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++ )
207 return (*
this)[ncard];
237 static std::shared_ptr<IOControl> init_iocontrol(
int argc,
const char*
const* argv,
239 const std::string& prefix =
"io" );
241 static void help_print(
int argc,
const char*
const* argv );
257 subdev(DefaultSubdev), channel(DefaultChannel),
263 enable_testmode(
false),
264 disable_testmode(
false)
295 friend std::ostream& operator<<(std::ostream& os,
const IOInfo& inf );
296 friend std::ostream& operator<<(std::ostream& os, const std::shared_ptr<IOInfo>& inf );
302 priority(p), index(i) {}
321 void ioread( std::shared_ptr<IOInfo>& it );
322 void check_testlamp();
323 void check_testmode();
329 virtual void askSensors( UniversalIO::UIOCommand cmd );
332 virtual bool activateObject()
override;
333 virtual bool deactivateObject()
override;
342 void readConfiguration();
344 bool readItem(
const std::shared_ptr<UniXML>& xml,
UniXML::iterator& it, xmlNode* sec );
345 void buildCardsList();
349 xmlNode* confnode = { 0 };
351 int polltime = { 150 };
353 bool noCards = {
false };
355 typedef std::vector< std::shared_ptr<IOInfo> > IOMap;
358 typedef std::deque<IOPriority> PIOMap;
361 size_t maxItem = { 0 };
362 size_t maxHalf = { 0 };
363 int filtersize = { 0 };
364 float filterT = { 0.0 };
367 std::string s_fvalue;
369 std::shared_ptr<SMInterface> shm;
373 typedef std::list<std::shared_ptr<IOInfo>> BlinkList;
375 void addBlink( std::shared_ptr<IOInfo>& it, BlinkList& lst );
376 void delBlink( std::shared_ptr<IOInfo>& it, BlinkList& lst );
377 void blink( BlinkList& lst,
bool& bstate );
382 bool blink_state = {
false };
387 bool blink2_state = {
false };
392 bool blink3_state = {
false };
396 bool isTestLamp = {
false };
397 IOController::IOStateList::iterator itTestLamp;
401 int maxHeartBeat = { 10 };
402 IOController::IOStateList::iterator itHeartBeat;
404 bool force = {
false };
405 bool force_out = {
false };
406 timeout_t smReadyTimeout = { 15000 };
407 ssize_t defCardNum = { -1 };
408 size_t maxCardNum = { 10 };
411 std::atomic_bool activated = {
false };
412 std::atomic_bool cancelled = {
false };
413 bool readconf_ok = {
false };
418 IOController::IOStateList::iterator itTestMode;
419 long testmode = {
false };
420 long prev_testmode = {
false };
422 std::shared_ptr<LogAgregator> loga;
423 std::shared_ptr<DebugStream> iolog;
424 std::shared_ptr<LogServer> logserv;
425 std::string logserv_host = {
""};
426 int logserv_port = {0};
428 std::shared_ptr< ThreadCreator<IOControl> > ioThread;
437 #endif // IOControl_H_ Пассивный таймер
Definition: PassiveTimer.h:92
Definition: IOControl.h:246
Definition: CallbackTimer.h:29
int ncard
Definition: IOControl.h:270
Definition: IOControl.h:299
int aref
Definition: IOControl.h:278
IOMap iomap
Definition: IOControl.h:356
Definition: ComediInterface.h:28
Definition: MessageType.h:168
Definition: UniSetObject.h:73
Definition: VMonitor.h:116
TestModeID
Definition: IOControl.h:308
std::mutex iopollMutex
Definition: IOControl.h:410
bool disable_testmode
Definition: IOControl.h:293
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:69
CardList cards
Definition: IOControl.h:352
bool no_testlamp
Definition: IOControl.h:291
Definition: IOControl.h:229
int subdev
Definition: IOControl.h:268
bool enable_testmode
Definition: IOControl.h:292
Definition: MessageType.h:124
bool lamp
Definition: IOControl.h:290
int range
Definition: IOControl.h:288
Definition: MessageType.h:211
PIOMap pmap
Definition: IOControl.h:359
int channel
Definition: IOControl.h:269
Definition: UniSetTypes_i.idl:64
long ObjectId
Definition: UniSetTypes_i.idl:30
Definition: IOControl.h:191