The VisAO Camera
framewriter.h
Go to the documentation of this file.
1 /************************************************************
2 * framewriter.h
3 *
4 * Author: Jared R. Males (jrmales@email.arizona.edu)
5 *
6 * Declarations for a class for writing image frames from shared memory to disk.
7 *
8 * Developed as part of the Magellan Adaptive Optics system.
9 ************************************************************/
10 
11 /** \file framewriter.h
12  * \author Jared R. Males
13  * \brief Declarations for a class for writing image frames from shared memory to disk.
14  *
15  *
16 */
17 
18 #ifndef __framewriter_h__
19 #define __framewriter_h__
20 
21 #include "VisAOApp_standalone.h"
22 #include "visaoimutils.h"
23 
24 #include "statusboard.h"
25 
26 namespace VisAO
27 {
28 
29 ///A class for writing image frames from shared memory to disk.
30 /** Begins writing to disk when a frame ready notification is received via the ping fifo.
31  *
32  * In addition to the \ref VisAOApp_standalone config file options, has:
33  *
34  * Required:
35  * - <b>name_base</b> <tt>string</tt> - the prefix of the data files, e.g. V47_ for ccd47 data
36  * - <b>shmem_key</b> <tt>int</tt> - the share memory key to write from.
37  *
38  * Optional:
39  * - <b>ping_fifo_path</b> <tt>string</tt> [fifos] - the directory containing the ping fifo, relative
40  * to VISAO_ROOT
41  * - <b>save_path</b> <tt>string</tt> [data] - the directory, relative to VISAO_ROOT, where to write the
42  * data
43  * - <b>write_aosys_head</b> <tt>int</tt> [1] - whether or not to write AO system header data
44  * - <b>write_visao_head</b> <tt>int</tt> [1] - whether or not to write VisAO camera header data
45  * - <b>origin</b> <tt>string</tt> [Magellan AO System]- the value of the FITS ORIGIN keyword for this data
46  * - <b>telescope</b> <tt>string</tt> [Magellan Clay]- the value of the FITS TELESCOP keyword for this data
47  * - <b>instrument</b> <tt>string</tt> [Magellan VisAO] - the value of the FITS INSTRUME keyword for this data
48  *
49  * See \ref VisAOApp_standalone for command line arguments. There are no additional command line arguments for
50  * a basic framegrabber, though derived clases may add them.
51  *
52  * Commands:
53  * - <b>"subdir s"</b> changes the directory where data is saved to s, which is relative to the data directory
54  * specified in the configuration by save_path. "subdir ." resets to save_path. The subdirectory is
55  * created if it doesn't exist.
56  * - <b>"subdir?"</b> returns the current subdirectory
57  */
58 template <class dataT> class framewriter : public VisAOApp_standalone
59 {
60 public:
61  framewriter(int argc, char **argv) throw (AOException);
62  framewriter(std::string name, const std::string &conffile) throw (AOException);
63 
64  int Create();
65 
66 protected:
67  std::string ping_fifo_path;
68 
69  std::string save_path;
70 
71  std::string name_base;
72 
73  std::string path_name;
74 
75  std::string subdir;
76 
77  int change_subdir(std::string sd);
78  //unsigned fileno;
79  //unsigned ndigits;
80 
81  sharedim_stack<dataT> * sis; ///< Manages a VisAO shared memory image stack.
82 
83  int shmem_key;
84 
85  bool attached_to_shmem;
86 
87  sharedim<dataT> sim; ///<The sharedim structure retreived from the stack
88 
89  int behind; ///<The number of frames currently behind
90  int total_skipped; ///<The total number of frames skipped
91 
92  visao_imheader imhead;
93 
94  bool write_aosys_head;
95  bool write_visao_head;
96 
97  pthread_mutex_t frame_ready_mutex;
98 public:
99  pthread_cond_t frame_ready_cond;
100 
101 public:
102  int set_ping_fifo_path(std::string &);
103  std::string get_ping_fifo_path(){return ping_fifo_path;}
104 
105  int set_save_path(std::string &);
106  std::string get_save_path(){return save_path;}
107 
108  int set_name_base(std::string &);
109  std::string get_name_base(){return name_base;}
110 
111  int set_sharedim_stack(sharedim_stack<dataT> *);
112  sharedim_stack<dataT> * get_sharedim_stack(){return sis;}
113 
114  int set_shmem_key(int sk);
115  int get_shmem_key(){return shmem_key;}
116  int connect_shmem();
117 
118  int set_sim(sharedim<dataT> s);
119  sharedim<dataT> get_sim(){return sim;}
120 
121  int get_total_skipped(){return total_skipped;}
122 
123  virtual int Run();
124 
125  int write_frame();
126  virtual int kill_me();
127 
128 protected:
129 
130  int attach_status_boards();
131 
132  /// Overridden from VisAOApp_base::remote_command, here just calls common_command.
133  virtual std::string remote_command(std::string com);
134  /// Overridden from VisAOApp_base::local_command, here just calls common_command.
135  virtual std::string local_command(std::string com);
136  /// Overridden from VisAOApp_base::script_command, here just calls common_command.
137  virtual std::string script_command(std::string com);
138  /// Overridden from VisAOApp_base::auto_command, here just calls common_command.
139  std::string auto_command(std::string com, char *seqmsg);
140 
141  /// The common command processor for commands received by fifo.
142  /** The return value depends on the command received. Recognized commands are:
143  * - subdir? the return value is the current subdirectory"
144  * - subdir xxxxx sets the subdirectory to xxxxx
145  * - For any other inputs returns "UNKNOWN COMMAND: (str)\n"
146  */
147  std::string common_command(std::string com, int cmode);
148 };
149 
150 //read one of the dio channel fifos
151 template <class dataT> int frame_ready(fifo_channel *fc);
152 
153 
154 template <class dataT> framewriter<dataT>::framewriter(int argc, char **argv) throw (AOException) : VisAOApp_standalone(argc, argv)
155 {
156  Create();
157 }
158 
159 template <class dataT> framewriter<dataT>::framewriter(std::string name, const std::string &conffile) throw (AOException) : VisAOApp_standalone(name, conffile)
160 {
161  Create();
162 }
163 
164 template <class dataT> int framewriter<dataT>::Create()
165 {
166  std::string pathtmp;
167 
168  std::string visao_root = getenv("VISAO_ROOT");
169 
170  //Set up the ping_fifo_path
171  try
172  {
173  pathtmp = (std::string)(ConfigDictionary())["ping_fifo_path"];
174  }
175  catch(Config_File_Exception)
176  {
177  pathtmp = "fifos";
178  }
179  ping_fifo_path = visao_root + "/" + pathtmp +"/";
180  _logger->log(Logger::LOG_LEV_INFO, "Set ping_fifo_path: %s", ping_fifo_path.c_str());
181 
182  //Set up the save_path
183  try
184  {
185  pathtmp = (std::string)(ConfigDictionary())["save_path"];
186  }
187  catch(Config_File_Exception)
188  {
189  pathtmp = "data";
190  }
191  save_path = visao_root + "/" + pathtmp + "/";
192  set_save_path(save_path); //takes care of other business
193 
194  _logger->log(Logger::LOG_LEV_INFO, "Set save_path: %s", save_path.c_str());
195 
196  //Set up the name_base
197  try
198  {
199  pathtmp = (std::string)(ConfigDictionary())["name_base"];
200  }
201  catch(Config_File_Exception)
202  {
203  _logger->log(Logger::LOG_LEV_FATAL, "name_base is a required config parameter.");
204  throw;
205  }
206 
207  name_base = pathtmp;
208  _logger->log(Logger::LOG_LEV_INFO, "Set name_base: %s", name_base.c_str());
209 
210  path_name = save_path+name_base;
211  _logger->log(Logger::LOG_LEV_INFO, "Generated path_name: %s", path_name.c_str());
212 
213  setup_fifo_list(4);
214  setup_baseApp(0, 1, 1, 1, false);
215  //setup_baseApp();
216 
217  set_fifo_list_channel(&fl, 0, RWBUFF_SZ, (char *)std::string(ping_fifo_path + MyName()+"_ping_in").c_str(), (char *)std::string(ping_fifo_path + MyName()+"_ping_out").c_str(), &frame_ready<dataT>, (void *)this);
218 
219  //Set up the fits ORIGIN header
220  try
221  {
222  imhead.origin = (std::string)(ConfigDictionary())["origin"];
223  }
224  catch(Config_File_Exception)
225  {
226  imhead.origin = "Magellan AO System";
227  }
228 
229  //Set up the fits TELESCOP header
230  try
231  {
232  imhead.telescop = (std::string)(ConfigDictionary())["telescope"];
233  }
234  catch(Config_File_Exception)
235  {
236  imhead.telescop = "Magellan Clay";
237  }
238 
239  //Set up the fits INSTRUME header
240  try
241  {
242  imhead.instrume = (std::string)(ConfigDictionary())["instrument"];
243  }
244  catch(Config_File_Exception)
245  {
246  imhead.instrume = "Magellan VisAO";
247  }
248 
249  //Decide whether we write the ao system header
250  try
251  {
252  write_aosys_head = (int)(ConfigDictionary())["write_aosys_head"];
253  }
254  catch(Config_File_Exception)
255  {
256  write_aosys_head = 1;
257  }
258 
259  //Decide whether we write the visao header
260  try
261  {
262  write_visao_head = (int)(ConfigDictionary())["write_visao_head"];
263  }
264  catch(Config_File_Exception)
265  {
266  write_visao_head = 1;
267  }
268 
269  try
270  {
271  shmem_key = (int)(ConfigDictionary())["shmem_key"];
272  }
273  catch(Config_File_Exception)
274  {
275  _logger->log(Logger::LOG_LEV_FATAL, "shmem_key is a required config parameter.");
276  throw;
277  }
278  attached_to_shmem = false;
279 
280  total_skipped = 0;
281  behind = 0;
282 
283  init_visao_imheader(&imhead);
284 
285  //Init the status board for known process names
286  statusboard_shmemkey = 0;
287  if(MyFullName() == "framewriter47.L")
288  {
289  std::cout << "Initing for framewriter47.L\n";
290  statusboard_shmemkey = STATUS_framewriter47;
291  }
292  if(MyFullName() == "framewriter39.L")
293  {
294  std::cout << "Initing for framewriter39.L\n";
295  statusboard_shmemkey = STATUS_framewriter39;
296  }
297 
298  if(statusboard_shmemkey)
299  {
300  if(create_statusboard(sizeof(basic_status_board)) != 0)
301  {
302  statusboard_shmemptr = 0;
303  _logger->log(Logger::LOG_LEV_ERROR, "Could not create status board.");
304  }
305  else
306  {
307  VisAO::basic_status_board * bsb = (VisAO::basic_status_board *) statusboard_shmemptr;
308  strncpy(bsb->appname, MyFullName().c_str(), 25);
309  bsb->max_update_interval = pause_time;
310  }
311  }
312 
313  pthread_cond_init(&frame_ready_cond, NULL);
314  pthread_mutex_init(&frame_ready_mutex, NULL);
315 
316  return 0;
317 }
318 
319 template <class dataT> int framewriter<dataT>::change_subdir(std::string sd)
320 {
321 
322  int idx = sd.find_first_of(" \t\r\n", 0);
323  if(idx > -1) subdir = sd.substr(0, idx);
324  else subdir = sd;
325 
326  path_name = save_path+ subdir+ "/" + name_base;
327  _logger->log(Logger::LOG_LEV_INFO, "Generated path_name: %s", path_name.c_str());
328 
329  if(subdir != "." && subdir != "")
330  {
331  std::string com = "mkdir -p ";
332  com += save_path+ subdir;
333 
334  system(com.c_str());
335  }
336 
337  return 0;
338 }
339 
340 template <class dataT> int framewriter<dataT>::set_ping_fifo_path(std::string &pfp)
341 {
342  ping_fifo_path = pfp;
343  return 0;
344 }
345 
346 template <class dataT> int framewriter<dataT>::set_save_path(std::string &sp)
347 {
348  save_path = sp;
349  path_name = save_path+name_base;
350 
351  //Make the directory
352  std::string com = "mkdir -p ";
353  com += save_path;
354 
355  system(com.c_str());
356 
357  return 0;
358 }
359 
360 template <class dataT> int framewriter<dataT>::set_name_base(std::string &nb)
361 {
362  name_base = nb;
363  path_name = save_path+name_base;
364  return 0;
365 }
366 
367 template <class dataT> int framewriter<dataT>::set_sharedim_stack(sharedim_stack<dataT> * s)
368 {
369  sis = s;
370  return 0;
371 }
372 
373 template <class dataT> int framewriter<dataT>::set_shmem_key(int sk)
374 {
375  shmem_key = sk;
376  return 0;
377 }
378 
379 template <class dataT> int framewriter<dataT>::connect_shmem()
380 {
381  sis = new sharedim_stack<dataT>;
382  if(sis->attach_shm(shmem_key) != 0)
383  {
384  ERROR_REPORT("Error attaching to shared memory.");
385  attached_to_shmem = false;
386  delete sis;
387  return -1;
388  }
389  attached_to_shmem = true;
390  return 0;
391 }
392 
393 template <class dataT> int framewriter<dataT>::set_sim(sharedim<dataT> s)
394 {
395  sim = s;
396  return 0;
397 }
398 
399 template <class dataT> int framewriter<dataT>::Run()
400 {
401  connect_shmem();
402 
403  //Install the main thread handler
404  if(install_sig_mainthread_catcher() != 0)
405  {
406  ERROR_REPORT("Error installing main thread catcher.");
407  return -1;
408  }
409 
410  //Startup the I/O signal handling thread
411  if(start_signal_catcher(true) != 0)
412  {
413  ERROR_REPORT("Error starting signal catching thread.");
414  return -1;
415  }
416 
417  //Now Block all I/O signals in this thread.
418  if(block_sigio() != 0)
419  {
420  ERROR_REPORT("Error blocking SIGIO in main thread.");
421  return -1;
422  }
423 
424 
425  /*global_fifo_list = &fl;
426  *
427  * signal(SIGIO, SIG_IGN);
428  * if(connect_fifo_list() == 0)
429  * {
430  * LOG_INFO("fifo_list connected.");
431  }
432  else
433  {
434  ERROR_REPORT("Error connecting the fifo list.");
435  return -1;
436  }
437 
438 
439 
440  act.sa_handler = &catch_fifo_response_list;
441  act.sa_flags = 0;
442  sigemptyset(&sset);
443  act.sa_mask = sset;
444 
445  sigaction(SIGIO, &act, 0);
446  */
447 
448  attach_status_boards();
449  LOG_INFO("starting up . . .");
450 
451  while(!TimeToDie)
452  {
453  //sleep(pause_time);
454  //update_statusboard();
455 
456  pthread_mutex_lock(&frame_ready_mutex);
457  pthread_cond_wait(&frame_ready_cond, &frame_ready_mutex);
458  pthread_mutex_unlock(&frame_ready_mutex);
459  write_frame();
460 
461  }
462 
463  return 0;
464 }
465 
466 template <class dataT> int framewriter<dataT>::write_frame()
467 {
468  static int last_image_abs = -1, last_image = -1, last_save_sequence = -1;
469  int skipped;
470  int fitsStatus;
471  char fitsError[30];
472  std::stringstream ss;
473  //timeval tv0, tv1;
474  //double dt;
475 
476  if(attached_to_shmem == false)
477  {
478  if(connect_shmem() != 0) return -1;
479  }
480 
481  //Detect a framegrabber restart
482  if(sis->get_last_image_abs() < last_image_abs || last_save_sequence != sis->header->save_sequence)
483  {
484  last_image_abs = sis->get_last_image_abs()-1; //Subtracting 1 here causes the current frame to be saved
485  //Not subtracting one causes us to wait 1 frame.
486  last_image = sis->get_last_image();
487  last_save_sequence = sis->header->save_sequence;
488  attach_status_boards();
489  //If we restarted, log it:
490  if(sis->get_last_image_abs() < last_image_abs) LOG_INFO("Detected framegrabber restart, resetting");
491  std::cout << "Detected framegrabber restart, resetting" << "\n";
492  }
493 
494  if(last_image_abs < 0)
495  {
496  last_image = sis->get_last_image();
497  last_save_sequence = sis->header->save_sequence;
498  last_image_abs = sis->get_last_image_abs()-1;
499  }
500 
501  while(last_image_abs < sis->get_last_image_abs() && !TimeToDie)
502  {
503  sim = sis->get_image(last_image);
504 
505  if(sim.nx)
506  {
507  //gettimeofday(&tv0, 0);
508 
509  fitsStatus = write_visao_fits<dataT>(path_name.c_str(), &sim, &imhead, write_aosys_head, write_visao_head);
510  if(fitsStatus != 0)
511  {
512  ss.str("");
513  fits_get_errstatus(fitsStatus, fitsError);
514  ss << "write_visao_fits returned status: [" << fitsStatus << "] " << fitsError << " - Error writing image";
515  ERROR_REPORT(ss.str().c_str());
516  //ERROR_REPORT(fits_report_error(stderr, fitsStatus));
517  return -1;
518  }
519  sis->set_saved(last_image, 1);
520 
521  //gettimeofday(&tv1,0);
522  //dt = ((double)tv1.tv_sec + ((double)tv1.tv_usec)/1e6)-((double)tv0.tv_sec + ((double)tv0.tv_usec)/1e6);
523  //std::cout << dt << "\n";
524  last_image_abs++;
525  last_image++;
526  if(last_image >= sis->get_max_n_images()) last_image = 0;
527  }
528  else
529  {
530  std::cout << "last_image " << last_image << "\n";
531  std::cout << "last_image_abs " << last_image_abs << "\n";
532  std::cout << "max_n_images " << sis->get_max_n_images() << "\n";
533  ERROR_REPORT("Error getting image in write_frame().");
534  exit(0);
535  }
536  behind = sis->get_last_image_abs() - last_image_abs;
537 
538  //if(behind) std::cout << "Behind by: " << sis->get_last_image_abs() - last_image_abs << "\n";
539 
540 
541  if(behind >= sis->get_max_n_images())
542  {
543  skipped = (int)(behind - .5*sis->get_max_n_images());
544  total_skipped += skipped;
545  _logger->log(Logger::LOG_LEV_ERROR,"Behind %i frames, skipping %i frames. Total skipped: %i", behind, skipped, total_skipped);
546 
547  last_image_abs += skipped;
548  last_image += skipped;
549  if(last_image >= sis->get_max_n_images()) last_image = last_image - sis->get_max_n_images();
550 
551  }
552  update_statusboard();
553 
554  }
555 
556 
557 
558  return 0;
559 }
560 
561 template <class dataT> int framewriter<dataT>::attach_status_boards()
562 {
563  size_t sz;
564 
565  if(!imhead.fsb)
567 
568  if(!imhead.csb)
569  imhead.csb = (VisAO::ccd47_status_board*) attach_shm(&sz, STATUS_ccd47, 0);
570 
571  if(!imhead.ssb)
572  imhead.ssb = (VisAO::shutter_status_board*) attach_shm(&sz, STATUS_shutterctrl, 0);
573 
574  if(!imhead.fw2sb)
575  imhead.fw2sb = (VisAO::filterwheel_status_board*) attach_shm(&sz, STATUS_filterwheel2, 0);
576 
577  if(!imhead.fw3sb)
578  imhead.fw3sb = (VisAO::filterwheel_status_board*) attach_shm(&sz, STATUS_filterwheel3, 0);
579 
580  if(!imhead.wsb)
581  imhead.wsb = (VisAO::wollaston_status_board*) attach_shm(&sz, STATUS_wollaston, 0);
582 
583  if(!imhead.aosb)
584  imhead.aosb = (VisAO::aosystem_status_board*) attach_shm(&sz, STATUS_aosystem, 0);
585 
586  if(!imhead.gsb)
587  imhead.gsb = (VisAO::gimbal_status_board*) attach_shm(&sz, STATUS_gimbal, 0);
588 
589  if(!imhead.vssb)
590  imhead.vssb = (VisAO::system_status_board*) attach_shm(&sz, STATUS_sysmonD, 0);
591 
592  if(!imhead.rsb)
594 
595  if(!imhead.stsb)
597 
598  return 0;
599 }
600 
601 template <class dataT> std::string framewriter<dataT>::remote_command(std::string com)
602 {
603  std::string resp;
604  _logger->log(Logger::LOG_LEV_TRACE, "Received remote command: %s.", com.c_str());
605  resp = common_command(com, CMODE_REMOTE);
606  if(resp == "") resp = (std::string("UNKOWN COMMAND: ") + com + "\n");
607  _logger->log(Logger::LOG_LEV_TRACE, "Response to remote command: %s.", resp.c_str());
608  return resp;
609 }
610 
611 template <class dataT> std::string framewriter<dataT>::local_command(std::string com)
612 {
613  std::string resp;
614  _logger->log(Logger::LOG_LEV_TRACE, "Received local command: %s.", com.c_str());
615  resp = common_command(com, CMODE_LOCAL);
616  if(resp == "") resp = (std::string("UNKOWN COMMAND: ") + com + "\n");
617  _logger->log(Logger::LOG_LEV_TRACE, "Response to local command: %s.", resp.c_str());
618  return resp;
619 }
620 
621 template <class dataT> std::string framewriter<dataT>::script_command(std::string com)
622 {
623  std::string resp;
624  _logger->log(Logger::LOG_LEV_TRACE, "Received script command: %s.", com.c_str());
625  resp = common_command(com, CMODE_SCRIPT);
626  if(resp == "") resp = (std::string("UNKOWN COMMAND: ") + com + "\n");
627  _logger->log(Logger::LOG_LEV_TRACE, "Response to script command: %s.", resp.c_str());
628  return resp;
629 }
630 
631 template <class dataT> std::string framewriter<dataT>::auto_command(std::string com, char *seqmsg)
632 {
633  std::string resp;
634  _logger->log(Logger::LOG_LEV_TRACE, "Received auto command: %s.", com.c_str());
635  resp = common_command(com, CMODE_AUTO);
636  seqmsg = 0; //just to avoid the warning
637  if(resp == "") resp = post_auto_command(com);
638  _logger->log(Logger::LOG_LEV_TRACE, "Response to auto command: %s.", resp.c_str());
639  return resp;
640 }
641 
642 template <class dataT> std::string framewriter<dataT>::common_command(std::string com, int cmode)
643 {
644  if(com == "subdir?")
645  {
646  return subdir + "\n";
647  }
648 
649  if(com.substr(0,6) == "subdir")
650  {
651  if(change_subdir(com.substr(7, com.length()-7)) == 0) return "0\n";
652  else return "-1\n";
653  }
654 
655  return "";
656 }
657 
658 template <class dataT> int framewriter<dataT>::kill_me()
659 {
660  pthread_cond_broadcast(&frame_ready_cond);
661  return 0;
662 }
663 
664 template <class dataT> int frame_ready(fifo_channel *fc)
665 {
666  framewriter<dataT> *fw;
667 
668  fw = (framewriter<dataT> *)fc->auxdata;
669 
670  if(!TimeToDie)
671  {
672  //fw->write_frame();
673  pthread_cond_broadcast(&fw->frame_ready_cond);
674  while(read_fifo_channel(fc) > 0); //We don't do anything with this, just clear it out.
675  }
676  return 0;
677 }
678 
679 
680 
681 
682 } //namespace VisAO
683 
684 #endif //__framewriter_h__
685 
int setup_fifo_list(fifo_list *fl, int nch)
Setup a fifo_list.
Definition: fifoutils.c:354
A class for writing image frames from shared memory to disk.
Definition: framewriter.h:58
int read_fifo_channel(fifo_channel *fc)
Read data from the input fifo channel.
Definition: fifoutils.c:246
#define STATUS_reconstructor
Shared memory key for the reconstructor status board.
Definition: statusboard.h:49
The standalone VisAO application, does not interface with the AO Supervisor.
std::string auto_command(std::string com, char *seqmsg)
Overridden from VisAOApp_base::auto_command, here just calls common_command.
Definition: framewriter.h:631
Declarations for the standalone VisAO application.
#define STATUS_framewriter47
Shared memory key for the ccd47 framewriter status board.
Definition: statusboard.h:45
virtual int kill_me()
Handle a timetodie condition upon exiting the signal catcher thread (e.g. tell main thread it is abou...
Definition: framewriter.h:658
virtual std::string remote_command(std::string com)
Overridden from VisAOApp_base::remote_command, here just calls common_command.
Definition: framewriter.h:601
Declarations for the VisAO status information structures.
#define STATUS_shuttertester
Shared memory key for shutter tester status board.
Definition: statusboard.h:80
int TimeToDie
Global set by SIGTERM.
void * attach_shm(size_t *sz, key_t mkey, int shmemid)
Attach to a shared memory buffer and get its size.
Definition: libvisaoc.c:90
#define STATUS_gimbal
Shared memory key for the Gimbal mirror status board.
Definition: statusboard.h:65
int total_skipped
The total number of frames skipped.
Definition: framewriter.h:90
virtual std::string script_command(std::string com)
Overridden from VisAOApp_base::script_command, here just calls common_command.
Definition: framewriter.h:621
sharedim_stack< dataT > * sis
Manages a VisAO shared memory image stack.
Definition: framewriter.h:81
#define STATUS_focusstage
Shared memory key for the focus motor controller status board.
Definition: statusboard.h:39
virtual int Run()
The application main loop, to be re-implemented in derived classes.
Definition: framewriter.h:399
int behind
The number of frames currently behind.
Definition: framewriter.h:89
virtual std::string local_command(std::string com)
Overridden from VisAOApp_base::local_command, here just calls common_command.
Definition: framewriter.h:611
The namespace of VisAO software.
Declarations for various image utility functions.
sharedim< dataT > sim
The sharedim structure retreived from the stack.
Definition: framewriter.h:87
std::string common_command(std::string com, int cmode)
The common command processor for commands received by fifo.
Definition: framewriter.h:642
#define RWBUFF_SZ
The size of the i/o buffer.
Definition: fifoutils.h:43
#define STATUS_ccd47
Shared memory key for the ccd47 controller status board.
Definition: statusboard.h:41
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.
Definition: fifoutils.c:373