ARPDAS_QNX6 1.0
|
#include <DG.h>
Public Member Functions | |
data_generator (int nQrows, int low_water) | |
virtual | ~data_generator () |
void | init (int collection) |
void | operate () |
int | execute (const char *cmd) |
virtual void | event (enum dg_event evt) |
virtual void | service_row_timer ()=0 |
Public Attributes | |
DG_dispatch * | dispatch |
Protected Member Functions | |
void | transmit_data (int single_row) |
Protected Attributes | |
bool | quit |
bool | started |
bool | regulated |
bool | autostart |
bool | regulation_optional |
int | dg_bfr_fd |
DG_cmd * | cmd |
DG_tmr * | tmr |
Private Member Functions | |
void | tm_start (int lock_needed=1) |
void | tm_play (int lock_needed=1) |
void | tm_stop () |
void | check_writev (int rc, int wr_size, const char *where) |
Private Attributes | |
uint64_t | row_period_nsec_default |
uint64_t | row_period_nsec_current |
data_generator::data_generator | ( | int | nQrows, |
int | low_water | ||
) |
void data_generator::check_writev | ( | int | rc, |
int | wr_size, | ||
const char * | where | ||
) | [private] |
Definition at line 106 of file DG.cc.
References nl_error.
Referenced by init(), and transmit_data().
void data_generator::event | ( | enum dg_event | evt | ) | [virtual] |
Reimplemented in collector, and tmc_collector.
Definition at line 263 of file DG.cc.
Referenced by execute(), tm_start(), and tm_stop().
int data_generator::execute | ( | const char * | cmd | ) |
Interperet data generator commands: I need to abstract the "signal handlers" operation. It appears that the key notifications are: Start Stop Quit Change to unregulated output (fast forward)
TM start: "TMc" Set start condition If regulated, program timer else stop timer if ext_stop, signal handlers TM end/stop "TMe" Set stop condition stop timer if ext_time, signal handlers Quit: "" Set stop and quit conditions stop timer if ext_stop or ext_time, signal handlers TM play "TM>" set regulated set row_rate to default if stopped, do start else reprogram timer TM fast forward "TM}" if regulation_optional stop timer set unregulated if stopped, do start else if ext_time, signal handlers TM faster/slower "TM+" "TM-" if regulation_optional if stopped do play else if regulated increase/decrease row_rate program timer TM single step "TMs"
Command Summary: "" Quit "TMc" TM Start "TMe" TM End/Stop/Pause "TMs" Single Step "TM>" Play "TM+" Faster "TM-" Slower "TM}" Fast Forward
Still need to add the search functions: TM Advance to MFCtr TM Advance to Time
Definition at line 176 of file DG.cc.
References dg_bfr_fd, dg_event_fast, dg_event_quit, dispatch, event(), data_queue::lock(), nl_error, quit, DG_dispatch::ready_to_quit(), regulated, regulation_optional, row_period_nsec_current, service_row_timer(), DG_tmr::settime(), started, tm_play(), tm_start(), tm_stop(), tmr, and data_queue::unlock().
Referenced by DG_cmd::execute().
void data_generator::init | ( | int | collection | ) |
Assumes tm_info is defined
Definition at line 21 of file DG.cc.
References DG_tmr::attach(), DG_cmd::attach(), check_writev(), cmd, dg_bfr_fd, dispatch, data_queue::init(), nl_error, row_period_nsec_current, row_period_nsec_default, tm_dev_name(), tm_info, TMHDR_WORD, tmi, tmr, and TMTYPE_INIT.
void data_generator::operate | ( | ) |
Control initialization This is how
Definition at line 116 of file DG.cc.
References autostart, dispatch, DG_dispatch::Loop(), and tm_start().
virtual void data_generator::service_row_timer | ( | ) | [pure virtual] |
Implemented in tmc_collector.
Referenced by DG_tmr_pulse_func(), and execute().
void data_generator::tm_play | ( | int | lock_needed = 1 | ) | [private] |
Definition at line 274 of file DG.cc.
References data_queue::lock(), regulated, row_period_nsec_current, row_period_nsec_default, DG_tmr::settime(), started, tm_start(), tmr, and data_queue::unlock().
Referenced by execute().
void data_generator::tm_start | ( | int | lock_needed = 1 | ) | [private] |
Definition at line 265 of file DG.cc.
References dg_event_start, event(), data_queue::lock(), regulated, row_period_nsec_current, DG_tmr::settime(), started, tmr, and data_queue::unlock().
Referenced by execute(), operate(), and tm_play().
void data_generator::tm_stop | ( | ) | [private] |
Definition at line 284 of file DG.cc.
References dg_event_stop, event(), data_queue::lock(), DG_tmr::settime(), started, tmr, and data_queue::unlock().
Referenced by execute().
void data_generator::transmit_data | ( | int | single_row | ) | [protected] |
Definition at line 40 of file DG.cc.
References check_writev(), dg_bfr_fd, dq_data, dq_tstamp, data_queue::first_dqr, tm_hdrs::hdr, data_queue::lock(), dq_data_ref::MFCtr_start, dq_data_ref::n_rows, data_queue::nbDataHdr, data_queue::nbQrow, dq_ref::next_dqr, nl_error, data_queue::output_tm_type, dq_data_ref::Qrow, data_queue::retire_rows(), data_queue::retire_tstamp(), data_queue::row, dq_data_ref::row_start, tm_hdrs::s, tm_hdr_t::tm_id, tm_hdr_t::tm_type, TMHDR_WORD, TMTYPE_TSTAMP, data_queue::total_Qrows, dq_tstamp_ref::TS, dq_ref::type, tm_hdrs::u, and data_queue::unlock().
bool data_generator::autostart [protected] |
Definition at line 29 of file DG.h.
Referenced by data_generator(), and operate().
DG_cmd* data_generator::cmd [protected] |
int data_generator::dg_bfr_fd [protected] |
Definition at line 34 of file DG.h.
Referenced by data_generator(), execute(), init(), and transmit_data().
Definition at line 23 of file DG.h.
Referenced by DG_tmr::attach(), DG_cmd::attach(), execute(), init(), operate(), DG_tmr::ready_to_quit(), and collector::receive().
bool data_generator::quit [protected] |
Definition at line 26 of file DG.h.
Referenced by data_generator(), and execute().
bool data_generator::regulated [protected] |
Definition at line 28 of file DG.h.
Referenced by collector::collector(), data_generator(), execute(), tm_play(), and tm_start().
bool data_generator::regulation_optional [protected] |
Definition at line 30 of file DG.h.
Referenced by collector::collector(), data_generator(), and execute().
uint64_t data_generator::row_period_nsec_current [private] |
uint64_t data_generator::row_period_nsec_default [private] |
bool data_generator::started [protected] |
Definition at line 27 of file DG.h.
Referenced by data_generator(), execute(), tm_play(), tm_start(), and tm_stop().
DG_tmr* data_generator::tmr [protected] |