~hitmuri/vjpirate/trunk

« back to all changes in this revision

Viewing changes to os/win/include/vrpn_nikon_controls.h

  • Committer: Florent Berthaut
  • Date: 2014-07-26 18:53:16 UTC
  • mfrom: (5.1.12 mac)
  • Revision ID: flo@localhost.localdomain-20140726185316-c2ucnwmgm5kij4e2
Merged mac branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef VRPN_NIKON_CONTROLS_H
 
2
#define VRPN_NIKON_CONTROLS_H
 
3
 
 
4
#include  "vrpn_Analog.h"
 
5
#include  "vrpn_Analog_Output.h"
 
6
 
 
7
class VRPN_API vrpn_Nikon_Controls : public vrpn_Serial_Analog, public vrpn_Analog_Output {
 
8
public:
 
9
  vrpn_Nikon_Controls(const char *device_name, vrpn_Connection *con = NULL, const char *port_name = "COM1");
 
10
  ~vrpn_Nikon_Controls(void) {};
 
11
 
 
12
  virtual void mainloop ();
 
13
 
 
14
protected:
 
15
  int _status;
 
16
 
 
17
  unsigned char _buffer[512]; //< Buffer of characters in report
 
18
  unsigned _bufcount;         //< How many characters we have so far
 
19
 
 
20
  double  _requested_focus;   //< Where we asked the focus to be set to
 
21
 
 
22
  struct timeval timestamp;   //< Time of the last report from the device
 
23
 
 
24
  virtual int reset(void);              //< Set device back to starting config
 
25
  virtual int get_report(void);         //< Try to read a report from the device
 
26
  virtual int set_channel(unsigned chan_num, vrpn_float64 value); //< Try to set the focus to this
 
27
 
 
28
  /// Send changes since the last time
 
29
  virtual void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
 
30
 
 
31
  /// Send values whether or not they have changed.
 
32
  virtual void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
 
33
 
 
34
  /// Responds to a connection request with a report of the values
 
35
  static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p);
 
36
 
 
37
  /// Responds to a request to change one of the values by
 
38
  /// setting the channel to that value.
 
39
  static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p);
 
40
 
 
41
  /// Responds to a request to change multiple channels at once.
 
42
  static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p);
 
43
};
 
44
 
 
45
#endif