19 #define JOE_ADDR_LEN 15 // Length of idrive string address
20 #define ERRMSG_LEN 32 // Length of an error message
49 catch (Config_File_Exception &e)
51 _logger->log( Logger::LOG_LEV_FATAL,
"%s", e.what().c_str());
52 throw AOException(
"Fatal: cannot find adopt ccd47 configuration");
63 _ccdDx = (*adopt_cfg)[
"ccdXdim"];
64 _ccdDy = (*adopt_cfg)[
"ccdYdim"];
70 _minRep = (*adopt_cfg)[
"minRep"];
71 _maxRep = (*adopt_cfg)[
"maxRep"];
75 _startProgramSet = (*adopt_cfg)[
"startProgramSet"];
76 _startProgram = (*adopt_cfg)[
"startProgram"];
77 _startGain = (*adopt_cfg)[
"startGain"];
78 _startReps = (*adopt_cfg)[
"startReps"];
80 EDT_cfgdir = (std::string)ConfigDictionary()[
"EDT_cfgdir"];
85 catch (Config_File_Exception &e)
87 _logger->log( Logger::LOG_LEV_FATAL,
"%s", e.what().c_str());
88 throw AOException(
"Fatal: Missing configuration data");
125 _logger->log(Logger::LOG_LEV_ERROR,
"Could not create status board.");
130 strncpy(bsb->appname, MyFullName().c_str(), 25);
142 std::string fifo_path, visao_root, fgin, fgout;
146 fifo_path = (std::string) ConfigDictionary()[
"fifo_path"];
148 catch (Config_File_Exception &e)
157 catch (Config_File_Exception &e)
166 catch (Config_File_Exception &e)
171 visao_root = getenv(
"VISAO_ROOT");
180 fgin = visao_root +
"/" + fifo_path +
"/" +
FrameGrabberName +
"_com_auto_in";
181 fgout = visao_root +
"/" + fifo_path +
"/" + FrameGrabberName +
"_com_auto_out";
184 fgin = visao_root +
"/" + fifo_path +
"/" +
FrameWriterName +
"_com_auto_in";
185 fgout = visao_root +
"/" + fifo_path +
"/" + FrameWriterName +
"_com_auto_out";
198 num = (*adopt_cfg)[
"num_programsets"];
202 for (i=0; i<num; i++)
205 sprintf( param,
"programset%d", i);
206 Config_File *subtree = (*adopt_cfg).extract(param);
213 _logger->log( Logger::LOG_LEV_INFO,
"%d programsets loaded.",
ondisk.size());
224 programset.
name = (std::string) cfg[
"name"];
227 size = cfg[
"num_programs"];
229 if ((size<=0) || (size > 1000))
231 _logger->log( Logger::LOG_LEV_WARNING,
"Skipping programset %s because it has %d programs", programset.
name.c_str(), size);
237 for (i=0; i< programset.
programs.size(); i++)
240 sprintf( par_name,
"program%d", i);
242 _logger->log( Logger::LOG_LEV_DEBUG,
"Reading program %d of %d", i, programset.
programs.size());
243 Config_File *subtree = cfg.extract(par_name);
256 program.
name = (std::string) cfg[
"name"];
258 program.
binx = cfg[
"binx"];
259 program.
biny = cfg[
"biny"];
260 program.
windowx = cfg[
"windowx"];
261 program.
windowy = cfg[
"windowy"];
262 program.delay_base = cfg[
"delay_base"];
263 program.delay_inc = cfg[
"delay_inc"];
266 for (
int i=0; i<4; i++)
271 sprintf( str,
"black%d", i+1);
274 catch (Config_File_Exception &e)
282 _logger->log( Logger::LOG_LEV_DEBUG,
"Found: speed %d, binx %d, biny %d, windowx %d, windowy %d, base %f, inc %f, EDT config %s", program.
readout_speed, program.
binx, program.
biny, program.
windowx, program.
windowy, program.delay_base, program.delay_inc, program.
EDT_cfg_fname.c_str());
292 _logger->log( Logger::LOG_LEV_DEBUG,
"Stopping CCD");
302 if (stat == NO_ERROR)
351 _logger->log( Logger::LOG_LEV_DEBUG,
"Starting CCD");
353 std::cerr <<
"Starting CCD\n";
357 if (stat == NO_ERROR)
359 _logger->log( Logger::LOG_LEV_DEBUG,
"CCD Started");
361 std::cerr <<
"CCD Started\n";
374 _logger->log( Logger::LOG_LEV_ERROR,
"Error starting CCD");
376 std::cerr <<
"Not Started\n";
431 if(it <0 || it > 4) it = 0;
449 int xbin, ybin, speed, rep;
462 return VALUE_OUT_OF_RANGE_ERROR;
465 framerate = 1.0e6/ (program->delay_base + program->delay_inc * rep);
467 _logger->log( Logger::LOG_LEV_DEBUG,
"Delay base: %f - Delay_inc: %f - Rep: %d - framerate: %f", program->delay_base, program->delay_inc, rep, framerate);
476 int xbin, ybin, speed, rep;
486 return VALUE_OUT_OF_RANGE_ERROR;
490 rep = ((1.0e6/fr) - program->delay_base)/program->delay_inc;
524 sigaddset(&set, SIGIO);
525 sigaddset(&set, RTSIGIO);
526 pthread_sigmask(SIG_BLOCK, &set, 0);
530 rv = rpd->ctrl->
__ReprogramJoe(rpd->program_set, rpd->program, rpd->gain, rpd->rep, rpd->force);
532 return (
void *) (&rv);
543 rpd.program_set = program_set;
544 rpd.program = program;
550 pthread_attr_init(&attr);
551 pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED);
565 int AstronomerWantsItRunning;
567 if(
cur_State == STATE_OPERATING) AstronomerWantsItRunning = 1;
568 else AstronomerWantsItRunning = 0;
574 if (stat != NO_ERROR)
580 _logger->log( Logger::LOG_LEV_DEBUG,
"Checking program set: %d program %d", program_set, program);
586 if ((
unsigned) program_set >=
ondisk.size())
588 _logger->log( Logger::LOG_LEV_WARNING,
"Program set %d is not valid", program_set);
594 _logger->log( Logger::LOG_LEV_INFO,
"Program selection requires upload of program set %d", program_set);
596 _logger->log( Logger::LOG_LEV_INFO,
"Starting control file upload (%s)",
getCompletePath(
ondisk[program_set].control_filename).c_str());
598 if ((stat = SendXmodemFile(
"XMC 1", (
char *)
getCompletePath(
ondisk[program_set].control_filename).c_str())) != NO_ERROR)
601 _logger->log( Logger::LOG_LEV_ERROR,
"Xmodem upload returned error");
602 std::cerr <<
"Xmodem upload returned error at " << __LINE__ <<
"\n";
606 _logger->log( Logger::LOG_LEV_INFO,
"Starting pattern file upload (%s)",
getCompletePath(
ondisk[program_set].pattern_filename).c_str());
608 if ((stat = SendXmodemFile(
"XMP 1", (
char *)
getCompletePath(
ondisk[program_set].pattern_filename).c_str())) != NO_ERROR)
611 _logger->log( Logger::LOG_LEV_ERROR,
"Xmodem upload returned error");
612 std::cerr <<
"Xmodem upload returned error at " << __LINE__ <<
"\n";
618 _logger->log( Logger::LOG_LEV_INFO,
"Upload complete");
622 if(program < 0 || program > 7 || gain < 0 || gain > 3)
624 _logger->log( Logger::LOG_LEV_ERROR,
"Program %d, gain %d is not valid", program, gain);
630 std::cout <<
"Setting program " << program + gain*8 << std::endl;
633 if ((stat =
SetJoeRCL(program + gain*8)) != NO_ERROR)
635 _logger->log( Logger::LOG_LEV_ERROR,
"Error in SetJoeRCL(): %d", stat);
643 if(rep > 65535) rep = 65535;
646 std::cout <<
"Setting repetitions" << std::endl;
649 sprintf( buffer,
"@REP %d", rep);
650 if ((SendJoeCommand( buffer, NULL, 25, 0)) != NO_ERROR)
652 std::cerr <<
"Error setting repetitions\n";
672 std::cout <<
"Loading EDT conf at " << __LINE__ << std::endl;
677 std::cout <<
"Stopping at " << __LINE__ << std::endl;
688 if(AstronomerWantsItRunning)
699 std::cout <<
"Starting at " << __LINE__ << std::endl;
712 std::cout <<
"Leaving _ReprogramJoe()\n";
722 std::cout <<
"s/w only reprogram" << std::endl;
744 void * __SetupNetwork(
void * ctrl)
749 sigaddset(&set, SIGIO);
750 sigaddset(&set, RTSIGIO);
752 pthread_sigmask(SIG_BLOCK, &set, 0);
754 int * result =
new int;
760 return (
void *) result;
777 _logger->log( Logger::LOG_LEV_ERROR,
"Error configuring network: (%d) %s", result, lao_strerror(result));
778 return NETWORK_ERROR;
780 _logger->log( Logger::LOG_LEV_INFO,
"Network reconfigured OK");
784 stat = PLAIN_ERROR(CheckJoe());
787 _logger->log( Logger::LOG_LEV_ERROR,
"Error during LittleJoe testing: (%d) %s", stat, (
char *)lao_strerror( stat));
801 if (state == STATE_NOCONNECTION)
807 std::cout <<
"Getting joe status" << std::endl;
809 stat = GetJoeStatus();
811 std::cout <<
"Done getting joe status" << std::endl;
824 if(stat == 0 &&
cur_State == STATE_OPERATING)
828 std::cout <<
"Not running, restarting.\n";
835 if(stat == 1 &&
cur_State == STATE_READY)
839 std::cout <<
"Running, restopping.\n";
847 if(stat == 0 &&
cur_State == STATE_CONNECTED)
850 std::cout <<
"STATE_CONNECTED, Stopping FG.\n";
857 if(stat == 1 &&
cur_State == STATE_CONNECTED)
864 std::cout <<
"STATE_CONNECTED, Starting FG.\n";
887 if (state == STATE_NOCONNECTION)
896 std::cout <<
"Getting temperatures" << std::endl;
898 stat = GetJoeTemperature( &t1, &t2, &t3);
900 std::cout <<
"Done getting temperatures" << std::endl;
903 if (stat != NO_ERROR)
908 temps[0] = (double)t1;
909 temps[1] = (double)t2;
910 temps[2] = (double)t3;
922 path = Utils::getConffile(filename);
924 int i = path.find(
".conf");
926 path.erase(i, path.length()-i);
940 std::cout <<
"DoFSM" << std::endl;
945 if (status != STATE_NOCONNECTION)
948 std::cout <<
"Testing Joe Link" << std::endl;
951 if ((stat=TestJoeLink()) != NO_ERROR)
954 std::cerr <<
"TestJoeLink Failed " << stat << std::endl;
969 case STATE_NOCONNECTION:
971 std::cout <<
"Setting up network" << std::endl;
975 if (stat == NO_ERROR)
cur_State = STATE_CONNECTED;
978 std::cout <<
"Network is setup" << std::endl;
979 if(
cur_State == STATE_CONNECTED) std::cout <<
"STATE_CONNECTED" << std::endl;
980 else std::cout <<
"STATE_NOCONNECTION" << std::endl;
987 case STATE_CONNECTED:
994 std::cout <<
"reading joe status" << std::endl;
999 case STATE_CONFIGURING:
1003 case STATE_OPERATING:
1005 std::cout <<
"reading joe status" << std::endl;
1011 std::cout <<
"reading joe temps" << std::endl;
1023 std::cout <<
"done with DoFSM" << std::endl;
1034 signal(SIGIO, SIG_IGN);
1038 ERROR_REPORT(
"Error installing main thread catcher.");
1045 ERROR_REPORT(
"Error starting signal catching thread.");
1052 ERROR_REPORT(
"Error blocking SIGIO in main thread.");
1056 LOG_INFO(
"starting up . . .");
1067 if(pthread_tryjoin_np(
load_thread, &thrdretval) == 0)
1070 if(*((
int *) thrdretval) != 0)
1072 error_report(Logger::LOG_LEV_ERROR,
"Program load thread returned error.");
1082 error_report(Logger::LOG_LEV_ERROR,
"Error in DoFSM.");
1093 else usleep((
int)((
pause_time-dt)*1e6 * .99));
1104 std::string visao_root;
1105 std::string edt_dir;
1106 std::string cfgtmp, bittmp;
1109 edt_dir = getenv(
"EDTDIR");
1112 int idx = cfgtmp.find(
".conf");
1113 if(idx > -1) cfgtmp.erase(idx, cfgtmp.length()-idx);
1115 cfgtmp = cfgtmp + fname;
1116 bittmp = edt_dir +
"/camera_config";
1119 std::cout <<
"Loading EDT Config\n" << cfgtmp <<
"\n" << bittmp <<
"\n";
1122 return initcam(cfgtmp.c_str(), bittmp.c_str());
1152 if(
cur_State == STATE_READY) cstate = 1;
1153 if(
cur_State == STATE_OPERATING) cstate = 2;
1154 if(
cur_State == STATE_CONFIGURING) cstate = 3;
1179 snprintf(rstr, 50,
"%i\n",
cur_Gain);
1185 snprintf(rstr, 50,
"%i\n",
cur_xbin);
1191 snprintf(rstr, 50,
"%i\n",
cur_ybin);
1195 if(com ==
"windowx?")
1201 if(com ==
"windowy?")
1207 if(com ==
"framerate?")
1215 snprintf(rstr, 50,
"%i\n",
cur_Reps);
1221 snprintf(rstr, 50,
"%06.2f %06.2f %06.2f\n",
temps[0],
temps[1],
temps[2]);
1225 if(com ==
"blacks?")
1236 snprintf(rstr, 50,
"%i\n", rv);
1247 snprintf(rstr, 50,
"%i\n", rv);
1259 if(com ==
"remaining?")
1271 if(com ==
"imtype?")
1273 snprintf(rstr, 50,
"%i\n",
imtype);
1277 if(com ==
"subdir?")
1282 if(com.substr(0,4) ==
"skip")
1286 int nsk = atoi(com.substr(5, com.length()-5).c_str());
1287 if(nsk < 0) nsk = 0;
1288 snprintf(rstr, 50,
"skip %i", nsk);
1297 if(com.substr(0,8) ==
"savedark")
1301 int nsav = atoi(com.substr(9, com.length()-9).c_str());
1307 _logger->log( Logger::LOG_LEV_ERROR,
"framewriter47 is not running. no images saved.");
1308 if(!
fw47sb)
return "-2\n";
1313 _logger->log( Logger::LOG_LEV_ERROR,
"framewriter47 appears to not be running. no images saved.");
1320 snprintf(rstr, 50,
"savedark %i", nsav);
1340 if(com.substr(0,4) ==
"save")
1344 int nsav = atoi(com.substr(5, com.length()-5).c_str());
1350 _logger->log( Logger::LOG_LEV_ERROR,
"framewriter47 is not running. no images saved.");
1351 if(!
fw47sb)
return "-2\n";
1356 _logger->log( Logger::LOG_LEV_ERROR,
"framewriter47 appears to not be running. no images saved.");
1362 snprintf(rstr, 50,
"save %i", nsav);
1382 if(com.substr(0,5) ==
"serve")
1386 int nsrv = atoi(com.substr(6, com.length()-6).c_str());
1403 snprintf(rstr, 50,
"serve %i", nsrv);
1423 if(com.substr(0,3) ==
"set")
1427 if(com.length() < 11)
1429 return "not enough arguments in set";
1432 int ns, np, ng, nrep;
1434 ns = atoi(com.substr(4,1).c_str());
1435 np = atoi(com.substr(6,1).c_str());
1436 ng = atoi(com.substr(8,1).c_str());
1437 nrep = atoi(com.substr(10, com.length() - 10).c_str());
1440 std::cout <<
"Reprogram: " << ns <<
" " << np <<
" " << ng <<
" " << nrep <<
"\n";
1449 if(com.substr(0,4) ==
"reps")
1453 if(com.length() < 5)
1455 return "not enough arguments in reps";
1458 int ns, np, ng, nrep;
1463 nrep = atoi(com.substr(4, com.length() - 4).c_str());
1466 std::cout <<
"Reprogram: " << ns <<
" " << np <<
" " << ng <<
" " << nrep <<
"\n";
1476 if(com.substr(0,9) ==
"framerate")
1480 if(com.length() < 10)
1482 return "not enough arguments in framerate";
1485 int ns, np, ng, nrep;
1493 std::cout <<
"Reprogram: " << ns <<
" " << np <<
" " << ng <<
" " << nrep <<
"\n";
1502 if(com.substr(0,7) ==
"exptime")
1506 if(com.length() < 8)
1508 return "not enough arguments in exptime";
1511 int ns, np, ng, nrep;
1519 std::cout <<
"Reprogram: " << ns <<
" " << np <<
" " << ng <<
" " << nrep <<
"\n";
1528 if(com.substr(0,4) ==
"fset")
1532 if(com.length() < 12)
1534 return "not enough arguments in fset";
1537 int ns, np, ng, nrep;
1539 ns = atoi(com.substr(5,1).c_str());
1540 np = atoi(com.substr(7,1).c_str());
1541 ng = atoi(com.substr(9,1).c_str());
1542 nrep = atoi(com.substr(11, com.length() - 10).c_str());
1544 std::cout <<
"Force Reprogram: " << ns <<
" " << np <<
" " << ng <<
" " << nrep <<
"\n";
1553 if(com.substr(0,5) ==
"swset")
1557 if(com.length() < 13)
1559 return "not enough arguments in swset";
1562 int ns, np, ng, nrep;
1564 ns = atoi(com.substr(6,1).c_str());
1565 np = atoi(com.substr(8,1).c_str());
1566 ng = atoi(com.substr(10,1).c_str());
1567 nrep = atoi(com.substr(12, com.length() - 10).c_str());
1569 std::cout <<
"SW only Reprogram: " << ns <<
" " << np <<
" " << ng <<
" " << nrep <<
"\n";
1578 if(com.substr(0,5) ==
"black")
1582 if(com.length() < 9)
1584 return "not enough arguments to set black\n";
1589 bchan = atoi(com.substr(6,1).c_str());
1591 if(bchan <0 || bchan > 1)
return "-1\n";
1593 blev = atoi(com.substr(8,4).c_str());
1595 if(blev < 0) blev = 0;
1596 if(blev > 1023) blev = 1023;
1601 std::cout <<
"Setting black: " << bchan <<
" " << blev <<
"\n";
1603 if(blev !=
blackLevel[bchan]) SetJoeBlack(bchan, blev);
1612 if(com.substr(0,6) ==
"subdir")
1623 if(com.substr(0,4) ==
"dark")
1634 if(com.substr(0,6) ==
"imtype")
1636 if(com.length() >= 7)
1640 int nsav = atoi(com.substr(7, com.length()-7).c_str());
1648 resp =
"Unkown Command: " + com ;
1671 csb->joe_temp =
temps[0];
1672 csb->head_temp1 =
temps[1];
1673 csb->head_temp2 =
temps[2];
1693 if(rcl < 0 || rcl > 31)
1698 error = SendJoeCommand(
"@RCL?", buffer, 31, 1);
1699 if (error != NO_ERROR)
1703 cur_rcl = atoi(buffer+6);
1711 sprintf( buffer,
"@RCL %1d", rcl);
1712 if ((error = SendJoeCommand( buffer, NULL, 0, 0)) != NO_ERROR)
std::string EDT_cfg_fname
Name of the EDT config file for this program.
void Create(void)
Common creation tasks, called by constructors.
littlejoe_program ReadProgram(Config_File &cfg)
Read a configuration file with the parameters of a single LittleJoe program.
Config_File * adopt_cfg
The dictionary of config details from the adopt config file.
std::string adopt_cfg_file
Name of the adopt config file (this is specified in the main config file)
int black_levels[4]
Array of default black levels.
Holds the details of a little joe program set (i.e. a pattern/con file pair)
int load_EDT_config(std::string)
Loads the EDT configuration file.
int FGrunning
Whether or not the framegrabber is running.
pthread_t load_thread
Identifier for the __ReprogramJoe thread.
int readout_speed
Program readout speed, pixel rate in khz.
double get_curr_time(void)
Gets the current CLOCK_REALTIME time, returns it in seconds to double precision.
int cur_xbin
Current x binning.
virtual int start_signal_catcher(bool inherit_sched=true)
Starts the signal catching loop.
int joe_loading
Tells the main thread that the __ReprogramJoe thread is working.
int cur_State
Current state.
int _minRep
Minimum repetitions.
int _ccdDx
CCD x dimension.
The standalone VisAO application, does not interface with the AO Supervisor.
std::string control_filename
Name of the control file.
std::string FrameWriterName
Process name of the relevant framewriter.
int Stop(void)
Stop sequencing and stop the framegrabber.
int SetupNetwork(void)
Setup network connection with LittleJoe.
The controller for the VisAO CCD47 via its Little Joe.
basic_status_board * fw47sb
The Framewriter47 status board is used to check if framewriter is running before saving.
void * statusboard_shmemptr
The pointer to the shared memory block for the statusboard.
int cur_Program
The currently running program.
virtual void error_report(int LogLevel, std::string emsg)
Report an error. Also calls log_msg.
Logger * _tempsLogger
Temperature logger.
double cur_framerate
Current frame rate.
virtual int update_statusboard()
Update the status board.
virtual int setup_baseApp(bool usethreads=false)
Install fifo channels.
int FGremaining
How many saves are remaining.
virtual int update_statusboard()
Update the CCD47 Status Board shared memory.
virtual std::string remote_command(std::string com)
Called by __remote_command after control state logic.
int FGskipping
Whether or not the framegrabber is skipping, and how many frames to skip.
#define STATUS_framewriter47
Shared memory key for the ccd47 framewriter status board.
std::vector< littlejoe_program > programs
Details of the individual programs.
virtual std::string local_command(std::string com)
Called by __local_command after control state logic.
int cur_ProgramSet
The currently loaded program set.
int setup_fifo_list(int nfifos)
Allocate the fifo_list.
int cur_windowx
Current x window size.
int cur_ybin
Current y binning.
std::string get_ccdNetAddr()
Return the network address of the CCD.
int _ccdDefaultYbin
Default y binning.
pthread_mutex_t reprogMutex
Mutex for the __ReprogramJoe thread.
std::string name
Program name.
int DoFSM(void)
Performs controller functions and manages states.
double temps[3]
Current temperatures.
key_t statusboard_shmemkey
The key used to lookup the shared memory.
int Start(void)
Start sequencing and start the framegrabber.
int SetJoeRCL(int rcl)
Set the recall "RCL" parameter on the little joe (pixel readout, gain & related settings) ...
int ComputeRepsFrameRate(double fr)
Computes the reps required to match a requested framerate.
CCD47Ctrl(std::string name, const std::string &conffile)
Name and config file constructor.
int FirstJoeConfig(void)
Sets the LittleJoe controller in a known state.
virtual int block_sigio()
Sets the signal mask to block SIGIO and RTSIGIO.
virtual std::string script_command(std::string com)
Called by __script_command after control state logic.
int TimeToDie
Global set by SIGTERM.
int imtype
0=science, 1=acquisition, 2=dark, 3=sky, 4=flat
int _maxRep
Maximum repetitions.
std::string control_mode_response()
Convenience function to return the control type response string, e.g. "A\n".
int ReprogramJoe(int program_set, int program, int gain, int rep, int force=0)
Reprogram the little joe, including file uploads as necessary.
void * attach_shm(size_t *sz, key_t mkey, int shmemid)
Attach to a shared memory buffer and get its size.
fifo_list fl
The list of named-pipe fifos used for inter-process comms.
int LoadJoeDiskFiles(void)
Load the configuration files specifying the different program sets that can be uploaded to LittleJoe...
int _ccdDefaultXbin
Default x binning.
std::string common_command(std::string com, int cmode)
Called by all the command handlers, to perform common command processing.
int ComputeFramerate()
Computes the current framerate from the current state of LittleJoe control variables.
int _ccdDefaultBlack
Default black levels.
int set_imtype(int it)
Set the image type.
double pause_time
Time to pause during application main loop.
int cur_speed
Current speed.
std::string _ccdNetAddr
CCD network address.
std::vector< littlejoe_programset > ondisk
Struct array representing files that can be uploaded to LittleJoe.
int ReadJoeStatus()
Check the LittleJoe CCD camera status.
Holds the details of one little joe program.
int ReadJoeTemps(void)
Read the LittleJoe CCD camera temperatures.
int create_statusboard(size_t sz)
Creates and attaches to the statusboard shared memory.
std::string EDT_cfgdir
EDT configuration files directory.
Declarations for the VisAO CCD47 controller.
int _maxNumBins
Maximum number of bins.
std::string getCompletePath(std::string filename)
Get the complete path of a program/pattern file.
double ts_to_curr_time(struct timespec *tsp)
Convert a timespec structure to double seconds.
static int control_mode
The current control mode.
std::string FWsubdir
The current subdirectory of the framewriter.
int _ccdNetPort
The TCP/IP port of the CCD at its network address.
std::string pattern_filename
Name of the pattern file.
int _maxNumSpeeds
Maximum number of speeds.
virtual int install_sig_mainthread_catcher()
Install the SIG_MAINTHREAD signal catcher.
int cur_windowy
Current y window size.
int blackLevel[2]
Current blacklevels.
int initcam(const char *fname, const char *bdir)
A local version of initcam.
int FGsaving
Whether or not the framegrabber is saving, and how many to save.
int swonly_reprogram(int program_set, int program, int gain, int rep)
Only change the settings in this software, do not reprogram the little joe.
std::string FrameGrabberName
Process name of the relevant framegrabber.
int get_ccdNetPort()
Returns the TCP/IP port of the CCD at its network address.
int GetFramegrabberStatus()
Checks whether the framegrabber process is running, and what its current status is.
int cur_Gain
The currently loaded gain.
The namespace of VisAO software.
int imtype
Image type, 0=science (default), 1=acquisition, 2=dark, 3=sky.
int _ccdDy
CCD y dimension.
int __ReprogramJoe(int program_set, int program, int gain, int rep, int force=0)
This function does the actual reprogramming, based on the adopt version.
int cur_Reps
The currently loaded repetitions.
int _ccdBlacksNum
Number of blacks.
void init_VisAOApp()
Initialize the details of the VisAOApp.
littlejoe_programset ReadProgramSet(Config_File &cfg)
Read a configuration file with the parameters of a little Joe Program SET.
int _ccdDefaultSpeed
Default speed.
int ComputeRepsExpTime(double et)
Computes the reps required to match a requested exptime.
std::string name
Name of the program set.
#define RWBUFF_SZ
The size of the i/o buffer.
std::string _ccdName
CCD name.
#define STATUS_ccd47
Shared memory key for the ccd47 controller status board.
void * ReprogramJoeThreadWorker(void *adata)
This is the thread start function for reprogramming the little joe.
int Run()
Overriden virtual function, called by Exec().
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.