89{
91 std::string resultString = "success";
92
93 for (auto [key, value] : paramValue.items()) {
94 try {
95
96
97
98
101 if (srchIdx == 0) {
102
103
104
105
106
107
108
110 if (
value.size() == 1) {
111
112
113
114
117 resultString =
"Incorrect JSON type for parameter " +
key;
118 break;
119 }
120
122 break;
123 }
124 else if (paramType == JSON::value_t::array) {
125
126 size_t elementSize =
value[0].size();
127 size_t arrayLength =
value.size();
128
132 }
133 }
134 else if (arrayLength == paramSize) {
135
136
137
139 }
140 else {
142 resultString =
"Invalid value format for array parameter " + paramKey +
" on side " +
m_sideLabels[
side];
143 break;
144 }
145 }
146 else if (paramType == JSON::value_t::object) {
147
148
149
150 }
151 else {
152
153
154
157 resultString =
"Invalid array length for parameter " + paramKey +
" on side " +
m_sideLabels[
side];
158 break;
159 }
160 else {
161
162
163
165 if (!
checkType(value[chan], paramType)) {
167 resultString = "Incorrect JSON type for parameter " + paramKey + "paramType = " +
168 std::to_string((
unsigned int) paramType) +
", value type = " + std::to_string((
unsigned int) value[chan].
type());
169 break;
170 }
171
173 }
174 }
175 }
176 }
177 else {
178
179
181 try {
182 int chanIndex = std::stoi(keyRemainder);
185 resultString =
"Invalid channel specifier in values for parameter " +
key;
186 break;
187 }
188
189 if (!
checkType(value, paramType, paramSize)) {
191 resultString =
"Incorrect JSON type for parameter " +
key;
192 break;
193 }
194
196 }
197 catch(...) {
199 resultString =
"Invalid channel specifier for parameter " +
key;
200 break;
201 }
202 }
203 }
204
205 }
206 }
207 catch (...) {
209 resultString =
"Exception caught while parsing key " +
key;
210 }
211 }
212
213 return {
result, resultString};
214}
void setChannelParameter(unsigned int side, unsigned int chanIndex, const std::string &key, T value)
void setPerSideParameter(unsigned int side, std::string key, T value)