Commit e3c855c5 authored by Pavel Vainerman's avatar Pavel Vainerman

Правки после проверки cppcheck (1.70)

parent 910bdd5a
...@@ -59,8 +59,8 @@ static struct option longopts[] = ...@@ -59,8 +59,8 @@ static struct option longopts[] =
string conffile("configure.xml"); string conffile("configure.xml");
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
static bool commandToAll( const string& section, std::shared_ptr<ObjectRepository> rep, Command cmd ); static bool commandToAll( const string& section, std::shared_ptr<ObjectRepository>& rep, Command cmd );
static void createSections( const std::shared_ptr<UniSetTypes::Configuration> c ); static void createSections(const std::shared_ptr<Configuration>& c );
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
int omap(); int omap();
int configure( const string& args, UInterface& ui ); int configure( const string& args, UInterface& ui );
...@@ -364,7 +364,7 @@ int main(int argc, char** argv) ...@@ -364,7 +364,7 @@ int main(int argc, char** argv)
} }
// ============================================================================================== // ==============================================================================================
static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository> rep, Command cmd) static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository>& rep, Command cmd)
{ {
if( verb ) if( verb )
cout << "\n||=======******** " << section << " ********=========||\n" << endl; cout << "\n||=======******** " << section << " ********=========||\n" << endl;
...@@ -504,7 +504,7 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository ...@@ -504,7 +504,7 @@ static bool commandToAll(const string& section, std::shared_ptr<ObjectRepository
} }
// ============================================================================================== // ==============================================================================================
static void createSections( const std::shared_ptr<UniSetTypes::Configuration> rconf ) static void createSections( const std::shared_ptr<UniSetTypes::Configuration>& rconf )
{ {
ObjectRepositoryFactory repf(rconf); ObjectRepositoryFactory repf(rconf);
......
...@@ -248,6 +248,7 @@ ...@@ -248,6 +248,7 @@
/*! Вывод состояния внутренних переменных */ /*! Вывод состояния внутренних переменных */
inline std::string dumpVars(){ return std::move(vmon.pretty_str()); } inline std::string dumpVars(){ return std::move(vmon.pretty_str()); }
// ------------------------------------------------------------ // ------------------------------------------------------------
std::string help();
</xsl:template> </xsl:template>
...@@ -530,6 +531,14 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te ...@@ -530,6 +531,14 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
</xsl:if> </xsl:if>
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
std::string <xsl:value-of select="$CLASSNAME"/>_SK::help()
{
ostringstream s;
return std::move(s.str());
}
// ----------------------------------------------------------------------------
</xsl:template> </xsl:template>
<xsl:template name="COMMON-ID-LIST"> <xsl:template name="COMMON-ID-LIST">
......
...@@ -136,7 +136,7 @@ class DBServer_MySQL: ...@@ -136,7 +136,7 @@ class DBServer_MySQL:
{ {
public: public:
DBServer_MySQL( UniSetTypes::ObjectId id, const std::string& prefix ); DBServer_MySQL( UniSetTypes::ObjectId id, const std::string& prefix );
DBServer_MySQL( const std::string& prefix ); explicit DBServer_MySQL( const std::string& prefix );
virtual ~DBServer_MySQL(); virtual ~DBServer_MySQL();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
......
...@@ -34,6 +34,7 @@ DBServer_PostgreSQL::DBServer_PostgreSQL(ObjectId id, const std::string& prefix ...@@ -34,6 +34,7 @@ DBServer_PostgreSQL::DBServer_PostgreSQL(ObjectId id, const std::string& prefix
DBServer_PostgreSQL::DBServer_PostgreSQL(): DBServer_PostgreSQL::DBServer_PostgreSQL():
DBServer(uniset_conf()->getDBServer()), DBServer(uniset_conf()->getDBServer()),
db(make_shared<PostgreSQLInterface>()),
PingTime(300000), PingTime(300000),
ReconnectTime(180000), ReconnectTime(180000),
connect_ok(false), connect_ok(false),
...@@ -41,7 +42,6 @@ DBServer_PostgreSQL::DBServer_PostgreSQL(): ...@@ -41,7 +42,6 @@ DBServer_PostgreSQL::DBServer_PostgreSQL():
qbufSize(200), qbufSize(200),
lastRemove(false) lastRemove(false)
{ {
db = make_shared<PostgreSQLInterface>();
// init(); // init();
if( getId() == DefaultObjectId ) if( getId() == DefaultObjectId )
......
...@@ -46,7 +46,7 @@ class PostgreSQLInterface ...@@ -46,7 +46,7 @@ class PostgreSQLInterface
class PostgreSQLResult class PostgreSQLResult
{ {
public: public:
PostgreSQLResult() {} PostgreSQLResult(){}
PostgreSQLResult( const pqxx::result& res ); PostgreSQLResult( const pqxx::result& res );
~PostgreSQLResult(); ~PostgreSQLResult();
......
...@@ -23,8 +23,8 @@ std::ostream& operator<<( std::ostream& os, IOControl::IOInfo& inf ) ...@@ -23,8 +23,8 @@ std::ostream& operator<<( std::ostream& os, IOControl::IOInfo& inf )
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, IOControl::IOControl(UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
const std::shared_ptr<SharedMemory> ic, int numcards, const std::string& prefix_ ): const std::shared_ptr<SharedMemory>& ic, int numcards, const std::string& prefix_ ):
UniSetObject(id), UniSetObject(id),
polltime(150), polltime(150),
cards(11), cards(11),
...@@ -533,7 +533,7 @@ void IOControl::ioread( IOInfo* it ) ...@@ -533,7 +533,7 @@ void IOControl::ioread( IOInfo* it )
return; return;
} }
IOBase* ib = &(*it); IOBase* ib = static_cast<IOBase*>(it);
try try
{ {
...@@ -588,7 +588,7 @@ void IOControl::ioread( IOInfo* it ) ...@@ -588,7 +588,7 @@ void IOControl::ioread( IOInfo* it )
delBlink(it, lstBlink3); delBlink(it, lstBlink3);
} }
if( it->no_testlamp || (!it->no_testlamp && !isTestLamp) ) if( it->no_testlamp || !isTestLamp )
card->setDigitalChannel(it->subdev, it->channel, 0); card->setDigitalChannel(it->subdev, it->channel, 0);
} }
break; break;
...@@ -604,7 +604,7 @@ void IOControl::ioread( IOInfo* it ) ...@@ -604,7 +604,7 @@ void IOControl::ioread( IOInfo* it )
delBlink(it, lstBlink3); delBlink(it, lstBlink3);
} }
if( it->no_testlamp || (!it->no_testlamp && !isTestLamp) ) if( it->no_testlamp || !isTestLamp )
card->setDigitalChannel(it->subdev, it->channel, 1); card->setDigitalChannel(it->subdev, it->channel, 1);
} }
break; break;
...@@ -657,7 +657,7 @@ void IOControl::ioread( IOInfo* it ) ...@@ -657,7 +657,7 @@ void IOControl::ioread( IOInfo* it )
{ {
bool set = IOBase::processingAsDO(ib, shm, force_out); bool set = IOBase::processingAsDO(ib, shm, force_out);
if( !it->lamp || (it->lamp && !isTestLamp) ) if( !it->lamp || !isTestLamp )
card->setDigitalChannel(it->subdev, it->channel, set); card->setDigitalChannel(it->subdev, it->channel, set);
} }
} }
...@@ -1158,8 +1158,8 @@ void IOControl::check_testlamp() ...@@ -1158,8 +1158,8 @@ void IOControl::check_testlamp()
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<IOControl> IOControl::init_iocontrol( int argc, const char* const* argv, std::shared_ptr<IOControl> IOControl::init_iocontrol(int argc, const char* const* argv,
UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory> ic, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory>& ic,
const std::string& prefix ) const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
......
...@@ -208,12 +208,12 @@ class IOControl: ...@@ -208,12 +208,12 @@ class IOControl:
public UniSetObject public UniSetObject
{ {
public: public:
IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory> shm = nullptr, int numcards = 2, const std::string& prefix = "io" ); IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory>& shm = nullptr, int numcards = 2, const std::string& prefix = "io" );
virtual ~IOControl(); virtual ~IOControl();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<IOControl> init_iocontrol( int argc, const char* const* argv, static std::shared_ptr<IOControl> init_iocontrol( int argc, const char* const* argv,
UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "io" ); const std::string& prefix = "io" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
static void help_print( int argc, const char* const* argv ); static void help_print( int argc, const char* const* argv );
......
...@@ -61,7 +61,7 @@ void Element::setChildOut() ...@@ -61,7 +61,7 @@ void Element::setChildOut()
it.el->setIn(it.num, _myout); it.el->setIn(it.num, _myout);
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
std::shared_ptr<Element> Element::find( const ElementID id ) std::shared_ptr<Element> Element::find(const ElementID& id )
{ {
for( const auto& it : outs ) for( const auto& it : outs )
{ {
......
...@@ -13,7 +13,7 @@ class LogicException: ...@@ -13,7 +13,7 @@ class LogicException:
{ {
public: public:
LogicException(): UniSetTypes::Exception("LogicException") {} LogicException(): UniSetTypes::Exception("LogicException") {}
LogicException( const std::string err): UniSetTypes::Exception(err) {} LogicException( const std::string& err): UniSetTypes::Exception(err) {}
}; };
...@@ -44,7 +44,6 @@ class Element ...@@ -44,7 +44,6 @@ class Element
virtual void setIn( int num, bool state ) = 0; virtual void setIn( int num, bool state ) = 0;
virtual bool getOut() = 0; virtual bool getOut() = 0;
inline ElementID getId() inline ElementID getId()
{ {
return myid; return myid;
...@@ -54,7 +53,7 @@ class Element ...@@ -54,7 +53,7 @@ class Element
return "?type?"; return "?type?";
} }
virtual std::shared_ptr<Element> find( const ElementID id ); virtual std::shared_ptr<Element> find( const ElementID& id );
virtual void addChildOut( std::shared_ptr<Element> el, int in_num ); virtual void addChildOut( std::shared_ptr<Element> el, int in_num );
virtual void delChildOut( std::shared_ptr<Element> el ); virtual void delChildOut( std::shared_ptr<Element> el );
......
...@@ -7,7 +7,7 @@ using namespace UniSetTypes; ...@@ -7,7 +7,7 @@ using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId, PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic, const std::string& prefix ): UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic, const std::string& prefix ):
UniSetObject_LT(objId), UniSetObject_LT(objId),
shm(nullptr) shm(nullptr)
{ {
...@@ -24,8 +24,6 @@ PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId, ...@@ -24,8 +24,6 @@ PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId,
throw SystemError("Not found conf-node for " + conf_name ); throw SystemError("Not found conf-node for " + conf_name );
UniXML::iterator it(confnode); UniXML::iterator it(confnode);
confnode = conf->getNode(myname);
string lfile = conf->getArgParam("--" + prefix + "-schema", it.getProp("schema")); string lfile = conf->getArgParam("--" + prefix + "-schema", it.getProp("schema"));
if( lfile.empty() ) if( lfile.empty() )
...@@ -62,7 +60,7 @@ PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId, ...@@ -62,7 +60,7 @@ PassiveLProcessor::PassiveLProcessor( UniSetTypes::ObjectId objId,
maxHeartBeat = conf->getArgPInt("--" + prefix + "-heartbeat-max", "10", 10); maxHeartBeat = conf->getArgPInt("--" + prefix + "-heartbeat-max", "10", 10);
} }
} }
// -------------------------------------------------------------------------
PassiveLProcessor::~PassiveLProcessor() PassiveLProcessor::~PassiveLProcessor()
{ {
...@@ -264,8 +262,8 @@ void PassiveLProcessor::help_print( int argc, const char* const* argv ) ...@@ -264,8 +262,8 @@ void PassiveLProcessor::help_print( int argc, const char* const* argv )
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<PassiveLProcessor> PassiveLProcessor::init_plproc( int argc, const char* const* argv, std::shared_ptr<PassiveLProcessor> PassiveLProcessor::init_plproc(int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic,
const std::string& prefix ) const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
...@@ -290,3 +288,4 @@ std::shared_ptr<PassiveLProcessor> PassiveLProcessor::init_plproc( int argc, con ...@@ -290,3 +288,4 @@ std::shared_ptr<PassiveLProcessor> PassiveLProcessor::init_plproc( int argc, con
dinfo << "(plproc): name = " << name << "(" << ID << ")" << endl; dinfo << "(plproc): name = " << name << "(" << ID << ")" << endl;
return make_shared<PassiveLProcessor>(ID, shmID, ic, prefix); return make_shared<PassiveLProcessor>(ID, shmID, ic, prefix);
} }
// -----------------------------------------------------------------------------
...@@ -18,8 +18,8 @@ class PassiveLProcessor: ...@@ -18,8 +18,8 @@ class PassiveLProcessor:
{ {
public: public:
PassiveLProcessor( UniSetTypes::ObjectId objId, PassiveLProcessor(UniSetTypes::ObjectId objId,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, const std::string& prefix = "lproc" ); UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr, const std::string& prefix = "lproc" );
virtual ~PassiveLProcessor(); virtual ~PassiveLProcessor();
enum Timers enum Timers
...@@ -30,7 +30,7 @@ class PassiveLProcessor: ...@@ -30,7 +30,7 @@ class PassiveLProcessor:
static void help_print( int argc, const char* const* argv ); static void help_print( int argc, const char* const* argv );
static std::shared_ptr<PassiveLProcessor> init_plproc( int argc, const char* const* argv, static std::shared_ptr<PassiveLProcessor> init_plproc( int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "plproc" ); const std::string& prefix = "plproc" );
protected: protected:
......
...@@ -143,7 +143,7 @@ class Schema ...@@ -143,7 +143,7 @@ class Schema
// наружный выход // наружный выход
struct EXTOut struct EXTOut
{ {
EXTOut( const std::string n, std::shared_ptr<Element> f): EXTOut( const std::string& n, std::shared_ptr<Element>& f):
name(n), from(f) {} name(n), from(f) {}
EXTOut(): name("") {} EXTOut(): name("") {}
......
...@@ -13,8 +13,8 @@ using namespace std; ...@@ -13,8 +13,8 @@ using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
MBExchange::MBExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, MBExchange::MBExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId,
const std::shared_ptr<SharedMemory> _ic, const std::string& prefix ): const std::shared_ptr<SharedMemory>& _ic, const std::string& prefix ):
UniSetObject_LT(objId), UniSetObject_LT(objId),
allInitOK(false), allInitOK(false),
initPause(0), initPause(0),
......
...@@ -37,7 +37,7 @@ class MBExchange: ...@@ -37,7 +37,7 @@ class MBExchange:
public UniSetObject_LT public UniSetObject_LT
{ {
public: public:
MBExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, MBExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "mb" ); const std::string& prefix = "mb" );
virtual ~MBExchange(); virtual ~MBExchange();
......
...@@ -11,8 +11,8 @@ using namespace std; ...@@ -11,8 +11,8 @@ using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
MBTCPMaster::MBTCPMaster( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, MBTCPMaster::MBTCPMaster(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId,
const std::shared_ptr<SharedMemory> ic, const std::string& prefix ): const std::shared_ptr<SharedMemory>& ic, const std::string& prefix ):
MBExchange(objId, shmId, ic, prefix), MBExchange(objId, shmId, ic, prefix),
force_disconnect(true) force_disconnect(true)
{ {
...@@ -219,8 +219,8 @@ void MBTCPMaster::help_print( int argc, const char* const* argv ) ...@@ -219,8 +219,8 @@ void MBTCPMaster::help_print( int argc, const char* const* argv )
cout << "--prefix-persistent-connection 0,1 - Не закрывать соединение на каждом цикле опроса" << endl; cout << "--prefix-persistent-connection 0,1 - Не закрывать соединение на каждом цикле опроса" << endl;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<MBTCPMaster> MBTCPMaster::init_mbmaster( int argc, const char* const* argv, std::shared_ptr<MBTCPMaster> MBTCPMaster::init_mbmaster(int argc, const char* const* argv,
UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory> ic, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory>& ic,
const std::string& prefix ) const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
......
...@@ -198,13 +198,13 @@ class MBTCPMaster: ...@@ -198,13 +198,13 @@ class MBTCPMaster:
public MBExchange public MBExchange
{ {
public: public:
MBTCPMaster( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, MBTCPMaster( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "mbtcp" ); const std::string& prefix = "mbtcp" );
virtual ~MBTCPMaster(); virtual ~MBTCPMaster();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<MBTCPMaster> init_mbmaster( int argc, const char* const* argv, static std::shared_ptr<MBTCPMaster> init_mbmaster( int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "mbtcp" ); const std::string& prefix = "mbtcp" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
......
...@@ -12,7 +12,7 @@ using namespace UniSetTypes; ...@@ -12,7 +12,7 @@ using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, MBTCPMultiMaster::MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId,
const std::shared_ptr<SharedMemory> ic, const std::string& prefix ): const std::shared_ptr<SharedMemory>& ic, const std::string& prefix ):
MBExchange(objId, shmId, ic, prefix), MBExchange(objId, shmId, ic, prefix),
force_disconnect(true) force_disconnect(true)
{ {
...@@ -204,7 +204,7 @@ std::shared_ptr<ModbusClient> MBTCPMultiMaster::initMB( bool reopen ) ...@@ -204,7 +204,7 @@ std::shared_ptr<ModbusClient> MBTCPMultiMaster::initMB( bool reopen )
// Если по текущему каналу связь есть, то возвращаем его // Если по текущему каналу связь есть, то возвращаем его
if( mbi != mblist.rend() && !mbi->ignore && mbi->respond ) if( mbi != mblist.rend() && !mbi->ignore && mbi->respond )
{ {
if( mbi->mbtcp->isConnection() || ( !mbi->mbtcp->isConnection() && mbi->init(mblog)) ) if( mbi->mbtcp->isConnection() || mbi->init(mblog) )
{ {
if( !mbi->ignore ) if( !mbi->ignore )
{ {
...@@ -469,7 +469,7 @@ void MBTCPMultiMaster::help_print( int argc, const char* const* argv ) ...@@ -469,7 +469,7 @@ void MBTCPMultiMaster::help_print( int argc, const char* const* argv )
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<MBTCPMultiMaster> MBTCPMultiMaster::init_mbmaster( int argc, const char* const* argv, std::shared_ptr<MBTCPMultiMaster> MBTCPMultiMaster::init_mbmaster( int argc, const char* const* argv,
UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory> ic, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory>& ic,
const std::string& prefix ) const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
......
...@@ -222,13 +222,13 @@ class MBTCPMultiMaster: ...@@ -222,13 +222,13 @@ class MBTCPMultiMaster:
public MBExchange public MBExchange
{ {
public: public:
MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, MBTCPMultiMaster( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "mbtcp" ); const std::string& prefix = "mbtcp" );
virtual ~MBTCPMultiMaster(); virtual ~MBTCPMultiMaster();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<MBTCPMultiMaster> init_mbmaster( int argc, const char* const* argv, static std::shared_ptr<MBTCPMultiMaster> init_mbmaster(int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "mbtcp" ); const std::string& prefix = "mbtcp" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
......
...@@ -9,7 +9,7 @@ using namespace std; ...@@ -9,7 +9,7 @@ using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
RTUExchange::RTUExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory> ic, RTUExchange::RTUExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory>& ic,
const std::string& prefix_ ): const std::string& prefix_ ):
MBExchange(objId, shmId, ic, prefix_), MBExchange(objId, shmId, ic, prefix_),
mbrtu(0), mbrtu(0),
...@@ -320,8 +320,8 @@ bool RTUExchange::poll() ...@@ -320,8 +320,8 @@ bool RTUExchange::poll()
return !allNotRespond; return !allNotRespond;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<RTUExchange> RTUExchange::init_rtuexchange( int argc, const char* const* argv, UniSetTypes::ObjectId icID, std::shared_ptr<RTUExchange> RTUExchange::init_rtuexchange(int argc, const char* const* argv, UniSetTypes::ObjectId icID,
const std::shared_ptr<SharedMemory> ic, const std::string& prefix ) const std::shared_ptr<SharedMemory>& ic, const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
......
...@@ -14,12 +14,12 @@ class RTUExchange: ...@@ -14,12 +14,12 @@ class RTUExchange:
{ {
public: public:
RTUExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, RTUExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID,
const std::shared_ptr<SharedMemory> ic = nullptr, const std::string& prefix = "rs" ); const std::shared_ptr<SharedMemory>& ic = nullptr, const std::string& prefix = "rs" );
virtual ~RTUExchange(); virtual ~RTUExchange();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<RTUExchange> init_rtuexchange( int argc, const char* const* argv, static std::shared_ptr<RTUExchange> init_rtuexchange( int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "rs" ); const std::string& prefix = "rs" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
......
...@@ -58,7 +58,7 @@ MBTCPTestServer::MBTCPTestServer( ModbusAddr myaddr, const string& inetaddr, int ...@@ -58,7 +58,7 @@ MBTCPTestServer::MBTCPTestServer( ModbusAddr myaddr, const string& inetaddr, int
catch( const std::exception& ex ) catch( const std::exception& ex )
{ {
cerr << "(MBTCPTestServer::init): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl; cerr << "(MBTCPTestServer::init): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl;
throw ex; throw;
} }
// sslot->initLog(conf,name,logfile); // sslot->initLog(conf,name,logfile);
......
...@@ -65,7 +65,7 @@ static void InitTest() ...@@ -65,7 +65,7 @@ static void InitTest()
catch( const std::exception& ex ) catch( const std::exception& ex )
{ {
cerr << "(mbs): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl; cerr << "(mbs): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl;
throw ex; throw;
} }
//mbs->setVerbose(true); //mbs->setVerbose(true);
......
...@@ -67,7 +67,7 @@ static void InitTest() ...@@ -67,7 +67,7 @@ static void InitTest()
catch( const std::exception& ex ) catch( const std::exception& ex )
{ {
cerr << "(mb1): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl; cerr << "(mb1): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl;
throw ex; throw;
} }
CHECK( mbs1 != nullptr ); CHECK( mbs1 != nullptr );
...@@ -99,7 +99,7 @@ static void InitTest() ...@@ -99,7 +99,7 @@ static void InitTest()
catch( const std::exception& ex ) catch( const std::exception& ex )
{ {
cerr << "(mb2): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl; cerr << "(mb2): Can`t create socket " << addr << ":" << port << " err: " << ex.what() << endl;
throw ex; throw;
} }
CHECK( mbs2 != nullptr ); CHECK( mbs2 != nullptr );
......
...@@ -12,7 +12,7 @@ using namespace UniSetTypes; ...@@ -12,7 +12,7 @@ using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
using namespace ModbusRTU; using namespace ModbusRTU;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
MBSlave::MBSlave( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory> ic, const string& prefix ): MBSlave::MBSlave(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory>& ic, const string& prefix ):
UniSetObject_LT(objId), UniSetObject_LT(objId),
addr(0x01), addr(0x01),
initPause(0), initPause(0),
...@@ -1232,8 +1232,8 @@ void MBSlave::help_print( int argc, const char* const* argv ) ...@@ -1232,8 +1232,8 @@ void MBSlave::help_print( int argc, const char* const* argv )
cout << LogServer::help_print("prefix-logserver") << endl; cout << LogServer::help_print("prefix-logserver") << endl;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<MBSlave> MBSlave::init_mbslave( int argc, const char* const* argv, UniSetTypes::ObjectId icID, std::shared_ptr<MBSlave> MBSlave::init_mbslave(int argc, const char* const* argv, UniSetTypes::ObjectId icID,
const std::shared_ptr<SharedMemory> ic, const string& prefix ) const std::shared_ptr<SharedMemory>& ic, const string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
string name = conf->getArgParam("--" + prefix + "-name", "MBSlave1"); string name = conf->getArgParam("--" + prefix + "-name", "MBSlave1");
......
...@@ -285,12 +285,12 @@ class MBSlave: ...@@ -285,12 +285,12 @@ class MBSlave:
public UniSetObject_LT public UniSetObject_LT
{ {
public: public:
MBSlave( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, const std::string& prefix = "mbs" ); MBSlave( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr, const std::string& prefix = "mbs" );
virtual ~MBSlave(); virtual ~MBSlave();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<MBSlave> init_mbslave(int argc, const char* const* argv, static std::shared_ptr<MBSlave> init_mbslave(int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "mbs" ); const std::string& prefix = "mbs" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
......
...@@ -12,7 +12,7 @@ using namespace UniSetTypes; ...@@ -12,7 +12,7 @@ using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
using namespace ModbusRTU; using namespace ModbusRTU;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
MBTCPPersistentSlave::MBTCPPersistentSlave( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory> ic, const string& prefix ): MBTCPPersistentSlave::MBTCPPersistentSlave(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory>& ic, const string& prefix ):
MBSlave(objId, shmId, ic, prefix), MBSlave(objId, shmId, ic, prefix),
sesscount_id(DefaultObjectId) sesscount_id(DefaultObjectId)
{ {
...@@ -127,7 +127,7 @@ void MBTCPPersistentSlave::help_print( int argc, const char* const* argv ) ...@@ -127,7 +127,7 @@ void MBTCPPersistentSlave::help_print( int argc, const char* const* argv )
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<MBTCPPersistentSlave> MBTCPPersistentSlave::init_mbslave( int argc, const char* const* argv, UniSetTypes::ObjectId icID, std::shared_ptr<MBTCPPersistentSlave> MBTCPPersistentSlave::init_mbslave( int argc, const char* const* argv, UniSetTypes::ObjectId icID,
const std::shared_ptr<SharedMemory> ic, const string& prefix ) const std::shared_ptr<SharedMemory>& ic, const string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
string name = conf->getArgParam("--" + prefix + "-name", "MBSlave1"); string name = conf->getArgParam("--" + prefix + "-name", "MBSlave1");
......
...@@ -21,12 +21,12 @@ class MBTCPPersistentSlave: ...@@ -21,12 +21,12 @@ class MBTCPPersistentSlave:
public MBSlave public MBSlave
{ {
public: public:
MBTCPPersistentSlave( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, const std::string& prefix = "mbs" ); MBTCPPersistentSlave( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr, const std::string& prefix = "mbs" );
virtual ~MBTCPPersistentSlave(); virtual ~MBTCPPersistentSlave();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<MBTCPPersistentSlave> init_mbslave( int argc, const char* const* argv, static std::shared_ptr<MBTCPPersistentSlave> init_mbslave( int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "mbs" ); const std::string& prefix = "mbs" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
......
...@@ -11,7 +11,7 @@ using namespace std; ...@@ -11,7 +11,7 @@ using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
RRDServer::RRDServer( UniSetTypes::ObjectId objId, xmlNode* cnode, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory> ic, RRDServer::RRDServer(UniSetTypes::ObjectId objId, xmlNode* cnode, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory>& ic,
const string& prefix ): const string& prefix ):
UObject_SK(objId, cnode, string(prefix + "-")), UObject_SK(objId, cnode, string(prefix + "-")),
prefix(prefix) prefix(prefix)
...@@ -251,8 +251,8 @@ void RRDServer::help_print( int argc, const char* const* argv ) ...@@ -251,8 +251,8 @@ void RRDServer::help_print( int argc, const char* const* argv )
cout << LogServer::help_print("prefix-logserver") << endl; cout << LogServer::help_print("prefix-logserver") << endl;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<RRDServer> RRDServer::init_rrdstorage( int argc, const char* const* argv, std::shared_ptr<RRDServer> RRDServer::init_rrdstorage(int argc, const char* const* argv,
UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory> ic, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory>& ic,
const std::string& prefix ) const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
......
...@@ -60,13 +60,13 @@ class RRDServer: ...@@ -60,13 +60,13 @@ class RRDServer:
public UObject_SK public UObject_SK
{ {
public: public:
RRDServer( UniSetTypes::ObjectId objId, xmlNode* cnode, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, RRDServer( UniSetTypes::ObjectId objId, xmlNode* cnode, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "rrd" ); const std::string& prefix = "rrd" );
virtual ~RRDServer(); virtual ~RRDServer();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<RRDServer> init_rrdstorage( int argc, const char* const* argv, static std::shared_ptr<RRDServer> init_rrdstorage( int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "rrd" ); const std::string& prefix = "rrd" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
......
...@@ -7,9 +7,10 @@ using namespace UniSetTypes; ...@@ -7,9 +7,10 @@ using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
SMViewer::SMViewer( UniSetTypes::ObjectId shmID ): SMViewer::SMViewer( UniSetTypes::ObjectId shmID ):
SViewer(uniset_conf()->getControllersSection(), true) SViewer(uniset_conf()->getControllersSection(), true),
shm(make_shared<SMInterface>(shmID, ui, DefaultObjectId))
{ {
shm = make_shared<SMInterface>(shmID, ui, DefaultObjectId);
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
SMViewer::~SMViewer() SMViewer::~SMViewer()
......
...@@ -9,7 +9,7 @@ using namespace std; ...@@ -9,7 +9,7 @@ using namespace std;
using namespace UniSetTypes; using namespace UniSetTypes;
using namespace UniSetExtensions; using namespace UniSetExtensions;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
UNetExchange::UNetExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory> ic, const std::string& prefix ): UNetExchange::UNetExchange(UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmId, const std::shared_ptr<SharedMemory>& ic, const std::string& prefix ):
UniSetObject_LT(objId), UniSetObject_LT(objId),
initPause(0), initPause(0),
activated(false), activated(false),
...@@ -502,7 +502,7 @@ void UNetExchange::step() ...@@ -502,7 +502,7 @@ void UNetExchange::step()
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void UNetExchange::ReceiverInfo::step( const std::shared_ptr<SMInterface> shm, const std::string& myname, std::shared_ptr<DebugStream>& unetlog ) void UNetExchange::ReceiverInfo::step( const std::shared_ptr<SMInterface>& shm, const std::string& myname, std::shared_ptr<DebugStream>& unetlog )
{ {
try try
{ {
...@@ -785,8 +785,8 @@ void UNetExchange::help_print( int argc, const char* argv[] ) ...@@ -785,8 +785,8 @@ void UNetExchange::help_print( int argc, const char* argv[] )
cout << LogServer::help_print("prefix-logserver") << endl; cout << LogServer::help_print("prefix-logserver") << endl;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<UNetExchange> UNetExchange::init_unetexchange( int argc, const char* const argv[], UniSetTypes::ObjectId icID, std::shared_ptr<UNetExchange> UNetExchange::init_unetexchange(int argc, const char* const argv[], UniSetTypes::ObjectId icID,
const std::shared_ptr<SharedMemory> ic, const std::string& prefix ) const std::shared_ptr<SharedMemory>& ic, const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
......
...@@ -102,12 +102,12 @@ class UNetExchange: ...@@ -102,12 +102,12 @@ class UNetExchange:
public UniSetObject_LT public UniSetObject_LT
{ {
public: public:
UNetExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, const std::string& prefix = "unet" ); UNetExchange( UniSetTypes::ObjectId objId, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr, const std::string& prefix = "unet" );
virtual ~UNetExchange(); virtual ~UNetExchange();
/*! глобальная функция для инициализации объекта */ /*! глобальная функция для инициализации объекта */
static std::shared_ptr<UNetExchange> init_unetexchange( int argc, const char* const argv[], static std::shared_ptr<UNetExchange> init_unetexchange( int argc, const char* const argv[],
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = 0, const std::string& prefix = "unet" ); UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = 0, const std::string& prefix = "unet" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
static void help_print( int argc, const char* argv[] ); static void help_print( int argc, const char* argv[] );
...@@ -190,7 +190,7 @@ class UNetExchange: ...@@ -190,7 +190,7 @@ class UNetExchange:
std::shared_ptr<UNetReceiver> r1; /*!< приём по первому каналу */ std::shared_ptr<UNetReceiver> r1; /*!< приём по первому каналу */
std::shared_ptr<UNetReceiver> r2; /*!< приём по второму каналу */ std::shared_ptr<UNetReceiver> r2; /*!< приём по второму каналу */
void step( const std::shared_ptr<SMInterface> shm, const std::string& myname, std::shared_ptr<DebugStream>& log ); void step(const std::shared_ptr<SMInterface>& shm, const std::string& myname, std::shared_ptr<DebugStream>& log );
inline void setRespondID( UniSetTypes::ObjectId id, bool invert = false ) inline void setRespondID( UniSetTypes::ObjectId id, bool invert = false )
{ {
...@@ -206,7 +206,7 @@ class UNetExchange: ...@@ -206,7 +206,7 @@ class UNetExchange:
sidChannelNum = id; sidChannelNum = id;
} }
inline void initIterators( const std::shared_ptr<SMInterface> shm ) inline void initIterators( const std::shared_ptr<SMInterface>& shm )
{ {
shm->initIterator(itLostPackets); shm->initIterator(itLostPackets);
shm->initIterator(itRespond); shm->initIterator(itRespond);
......
...@@ -17,8 +17,8 @@ UniExchange::NetNodeInfo::NetNodeInfo(): ...@@ -17,8 +17,8 @@ UniExchange::NetNodeInfo::NetNodeInfo():
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
UniExchange::UniExchange( UniSetTypes::ObjectId id, UniSetTypes::ObjectId shmID, UniExchange::UniExchange(UniSetTypes::ObjectId id, UniSetTypes::ObjectId shmID,
const std::shared_ptr<SharedMemory> ic, const std::string& prefix ): const std::shared_ptr<SharedMemory>& ic, const std::string& prefix ):
IOController(id), IOController(id),
polltime(200), polltime(200),
mymap(1), mymap(1),
...@@ -337,8 +337,8 @@ void UniExchange::sigterm( int signo ) ...@@ -337,8 +337,8 @@ void UniExchange::sigterm( int signo )
{ {
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
std::shared_ptr<UniExchange> UniExchange::init_exchange( int argc, const char* const* argv, std::shared_ptr<UniExchange> UniExchange::init_exchange(int argc, const char* const* argv,
UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory> ic, UniSetTypes::ObjectId icID, const std::shared_ptr<SharedMemory>& ic,
const std::string& prefix ) const std::string& prefix )
{ {
auto conf = uniset_conf(); auto conf = uniset_conf();
......
...@@ -38,13 +38,13 @@ class UniExchange: ...@@ -38,13 +38,13 @@ class UniExchange:
{ {
public: public:
UniExchange( UniSetTypes::ObjectId id, UniSetTypes::ObjectId shmID, UniExchange( UniSetTypes::ObjectId id, UniSetTypes::ObjectId shmID,
const std::shared_ptr<SharedMemory> ic = nullptr, const std::string& prefix = "unet" ); const std::shared_ptr<SharedMemory>& ic = nullptr, const std::string& prefix = "unet" );
virtual ~UniExchange(); virtual ~UniExchange();
void execute(); void execute();
static std::shared_ptr<UniExchange> init_exchange( int argc, const char* const* argv, static std::shared_ptr<UniExchange> init_exchange( int argc, const char* const* argv,
UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory> ic = nullptr, UniSetTypes::ObjectId shmID, const std::shared_ptr<SharedMemory>& ic = nullptr,
const std::string& prefix = "unet" ); const std::string& prefix = "unet" );
/*! глобальная функция для вывода help-а */ /*! глобальная функция для вывода help-а */
......
...@@ -127,7 +127,7 @@ bool IOBase::check_on_delay( bool val ) ...@@ -127,7 +127,7 @@ bool IOBase::check_on_delay( bool val )
// обновляем значение только если наступило время // обновляем значение только если наступило время
// или если оно "0"... // или если оно "0"...
if( !val || (val && ptOnDelay.checkTime()) ) if( !val || ptOnDelay.checkTime() )
ondelay_state = val; ondelay_state = val;
// возвращаем ТЕКУЩЕЕ, А НЕ НОВОЕ значение // возвращаем ТЕКУЩЕЕ, А НЕ НОВОЕ значение
...@@ -147,7 +147,7 @@ bool IOBase::check_off_delay( bool val ) ...@@ -147,7 +147,7 @@ bool IOBase::check_off_delay( bool val )
// обновляем значение только если наступило время // обновляем значение только если наступило время
// или если оно "1"... // или если оно "1"...
if( val || (!val && ptOffDelay.checkTime()) ) if( val || ptOffDelay.checkTime() )
offdelay_state = val; offdelay_state = val;
// возвращаем ТЕКУЩЕЕ, А НЕ НОВОЕ значение // возвращаем ТЕКУЩЕЕ, А НЕ НОВОЕ значение
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment