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"
40#include "DebugStream.h"
41#include "LogAgregator.h"
42#include "USingleProcess.h"
45#define vmonit( var ) vmon.add( #var, var )
193 public std::vector<ComediInterface*>
197 explicit CardList(
size_t size ) : std::vector<ComediInterface * >(size) { }
201 for(
size_t i = 0; i < size(); i++ )
207 if( ncard > 0 && ncard < size() )
208 return (*
this)[ncard];
216 return (*
this)[ncard];
244 uniset::ObjectId icID,
const std::shared_ptr<SharedMemory>& shm =
nullptr,
size_t numcards = 2,
const std::string& prefix =
"io" );
248 static std::shared_ptr<IOControl>
init_iocontrol(
int argc,
const char*
const* argv,
250 const std::string& prefix =
"io" );
252 static void help_print(
int argc,
const char*
const* argv );
296 friend std::ostream& operator<<(std::ostream& os,
const IOInfo& inf );
297 friend std::ostream& operator<<(std::ostream& os,
const std::shared_ptr<IOInfo>& inf );
303 priority(p), index(i) {}
322 void ioread( std::shared_ptr<IOInfo>& it );
323 void check_testlamp();
324 void check_testmode();
330 virtual void askSensors( UniversalIO::UIOCommand cmd );
343 void readConfiguration();
345 bool readItem(
const std::shared_ptr<UniXML>& xml,
UniXML::iterator& it, xmlNode* sec );
346 void buildCardsList();
354 bool noCards = {
false };
356 typedef std::vector< std::shared_ptr<IOInfo> > IOMap;
359 typedef std::deque<IOPriority> PIOMap;
363 size_t maxHalf = { 0 };
364 int filtersize = { 0 };
365 float filterT = { 0.0 };
368 std::string s_fvalue;
370 std::shared_ptr<SMInterface> shm;
374 typedef std::list<std::shared_ptr<IOInfo>> BlinkList;
376 void addBlink( std::shared_ptr<IOInfo>& it, BlinkList& lst );
377 void delBlink( std::shared_ptr<IOInfo>& it, BlinkList& lst );
378 void blink( BlinkList& lst,
bool& bstate );
382 PassiveTimer ptBlink;
383 bool blink_state = {
false };
387 PassiveTimer ptBlink2;
388 bool blink2_state = {
false };
392 PassiveTimer ptBlink3;
393 bool blink3_state = {
false };
397 bool isTestLamp = {
false };
398 IOController::IOStateList::iterator itTestLamp;
400 PassiveTimer ptHeartBeat;
402 int maxHeartBeat = { 10 };
403 IOController::IOStateList::iterator itHeartBeat;
409 size_t maxCardNum = { 10 };
412 std::atomic_bool activated = {
false };
413 std::atomic_bool cancelled = {
false };
414 bool readconf_ok = {
false };
419 IOController::IOStateList::iterator itTestMode;
420 long testmode = {
false };
421 long prev_testmode = {
false };
423 std::shared_ptr<LogAgregator> loga;
424 std::shared_ptr<DebugStream> iolog;
425 std::shared_ptr<LogServer> logserv;
426 std::string logserv_host = {
""};
427 int logserv_port = {0};
429 std::shared_ptr< ThreadCreator<IOControl> > ioThread;
Definition IOControl.h:194
Definition ComediInterface.h:29
Definition IOControl.h:241
xmlNode * confnode
Definition IOControl.h:350
PIOMap pmap
Definition IOControl.h:360
void iopoll()
Definition IOControl/IOControl.cc:493
CardList cards
Definition IOControl.h:353
TestModeID
Definition IOControl.h:310
@ tmConfigEnable
Definition IOControl.h:313
@ tmNone
Definition IOControl.h:311
@ tmOnlyInputs
Definition IOControl.h:315
@ tmConfigDisable
Definition IOControl.h:314
@ tmOnlyOutputs
Definition IOControl.h:316
@ tmOffPoll
Definition IOControl.h:312
ssize_t defCardNum
Definition IOControl.h:408
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/IOControl.cc:1227
IOMap iomap
Definition IOControl.h:357
static void help_print(int argc, const char *const *argv)
Definition IOControl/IOControl.cc:1263
timeout_t smReadyTimeout
Definition IOControl.h:407
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации)
Definition IOControl/IOControl.cc:908
int polltime
Definition IOControl.h:352
bool force_out
Definition IOControl.h:406
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы)
Definition IOControl/IOControl.cc:922
size_t maxItem
Definition IOControl.h:362
bool force
Definition IOControl.h:405
std::mutex iopollMutex
Definition IOControl.h:411
Definition MessageType.h:127
Definition MessageType.h:171
Definition MessageType.h:214
Definition USingleProcess.h:28
Definition UniSetObject.h:80
Definition AccessConfig.h:30
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
long ObjectId
Definition UniSetTypes_i.idl:30
Definition IOControl.h:259
int range
Definition IOControl.h:289
bool disable_testmode
Definition IOControl.h:294
bool lamp
Definition IOControl.h:291
int aref
Definition IOControl.h:279
bool enable_testmode
Definition IOControl.h:293
bool no_testlamp
Definition IOControl.h:292
int ncard
Definition IOControl.h:271
int channel
Definition IOControl.h:270
int subdev
Definition IOControl.h:269
Definition IOControl.h:301
Definition UniSetTypes_i.idl:65