25 #include "ThreadCreator.h" 26 #include "PassiveTimer.h" 28 #include "IONotifyController.h" 29 #include "UniSetObject.h" 31 #include "MessageType.h" 32 #include "ComediInterface.h" 33 #include "DigitalFilter.h" 34 #include "Calibration.h" 35 #include "SMInterface.h" 36 #include "IOController.h" 38 #include "SharedMemory.h" 39 #include "LogServer.h" 40 #include "DebugStream.h" 41 #include "LogAgregator.h" 44 #define vmonit( var ) vmon.add( #var, var ) 192 public std::vector<ComediInterface*>
196 explicit CardList(
size_t size ) : std::vector<ComediInterface * >(size) { }
200 for(
size_t i = 0; i < size(); i++ )
206 if( ncard > 0 && ncard < size() )
207 return (*
this)[ncard];
215 return (*
this)[ncard];
245 static std::shared_ptr<IOControl>
init_iocontrol(
int argc,
const char*
const* argv,
247 const std::string& prefix =
"io" );
249 static void help_print(
int argc,
const char*
const* argv );
293 friend std::ostream& operator<<(std::ostream& os,
const IOInfo& inf );
294 friend std::ostream& operator<<(std::ostream& os,
const std::shared_ptr<IOInfo>& inf );
300 priority(p), index(i) {}
319 void ioread( std::shared_ptr<IOInfo>& it );
320 void check_testlamp();
321 void check_testmode();
327 virtual void askSensors( UniversalIO::UIOCommand cmd );
340 void readConfiguration();
342 bool readItem(
const std::shared_ptr<UniXML>& xml,
UniXML::iterator& it, xmlNode* sec );
343 void buildCardsList();
351 bool noCards = {
false };
353 typedef std::vector< std::shared_ptr<IOInfo> > IOMap;
356 typedef std::deque<IOPriority> PIOMap;
360 size_t maxHalf = { 0 };
361 int filtersize = { 0 };
362 float filterT = { 0.0 };
365 std::string s_fvalue;
367 std::shared_ptr<SMInterface> shm;
371 typedef std::list<std::shared_ptr<IOInfo>> BlinkList;
373 void addBlink( std::shared_ptr<IOInfo>& it, BlinkList& lst );
374 void delBlink( std::shared_ptr<IOInfo>& it, BlinkList& lst );
375 void blink( BlinkList& lst,
bool& bstate );
379 PassiveTimer ptBlink;
380 bool blink_state = {
false };
384 PassiveTimer ptBlink2;
385 bool blink2_state = {
false };
389 PassiveTimer ptBlink3;
390 bool blink3_state = {
false };
394 bool isTestLamp = {
false };
395 IOController::IOStateList::iterator itTestLamp;
397 PassiveTimer ptHeartBeat;
399 int maxHeartBeat = { 10 };
400 IOController::IOStateList::iterator itHeartBeat;
406 size_t maxCardNum = { 10 };
409 std::atomic_bool activated = {
false };
410 std::atomic_bool cancelled = {
false };
411 bool readconf_ok = {
false };
416 IOController::IOStateList::iterator itTestMode;
417 long testmode = {
false };
418 long prev_testmode = {
false };
420 std::shared_ptr<LogAgregator> loga;
421 std::shared_ptr<DebugStream> iolog;
422 std::shared_ptr<LogServer> logserv;
423 std::string logserv_host = {
""};
424 int logserv_port = {0};
426 std::shared_ptr< ThreadCreator<IOControl> > ioThread;
435 #endif // IOControl_H_ xmlNode * confnode
Definition: IOControl.h:347
Definition: IOControl.h:312
Definition: IOControl.h:254
timeout_t smReadyTimeout
Definition: IOControl.h:404
Definition: CommonEventLoop.h:14
int ncard
Definition: IOControl.h:268
Definition: IOControl.h:297
int aref
Definition: IOControl.h:276
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы)
Definition: iocontrol.cc:917
IOMap iomap
Definition: IOControl.h:354
static void help_print(int argc, const char *const *argv)
Definition: iocontrol.cc:1250
Definition: ComediInterface.h:28
bool force_out
Definition: IOControl.h:403
Definition: MessageType.h:170
bool force
Definition: IOControl.h:402
Definition: UniSetObject.h:73
TestModeID
Definition: IOControl.h:306
std::mutex iopollMutex
Definition: IOControl.h:408
bool disable_testmode
Definition: IOControl.h:291
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:69
Definition: IOControl.h:313
Definition: IOControl.h:309
CardList cards
Definition: IOControl.h:350
bool no_testlamp
Definition: IOControl.h:289
Definition: IOControl.h:237
int subdev
Definition: IOControl.h:266
bool enable_testmode
Definition: IOControl.h:290
ssize_t defCardNum
Definition: IOControl.h:405
Definition: IOControl.h:308
Definition: MessageType.h:126
bool lamp
Definition: IOControl.h:288
int range
Definition: IOControl.h:286
Definition: MessageType.h:213
Definition: IOControl.h:311
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации)
Definition: iocontrol.cc:903
PIOMap pmap
Definition: IOControl.h:357
int channel
Definition: IOControl.h:267
static std::shared_ptr< IOControl > init_iocontrol(int argc, const char *const *argv, uniset::ObjectId icID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="io")
Definition: iocontrol.cc:1222
Definition: IOControl.h:310
Definition: UniSetTypes_i.idl:64
int polltime
Definition: IOControl.h:349
void iopoll()
Definition: iocontrol.cc:492
long ObjectId
Definition: UniSetTypes_i.idl:30
size_t maxItem
Definition: IOControl.h:359
Definition: IOControl.h:191