Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Common Library
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rutherford Experiment Lab Course Online
Common Library
Commits
66467e4c
Verified
Commit
66467e4c
authored
3 years ago
by
Tobias Triffterer
Browse files
Options
Downloads
Patches
Plain Diff
Parse updateHistogram Command
This adds the code necessary to process this new command.
parent
b44f3216
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3256
passed with stage
Stage:
in 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/command.cpp
+15
-1
15 additions, 1 deletion
src/command.cpp
src/command.h
+1
-0
1 addition, 0 deletions
src/command.h
with
16 additions
and
1 deletion
src/command.cpp
+
15
−
1
View file @
66467e4c
...
@@ -98,7 +98,7 @@ Command Command::fromString(const QString& source)
...
@@ -98,7 +98,7 @@ Command Command::fromString(const QString& source)
// Not yet implemented:
// Not yet implemented:
case
Action
::
queryServerInformation
:
case
Action
::
queryServerInformation
:
case
Action
::
updateHistogram
:
case
Action
::
updateHistogram
:
return
Command
(
);
return
parseUpdateHistogram
(
rootobj
);
default:
default:
return
Command
();
return
Command
();
}
}
...
@@ -250,6 +250,20 @@ Protocol::Command Protocol::Command::parseFillHistogram(const QJsonObject& input
...
@@ -250,6 +250,20 @@ Protocol::Command Protocol::Command::parseFillHistogram(const QJsonObject& input
);
);
}
}
Protocol
::
Command
Protocol
::
Command
::
parseUpdateHistogram
(
const
QJsonObject
&
input
)
{
if
(
!
input
.
keys
().
contains
(
QStringLiteral
(
"bincontents"
))
||
!
input
.
value
(
QStringLiteral
(
"bincontents"
)).
isString
())
{
logError
(
QStringLiteral
(
"updateHistogram command does not contain bincontents."
));
return
Command
();
}
return
Command
(
Action
::
updateHistogram
,
Arguments
{
std
::
make_pair
(
QStringLiteral
(
"bincontents"
),
input
.
value
(
QStringLiteral
(
"bincontents"
)).
toString
())},
input
.
value
(
QStringLiteral
(
"token"
)).
toString
()
);
}
QString
Command
::
toString
()
const
QString
Command
::
toString
()
const
{
{
if
(
action
==
Action
::
invalid
)
if
(
action
==
Action
::
invalid
)
...
...
This diff is collapsed.
Click to expand it.
src/command.h
+
1
−
0
View file @
66467e4c
...
@@ -75,6 +75,7 @@ private:
...
@@ -75,6 +75,7 @@ private:
static
Command
parseUpdateExperimentState
(
const
QJsonObject
&
input
);
static
Command
parseUpdateExperimentState
(
const
QJsonObject
&
input
);
static
Command
parseSetTargetState
(
const
QJsonObject
&
input
);
static
Command
parseSetTargetState
(
const
QJsonObject
&
input
);
static
Command
parseFillHistogram
(
const
QJsonObject
&
input
);
static
Command
parseFillHistogram
(
const
QJsonObject
&
input
);
static
Command
parseUpdateHistogram
(
const
QJsonObject
&
input
);
static
QString
getActionString
(
const
Action
action
);
static
QString
getActionString
(
const
Action
action
);
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment