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"
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;
Definition IOControl.h:193
Definition ComediInterface.h:29
Definition IOControl.h:239
xmlNode * confnode
Definition IOControl.h:347
PIOMap pmap
Definition IOControl.h:357
void iopoll()
Definition IOControl/iocontrol.cc:492
CardList cards
Definition IOControl.h:350
TestModeID
Definition IOControl.h:307
@ tmConfigEnable
Definition IOControl.h:310
@ tmNone
Definition IOControl.h:308
@ tmOnlyInputs
Definition IOControl.h:312
@ tmConfigDisable
Definition IOControl.h:311
@ tmOnlyOutputs
Definition IOControl.h:313
@ tmOffPoll
Definition IOControl.h:309
ssize_t defCardNum
Definition IOControl.h:405
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:1222
IOMap iomap
Definition IOControl.h:354
static void help_print(int argc, const char *const *argv)
Definition IOControl/iocontrol.cc:1250
timeout_t smReadyTimeout
Definition IOControl.h:404
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации)
Definition IOControl/iocontrol.cc:903
int polltime
Definition IOControl.h:349
bool force_out
Definition IOControl.h:403
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы)
Definition IOControl/iocontrol.cc:917
size_t maxItem
Definition IOControl.h:359
bool force
Definition IOControl.h:402
std::mutex iopollMutex
Definition IOControl.h:408
Definition MessageType.h:127
Definition MessageType.h:171
Definition MessageType.h:214
Definition UniSetObject.h:80
Definition Calibration.h:27
const ObjectId DefaultObjectId
Definition UniSetTypes.h:71
long ObjectId
Definition UniSetTypes_i.idl:30
Definition IOControl.h:256
int range
Definition IOControl.h:286
bool disable_testmode
Definition IOControl.h:291
bool lamp
Definition IOControl.h:288
int aref
Definition IOControl.h:276
bool enable_testmode
Definition IOControl.h:290
bool no_testlamp
Definition IOControl.h:289
int ncard
Definition IOControl.h:268
int channel
Definition IOControl.h:267
int subdev
Definition IOControl.h:266
Definition IOControl.h:298
Definition UniSetTypes_i.idl:65