RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Spaceball.h
1#ifndef VRPN_SPACEBALL_H
2#define VRPN_SPACEBALL_H
3
4#include "vrpn_Analog.h" // for vrpn_Serial_Analog
5#include "vrpn_Button.h" // for vrpn_Button_Filter
6#include "vrpn_Configure.h" // for VRPN_API
7#include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc
8#include "vrpn_Shared.h" // for timeval
9#include "vrpn_Types.h" // for vrpn_uint32
10
11class VRPN_API vrpn_Spaceball: public vrpn_Serial_Analog
12 ,public vrpn_Button_Filter
13{
14 public:
15 vrpn_Spaceball (const char * name, vrpn_Connection * c,
16 const char * port, int baud);
17
18 ~vrpn_Spaceball () {};
19
20 /// Called once through each main loop iteration to handle updates.
21 virtual void mainloop ();
22
23 virtual int reset(void); ///< Set device back to starting config
24
25 protected:
26 int _numbuttons; ///< How many buttons to open
27 int _numchannels; ///< How many analog channels to open
28 unsigned char buf[512]; ///< Buffer of characters in report,
29 int bufpos; ///< Current char pos in buffer
30 int packtype; ///< What kind of packet we are decoding
31 int packlen; ///< Expected packet length
32 int escapedchar; ///< We're processing an escaped char
33 int erroroccured; ///< A device error has occurred
34 int resetoccured; ///< A reset event has occurred
35 int spaceball4000; ///< We found a Spaceball 4000
36 int leftymode4000; ///< Spaceball 4000 is in lefty mode
37 int null_radius; ///< range where no motion should be reported
38 struct timeval timestamp; ///< Time of the last report from the device
39
40 virtual void clear_values(void); ///< Set all buttons, analogs and encoders back to 0
41
42 /// Try to read reports from the device. Returns 1 if a complete
43 /// report received, 0 otherwise. Sets status to current mode.
44 virtual int get_report(void);
45
46 /// send report iff changed
47 virtual void report_changes
48 (vrpn_uint32 class_of_service
49 = vrpn_CONNECTION_LOW_LATENCY);
50
51 /// send report whether or not changed
52 virtual void report
53 (vrpn_uint32 class_of_service
54 = vrpn_CONNECTION_LOW_LATENCY);
55
56 // NOTE: class_of_service is only applied to vrpn_Analog
57 // values, not vrpn_Button, which are always vrpn_RELIABLE
58};
59
60#endif
定义 vrpn_Button.h:66
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Analog.h:63
定义 vrpn_Spaceball.h:13
int packlen
Expected packet length
定义 vrpn_Spaceball.h:31
int leftymode4000
Spaceball 4000 is in lefty mode
定义 vrpn_Spaceball.h:36
int escapedchar
We're processing an escaped char
定义 vrpn_Spaceball.h:32
int resetoccured
A reset event has occurred
定义 vrpn_Spaceball.h:34
int _numchannels
How many analog channels to open
定义 vrpn_Spaceball.h:27
virtual int get_report(void)
report received, 0 otherwise. Sets status to current mode.
virtual void clear_values(void)
Set all buttons, analogs and encoders back to 0
virtual void mainloop()
Called once through each main loop iteration to handle updates.
virtual int reset(void)
Set device back to starting config
int bufpos
Current char pos in buffer
定义 vrpn_Spaceball.h:29
int spaceball4000
We found a Spaceball 4000
定义 vrpn_Spaceball.h:35
int erroroccured
A device error has occurred
定义 vrpn_Spaceball.h:33
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report whether or not changed
int null_radius
range where no motion should be reported
定义 vrpn_Spaceball.h:37
int _numbuttons
How many buttons to open
定义 vrpn_Spaceball.h:26
int packtype
What kind of packet we are decoding
定义 vrpn_Spaceball.h:30
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report iff changed