COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
prkx2su_class.h
Go to the documentation of this file.
1 #ifndef PRKX2SU_CLASS_H
2 #define PRKX2SU_CLASS_H
3 
4 #include "support/configCosmos.h"
5 #include "math/mathlib.h"
6 #include "support/cosmos-errno.h"
8 #include <cstdio>
9 
10 #define PRKX2SU_ID 1
11 #define PRKX2SU_BAUD 9600
12 #define PRKX2SU_BITS 8
13 #define PRKX2SU_PARITY 0
14 #define PRKX2SU_STOPBITS 1
15 #define PRKX2SU_AXIS_AZ 0
16 #define PRKX2SU_AXIS_EL 1
17 
18 namespace Cosmos {
19  namespace Devices {
20 
21  class Prkx2su
22  {
23  public:
24  Prkx2su(string dev);
25 
26  uint8_t azid;
27  uint8_t azstatus;
28  int32_t az_center;
29  int32_t az_mode;
31  float az_offset;
32  float minaz;
33  float maxaz;
34  float currentaz;
35  float targetaz;
36  uint8_t elid;
37  uint8_t elstatus;
39  float el_offset;
40  float minel;
41  float maxel;
42  float currentel;
43  float targetel;
44  float minimumel;
45  float sensitivity;
46  int32_t in_command;
47  int32_t data_received;
48 
50 
51  int32_t init(string device);
52  int32_t connect();
53  int32_t disconnect();
54  int32_t get_status(uint8_t axis);
55  float get_az();
56  float get_el();
57  int32_t get_az_el(float &az, float &el);
58  float get_az_offset();
59  float get_el_offset();
60  int32_t gotoazel(float az, float el);
61  int32_t stop(uint8_t axis);
62  int32_t ramp(uint8_t axis, uint8_t speed);
63  int32_t minimum_speed(uint8_t axis, uint8_t speed);
64  int32_t maximum_speed(uint8_t axis, uint8_t speed);
65  int32_t getdata(uint8_t axis, string &buf, uint16_t buflen);
66  int32_t send(uint8_t axis, string buf, bool force);
67  int32_t test(uint8_t axis);
68  int32_t set_sensitivity(float sensitivity);
69  int32_t get_limits(uint8_t axis);
70  int32_t write_calibration(uint8_t axis, float value);
71  };
72  }
73 }
74 #endif // PRKX2SU_CLASS_H
Definition: agentclass.cpp:54
uint8_t elid
Definition: prkx2su_class.h:36
float targetaz
Definition: prkx2su_class.h:35
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int32_t minimum_speed(uint8_t axis, uint8_t speed)
Definition: prkx2su_class.cpp:260
float minimumel
Definition: prkx2su_class.h:44
int32_t get_limits(uint8_t axis)
Definition: prkx2su_class.cpp:172
float sensitivity
Definition: prkx2su_class.h:45
int32_t in_command
Definition: prkx2su_class.h:46
float get_el()
Definition: prkx2su_class.cpp:358
int32_t test(uint8_t axis)
Definition: prkx2su_class.cpp:420
Definition: serialclass.h:43
Serial * serial[2]
Definition: prkx2su_class.h:49
Definition: prkx2su_class.h:21
int32_t get_az_el(float &az, float &el)
Definition: prkx2su_class.cpp:363
int32_t ramp(uint8_t axis, uint8_t speed)
Definition: prkx2su_class.cpp:241
int32_t az_center
Definition: prkx2su_class.h:28
int32_t connect()
Definition: prkx2su_class.cpp:26
int32_t el_offset_waiting
Definition: prkx2su_class.h:38
float el_offset
Definition: prkx2su_class.h:39
float maxaz
Definition: prkx2su_class.h:33
int32_t getdata(uint8_t axis, string &buf, uint16_t buflen)
Definition: prkx2su_class.cpp:115
uint8_t azstatus
Definition: prkx2su_class.h:27
int32_t az_mode
Definition: prkx2su_class.h:29
int32_t disconnect()
Definition: prkx2su_class.cpp:91
float maxel
Definition: prkx2su_class.h:41
uint8_t azid
Definition: prkx2su_class.h:26
float get_az_offset()
Definition: prkx2su_class.cpp:410
int32_t maximum_speed(uint8_t axis, uint8_t speed)
Definition: prkx2su_class.cpp:279
Headers and definitions common to all COSMOS.
float minaz
Definition: prkx2su_class.h:32
COSMOS Error Codes.
float targetel
Definition: prkx2su_class.h:43
float get_el_offset()
Definition: prkx2su_class.cpp:415
Prkx2su(string dev)
Definition: prkx2su_class.cpp:6
int32_t init(string device)
float currentaz
Definition: prkx2su_class.h:34
int32_t az_offset_waiting
Definition: prkx2su_class.h:30
mathlib include file
int32_t stop(uint8_t axis)
Definition: prkx2su_class.cpp:234
float az_offset
Definition: prkx2su_class.h:31
float speed
Definition: netperf_send.cpp:40
int32_t get_status(uint8_t axis)
Definition: prkx2su_class.cpp:144
int32_t gotoazel(float az, float el)
Definition: prkx2su_class.cpp:298
char buf[128]
Definition: rw_test.cpp:40
uint8_t elstatus
Definition: prkx2su_class.h:37
float currentel
Definition: prkx2su_class.h:42
int32_t set_sensitivity(float sensitivity)
Definition: prkx2su_class.cpp:464
float get_az()
Definition: prkx2su_class.cpp:353
float minel
Definition: prkx2su_class.h:40
int32_t write_calibration(uint8_t axis, float value)
Definition: prkx2su_class.cpp:380
static string device
Definition: ax25_recv.cpp:39
int32_t data_received
Definition: prkx2su_class.h:47