205 printf(
"Usage: agent_antenna antenna node");
243 else if (
antbase.find(
"loop") != string::npos)
269 if ((iretn=
agent->
add_request(
"jog",
request_jog,
"{degrees aziumth} {degrees elevation}",
"Jog the antenna azimuth and elevation in degrees.")))
294 sprintf(sohstring,
"{\"device_ant_temp_%03lu\",\"device_ant_align_%03lu\",\"device_ant_azim_%03lu\",\"device_ant_elev_%03lu\"}",
antindex,
antindex,
antindex,
antindex);
319 FILE *op = fopen(offsetname.c_str(),
"r");
413 printf(
"%f: Connect Antenna\n", et.lap());
int32_t request_get_horizon(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:516
int32_t finish_active_loop()
Definition: agentclass.cpp:355
FILE * get_debug_fd(double mjd=0.)
Definition: agentclass.cpp:2645
static string antbase
Definition: agent_antenna.cpp:154
int32_t prkx2su_goto(float az, float el)
Definition: prkx2su_lib.cpp:330
string nodeName
Definition: agentclass.h:367
string getNode()
Listen for heartbeat.
Definition: agentclass.cpp:2607
static antstruc target
Definition: agent_antenna.cpp:160
int32_t request_enable(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:522
int32_t prkx2su_get_az_el(float &az, float &el)
Definition: prkx2su_lib.cpp:385
int32_t gs232b_goto(float az, float el)
Definition: gs232b_lib.cpp:224
static std::string antdevice
Definition: agent_antenna.cpp:157
int32_t request_track_azel(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:633
int32_t request_disable(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:528
int iretn
Definition: rw_test.cpp:37
int32_t request_debug(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:619
int32_t wait(State state=State::RUN, double waitsec=10.)
Definition: agentclass.cpp:398
int32_t request_get_offset(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:479
double lastx()
Least squares last independent value.
Definition: mathlib.cpp:2671
static uint16_t devindex
Definition: agent_antenna.cpp:158
static bool antconnected
Definition: agent_antenna.cpp:162
int32_t set_sohstring(string list)
Set Limited SOH string.
Definition: agentclass.cpp:641
static thread rthread
Definition: agent_antenna.cpp:168
static uint16_t antindex
Definition: agent_antenna.cpp:159
int32_t request_set_rotctl(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:535
ElapsedTime et
Definition: agent_cpu_device_test.cpp:51
int32_t request_jog(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:507
int32_t json_dump_node(cosmosstruc *cinfo)
Save Node entries to disk.
Definition: jsonlib.cpp:7233
vector< devicestruc > device
Vector of all general (common) information for devices (components) in node.
Definition: jsondef.h:4238
string cosmos_error_string(int32_t cosmos_errno)
Definition: cosmos-errno.cpp:45
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
static string sohstring
Definition: agent_cpu-2-0.cpp:72
static azelstruc antennaoffset
Definition: agent_antenna.cpp:185
float elev
Elevation.
Definition: jsondef.h:2258
static LsFit trackaz(5, 2)
int32_t gs232b_set_sensitivity(float sensitivity)
Definition: gs232b_lib.cpp:417
Definition: jsondef.h:564
string getAgent()
Definition: agentclass.cpp:2609
static std::string nodename
Definition: agent_antenna.cpp:155
int32_t add_request(string token, external_request_function function, string synopsis="", string description="")
Add internal request to Agent request list with description and synopsis.
Definition: agentclass.cpp:312
static Agent * agent
Definition: agent_antenna.cpp:178
int32_t request_set_azel(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:487
static antstruc current
Definition: agent_antenna.cpp:161
Definition: agentclass.h:139
int32_t connect_antenna()
Definition: agent_antenna.cpp:557
double eval(double x)
Least squares dependent scalar value.
Definition: mathlib.cpp:2714
#define DEGOF(rad)
Degrees of a Radian value.
Definition: math/constants.h:33
int32_t shutdown()
Shutdown agent gracefully.
Definition: agentclass.cpp:366
int32_t request_pause(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:460
int32_t request_get_rotctl(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:551
double data_ctime(string path)
Definition: datalib.cpp:1910
float azim
Azimuth;.
Definition: jsondef.h:2256
int32_t prkx2su_set_sensitivity(float sensitivity)
Definition: prkx2su_lib.cpp:491
Definition: elapsedtime.h:62
int32_t request_set_offset(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:468
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
string get_nodedir(string node, bool create_flag)
Get Current Node Directory.
Definition: datalib.cpp:1572
static bool debug
Definition: agent_antenna.cpp:164
int32_t request_get_azel(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:499
static bool trackflag
Definition: agent_antenna.cpp:189
string utc2iso8601(double utc)
ISO 8601 version of time.
Definition: timelib.cpp:1286
static LsFit trackel(5, 2)
vector< agentstruc > agent
Single entry vector for agent information.
Definition: jsondef.h:4247
int32_t gs232b_get_az_el(float &az, float &el)
Definition: gs232b_lib.cpp:338
Antenna.
Definition: jsondef.h:506
vector< piecestruc > pieces
Vector of all pieces in node.
Definition: jsondef.h:4232
int32_t request_get_state(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:424
int32_t start_active_loop()
Definition: agentclass.cpp:347
int32_t json_createpiece(cosmosstruc *cinfo, string name, DeviceType ctype, double emi, double abs, double hcap, double hcon, double density)
Create new piece.
Definition: jsonlib.cpp:722
int32_t prkx2su_init(string dev)
Definition: prkx2su_lib.cpp:44
cosmosstruc * cinfo
Definition: agentclass.h:346
int32_t request_stop(string &req, string &response, Agent *)
Definition: agent_antenna.cpp:440
static bool antenabled
Definition: agent_antenna.cpp:163
void rotctl_loop()
Definition: agent_antenna.cpp:646
float az
Definition: agent_antenna.cpp:182
double firstx()
Least squares first independent value.
Definition: mathlib.cpp:2687
string mjd2iso8601(double mjd)
Definition: timelib.cpp:1316
Definition: jsondef.h:565
Definition: jsondef.h:563
float el
Definition: agent_antenna.cpp:183
#define RADOF(deg)
Radians of a Degree value.
Definition: math/constants.h:29