File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,41 @@ bool CompositeDevice::compareIndex(uint32_t index)
256256 return false ;
257257}
258258
259+ bool CompositeDevice::isEnabled (uint32_t index)
260+ {
261+ for (const auto & device : devices)
262+ {
263+ if (device->compareIndex (index))
264+ return device->isEnabled ();
265+ }
266+
267+ Onix1::showWarningMessageBoxAsync (
268+ " Unknown Index" ,
269+ " Could not get the enabled status of a device at index " + std::to_string (index) + " , it was not found in " + getName ()
270+ );
271+
272+ return false ;
273+ }
274+
275+ void CompositeDevice::setEnabled (uint32_t index, bool newState)
276+ {
277+ for (const auto & device : devices)
278+ {
279+ if (device->compareIndex (index))
280+ {
281+ device->setEnabled (newState);
282+ return ;
283+ }
284+ }
285+
286+ Onix1::showWarningMessageBoxAsync (
287+ " Unknown Index" ,
288+ " Could not set the enabled status of a device at index " + std::to_string (index) + " , it was not found in " + getName ()
289+ );
290+
291+ return ;
292+ }
293+
259294int CompositeDevice::configureDevice ()
260295{
261296 int result = ONI_ESUCCESS;
Original file line number Diff line number Diff line change @@ -246,6 +246,8 @@ namespace OnixSourcePlugin
246246 CompositeDeviceType getCompositeDeviceType () const ;
247247
248248 bool compareIndex (uint32_t index) override ;
249+ bool isEnabled (uint32_t index);
250+ void setEnabled (uint32_t index, bool newState);
249251 int configureDevice () override ;
250252 bool updateSettings () override ;
251253 void startAcquisition () override ;
You can’t perform that action at this time.
0 commit comments