Commit 818aab74 authored by Pavel Vainerman's avatar Pavel Vainerman

make style..

parent faec0cbb
...@@ -120,11 +120,11 @@ int main( int argc, char **argv ) ...@@ -120,11 +120,11 @@ int main( int argc, char **argv )
ls.run( addr, port, true ); ls.run( addr, port, true );
if( verb ) if( verb )
ls.setSessionLog(Debug::ANY); ls.setSessionLog(Debug::ANY);
unsigned int i=0; unsigned int i=0;
while( true ) while( true )
// for( int n=0; n<2; n++ ) // for( int n=0; n<2; n++ )
{ {
dlog->any() << "[" << ++i << "] Test message for log" << endl; dlog->any() << "[" << ++i << "] Test message for log" << endl;
dlog->info() << ": dlog : INFO message" << endl; dlog->info() << ": dlog : INFO message" << endl;
......
...@@ -236,7 +236,7 @@ TEST_CASE("[UNetUDP]: check receiver","[unetudp][receiver]") ...@@ -236,7 +236,7 @@ TEST_CASE("[UNetUDP]: check receiver","[unetudp][receiver]")
REQUIRE( ui->getValue(10) == 1 ); REQUIRE( ui->getValue(10) == 1 );
REQUIRE( ui->getValue(11) == 0 ); REQUIRE( ui->getValue(11) == 0 );
WARN("check respond sensor DISABLED!"); WARN("check respond sensor DISABLED!");
// msleep(1500); // msleep(1500);
// REQUIRE( ui->getValue(node2_respond_s) == 1 ); // REQUIRE( ui->getValue(node2_respond_s) == 1 );
} }
......
...@@ -22,24 +22,24 @@ ...@@ -22,24 +22,24 @@
#include "DebugStream.h" #include "DebugStream.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
class UObject_SK: class UObject_SK:
public UniSetObject, public UniSetObject,
public LT_Object public LT_Object
{ {
public: public:
UObject_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::uniset_conf()->getNode("UObject"), const std::string& argprefix="" ); UObject_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::uniset_conf()->getNode("UObject"), const std::string& argprefix="" );
UObject_SK(); UObject_SK();
virtual ~UObject_SK(); virtual ~UObject_SK();
bool alarm( UniSetTypes::ObjectId sid, bool state ); bool alarm( UniSetTypes::ObjectId sid, bool state );
long getValue( UniSetTypes::ObjectId sid ); long getValue( UniSetTypes::ObjectId sid );
void setValue( UniSetTypes::ObjectId sid, long value ); void setValue( UniSetTypes::ObjectId sid, long value );
void askSensor( UniSetTypes::ObjectId sid, UniversalIO::UIOCommand, UniSetTypes::ObjectId node = UniSetTypes::uniset_conf()->getLocalNode() ); void askSensor( UniSetTypes::ObjectId sid, UniversalIO::UIOCommand, UniSetTypes::ObjectId node = UniSetTypes::uniset_conf()->getLocalNode() );
void updateValues(); void updateValues();
void setMsg( UniSetTypes::ObjectId code, bool state ); void setMsg( UniSetTypes::ObjectId code, bool state );
std::shared_ptr<DebugStream> mylog; std::shared_ptr<DebugStream> mylog;
void init_dlog( std::shared_ptr<DebugStream> d ); void init_dlog( std::shared_ptr<DebugStream> d );
// "синтаксический сахар"..для логов // "синтаксический сахар"..для логов
#define myinfo if( mylog->debugging(Debug::INFO) ) mylog->any() #define myinfo if( mylog->debugging(Debug::INFO) ) mylog->any()
...@@ -57,91 +57,91 @@ class UObject_SK: ...@@ -57,91 +57,91 @@ class UObject_SK:
#define mylogany mylog->any() #define mylogany mylog->any()
// Используемые идентификаторы // Используемые идентификаторы
// Используемые идентификаторы сообщений // Используемые идентификаторы сообщений
// Текущее значение // Текущее значение
// --- public variables --- // --- public variables ---
// --- end of public variables --- // --- end of public variables ---
protected: protected:
// --- protected variables --- // --- protected variables ---
// ---- end of protected variables ---- // ---- end of protected variables ----
virtual void callback() override; virtual void callback() override;
virtual void processingMessage( UniSetTypes::VoidMessage* msg ) override; virtual void processingMessage( UniSetTypes::VoidMessage* msg ) override;
virtual void sysCommand( const UniSetTypes::SystemMessage* sm ) override; virtual void sysCommand( const UniSetTypes::SystemMessage* sm ) override;
virtual void askSensors( UniversalIO::UIOCommand cmd ){} virtual void askSensors( UniversalIO::UIOCommand cmd ){}
virtual void sensorInfo( const UniSetTypes::SensorMessage* sm ) override{} virtual void sensorInfo( const UniSetTypes::SensorMessage* sm ) override{}
virtual void timerInfo( const UniSetTypes::TimerMessage* tm ) override{} virtual void timerInfo( const UniSetTypes::TimerMessage* tm ) override{}
virtual void sigterm( int signo ) override; virtual void sigterm( int signo ) override;
virtual bool activateObject() override; virtual bool activateObject() override;
virtual void testMode( bool state ); virtual void testMode( bool state );
void updatePreviousValues(); void updatePreviousValues();
void checkSensors(); void checkSensors();
void updateOutputs( bool force ); void updateOutputs( bool force );
void preAskSensors( UniversalIO::UIOCommand cmd ); void preAskSensors( UniversalIO::UIOCommand cmd );
void preSensorInfo( const UniSetTypes::SensorMessage* sm ); void preSensorInfo( const UniSetTypes::SensorMessage* sm );
void preTimerInfo( const UniSetTypes::TimerMessage* tm ); void preTimerInfo( const UniSetTypes::TimerMessage* tm );
void waitSM( int wait_msec, UniSetTypes::ObjectId testID = UniSetTypes::DefaultObjectId ); void waitSM( int wait_msec, UniSetTypes::ObjectId testID = UniSetTypes::DefaultObjectId );
void resetMsg(); void resetMsg();
Trigger trResetMsg; Trigger trResetMsg;
PassiveTimer ptResetMsg; PassiveTimer ptResetMsg;
int resetMsgTime; int resetMsgTime;
// Выполнение очередного шага программы // Выполнение очередного шага программы
virtual void step(){} virtual void step(){}
int sleep_msec; /*!< пауза между итерациями */ int sleep_msec; /*!< пауза между итерациями */
bool active; bool active;
UniSetTypes::ObjectId smTestID; /*!< идентификатор датчика для тестирования готовности SM */ UniSetTypes::ObjectId smTestID; /*!< идентификатор датчика для тестирования готовности SM */
// управление датчиком "сердцебиения" // управление датчиком "сердцебиения"
PassiveTimer ptHeartBeat; /*! < период "сердцебиения" */ PassiveTimer ptHeartBeat; /*! < период "сердцебиения" */
UniSetTypes::ObjectId idHeartBeat; /*! < идентификатор датчика (AI) "сердцебиения" */ UniSetTypes::ObjectId idHeartBeat; /*! < идентификатор датчика (AI) "сердцебиения" */
int maxHeartBeat; /*! < сохраняемое значение */ int maxHeartBeat; /*! < сохраняемое значение */
xmlNode* confnode; xmlNode* confnode;
/*! получить числовое свойство из конф. файла по привязанной confnode */ /*! получить числовое свойство из конф. файла по привязанной confnode */
int getIntProp(const std::string& name) { return UniSetTypes::uniset_conf()->getIntProp(confnode, name); } int getIntProp(const std::string& name) { return UniSetTypes::uniset_conf()->getIntProp(confnode, name); }
/*! получить текстовое свойство из конф. файла по привязанной confnode */ /*! получить текстовое свойство из конф. файла по привязанной confnode */
inline const std::string getProp(const std::string& name) { return UniSetTypes::uniset_conf()->getProp(confnode, name); } inline const std::string getProp(const std::string& name) { return UniSetTypes::uniset_conf()->getProp(confnode, name); }
int smReadyTimeout; /*!< время ожидания готовности SM */ int smReadyTimeout; /*!< время ожидания готовности SM */
std::atomic_bool activated; std::atomic_bool activated;
int activateTimeout; /*!< время ожидания готовности UniSetObject к работе */ int activateTimeout; /*!< время ожидания готовности UniSetObject к работе */
PassiveTimer ptStartUpTimeout; /*!< время на блокировку обработки WatchDog, если недавно был StartUp */ PassiveTimer ptStartUpTimeout; /*!< время на блокировку обработки WatchDog, если недавно был StartUp */
int askPause; /*!< пауза между неудачными попытками заказать датчики */ int askPause; /*!< пауза между неудачными попытками заказать датчики */
IOController_i::SensorInfo si; IOController_i::SensorInfo si;
bool forceOut; /*!< флаг принудительного обноления "выходов" */ bool forceOut; /*!< флаг принудительного обноления "выходов" */
private: private:
// --- private variables --- // --- private variables ---
// --- end of private variables --- // --- end of private variables ---
// предыдущее значение (для работы UpdateValue()) // предыдущее значение (для работы UpdateValue())
// Используемые идентификаторы сообщений // Используемые идентификаторы сообщений
bool end_private; // вспомогательное поле (для внутреннего использования при генерировании кода) bool end_private; // вспомогательное поле (для внутреннего использования при генерировании кода)
}; };
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -140,7 +140,7 @@ void LogServer::work() ...@@ -140,7 +140,7 @@ void LogServer::work()
continue; continue;
} }
} }
auto s = make_shared<LogSession>(*tcp, elog, sessTimeout, cmdTimeout, outTimeout); auto s = make_shared<LogSession>(*tcp, elog, sessTimeout, cmdTimeout, outTimeout);
s->setSessionLogLevel(sessLogLevel); s->setSessionLogLevel(sessLogLevel);
{ {
......
...@@ -99,9 +99,9 @@ TEST_CASE("LogAgregator", "[LogServer][LogAgregator]" ) ...@@ -99,9 +99,9 @@ TEST_CASE("LogAgregator", "[LogServer][LogAgregator]" )
TEST_CASE("LogServer", "[LogServer]" ) TEST_CASE("LogServer", "[LogServer]" )
{ {
g_read_cancel = false; g_read_cancel = false;
auto la = make_shared<LogAgregator>(); auto la = make_shared<LogAgregator>();
auto log1 = la->create("log1"); auto log1 = la->create("log1");
auto log2 = la->create("log2"); auto log2 = la->create("log2");
log1->level(Debug::ANY); log1->level(Debug::ANY);
log2->level(Debug::ANY); log2->level(Debug::ANY);
...@@ -115,7 +115,7 @@ TEST_CASE("LogServer", "[LogServer]" ) ...@@ -115,7 +115,7 @@ TEST_CASE("LogServer", "[LogServer]" )
LogServer ls(la); LogServer ls(la);
//ls.setSessionLog(Debug::ANY); //ls.setSessionLog(Debug::ANY);
ls.run( ip, port, true ); ls.run( ip, port, true );
for( int i=0; i<3 && !ls.isRunning(); i++ ) for( int i=0; i<3 && !ls.isRunning(); i++ )
msleep(500); msleep(500);
......
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