21 Myfe(
const char* eqname,
const char* eqfilename)
74 double data = 100.0*sin(M_PI/2.0+M_PI*t/60);
78 sprintf(status_buf,
"value %.1f",
data);
85 fprintf(stderr,
"Usage: tmfe_example_mt ...\n");
89int main(
int argc,
char* argv[])
94 signal(SIGPIPE, SIG_IGN);
96 std::vector<std::string> eq_args;
110 fprintf(stderr,
"Cannot connect to MIDAS, error \"%s\", bye.\n", result.
error_message.c_str());
117 eq->fEqConfEventID = 1;
118 eq->fEqConfLogHistory = 1;
119 eq->fEqConfPeriodMilliSec = 1000;
120 eq->fEqConfBuffer =
"SYSTEM";
123 eq->EqSetStatus(
"Starting...",
"white");
140 eq->EqSetStatus(
"Started...",
"white");
TMFeResult HandleEndRun(int run_number)
TMFeResult HandleBeginRun(int run_number)
void SendData(double dvalue)
Myfe(const char *eqname, const char *eqfilename)
TMFeResult HandleRpc(const char *cmd, const char *args, std::string &response)
static std::string GetThreadId()
return identification of this thread
static double GetTime()
return current time in seconds, with micro-second precision
void AddRpcHandler(TMFeRpcHandlerInterface *)
void Msg(int message_type, const char *filename, int line, const char *routine, const char *format,...) MATTRPRINTF(6
TMFeResult Connect(const char *progname=NULL, const char *hostname=NULL, const char *exptname=NULL)
std::atomic_bool fShutdownRequested
shutdown was requested by Ctrl-C or by RPC command
void * BkOpen(char *pevent, const char *bank_name, int bank_type) const
TMFeResult BkInit(char *pevent, size_t size) const
TMFeResult EqSetStatus(const char *status, const char *color)
MVOdb * fOdbEqVariables
ODB Equipment/EQNAME/Variables.
TMFeResult BkClose(char *pevent, void *ptr) const
TMFeResult ComposeEvent(char *pevent, size_t size) const
TMFeResult EqSendEvent(const char *pevent, bool write_to_odb=true)
std::string error_message