25 #include "PassiveTimer.h"
27 #include "IONotifyController.h"
28 #include "UniSetObject.h"
30 #include "MessageType.h"
31 #include "ComediInterface.h"
32 #include "DigitalFilter.h"
33 #include "Calibration.h"
34 #include "SMInterface.h"
35 #include "SingleProcess.h"
36 #include "IOController.h"
38 #include "SharedMemory.h"
39 #include "LogServer.h"
40 #include "DebugStream.h"
41 #include "LogAgregator.h"
188 public std::vector<ComediInterface*>
192 explicit CardList(
size_t size ) : std::vector<ComediInterface * >(size) { }
196 for(
size_t i = 0; i < size(); i++ )
202 if( ncard >= 0 && ncard < (
int)size() )
203 return (*
this)[ncard];
233 static std::shared_ptr<IOControl>
init_iocontrol(
int argc,
const char*
const* argv,
235 const std::string& prefix =
"io" );
237 static void help_print(
int argc,
const char*
const* argv );
287 friend std::ostream& operator<<(std::ostream& os,
IOInfo& inf );
293 priority(p), index(i) {}
314 void ioread( IOInfo* it );
315 void check_testlamp();
316 void check_testmode();
321 virtual void askSensors( UniversalIO::UIOCommand cmd );
324 virtual void sigterm(
int signo )
override;
334 void readConfiguration();
336 bool readItem(
const std::shared_ptr<UniXML>& xml,
UniXML::iterator& it, xmlNode* sec );
337 void buildCardsList();
345 bool noCards = {
false };
347 typedef std::vector<IOInfo> IOMap;
350 typedef std::deque<IOPriority> PIOMap;
354 unsigned int maxHalf = { 0 };
355 int filtersize = { 0 };
356 float filterT = { 0.0 };
359 std::string s_fvalue;
361 std::shared_ptr<SMInterface> shm;
365 typedef std::list<IOInfo*> BlinkList;
367 void addBlink( IOInfo* it, BlinkList& lst );
368 void delBlink( IOInfo* it, BlinkList& lst );
369 void blink( BlinkList& lst,
bool& bstate );
373 PassiveTimer ptBlink;
374 bool blink_state = {
false };
378 PassiveTimer ptBlink2;
379 bool blink2_state = {
false };
383 PassiveTimer ptBlink3;
384 bool blink3_state = {
false };
388 bool isTestLamp = {
false };
389 IOController::IOStateList::iterator itTestLamp;
391 PassiveTimer ptHeartBeat;
393 int maxHeartBeat = { 10 };
394 IOController::IOStateList::iterator itHeartBeat;
400 int maxCardNum = { 10 };
403 std::atomic_bool activated = {
false };
404 bool readconf_ok = {
false };
407 std::atomic_bool term = {
false };
410 IOController::IOStateList::iterator itTestMode;
411 long testmode = {
false };
412 long prev_testmode = {
false };
414 std::shared_ptr<LogAgregator> loga;
415 std::shared_ptr<DebugStream> iolog;
416 std::shared_ptr<LogServer> logserv;
417 std::string logserv_host = {
""};
418 int logserv_port = {0};
425 #endif // IOControl_H_
xmlNode * confnode
Definition: IOControl.h:341
Definition: IOControl.h:305
Definition: IOControl.h:240
timeout_t smReadyTimeout
Definition: IOControl.h:398
Definition: CallbackTimer.h:29
int ncard
Definition: IOControl.h:264
Definition: IOControl.h:290
int aref
Definition: IOControl.h:272
IOMap iomap
Definition: IOControl.h:348
static void help_print(int argc, const char *const *argv)
Definition: IOControl.cc:1209
unsigned int maxItem
Definition: IOControl.h:353
Definition: ComediInterface.h:28
bool force_out
Definition: IOControl.h:397
Definition: MessageType.h:166
bool force
Definition: IOControl.h:396
Definition: UniSetObject.h:73
TestModeID
Definition: IOControl.h:299
std::mutex iopollMutex
Definition: IOControl.h:402
bool disable_testmode
Definition: IOControl.h:285
const ObjectId DefaultObjectId
Definition: UniSetTypes.h:56
Definition: IOControl.h:306
Definition: IOControl.h:302
CardList cards
Definition: IOControl.h:344
bool no_testlamp
Definition: IOControl.h:283
Definition: IOControl.h:225
int subdev
Definition: IOControl.h:262
bool enable_testmode
Definition: IOControl.h:284
Definition: IOControl.h:301
Definition: MessageType.h:122
bool lamp
Definition: IOControl.h:282
int range
Definition: IOControl.h:280
Definition: MessageType.h:209
Definition: IOControl.h:304
int defCardNum
Definition: IOControl.h:399
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации) ...
Definition: IOControl.cc:862
PIOMap pmap
Definition: IOControl.h:351
int channel
Definition: IOControl.h:263
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:1181
Definition: IOControl.h:303
virtual void sigterm(int signo) override
Definition: IOControl.cc:876
int polltime
Definition: IOControl.h:343
void iopoll()
Definition: IOControl.cc:463
long ObjectId
Definition: UniSetTypes_i.idl:30
Definition: IOControl.h:187