MCPcopy Create free account
hub / github.com/benkuper/Chataigne / updatePingStatusValues

Method updatePingStatusValues

Source/Module/modules/system/os/OSModule.cpp:301–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void OSModule::updatePingStatusValues()
302{
303 pingThread.stopThread(2000);
304 var data = pingStatusCC.getJSONData();
305 pingStatusCC.clear();
306
307 for (auto& c : pingIPsCC.controllables)
308 {
309 String s = ((StringParameter*)c)->niceName;
310 BoolParameter* b = pingStatusCC.addBoolParameter(s.isNotEmpty() ? s : "[noip]", "Status for this IP", false);
311 b->saveValueOnly = false;
312 }
313
314 pingStatusCC.loadJSONData(data, false); //force reload styles
315 for (auto& c : pingIPsCC.controllables)
316 {
317 if (BoolParameter* p = dynamic_cast<BoolParameter*>(c)) p->setValue(false);
318 }
319
320 if (enabled->boolValue() && pingIPsCC.controllables.size() > 0) pingThread.startThread();
321}
322
323var OSModule::launchProcessFromScript(const var::NativeFunctionArgs& args)
324{

Callers

nothing calls this directly

Calls 5

getJSONDataMethod · 0.45
clearMethod · 0.45
loadJSONDataMethod · 0.45
setValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected