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
50b4f892
Commit
50b4f892
authored
Apr 30, 2017
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(HTTP): немного переделал создание help
parent
10b40d03
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
10 deletions
+10
-10
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+1
-1
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+1
-1
UObject_SK.cc
extensions/lib/UObject_SK.cc
+1
-1
ujson.h
include/ujson.h
+1
-1
IOController.cc
src/Processes/IOController.cc
+2
-2
ujson.cc
src/Various/ujson.cc
+2
-2
uhttp-test.cc
tests/UHttpTest/uhttp-test.cc
+2
-2
No files found.
Utilities/codegen/ctl-cpp-common.xsl
View file @
50b4f892
...
@@ -693,7 +693,7 @@ Poco::JSON::Object::Ptr <xsl:value-of select="$CLASSNAME"/>_SK::httpHelp( const
...
@@ -693,7 +693,7 @@ Poco::JSON::Object::Ptr <xsl:value-of select="$CLASSNAME"/>_SK::httpHelp( const
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
uniset::json::help::object myhelp(myname, UniSetObject::httpGet(params));
</xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
uniset::json::help::object myhelp(myname, UniSetObject::httpGet(params));
</xsl:if>
// 'log'
// 'log'
uniset::json::help::item cmd("show log level");
uniset::json::help::item cmd("
log","
show log level");
myhelp.add(cmd);
myhelp.add(cmd);
return myhelp;
return myhelp;
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
50b4f892
...
@@ -2016,7 +2016,7 @@ namespace uniset
...
@@ -2016,7 +2016,7 @@ namespace uniset
{
{
// 'regs'
// 'regs'
uniset
::
json
::
help
::
item
cmd
(
"get registers list"
);
uniset
::
json
::
help
::
item
cmd
(
"
regs"
,
"
get registers list"
);
cmd
.
param
(
"regs=reg1,reg2,reg3.."
,
"get these registers"
);
cmd
.
param
(
"regs=reg1,reg2,reg3.."
,
"get these registers"
);
cmd
.
param
(
"addr=mbaddr1,mbaddr2,.."
,
"get registers for mbaddr"
);
cmd
.
param
(
"addr=mbaddr1,mbaddr2,.."
,
"get registers for mbaddr"
);
myhelp
.
add
(
cmd
);
myhelp
.
add
(
cmd
);
...
...
extensions/lib/UObject_SK.cc
View file @
50b4f892
...
@@ -628,7 +628,7 @@ Poco::JSON::Object::Ptr UObject_SK::httpHelp( const Poco::URI::QueryParameters&
...
@@ -628,7 +628,7 @@ Poco::JSON::Object::Ptr UObject_SK::httpHelp( const Poco::URI::QueryParameters&
uniset
::
json
::
help
::
object
myhelp
(
myname
,
UniSetObject
::
httpGet
(
params
));
uniset
::
json
::
help
::
object
myhelp
(
myname
,
UniSetObject
::
httpGet
(
params
));
// 'log'
// 'log'
uniset
::
json
::
help
::
item
cmd
(
"show log level"
);
uniset
::
json
::
help
::
item
cmd
(
"
log"
,
"
show log level"
);
myhelp
.
add
(
cmd
);
myhelp
.
add
(
cmd
);
return
myhelp
;
return
myhelp
;
...
...
include/ujson.h
View file @
50b4f892
...
@@ -37,7 +37,7 @@ namespace uniset
...
@@ -37,7 +37,7 @@ namespace uniset
public
:
public
:
item
(
Poco
::
JSON
::
Object
::
Ptr
&
ptr
);
item
(
Poco
::
JSON
::
Object
::
Ptr
&
ptr
);
item
(
const
std
::
string
&
description
);
item
(
const
std
::
string
&
cmd
,
const
std
::
string
&
description
);
void
param
(
const
std
::
string
&
name
,
const
std
::
string
&
description
);
void
param
(
const
std
::
string
&
name
,
const
std
::
string
&
description
);
Poco
::
JSON
::
Object
::
Ptr
get
();
Poco
::
JSON
::
Object
::
Ptr
get
();
...
...
src/Processes/IOController.cc
View file @
50b4f892
...
@@ -850,7 +850,7 @@ Poco::JSON::Object::Ptr IOController::httpHelp( const Poco::URI::QueryParameters
...
@@ -850,7 +850,7 @@ Poco::JSON::Object::Ptr IOController::httpHelp( const Poco::URI::QueryParameters
{
{
// 'get'
// 'get'
uniset
::
json
::
help
::
item
cmd
(
"get value for sensor"
);
uniset
::
json
::
help
::
item
cmd
(
"get
"
,
"get
value for sensor"
);
cmd
.
param
(
"id1,name2,id3"
,
"get value for id1,name2,id3 sensors"
);
cmd
.
param
(
"id1,name2,id3"
,
"get value for id1,name2,id3 sensors"
);
cmd
.
param
(
"shortInfo"
,
"get short information for sensors"
);
cmd
.
param
(
"shortInfo"
,
"get short information for sensors"
);
myhelp
.
add
(
cmd
);
myhelp
.
add
(
cmd
);
...
@@ -858,7 +858,7 @@ Poco::JSON::Object::Ptr IOController::httpHelp( const Poco::URI::QueryParameters
...
@@ -858,7 +858,7 @@ Poco::JSON::Object::Ptr IOController::httpHelp( const Poco::URI::QueryParameters
{
{
// 'sensors'
// 'sensors'
uniset
::
json
::
help
::
item
cmd
(
"get all sensors"
);
uniset
::
json
::
help
::
item
cmd
(
"
sensors"
,
"
get all sensors"
);
cmd
.
param
(
"nameonly"
,
"get only name sensors"
);
cmd
.
param
(
"nameonly"
,
"get only name sensors"
);
cmd
.
param
(
"offset=N"
,
"get from N record"
);
cmd
.
param
(
"offset=N"
,
"get from N record"
);
cmd
.
param
(
"limit=M"
,
"limit of records"
);
cmd
.
param
(
"limit=M"
,
"limit of records"
);
...
...
src/Various/ujson.cc
View file @
50b4f892
...
@@ -41,10 +41,10 @@ namespace uniset
...
@@ -41,10 +41,10 @@ namespace uniset
params
=
ptr
->
getArray
(
"parameters"
);
params
=
ptr
->
getArray
(
"parameters"
);
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
json
::
help
::
item
::
item
(
const
std
::
string
&
description
)
json
::
help
::
item
::
item
(
const
std
::
string
&
cmd
,
const
std
::
string
&
description
)
{
{
root
=
new
Poco
::
JSON
::
Object
();
root
=
new
Poco
::
JSON
::
Object
();
root
->
set
(
"description"
,
description
);
root
->
set
(
cmd
,
description
);
}
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
void
json
::
help
::
item
::
param
(
const
std
::
string
&
name
,
const
std
::
string
&
description
)
void
json
::
help
::
item
::
param
(
const
std
::
string
&
name
,
const
std
::
string
&
description
)
...
...
tests/UHttpTest/uhttp-test.cc
View file @
50b4f892
...
@@ -30,13 +30,13 @@ class UTestSupplier:
...
@@ -30,13 +30,13 @@ class UTestSupplier:
{
{
uniset
::
json
::
help
::
object
myhelp
(
"test"
);
uniset
::
json
::
help
::
object
myhelp
(
"test"
);
uniset
::
json
::
help
::
item
cmd1
(
"description for cmd1"
);
uniset
::
json
::
help
::
item
cmd1
(
"
cmd1"
,
"
description for cmd1"
);
cmd1
.
param
(
"p1"
,
"description of p1"
);
cmd1
.
param
(
"p1"
,
"description of p1"
);
cmd1
.
param
(
"p2"
,
"description of p1"
);
cmd1
.
param
(
"p2"
,
"description of p1"
);
cmd1
.
param
(
"p3"
,
"description of p1"
);
cmd1
.
param
(
"p3"
,
"description of p1"
);
myhelp
.
add
(
cmd1
);
myhelp
.
add
(
cmd1
);
uniset
::
json
::
help
::
item
cmd2
(
"description for cmd2"
);
uniset
::
json
::
help
::
item
cmd2
(
"
cmd2"
,
"
description for cmd2"
);
cmd2
.
param
(
"p1"
,
"description of p1"
);
cmd2
.
param
(
"p1"
,
"description of p1"
);
cmd2
.
param
(
"p2"
,
"description of p1"
);
cmd2
.
param
(
"p2"
,
"description of p1"
);
cmd2
.
param
(
"p3"
,
"description of p1"
);
cmd2
.
param
(
"p3"
,
"description of p1"
);
...
...
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