30 #define JOE_ADDR_LEN 15 // Length of idrive string address
31 #define ERRMSG_LEN 32 // Length of an error message
33 int cur_xbin, cur_ybin, cur_speed;
34 int default_xbin, default_ybin, default_speed, default_black;
43 std::cout <<
"Starting" << std::endl;
52 _ccdName = (std::string) ConfigDictionary()[
"ccdName"];
55 _ccdDx = ConfigDictionary()[
"ccdXdim"];
56 _ccdDy = ConfigDictionary()[
"ccdYdim"];
62 _minRep = ConfigDictionary()[
"minRep"];
63 _maxRep = ConfigDictionary()[
"maxRep"];
66 _maxNumWins = ConfigDictionary()[
"maxNumWins"];
69 _fanCtrlActive = ConfigDictionary()[
"fanCtrlActive"];
71 wait_to = ConfigDictionary()[
"wait_to"];
74 _fanOnTemp = ConfigDictionary()[
"fanOnTemp"];
75 _fanOffTemp = ConfigDictionary()[
"fanOffTemp"];
78 catch (Config_File_Exception &e)
80 _logger->log( Logger::LOG_LEV_FATAL,
"%s", e.what().c_str());
81 throw AOException(
"Fatal: Missing configuration data");
94 std::string ccd47_fifo_in =
"/home/aosup/visao/fifos/ccd47ctrl_com_remote_in";
95 std::string ccd47_fifo_out =
"/home/aosup/visao/fifos/ccd47ctrl_com_remote_out";
99 signal(SIGIO, SIG_IGN);
111 setCurState(STATE_NOCONNECTION);
112 var_errmsg.Set(
"Starting up");
119 var_name = RTDBvar( MyFullName(),
"NAME", NO_DIR, CHAR_VARIABLE,
_ccdName.size()+1);
123 var_enable_req = RTDBvar( MyFullName(),
"ENABLE", REQ_VAR);
124 var_enable_cur = RTDBvar( MyFullName(),
"ENABLE", CUR_VAR);
126 var_enable_cur.Set(0);
128 var_errmsg = RTDBvar( MyFullName(),
"ERRMSG", NO_DIR, CHAR_VARIABLE, ERRMSG_LEN);
130 var_dx = RTDBvar( MyFullName(),
"DX");
131 var_dx_cur = RTDBvar( MyFullName(),
"DX", CUR_VAR);
132 var_dx_req = RTDBvar( MyFullName(),
"DX", REQ_VAR);
133 var_dy = RTDBvar( MyFullName(),
"DY");
134 var_dy_cur = RTDBvar( MyFullName(),
"DY", CUR_VAR);
135 var_dy_req = RTDBvar( MyFullName(),
"DY", REQ_VAR);
136 var_windowxs = RTDBvar( MyFullName(),
"WINDOWXS", NO_DIR, INT_VARIABLE, _maxNumWins);
137 var_windowys = RTDBvar( MyFullName(),
"WINDOWYS", NO_DIR, INT_VARIABLE, _maxNumWins);
139 var_xbins = RTDBvar( MyFullName(),
"XBINS", NO_DIR, INT_VARIABLE,
_maxNumBins);
140 var_ybins = RTDBvar( MyFullName(),
"YBINS", NO_DIR, INT_VARIABLE,
_maxNumBins);
141 var_speeds = RTDBvar( MyFullName(),
"SPEEDS", NO_DIR, INT_VARIABLE,
_maxNumSpeeds);
143 var_xbin_req = RTDBvar( MyFullName(),
"XBIN", REQ_VAR);
144 var_ybin_req = RTDBvar( MyFullName(),
"YBIN", REQ_VAR);
145 var_xbin_cur = RTDBvar( MyFullName(),
"XBIN", CUR_VAR);
146 var_ybin_cur = RTDBvar( MyFullName(),
"YBIN", CUR_VAR);
148 var_speed_cur = RTDBvar( MyFullName(),
"SPEED", CUR_VAR);
149 var_speed_req = RTDBvar( MyFullName(),
"SPEED", REQ_VAR);
151 var_black_cur = RTDBvar( MyFullName(),
"BLACK", CUR_VAR, INT_VARIABLE,
_ccdBlacks.size());
152 var_black_req = RTDBvar( MyFullName(),
"BLACK", REQ_VAR, INT_VARIABLE,
_ccdBlacks.size());
154 var_framerate_cur = RTDBvar( MyFullName(),
"FRMRT", CUR_VAR, REAL_VARIABLE);
155 var_framerate_req = RTDBvar( MyFullName(),
"FRMRT", REQ_VAR, REAL_VARIABLE);
157 var_rep_cur = RTDBvar( MyFullName(),
"REP", CUR_VAR);
158 var_rep_req = RTDBvar( MyFullName(),
"REP", REQ_VAR);
160 var_gain_cur = RTDBvar( MyFullName(),
"GAIN", CUR_VAR, INT_VARIABLE);
161 var_gain_req = RTDBvar( MyFullName(),
"GAIN", REQ_VAR, INT_VARIABLE);
163 var_temps = RTDBvar( MyFullName(),
"TEMPS", NO_DIR, INT_VARIABLE, 3);
165 var_fanReq = RTDBvar( (std::string)ConfigDictionary()[
"fanReqVar"], INT_VARIABLE, 1,
false);
178 binning.push_back(-1);
179 var_xbins.Set( binning);
185 binning.push_back(-1);
187 var_ybins.Set( binning);
198 setCurState(STATE_NOCONNECTION);
200 var_cmode_cur = RTDBvar( MyFullName(),
"ConMode", CUR_VAR, INT_VARIABLE, 1,1);
201 var_cmode_req = RTDBvar( MyFullName(),
"ConMode", REQ_VAR, INT_VARIABLE, 1,1);
205 var_preset_req = RTDBvar( MyFullName(),
"Preset", REQ_VAR, INT_VARIABLE, 1,1);
209 catch (AOVarException &e)
211 _logger->log(Logger::LOG_LEV_FATAL,
"%s:%d: %s", __FILE__, __LINE__, e.what().c_str());
212 throw AOException(
"Error creating RTDB variables");
220 if ((state == STATE_NOCONNECTION) && (oldstate != STATE_NOCONNECTION))
222 var_enable_cur.Set( 0,0, FORCE_SEND);
223 var_xbin_cur.Set( 0, 0, FORCE_SEND);
224 var_ybin_cur.Set( 0, 0, FORCE_SEND);
225 var_speed_cur.Set( 0, 0, FORCE_SEND);
227 var_rep_cur.Set( 0, 0, FORCE_SEND);
229 for (
unsigned int i=0; i<
_ccdBlacks.size(); i++)
230 var_black_cur.Set( 0, i, NO_SEND);
231 var_black_cur.Send();
249 catch (AOException &e)
251 _logger->log( Logger::LOG_LEV_ERROR,
"Caught exception: %s", e.what().c_str());
262 status = getCurState();
270 status = getCurState();
275 case STATE_NOCONNECTION:
282 case STATE_CONNECTED:
284 case STATE_CONFIGURING:
286 case STATE_OPERATING:
297 setCurState(getCurState());
317 setCurState(STATE_NOCONNECTION);
354 setCurState(STATE_NOCONNECTION);
360 setCurState(STATE_CONFIGURING);
366 setCurState(STATE_NOCONNECTION);
372 setCurState(STATE_READY);
373 var_enable_cur.Set(0, 0, CHECK_SEND);
378 setCurState(STATE_OPERATING);
379 var_enable_cur.Set(1, 0, CHECK_SEND);
384 if(resp ==
"" || resp.length() < 1)
386 setCurState(STATE_NOCONNECTION);
395 if(resp ==
"" || resp.length() < 1)
397 setCurState(STATE_NOCONNECTION);
403 if(resp ==
"" || resp.length() < 1)
405 setCurState(STATE_NOCONNECTION);
409 speed = atoi(resp.c_str());
410 var_speed_cur.Set(speed, 0, CHECK_SEND);
413 if(resp ==
"" || resp.length() < 1)
415 setCurState(STATE_NOCONNECTION);
418 int xbin = atoi(resp.c_str());
419 var_xbin_cur.Set(xbin, 0, CHECK_SEND);
422 if(resp ==
"" || resp.length() < 1)
424 setCurState(STATE_NOCONNECTION);
427 int ybin = atoi(resp.c_str());
428 var_ybin_cur.Set(ybin, 0, CHECK_SEND);
431 if(resp ==
"" || resp.length() < 1)
433 setCurState(STATE_NOCONNECTION);
436 int xwin = atoi(resp.c_str());
437 var_dx.Set(xwin, 0, CHECK_SEND);
438 var_dx_cur.Set(xwin, 0, CHECK_SEND);
441 if(resp ==
"" || resp.length() < 1)
443 setCurState(STATE_NOCONNECTION);
446 int ywin = atoi(resp.c_str());
447 var_dy.Set(ywin,0,CHECK_SEND);
448 var_dy_cur.Set(ywin, 0, CHECK_SEND);
451 if(resp ==
"" || resp.length() < 1)
453 setCurState(STATE_NOCONNECTION);
456 int reps = atoi(resp.c_str());
457 var_rep_cur.Set(reps, 0, CHECK_SEND);
460 if(resp ==
"" || resp.length() < 1)
462 setCurState(STATE_NOCONNECTION);
465 int gain = atoi(resp.c_str());
466 var_gain_cur.Set(gain, 0, CHECK_SEND);
477 if(resp ==
"" || resp.length() < 19)
479 setCurState(STATE_NOCONNECTION);
482 t1 = strtod(resp.substr(0,6).c_str(),0);
483 t2 = strtod(resp.substr(7,6).c_str(),0);
484 t3 = strtod(resp.substr(14,6).c_str(),0);
490 var_temps.Set(temps, CHECK_SEND);
493 if(resp ==
"" || resp.length() < 9)
495 std::cout << resp <<
"\n";
496 setCurState(STATE_NOCONNECTION);
501 blacks[0] = atoi(resp.substr(0,4).c_str());
503 blacks[1] = atoi(resp.substr(5,4).c_str());
504 var_black_cur.Set(blacks, CHECK_SEND);
511 var_fanReq.Set(0, 0, CHECK_SEND);
515 var_fanReq.Set(1, 0, CHECK_SEND);
522 setCurState(STATE_NOCONNECTION);
533 ERROR_REPORT(
"Error sending stop command to CCD47Ctrl");
546 ERROR_REPORT(
"Error sending start command to CCD47Ctrl");
555 int enable, enabled, stat;
559 std::cerr <<
"EnableReqChanged" << std::endl;
563 enable = var->Value.Lv[0];
564 ctrl->var_enable_req.Set(enable, 0, NO_SEND);
565 ctrl->var_enable_cur.Get(&enabled);
568 if ((enable != 0) && (enable != 1))
572 if ((enable == 1) && (enabled == 0))
573 stat = ctrl->
Start();
576 if ((enable == 0) && (enabled == 1))
587 std::cerr <<
"XbinReqChanged" << std::endl;
590 ctrl->var_xbin_req.Set( var->Value.Lv[0], 0, NO_SEND);
597 std::cerr <<
"YbinReqChanged" << std::endl;
600 ctrl->var_ybin_req.Set( var->Value.Lv[0], 0, NO_SEND);
607 std::cerr <<
"SpeedReqChanged" << std::endl;
610 ctrl->var_speed_req.Set( var->Value.Lv[0], 0, NO_SEND);
621 std::cerr <<
"BlackReqChanged" << std::endl;
624 int black,cur_black,stat;
631 black = var->Value.Lv[i];
632 ctrl->var_black_cur.Get(i, &cur_black);
634 Logger::get()->log( Logger::LOG_LEV_DEBUG,
"Setting black level %d to %d", i, black);
635 if (black != cur_black)
637 snprintf(cmstr, 50,
"black %d %d", i, black);
638 std::cout << cmstr <<
"\n";
654 std::cerr <<
"RepReqChanged" << std::endl;
659 int rep = var->Value.Lv[0];
666 std::cout << cmstr <<
"\n";
672 else return JOE_OUT_OF_RANGE_ERROR;
680 std::cerr <<
"GainReqChanged" << std::endl;
685 int gain = var->Value.Lv[0];
687 if ((gain>= 0) && (gain<= 3))
692 std::cout << cmstr <<
"\n";
698 else return JOE_OUT_OF_RANGE_ERROR;
709 std::cerr <<
"CModeReqChanged" << std::endl;
715 newstate = msgb->Value.Lv[0];
722 if(rstr ==
"") stat = -1;
734 std::cerr <<
"PresetReqChanged" << std::endl;
748 if(rstr ==
"") stat = -1;
759 ERROR_REPORT(
"Error sending command to CCD47");
768 std::cerr <<
"FrameRateReqChanged" << std::endl;
772 return ctrl->ChangeFramerate( var->Value.Dv[0], 0);
786 int JoeCtrl::ChangeFramerate(
double framerate,
int bestspeed)
788 int xbin, ybin, cur_speed, cur_winx, cur_winy;
791 int found_program=-1;
796 return VALUE_OUT_OF_RANGE_ERROR;
798 var_xbin_cur.Get(&xbin);
799 var_ybin_cur.Get(&ybin);
800 var_speed_cur.Get(&cur_speed);
801 var_dx_cur.Get(&cur_winx);
802 var_dy_cur.Get(&cur_winy);
804 _logger->log( Logger::LOG_LEV_DEBUG,
"Requested frequency: %5.2f", framerate);
806 for (i=0; i<
ondisk.size(); i++)
807 for (j=0; j<
ondisk[i].programs.size(); j++)
810 if ((xbin !=
ondisk[i].programs[j].binx) ||
811 (ybin !=
ondisk[i].programs[j].biny) ||
812 (
ondisk[i].programs[j].windowx != cur_winx) ||
813 (
ondisk[i].programs[j].windowx != cur_winy))
817 double mintime =
ondisk[i].programs[j].delay_base;
818 double maxtime = mintime +
ondisk[i].programs[j].delay_inc * 65535;
820 double max_framerate = 1e6/mintime;
821 double min_framerate = 1e6/maxtime;
823 _logger->log( Logger::LOG_LEV_DEBUG,
"Program %d %d: max,min = %5.2f, %5.2f", i, j, max_framerate, min_framerate);
828 if ((framerate < min_framerate) || (framerate > max_framerate))
831 int readout_speed =
ondisk[i].programs[j].readout_speed;
834 if ((!bestspeed) && (readout_speed != cur_speed))
838 if (found_program>=0)
839 if ( readout_speed >=
ondisk[found_set].programs[found_program].readout_speed)
845 found_speed = readout_speed;
847 _logger->log( Logger::LOG_LEV_DEBUG,
"Found program: %d %d %d", found_set, found_program, found_speed);
851 if (found_program <0)
852 return VALUE_OUT_OF_RANGE_ERROR;
855 double base =
ondisk[found_set].programs[found_program].delay_base;
856 double inc =
ondisk[found_set].programs[found_program].delay_inc;
857 double goal = 1e6/framerate;
870 _logger->log( Logger::LOG_LEV_DEBUG,
"Base %5.2f, inc %5.2f, goal %5.2f", base, inc, goal);
871 _logger->log( Logger::LOG_LEV_DEBUG,
"Setting speed %d, repetitions %d", found_speed, (
int)goal);
874 snprintf(cmstr, 50,
"set %i %i %i %i", found_set, found_program,
cur_Gain, (
int) goal);
876 std::cout << cmstr <<
"\n";
890 int JoeCtrl::ComputeFramerate()
896 if(resp ==
"" || resp.length() < 1)
898 setCurState(STATE_NOCONNECTION);
901 double framerate = strtod(resp.c_str(), 0);
902 var_framerate_cur.Set(framerate, 0, CHECK_SEND);
911 int JoeCtrl::ExposeSpeeds()
916 var_xbin_cur.Get(&xbin);
917 var_ybin_cur.Get(&ybin);
933 var_speeds.Set(speeds);
944 int JoeCtrl::ExposeWindows()
949 var_xbin_cur.Get(&xbin);
950 var_ybin_cur.Get(&ybin);
952 int *winxs =
new int[ _maxNumWins];
953 int *winys =
new int[ _maxNumWins];
954 memset( winxs, 0,
sizeof(
int) * _maxNumWins);
955 memset( winys, 0,
sizeof(
int) * _maxNumWins);
964 for(
int j=0; j< counter; j++)
978 var_windowxs.Set(winxs);
979 var_windowys.Set(winys);
1015 var_speed_req.Get(&speed);
1016 var_xbin_req.Get(&xbin);
1017 var_ybin_req.Get(&ybin);
1018 var_rep_req.Get(&reps);
1020 var_speed_cur.Get(&cur_speed);
1021 var_xbin_cur.Get(&cur_xbin);
1022 var_ybin_cur.Get(&cur_ybin);
1027 if ((speed == cur_speed) && (xbin == cur_xbin) && (ybin == cur_ybin) && (reps==
cur_Reps))
1029 _logger->log( Logger::LOG_LEV_INFO,
"SetJoeProgram(): current settings are OK, nothing to do.");
1039 _logger->log( Logger::LOG_LEV_DEBUG,
"Checking program %d, %dx%d", speed, xbin, ybin);
1043 pos = GetProgramPos( speed, xbin, ybin, &need_upload);
1044 _logger->log( Logger::LOG_LEV_DEBUG,
"Pos in memory=%d, need_upload = %d", pos, need_upload);
1057 if (need_upload == -1)
1059 _logger->log( Logger::LOG_LEV_WARNING,
"Program %d, %dx%d is not valid", speed, xbin, ybin);
1066 UpdateJoeMemory( need_upload);
1074 _logger->log( Logger::LOG_LEV_INFO,
"Program in memory at position %d", pos);
1080 std::cout <<
"Sending command: " << cmstr <<
"\n";
1128 return ComputeFramerate();
1159 for (i=0; i<
ondisk.size(); i++)
1160 for (j=0; j<
ondisk[i].programs.size(); j++)
1161 if ((
ondisk[i].programs[j].binx == xbin) &&
1162 (
ondisk[i].programs[j].biny == ybin) &&
1163 (
ondisk[i].programs[j].readout_speed == speed))
1164 return &(
ondisk[i].programs[j]);
1181 int JoeCtrl::GetProgramPos(
int speed,
int xbin,
int ybin,
int *need_upload)
1187 vector<littlejoe_program>::iterator iter;
1190 if ((iter->binx == xbin) &&
1191 (iter->biny == ybin) &&
1192 (iter->readout_speed == speed))
1201 _logger->log( Logger::LOG_LEV_DEBUG,
"Not in memory");
1205 for (i=0; i<
ondisk.size(); i++)
1206 for (j=0; j<
ondisk[i].programs.size(); j++)
1207 if ((
ondisk[i].programs[j].binx == xbin) &&
1208 (
ondisk[i].programs[j].biny == ybin) &&
1209 (
ondisk[i].programs[j].readout_speed == speed))
1214 _logger->log( Logger::LOG_LEV_DEBUG,
"Not on disk");
1227 int JoeCtrl::UpdateJoeMemory(
unsigned int uploaded_file)
1229 if (uploaded_file >=
ondisk.size())
1230 return JOE_OUT_OF_RANGE_ERROR;
1243 int DumpProgramset( littlejoe_programset programset)
1247 printf(
"Programset: %s\n", programset.name.c_str());
1248 printf(
"Control filename: %s\n", programset.control_filename.c_str());
1249 printf(
"Pattern filename: %s\n", programset.pattern_filename.c_str());
1250 printf(
"Number of programs: %lu\n", (
unsigned long) (programset.programs.size()));
1252 vector<littlejoe_program>::iterator iter;
1253 for (iter= programset.programs.begin(); iter != programset.programs.end(); iter++)
1255 printf(
"Program %d, name:%s\n", i++, iter->name.c_str());
1256 printf(
"Bin, speed: %dx%d, %d\n", iter->binx, iter->biny, iter->readout_speed);
1257 printf(
"Delay base, inc: %f,%f\n", iter->delay_base, iter->delay_inc);
1269 int JoeCtrl::EraseLocalMemory()
1285 int JoeCtrl::SetLocalMemory(
unsigned int programset_num)
1299 int JoeCtrl::LoadJoeDiskFiles()
1304 num = ConfigDictionary()[
"num_programsets"];
1308 for (i=0; i<num; i++)
1312 sprintf( param,
"programset%d", i);
1313 Config_File *subtree = ConfigDictionary().extract(param);
1314 ondisk[i] = ReadProgramSet( *subtree);
1319 for (i=0; i<num; i++)
1320 DumpProgramset(
ondisk[i]);
1322 _logger->log( Logger::LOG_LEV_INFO,
"%d programsets loaded.",
ondisk.size());
1328 littlejoe_programset JoeCtrl::ReadProgramSet( Config_File &cfg)
1333 littlejoe_programset programset;
1335 programset.name = (std::string) cfg[
"name"];
1336 programset.control_filename = (std::string) cfg[
"control_filename"];
1337 programset.pattern_filename = (std::string) cfg[
"pattern_filename"];
1338 size = cfg[
"num_programs"];
1340 if ((size<=0) || (size > 1000))
1342 _logger->log( Logger::LOG_LEV_WARNING,
"Skipping programset %s because it has %d programs", programset.name.c_str(), size);
1346 programset.programs.resize( size);
1348 for (i=0; i< programset.programs.size(); i++)
1351 sprintf( par_name,
"program%d", i);
1353 _logger->log( Logger::LOG_LEV_DEBUG,
"Reading program %d of %d", i, programset.programs.size());
1354 Config_File *subtree = cfg.extract(par_name);
1355 programset.programs[i] = ReadProgram( *subtree);
1364 littlejoe_program JoeCtrl::ReadProgram( Config_File &cfg)
1366 littlejoe_program program;
1368 program.name = (std::string) cfg[
"name"];
1369 program.readout_speed = cfg[
"readout_speed"];
1370 program.binx = cfg[
"binx"];
1371 program.biny = cfg[
"biny"];
1372 program.windowx = cfg[
"windowx"];
1373 program.windowy = cfg[
"windowy"];
1374 program.delay_base = cfg[
"delay_base"];
1375 program.delay_inc = cfg[
"delay_inc"];
1378 for (
int i=0; i<4; i++) {
1381 sprintf( str,
"black%d", i+1);
1382 program.black_levels[i] = cfg[str];
1383 }
catch (Config_File_Exception &e) {
1384 program.black_levels[i] = -1;
1388 _logger->log( Logger::LOG_LEV_DEBUG,
"Found: speed %d, binx %d, biny %d, base %f, inc %f", program.readout_speed, program.binx, program.biny, program.delay_base, program.delay_inc);
1398 int JoeCtrl::insert_value( vector<int> &array,
int value)
1400 vector<int>::iterator iter;
1401 for ( iter = array.begin(); iter != array.end(); iter++)
1405 array.push_back(value);
int _minRep
Minimum repititions (controls integration time)
RTDBvar var_preset_req
Preset to program set 0, program 0, for presetVisAO.
int cur_Reps
The current repititions running on the little joe.
int _maxRep
Maximum repititions (controls integration time)
int cur_Program
The current program running on the little joe.
fifo_list * global_fifo_list
The global fifo_list, for signal handling.
int cur_ProgramSet
The Current program set loaded on the little joe.
static int EnableReqChanged(void *pt, Variable *var)
RTDB handler for an enable change request form the AO Supervisor.
static int PresetReqChanged(void *pt, Variable *msgb)
RTDB handler for preset request from the AO Supervisor.
double wait_to
The timeout for waiting on responses from FIFOs in seconds.
littlejoe_programset memory
Struct representing LittleJoe's internal memory.
int read_fifo_channel(fifo_channel *fc)
Read data from the input fifo channel.
std::string send_ccd47_command(std::string com)
Send a command to the CCD47 and get its response.
static int SpeedReqChanged(void *pt, Variable *var)
RTDB handler for a speed change request form the AO Supervisor.
int Stop()
Send a stop command to the CCD47Ctrl.
void SetupVars(void)
VIRTUAL - Setups variables in RTDB.
std::string _ccdName
CCD name.
static int RepReqChanged(void *pt, Variable *var)
RTDB handler for a repetitions change request form the AO Supervisor.
int Start()
Send a start command to the CCD47Ctrl.
static int BlackReqChanged(void *pt, Variable *var)
RTDB handler for a black level change request form the AO Supervisor.
fifo_channel * fifo_ch
An array of fifo_channels.
int cur_Gain
The current gain running on the little joe.
RTDBvar var_cmode_cur
The current control mode in the RTDB.
std::vector< littlejoe_program > programs
Details of the individual programs.
static int CModeReqChanged(void *pt, Variable *msgb)
RTDB handler for a control mode change request from the AO Supervisor.
std::vector< int > _ccdXbins
Vector of x binnings.
int setup_fifo_list(int nfifos)
Allocate the fifo_list.
std::vector< littlejoe_programset > ondisk
Struct array representing files that can be uploaded to LittleJoe (each one is a memory dump) ...
static int XbinReqChanged(void *pt, Variable *var)
RTDB handler for an x-bin change request form the AO Supervisor.
int TestCCD47CtrlLink()
Test the link with the CCD47Ctrl, and get its state.
int _maxNumBins
Maximum number of binnings.
static int FrameRateReqChanged(void *pt, Variable *var)
RTDB handler for a frame rate change request form the AO Supervisor.
int ReprogramJoe(int force=0)
Calculate and send a reprogram request to the CCD47Ctrl.
int _ccdDefaultXbin
Default x binning.
int TimeToDie
Global set by SIGTERM.
int DoFSM(void)
Perform controller functions and manage states.
fifo_list fl
The list of named-pipe fifos used for inter-process comms.
static int YbinReqChanged(void *pt, Variable *var)
RTDB handler for a y-bin change request form the AO Supervisor.
int _ccdBlacksNum
Nuber of blacks.
int _startProgramSet
The program set currently set to load from flash on little joe power up.
std::vector< int > _ccdBlacks
Vector of black levels.
void StateChange(int oldstate, int state)
VIRTUAL - StateChange.
int _ccdDefaultSpeed
Default speed.
std::vector< int > _ccdYbins
Vector of y binnings.
Holds the details of one little joe program.
int _maxNumSpeeds
Maximum number of speeds.
int _ccdDefaultYbin
Default y binning.
The interface between the CCD47Ctrl class and the AO Supervisor.
int connect_fifo_list()
Connect the fifo_list with exclusive locking.
The namespace of VisAO software.
static int GainReqChanged(void *pt, Variable *var)
RTDB handler for a gain change request form the AO Supervisor.
Declarations for CCD47 control from the AO Supervisor.
void Create(void)
Read the JoeCtrl specific config vars and connect to the CCD47Ctrl.
JoeCtrl(std::string name, const std::string &conffile)
Config file constructor.
#define RWBUFF_SZ
The size of the i/o buffer.
RTDBvar var_cmode_req
The requested control mode in the RTDB.
int _ccdDefaultBlack
Default black levels.
void PostInit()
VIRTUAL - Perform post-initialization settings.
int set_fifo_list_channel(fifo_list *fl, int nch, int buffsz, const char *fin, const char *fout, int(*inp_hand)(fifo_channel *), void *adata)
Set the details of one channel in the list.
int write_fifo_channel(int ch, const char *com, int comlen, std::string *resp)
Write data to a fifo_channel, and get a response if desired.