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
3741b025
Commit
3741b025
authored
Nov 14, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Небольшие правки логов
parent
2648d598
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
+19
-5
TODO
TODO
+4
-0
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+11
-4
UHttpRequestHandler.cc
src/Communications/Http/UHttpRequestHandler.cc
+3
-0
UniSetObject.cc
src/ObjectRepository/UniSetObject.cc
+1
-1
No files found.
TODO
View file @
3741b025
...
...
@@ -39,6 +39,8 @@ Version 2.3
uniset-codegen: добавить ключ --gen-sensor-name для генерирования name_Item.. (чтобы можно было в логах использовать текстовые названия)
uniset-codegen: перенести инициализацию полей в header (c++11) и "разгрузить конструкторы"
- Сделать диапазонные пороги в IOBase и SM (т.е. "1" когда min >= val <= max ).
SQL:
====
- добавить работу с History (при передаче указателя на SM в конструкторе).
...
...
@@ -51,6 +53,8 @@ HTTP API:
- запрос о том, кто последний сохранил указанный датчик
- список объектов возвращать с их типом (чтобы можно было SM вычислять)
= Сделать возможность настраивать параметры httpserver-а из командной строки (количество потоков и т.п.)
- ТЕСТЫ (как вариант поизучать про тестовые фреймворки на питоне)
Version 2.5
============
...
...
Utilities/codegen/ctl-cpp-common.xsl
View file @
3741b025
...
...
@@ -255,10 +255,12 @@
std::string help() noexcept;
<xsl:if
test=
"normalize-space($DISABLE_REST_API)!='1'"
>
#ifndef DISABLE_REST_API
// HTTP API
virtual nlohmann::json httpGet( const Poco::URI::QueryParameters
&
p ) override;
virtual nlohmann::json httpRequest( const std::string
&
req, const Poco::URI::QueryParameters
&
p ) override;
virtual nlohmann::json httpHelp( const Poco::URI::QueryParameters
&
p ) override;
#endif
</xsl:if>
</xsl:template>
...
...
@@ -273,9 +275,11 @@
virtual bool activateObject() override;
virtual std::string getMonitInfo(){ return ""; } /*!
<
пользовательская информация выводимая в getInfo() */
<xsl:if
test=
"normalize-space($DISABLE_REST_API)!='1'"
>
#ifndef DISABLE_REST_API
virtual void httpGetUserData( nlohmann::json
&
jdata ){} /*!
<
для пользовательских данных в httpGet() */
virtual nlohmann::json httpDumpIO();
virtual nlohmann::json httpRequestLog( const Poco::URI::QueryParameters
&
p );
#endif
</xsl:if>
// Выполнение очередного шага программы
virtual void step(){}
...
...
@@ -565,6 +569,7 @@ uniset::SimpleInfo* <xsl:value-of select="$CLASSNAME"/>_SK::getInfo( CORBA::Long
}
// -----------------------------------------------------------------------------
<xsl:if
test=
"normalize-space($DISABLE_REST_API)!='1'"
>
#ifndef DISABLE_REST_API
nlohmann::json
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::httpGet( const Poco::URI::QueryParameters
&
params )
{
<xsl:if
test=
"not(normalize-space($BASECLASS)='')"
>
nlohmann::json json =
<xsl:value-of
select=
"$BASECLASS"
/>
::httpGet(params);
</xsl:if>
...
...
@@ -648,13 +653,11 @@ nlohmann::json <xsl:value-of select="$CLASSNAME"/>_SK::httpRequest( const std::s
nlohmann::json
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::httpRequestLog( const Poco::URI::QueryParameters
&
p )
{
nlohmann::json jret;
auto
&
jdata = jret[myname];
jdata["log"] = Debug::str(mylog->level());
jret[myname]["log"] = Debug::str(mylog->level());
return std::move(jret);
}
// -----------------------------------------------------------------------------
#endif
</xsl:if>
// -----------------------------------------------------------------------------
<xsl:if
test=
"normalize-space($TESTMODE)!=''"
>
...
...
@@ -1408,6 +1411,7 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::testMode( bool _state )
}
// -----------------------------------------------------------------------------
<xsl:if
test=
"normalize-space($DISABLE_REST_API)!='1'"
>
#ifndef DISABLE_REST_API
nlohmann::json
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::httpDumpIO()
{
nlohmann::json jdata;
...
...
@@ -1440,6 +1444,7 @@ nlohmann::json <xsl:value-of select="$CLASSNAME"/>_SK::httpDumpIO()
return std::move(jdata);
}
// ----------------------------------------------------------------------------
#endif
</xsl:if>
std::string
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::dumpIO()
...
...
@@ -1794,6 +1799,7 @@ bool <xsl:value-of select="$CLASSNAME"/>_SK::setMsg( uniset::ObjectId _code, boo
}
// -----------------------------------------------------------------------------
<xsl:if
test=
"normalize-space($DISABLE_REST_API)!='1'"
>
#ifndef DISABLE_REST_API
nlohmann::json
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::httpDumpIO()
{
nlohmann::json jdata;
...
...
@@ -1825,6 +1831,7 @@ nlohmann::json <xsl:value-of select="$CLASSNAME"/>_SK::httpDumpIO()
return std::move(jdata);
}
// -----------------------------------------------------------------------------
#endif
</xsl:if>
std::string
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::dumpIO()
...
...
src/Communications/Http/UHttpRequestHandler.cc
View file @
3741b025
...
...
@@ -40,6 +40,7 @@ void UHttpRequestHandler::handleRequest( Poco::Net::HTTPServerRequest& req, Poco
nlohmann
::
json
jdata
;
jdata
[
"error"
]
=
resp
.
getReasonForStatus
(
resp
.
getStatus
());
jdata
[
"ecode"
]
=
resp
.
getStatus
();
jdata
[
"message"
]
=
"Unknown 'registry of objects'"
;
out
<<
jdata
.
dump
();
out
.
flush
();
return
;
...
...
@@ -54,6 +55,7 @@ void UHttpRequestHandler::handleRequest( Poco::Net::HTTPServerRequest& req, Poco
nlohmann
::
json
jdata
;
jdata
[
"error"
]
=
resp
.
getReasonForStatus
(
resp
.
getStatus
());
jdata
[
"ecode"
]
=
resp
.
getStatus
();
jdata
[
"message"
]
=
"method must be 'GET'"
;
out
<<
jdata
.
dump
();
out
.
flush
();
return
;
...
...
@@ -79,6 +81,7 @@ void UHttpRequestHandler::handleRequest( Poco::Net::HTTPServerRequest& req, Poco
nlohmann
::
json
jdata
;
jdata
[
"error"
]
=
resp
.
getReasonForStatus
(
resp
.
getStatus
());
jdata
[
"ecode"
]
=
resp
.
getStatus
();
jdata
[
"message"
]
=
"BAD REQUEST STRUCTURE"
;
out
<<
jdata
.
dump
();
out
.
flush
();
return
;
...
...
src/ObjectRepository/UniSetObject.cc
View file @
3741b025
...
...
@@ -229,7 +229,7 @@ void UniSetObject::registered()
if
(
myid
==
uniset
::
DefaultObjectId
)
{
u
info
<<
myname
<<
"(registered): Don`t registration. myid=DefaultObjectId
\n
"
;
u
logrep
<<
myname
<<
"(registered): Don`t registration. myid=DefaultObjectId
\n
"
;
return
;
}
...
...
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