Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
b372950f
Commit
b372950f
authored
Dec 12, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Пернёс исправления из другой ветки..
parent
133300be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
13 deletions
+43
-13
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+42
-12
configure.ac
configure.ac
+1
-1
No files found.
Utilities/codegen/ctl-cpp-common.xsl
View file @
b372950f
...
...
@@ -416,6 +416,8 @@
std::unordered_map
<
const uniset::ObjectId,size_t, StatHashFn
>
smStat; /*!
<
количество сообщений по датчикам */
size_t processingMessageCatchCount = { 0 }; /*!
<
количество исключений пойманных в processingMessage */
std::string ostate = { "" }; /*!
<
состояние процесса (выводится в getInfo()) */
</xsl:if>
</xsl:template>
...
...
@@ -476,22 +478,42 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::preSysCommand( const SystemMessage*
}
case SystemMessage::StartUp:
{
ostate = "StartUp...";
try
{
if( !logserv_host.empty()
&&
logserv_port != 0
&&
!logserv-
>
isRunning() )
{
ostate = "StartUp: run log server...";
myinfo
<<
myname
<<
"(preSysCommand): run log server "
<<
logserv_host
<<
":"
<<
logserv_port
<<
endl;
logserv-
>
run(logserv_host, logserv_port, true);
}
}
catch( std::exception
&
ex )
{
mywarn
<<
myname
<<
"(preSysCommand): CAN`t run log server err: "
<<
ex.what()
<<
endl;
}
catch( ... )
{
mywarn
<<
myname
<<
"(preSysCommand): CAN`t run log server err: catch ..."
<<
endl;
}
ostate = "StartUp: wait sm ready..";
waitSM(smReadyTimeout);
ptStartUpTimeout.reset();
// т.к. для io-переменных важно соблюдать последовательность!
// сперва обновить входы..
ostate = "StartUp: update values..";
updateValues();
ostate = "StartUp: init from SM..";
initFromSM(); // потом обновить значения переменных, помеченных как инициализируемые из SM
ostate = "StartUp: update outputs..";
updateOutputs(true); // а потом уже выходы (принудительное обновление)
ostate = "StartUp: pre ask sensors..";
preAskSensors(UniversalIO::UIONotify);
ostate = "StartUp: ask sensors..";
askSensors(UniversalIO::UIONotify);
active = true;
ostate = "StartUp: [OK]";
break;
}
...
...
@@ -514,9 +536,20 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::preSysCommand( const SystemMessage*
if( logserv
&&
!logserv_host.empty()
&&
logserv_port != 0 )
{
try
{
mylogany
<<
myname
<<
"(preSysCommand): try restart logserver.."
<<
endl;
logserv-
>
check(true);
}
catch( std::exception
&
ex )
{
mywarn
<<
myname
<<
"(preSysCommand): CAN`t restart log server err: "
<<
ex.what()
<<
endl;
}
catch( ... )
{
mywarn
<<
myname
<<
"(preSysCommand): CAN`t restart log server err: catch ..."
<<
endl;
}
}
}
break;
...
...
@@ -536,6 +569,8 @@ uniset::SimpleInfo* <xsl:value-of select="$CLASSNAME"/>_SK::getInfo( const char*
ostringstream inf;
inf
<<
i->info
<<
endl;
inf
<<
"process state: "
<<
ostate
<<
endl;
if( logserv /*
&&
userparam
<
0 */ )
{
inf
<<
"LogServer: "
<<
logserv_host
<<
":"
<<
logserv_port
...
...
@@ -801,10 +836,7 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
<<
wait_msec
<<
" мсек";
mycrit
<<
err.str()
<<
endl;
// terminate();
// abort();
// raise(SIGTERM);
std::terminate();
std::abort();
// throw uniset::SystemError(err.str());
}
...
...
@@ -816,10 +848,7 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
<<
wait_msec
<<
" мсек";
mycrit
<<
err.str()
<<
endl;
// terminate();
// abort();
//raise(SIGTERM);
std::terminate();
std::abort();
// throw uniset::SystemError(err.str());
}
}
...
...
@@ -1230,9 +1259,9 @@ end_private(false)
if( smTestID == DefaultObjectId )
smTestID = getSMTestID();
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout",
2
0000);
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout",
4
0000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout",
1
0000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout",
3
0000);
ptStartUpTimeout.setTiming(msec);
// =====================
<
variables
>
=====================
...
...
@@ -1699,10 +1728,11 @@ askPause(uniset_conf()->getPIntProp(cnode,"askPause",2000))
vmonit(smTestID);
vmonit(smReadyTimeout);
vmonit(activateTimeout);
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout",
2
0000);
activateTimeout = conf->getArgPInt("--" + argprefix + "activate-timeout",
4
0000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout",
1
0000);
int msec = conf->getArgPInt("--" + argprefix + "startup-timeout",
3
0000);
ptStartUpTimeout.setTiming(msec);
}
...
...
configure.ac
View file @
b372950f
...
...
@@ -32,7 +32,7 @@ AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
AM_PROG_LIBTOOL
ASTYLE_OPT="-A1 -T -C -S -
L -w -Y -M -f -p --mode=c --lineend=linux --align-reference=type --align-pointer=type --suffix=none --style=ansi --max-instatement-indent=50
"
ASTYLE_OPT="-A1 -T -C -S -
N -L -w -Y -M -f -p --mode=c --lineend=linux --align-reference=type --align-pointer=type --suffix=none --style=ansi
"
AC_SUBST(ASTYLE_OPT)
# Checks for libraries.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment