#include <prkx2su_class.h>
|
| Prkx2su (string dev) |
|
int32_t | init (string device) |
|
int32_t | connect () |
|
int32_t | disconnect () |
|
int32_t | get_status (uint8_t axis) |
|
float | get_az () |
|
float | get_el () |
|
int32_t | get_az_el (float &az, float &el) |
|
float | get_az_offset () |
|
float | get_el_offset () |
|
int32_t | gotoazel (float az, float el) |
|
int32_t | stop (uint8_t axis) |
|
int32_t | ramp (uint8_t axis, uint8_t speed) |
|
int32_t | minimum_speed (uint8_t axis, uint8_t speed) |
|
int32_t | maximum_speed (uint8_t axis, uint8_t speed) |
|
int32_t | getdata (uint8_t axis, string &buf, uint16_t buflen) |
|
int32_t | send (uint8_t axis, string buf, bool force) |
|
int32_t | test (uint8_t axis) |
|
int32_t | set_sensitivity (float sensitivity) |
|
int32_t | get_limits (uint8_t axis) |
|
int32_t | write_calibration (uint8_t axis, float value) |
|
Cosmos::Devices::Prkx2su::Prkx2su |
( |
string |
dev | ) |
|
#define PRKX2SU_STOPBITS
Definition: prkx2su_class.h:14
Definition: serialclass.h:43
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
Serial * serial[2]
Definition: prkx2su_class.h:49
#define PRKX2SU_BAUD
Definition: prkx2su_class.h:11
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
#define PRKX2SU_PARITY
Definition: prkx2su_class.h:13
#define PRKX2SU_BITS
Definition: prkx2su_class.h:12
static string device
Definition: ax25_recv.cpp:39
int32_t Cosmos::Devices::Prkx2su::init |
( |
string |
device | ) |
|
int32_t Cosmos::Devices::Prkx2su::connect |
( |
| ) |
|
Connects to am MII prkx2su antenna controller, which in turn drives a Yaesu G-5500 antenna controller.
- Parameters
-
dev | pointer to a character string with the serial port it is connected to. |
- See also
- cssl_start
-
cssl_open
-
cssl_setflowcontrol
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
Serial * serial[2]
Definition: prkx2su_class.h:49
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
int32_t disconnect()
Definition: prkx2su_class.cpp:91
int32_t open_device()
Definition: serialclass.cpp:60
int32_t set_timeout(int, double timeout)
Definition: serialclass.cpp:515
#define SERIAL_ERROR_OPEN
Definition: cosmos-errno.h:177
int32_t Cosmos::Devices::Prkx2su::disconnect |
( |
| ) |
|
Close currently open prkx2su.
int32_t close_device()
Definition: serialclass.cpp:126
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
Serial * serial[2]
Definition: prkx2su_class.h:49
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
int32_t Cosmos::Devices::Prkx2su::get_status |
( |
uint8_t |
axis | ) |
|
Poll controller for Status and Heading. Turns calibration mode on in prkx2su.
- Parameters
-
axis | 32 bit signed integer , 0 = Azimuth, 1 = Elevation |
uint8_t elid
Definition: prkx2su_class.h:36
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
int32_t getdata(uint8_t axis, string &buf, uint16_t buflen)
Definition: prkx2su_class.cpp:115
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
uint8_t azstatus
Definition: prkx2su_class.h:27
uint8_t azid
Definition: prkx2su_class.h:26
float currentaz
Definition: prkx2su_class.h:34
char buf[128]
Definition: rw_test.cpp:40
uint8_t elstatus
Definition: prkx2su_class.h:37
float currentel
Definition: prkx2su_class.h:42
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29
float Cosmos::Devices::Prkx2su::get_az |
( |
| ) |
|
float currentaz
Definition: prkx2su_class.h:34
float Cosmos::Devices::Prkx2su::get_el |
( |
| ) |
|
float currentel
Definition: prkx2su_class.h:42
int32_t Cosmos::Devices::Prkx2su::get_az_el |
( |
float & |
az, |
|
|
float & |
el |
|
) |
| |
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
float currentaz
Definition: prkx2su_class.h:34
int32_t get_status(uint8_t axis)
Definition: prkx2su_class.cpp:144
float currentel
Definition: prkx2su_class.h:42
float Cosmos::Devices::Prkx2su::get_az_offset |
( |
| ) |
|
float az_offset
Definition: prkx2su_class.h:31
float Cosmos::Devices::Prkx2su::get_el_offset |
( |
| ) |
|
float el_offset
Definition: prkx2su_class.h:39
int32_t Cosmos::Devices::Prkx2su::gotoazel |
( |
float |
az, |
|
|
float |
el |
|
) |
| |
303 az = fmodf(az,
D2PI);
329 float sep = sqrtf(daz*daz+del*del);
337 sprintf(out,
"APn%03d.%1d\r;", static_cast <uint16_t>(az), static_cast <uint16_t>(10 * (az - static_cast <uint16_t>(az))));
341 sprintf(out,
"APn%03d.%1d\r;", static_cast <uint16_t>(el), static_cast <uint16_t>(10 * (el - static_cast <uint16_t>(el))));
float targetaz
Definition: prkx2su_class.h:35
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
float sensitivity
Definition: prkx2su_class.h:45
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
int32_t get_az_el(float &az, float &el)
Definition: prkx2su_class.cpp:363
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
float maxel
Definition: prkx2su_class.h:41
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
float targetel
Definition: prkx2su_class.h:43
float currentaz
Definition: prkx2su_class.h:34
const double D2PI
Double precision 2*PI.
Definition: math/constants.h:16
float currentel
Definition: prkx2su_class.h:42
const double DPI
Double precision PI.
Definition: math/constants.h:14
float minel
Definition: prkx2su_class.h:40
int32_t Cosmos::Devices::Prkx2su::stop |
( |
uint8_t |
axis | ) |
|
Routine to stop current action. Whatever the current command is, it will cancelled before completeion.
- Returns
- 0 or negative error.
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
int32_t Cosmos::Devices::Prkx2su::ramp |
( |
uint8_t |
axis, |
|
|
uint8_t |
speed |
|
) |
| |
246 if (speed < 1 || speed > 10)
248 sprintf(out,
"WNn%03hhu;",
speed);
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_ERROR_OUTOFRANGE
Definition: cosmos-errno.h:251
float speed
Definition: netperf_send.cpp:40
int32_t Cosmos::Devices::Prkx2su::minimum_speed |
( |
uint8_t |
axis, |
|
|
uint8_t |
speed |
|
) |
| |
265 if (speed < 1 || speed > 10)
267 sprintf(out,
"WFn%03hhu;",
speed);
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_ERROR_OUTOFRANGE
Definition: cosmos-errno.h:251
float speed
Definition: netperf_send.cpp:40
int32_t Cosmos::Devices::Prkx2su::maximum_speed |
( |
uint8_t |
axis, |
|
|
uint8_t |
speed |
|
) |
| |
284 if (speed < 1 || speed > 10)
286 sprintf(out,
"WGn%03hhu;",
speed);
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_ERROR_OUTOFRANGE
Definition: cosmos-errno.h:251
float speed
Definition: netperf_send.cpp:40
int32_t Cosmos::Devices::Prkx2su::getdata |
( |
uint8_t |
axis, |
|
|
string & |
buf, |
|
|
uint16_t |
buflen |
|
) |
| |
Routine to use in blocking mode. Reads the serial port until a New Line is received, then returns entire buffer.
- Parameters
-
axis | Axis to read. |
buf | Pointer to a char buffer |
buflen | 32 bit signed integer indicating the maximum size of the buffer |
- Returns
- 32 bit signed integer containing the number of bytes read.
120 while((j=
serial[axis]->get_char()) >= 0)
122 buf.push_back(static_cast<char>(j));
123 if (j ==
';' || static_cast<uint16_t>(
buf.size()) == buflen)
135 return static_cast<int32_t
>(
buf.size());
Serial * serial[2]
Definition: prkx2su_class.h:49
char buf[128]
Definition: rw_test.cpp:40
int32_t Cosmos::Devices::Prkx2su::send |
( |
uint8_t |
axis, |
|
|
string |
buf, |
|
|
bool |
force |
|
) |
| |
455 if (lastbuf !=
buf || force)
int32_t put_string(string data)
Definition: serialclass.cpp:686
int32_t test(uint8_t axis)
Definition: prkx2su_class.cpp:420
int iretn
Definition: rw_test.cpp:37
Serial * serial[2]
Definition: prkx2su_class.h:49
char buf[128]
Definition: rw_test.cpp:40
int32_t Cosmos::Devices::Prkx2su::test |
( |
uint8_t |
axis | ) |
|
436 if (buf[0] !=
'1' || buf[1] != 0x1 || buf[buf.size()-1] !=
';')
int32_t put_string(string data)
Definition: serialclass.cpp:686
int iretn
Definition: rw_test.cpp:37
Serial * serial[2]
Definition: prkx2su_class.h:49
int32_t getdata(uint8_t axis, string &buf, uint16_t buflen)
Definition: prkx2su_class.cpp:115
#define PRKX2SU_ERROR_SEND
Definition: cosmos-errno.h:252
char buf[128]
Definition: rw_test.cpp:40
int32_t Cosmos::Devices::Prkx2su::set_sensitivity |
( |
float |
sensitivity | ) |
|
float sensitivity
Definition: prkx2su_class.h:45
int32_t Cosmos::Devices::Prkx2su::get_limits |
( |
uint8_t |
axis | ) |
|
189 sscanf(buf.c_str(),
"%*2c%f", &
minaz);
197 sscanf(buf.c_str(),
"%*2c%f", &
minel);
206 iretn =
getdata(axis, buf, 200);
214 sscanf(buf.c_str(),
"%*2c%f", &
maxaz);
222 sscanf(buf.c_str(),
"%*2c%f", &
maxel);
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
float maxaz
Definition: prkx2su_class.h:33
int32_t getdata(uint8_t axis, string &buf, uint16_t buflen)
Definition: prkx2su_class.cpp:115
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
float maxel
Definition: prkx2su_class.h:41
float minaz
Definition: prkx2su_class.h:32
char buf[128]
Definition: rw_test.cpp:40
float minel
Definition: prkx2su_class.h:40
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29
int32_t Cosmos::Devices::Prkx2su::write_calibration |
( |
uint8_t |
axis, |
|
|
float |
value |
|
) |
| |
404 value =
DEGOF(value);
405 sprintf(out,
"Awn%03d.%1d;", (int16_t)value, (int16_t)(10 * (value - (int16_t)value)));
int32_t send(uint8_t axis, string buf, bool force)
Definition: prkx2su_class.cpp:444
int iretn
Definition: rw_test.cpp:37
#define PRKX2SU_AXIS_EL
Definition: prkx2su_class.h:16
#define PRKX2SU_AXIS_AZ
Definition: prkx2su_class.h:15
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
const double D2PI
Double precision 2*PI.
Definition: math/constants.h:16
const double DPI
Double precision PI.
Definition: math/constants.h:14
uint8_t Cosmos::Devices::Prkx2su::azid |
uint8_t Cosmos::Devices::Prkx2su::azstatus |
int32_t Cosmos::Devices::Prkx2su::az_center |
int32_t Cosmos::Devices::Prkx2su::az_mode |
int32_t Cosmos::Devices::Prkx2su::az_offset_waiting |
float Cosmos::Devices::Prkx2su::az_offset |
float Cosmos::Devices::Prkx2su::minaz |
float Cosmos::Devices::Prkx2su::maxaz |
float Cosmos::Devices::Prkx2su::currentaz |
float Cosmos::Devices::Prkx2su::targetaz |
uint8_t Cosmos::Devices::Prkx2su::elid |
uint8_t Cosmos::Devices::Prkx2su::elstatus |
int32_t Cosmos::Devices::Prkx2su::el_offset_waiting |
float Cosmos::Devices::Prkx2su::el_offset |
float Cosmos::Devices::Prkx2su::minel |
float Cosmos::Devices::Prkx2su::maxel |
float Cosmos::Devices::Prkx2su::currentel |
float Cosmos::Devices::Prkx2su::targetel |
float Cosmos::Devices::Prkx2su::minimumel |
float Cosmos::Devices::Prkx2su::sensitivity |
int32_t Cosmos::Devices::Prkx2su::in_command |
int32_t Cosmos::Devices::Prkx2su::data_received |
Serial* Cosmos::Devices::Prkx2su::serial[2] |
The documentation for this class was generated from the following files: