nx_server_plugin_sdk  1.0
Server Plugin SDK
settings_model.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2 
3 #pragma once
4 
5 #include <string>
6 
7 namespace nx {
8 namespace vms_server_plugins {
9 namespace analytics {
10 namespace stub {
11 namespace special_objects {
12 
13 const std::string kGenerateFixedObjectSetting{"generateFixedObject"};
14 const std::string kFixedObjectColorSetting{"fixedObjectColor"};
15 const std::string kNoSpecialColorSettingValue{"No special color"};
16 
17 const std::string kGenerateCounterSetting{"generateCounter"};
18 const std::string kCounterBoundingBoxSideSizeSetting{"counterBoundingBoxSideSize"};
19 const std::string kCounterXOffsetSetting{"counterXOffset"};
20 const std::string kCounterYOffsetSetting{"counterYOffset"};
21 
22 const std::string kGeneratePointSetting{"generatePoint"};
23 const std::string kGenerateEmptyNameObjectSetting{"generateEmptyNameObject"};
24 
25 const std::string kBlinkingObjectPeriodMsSetting{"blinkingObjectPeriodMs"};
26 const std::string kBlinkingObjectInDedicatedPacketSetting{"blinkingObjectInDedicatedPacket"};
27 
28 const std::string kGenerateObjectsEveryNFramesSetting{"generateObjectsEveryNFrames"};
29 const std::string kAdditionalFrameProcessingDelayMsSetting{"additionalFrameProcessingDelayMs"};
30 const std::string kOverallMetadataDelayMsSetting{"overallMetadataDelayMs"};
31 
32 static const std::string kSettingsModel = /*suppress newline*/ 1 + R"json(
33 {
34  "type": "Settings",
35  "items":
36  [
37  {
38  "type": "GroupBox",
39  "caption": "Stub DeviceAgent settings",
40  "items":
41  [
42  {
43  "type": "GroupBox",
44  "caption": "Object generation settings",
45  "items":
46  [
47  {
48  "type": "CheckBox",
49  "name": ")json" + kGenerateFixedObjectSetting + R"json(",
50  "caption": "Generate fixed object",
51  "description": "Generates a fixed object with coordinates (0.25, 0.25, 0.25, 0.25)",
52  "defaultValue": false
53  },
54  {
55  "type": "ComboBox",
56  "name": ")json" + kFixedObjectColorSetting + R"json(",
57  "caption": "Fixed object color",
58  "range": [
59  ")json" + kNoSpecialColorSettingValue + R"json(",
60  "Magenta", "Blue", "Green", "Yellow", "Cyan", "Purple", "Orange",
61  "Red", "White", "#FFFFC0", "!invalid!", "#NONHEX"
62  ],
63  "defaultValue": ")json" + kNoSpecialColorSettingValue + R"json("
64  },
65  {
66  "type": "CheckBox",
67  "name": ")json" + kGenerateCounterSetting + R"json(",
68  "caption": "Generate counter",
69  "description": "Generates a counter",
70  "defaultValue": false
71  },
72  {
73  "type": "DoubleSpinBox",
74  "caption": "Size of the side of the counter bounding box",
75  "name": ")json" + kCounterBoundingBoxSideSizeSetting + R"json(",
76  "defaultValue": 0.0,
77  "minValue": 0.0,
78  "maxValue": 1.0
79  },
80  {
81  "type": "DoubleSpinBox",
82  "caption": "Counter bounding box X-Offset",
83  "name": ")json" + kCounterXOffsetSetting + R"json(",
84  "defaultValue": 0.0,
85  "minValue": 0.0,
86  "maxValue": 1.0
87  },
88  {
89  "type": "DoubleSpinBox",
90  "caption": "Counter bounding box Y-Offset",
91  "name": ")json" + kCounterYOffsetSetting + R"json(",
92  "defaultValue": 0.0,
93  "minValue": 0.0,
94  "maxValue": 1.0
95  },
96  {
97  "type": "CheckBox",
98  "name": ")json" + kGeneratePointSetting + R"json(",
99  "caption": "Generate point",
100  "description": "Generates a point-like object with showAsPoint=true",
101  "defaultValue": false
102  },
103  {
104  "type": "CheckBox",
105  "name": ")json" + kGenerateEmptyNameObjectSetting + R"json(",
106  "caption": "Generate empty-name object",
107  "description": "Generates an object with an empty Object Type Name",
108  "defaultValue": false
109  },
110  {
111  "type": "SpinBox",
112  "name": ")json" + kBlinkingObjectPeriodMsSetting + R"json(",
113  "caption": "Generate 1-frame BlinkingObject every N ms (if not 0)",
114  "defaultValue": 0,
115  "minValue": 0,
116  "maxValue": 100000
117  },
118  {
119  "type": "CheckBox",
120  "name": ")json" + kBlinkingObjectInDedicatedPacketSetting + R"json(",
121  "caption": "Put BlinkingObject into a dedicated MetadataPacket",
122  "defaultValue": false
123  },
124  {
125  "type": "SpinBox",
126  "name": ")json" + kGenerateObjectsEveryNFramesSetting + R"json(",
127  "caption": "Generate objects every N frames",
128  "defaultValue": 1,
129  "minValue": 1,
130  "maxValue": 100000
131  },
132  {
133  "type": "SpinBox",
134  "name": ")json" + kOverallMetadataDelayMsSetting + R"json(",
135  "caption": "Overall metadata delay, ms",
136  "defaultValue": 0,
137  "minValue": 0,
138  "maxValue": 1000000000
139  }
140  ]
141  },
142  {
143  "type": "SpinBox",
144  "name": ")json" + kAdditionalFrameProcessingDelayMsSetting + R"json(",
145  "caption": "Additional frame processing delay, ms",
146  "defaultValue": 0,
147  "minValue": 0,
148  "maxValue": 1000000000
149  }
150  ]
151  }
152  ]
153 }
154 )json";
155 
156 } // namespace special_objects
157 } // namespace stub
158 } // namespace analytics
159 } // namespace vms_server_plugins
160 } // namespace nx
Definition: apple_utils.h:6