MCPcopy Create free account
hub / github.com/KDE/labplot / statisticsChanged

Method statisticsChanged

src/frontend/dockwidgets/LiveDataDock.cpp:648–656  ·  view source on GitHub ↗

! *\brief called when the will statistics are changed in the will settings widget * adds or removes the statistic represented by the index from m_mqttClient */

Source from the content-addressed store, hash-verified

646 * adds or removes the statistic represented by the index from m_mqttClient
647 */
648void LiveDataDock::statisticsChanged(MQTTClient::WillStatisticsType willStatisticsType) {
649 if (willStatisticsType != MQTTClient::WillStatisticsType::NoStatistics) {
650 // if it's not already added and it's checked we add it
651 if (!m_mqttClient->willStatistics().at(static_cast<int>(willStatisticsType)))
652 m_mqttClient->addWillStatistics(willStatisticsType);
653 else // otherwise remove it
654 m_mqttClient->removeWillStatistics(willStatisticsType);
655 }
656}
657
658/*!
659 *\brief called when the client connects to the broker successfully, it subscribes to every topic (# wildcard)

Callers 1

showWillSettingsMethod · 0.95

Calls 3

willStatisticsMethod · 0.80
addWillStatisticsMethod · 0.80
removeWillStatisticsMethod · 0.80

Tested by

no test coverage detected