The VisAO Camera
frameselector.h
Go to the documentation of this file.
1 /************************************************************
2 * frameselector.h
3 *
4 * Author: Jared R. Males (jrmales@email.arizona.edu)
5 *
6 * Declarations for the real time frame selector
7 *
8 * Developed as part of the Magellan Adaptive Optics system.
9 ************************************************************/
10 
11 /** \file frameselector.h
12  * \author Jared R. Males
13  * \brief Declarations for the real time frame selector
14  *
15  *
16 */
17 
18 #ifndef __frameselector_h__
19 #define __frameselector_h__
20 
21 #include "VisAOApp_standalone.h"
22 
23 namespace VisAO
24 {
25 
27 {
28 public:
29  frameselector(int argc, char **argv) throw (AOException);
30  frameselector(std::string name, const std::string &conffile) throw (AOException);
31 
32  int Create();
33 
34 protected:
35  std::string ping_fifo_path;
36 
37  sharedim_stack<float> * sis; ///< Manages a VisAO shared memory image stack.
38 
39  int shmem_key;
40 
41  bool attached_to_shmem;
42 
43  sharedim<float> sim; ///<The sharedim structure retreived from the stack
44 
45  double thresh;
46 
47  bool frame_select;
48 
49  pthread_mutex_t strehl_ready_mutex;
50  pthread_mutex_t select_mutex;
51 
52 public:
53  pthread_cond_t strehl_ready_cond;
54 
55 public:
56  int set_ping_fifo_path(std::string &);
57  std::string get_ping_fifo_path(){return ping_fifo_path;}
58 
59  int set_sharedim_stack(sharedim_stack<float> *);
60  sharedim_stack<float> * get_sharedim_stack(){return sis;}
61 
62  int set_shmem_key(int sk);
63  int get_shmem_key(){return shmem_key;}
64  int connect_shmem();
65 
66  int set_sim(sharedim<float> s);
67  sharedim<float> get_sim(){return sim;}
68 
69  virtual int Run();
70 
71  int selector();
72 
73  virtual int kill_me();
74 
75  virtual int update_statusboard();
76 
77 protected:
78 
79  int attach_status_boards();
80 
81  /// Overridden from VisAOApp_base::remote_command, here just calls common_command.
82  virtual std::string remote_command(std::string com);
83  /// Overridden from VisAOApp_base::local_command, here just calls common_command.
84  virtual std::string local_command(std::string com);
85  /// Overridden from VisAOApp_base::script_command, here just calls common_command.
86  virtual std::string script_command(std::string com);
87  /// Overridden from VisAOApp_base::auto_command, here just calls common_command.
88  std::string auto_command(std::string com, char *seqmsg);
89 
90  /// The common command processor for commands received by fifo.
91  /** The return value depends on the command received. Recognized commands are:
92  * -
93  * - For any other inputs returns "UNKNOWN COMMAND: (str)\n"
94  */
95  std::string common_command(std::string com, int cmode);
96 
97  std::string get_state_str();
98 };
99 
100 //read one of the dio channel fifos
101 //int strehl_ready(fifo_channel *fc);
102 void strehl_ready(int signum, siginfo_t *siginf, void *ucont);
103 
104 
105 } //namespace VisAO
106 
107 #endif //__framewriter_h__
108 
std::string common_command(std::string com, int cmode)
The common command processor for commands received by fifo.
virtual int Run()
The application main loop, to be re-implemented in derived classes.
virtual std::string script_command(std::string com)
Overridden from VisAOApp_base::script_command, here just calls common_command.
virtual int update_statusboard()
Update the status board.
The standalone VisAO application, does not interface with the AO Supervisor.
Declarations for the standalone VisAO application.
virtual std::string local_command(std::string com)
Overridden from VisAOApp_base::local_command, here just calls common_command.
virtual std::string remote_command(std::string com)
Overridden from VisAOApp_base::remote_command, here just calls common_command.
std::string auto_command(std::string com, char *seqmsg)
Overridden from VisAOApp_base::auto_command, here just calls common_command.
virtual int kill_me()
Handle a timetodie condition upon exiting the signal catcher thread (e.g. tell main thread it is abou...
sharedim_stack< float > * sis
Manages a VisAO shared memory image stack.
Definition: frameselector.h:37
sharedim< float > sim
The sharedim structure retreived from the stack.
Definition: frameselector.h:43
The namespace of VisAO software.