forked from atsommer/Simplicio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCameraSettings.cpp
67 lines (60 loc) · 1.35 KB
/
CameraSettings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "stdafx.h"
#include "CameraSettings.h"
#include "sencam.h"
#include "cam_types.h"
namespace forms2{
CameraSettings::CameraSettings(void)
{
mode = NULL_SETTING;
trig = NULL_SETTING;
roix1 = NULL_SETTING;
roix2 = NULL_SETTING;
roiy1 = NULL_SETTING;
roiy2 = NULL_SETTING;
hbin = NULL_SETTING;
vbin = NULL_SETTING;
}
int CameraSettings::getSetting(int settingID)
{
getSettings();
switch(settingID){
case MODE: return mode; break;
case TRIG: return trig; break;
case ROIX1: return roix1; break;
case ROIX2: return roix2; break;
case ROIY1: return roiy1; break;
case ROIY2: return roiy2; break;
case HBIN: return hbin; break;
case VBIN: return vbin; break;
default: return NULL_SETTING;
}
}
int CameraSettings::getCols()
{
getSettings();
return 32*(roix2-roix1+1)/hbin;
}
int CameraSettings::getRows()
{
getSettings();
int rows = 32*(roiy2-roiy1+1);
if (roiy2==33)
rows-=16;
return rows/vbin;
}
bool CameraSettings::isDouble(){
getSettings();
//const int typ = mode & 0x00FF;//byte 0
const int submode = (mode & 0xFF0000)>>16;//byte 2
//int dbl = (submode==QE_DOUBLE)? 2:1;
return (submode==QE_DOUBLE);
}
void CameraSettings::update()
{
getSettings();
}
void CameraSettings::getSettings()
{
GET_SETTINGS( &mode, &trig, &roix1, &roix2, &roiy1, &roiy2, &hbin, &vbin, (char**)table);
}
}