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];
239 private USingleProcess,
244 uniset::ObjectId icID,
const std::shared_ptr<SharedMemory>& shm =
nullptr,
size_t numcards = 2,
const std::string& prefix =
"io" );
245 virtual ~IOControl();
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 );
262 IOInfo(
const IOInfo& r ) =
delete;
263 IOInfo& operator=(
const IOInfo& r) =
delete;
264 IOInfo( IOInfo&& r ) =
default;
265 IOInfo& operator=(IOInfo&& r) =
default;
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 );
302 IOPriority(
size_t p,
size_t i):
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();
344 bool initIOItem( UniXML::iterator& it );
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;
Определения IOControl.h:194
Определения ComediInterface.h:29
xmlNode * confnode
Определения IOControl.h:350
PIOMap pmap
Определения IOControl.h:360
void iopoll()
Определения IOControl/iocontrol.cc:493
CardList cards
Определения IOControl.h:353
TestModeID
Определения IOControl.h:310
@ tmConfigEnable
Определения IOControl.h:313
@ tmNone
Определения IOControl.h:311
@ tmOnlyInputs
Определения IOControl.h:315
@ tmConfigDisable
Определения IOControl.h:314
@ tmOnlyOutputs
Определения IOControl.h:316
@ tmOffPoll
Определения IOControl.h:312
ssize_t defCardNum
Определения 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")
Определения IOControl/iocontrol.cc:1227
IOMap iomap
Определения IOControl.h:357
static void help_print(int argc, const char *const *argv)
Определения IOControl/iocontrol.cc:1263
timeout_t smReadyTimeout
Определения IOControl.h:407
virtual bool activateObject() override
Активизация объекта (переопределяется для необходимых действий после активизации).
Определения IOControl/iocontrol.cc:908
int polltime
Определения IOControl.h:352
bool force_out
Определения IOControl.h:406
virtual bool deactivateObject() override
Деактивация объекта (переопределяется для необходимых действий при завершении работы).
Определения IOControl/iocontrol.cc:922
size_t maxItem
Определения IOControl.h:362
bool force
Определения IOControl.h:405
std::mutex iopollMutex
Определения IOControl.h:411
Определения MessageType.h:127
Определения MessageType.h:171
Определения MessageType.h:214
UniSetObject(const std::string &name, const std::string §ion)
Определения UniSetObject.cc:89
Определения Calibration.h:27
const ObjectId DefaultObjectId
Определения UniSetTypes.h:71
long ObjectId
Определения UniSetTypes_i.idl:30
Определения IOControl.h:259
int range
Определения IOControl.h:289
bool disable_testmode
Определения IOControl.h:294
bool lamp
Определения IOControl.h:291
int aref
Определения IOControl.h:279
bool enable_testmode
Определения IOControl.h:293
bool no_testlamp
Определения IOControl.h:292
int ncard
Определения IOControl.h:271
int channel
Определения IOControl.h:270
int subdev
Определения IOControl.h:269
Определения UniSetTypes_i.idl:65