Commit 01e14ff8 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Add vars to NetworkDefinition to hide panels and change start tab

parent 68a3f16a
......@@ -14,6 +14,10 @@ NetworkDefinition::NetworkDefinition (QObject * parent)
, m_dumpObjectsOnInit (false)
, m_benchmarkSimulatorTick (false)
, m_benchmarkCanFramesTiming (false)
, m_hideSensorsPanel (false)
, m_hideActuatorsPanel (false)
, m_hideMessagesPanel (false)
, m_startTab (Tabs::NODES_IO)
, m_nodesList (Q_NULLPTR)
, m_sensorsList (Q_NULLPTR)
, m_actuatorsList (Q_NULLPTR)
......
......@@ -10,6 +10,8 @@
#include "QQmlConstRefPropertyHelpers.h"
#include "QQmlListPropertyHelper.h"
#include "IdentifiableObject.h"
class NodesList;
class SensorsList;
class ActuatorsList;
......@@ -18,6 +20,13 @@ class Dashboard;
class CanBus;
class SerialBus;
QML_ENUM_CLASS (Tabs,
DATASHEET,
NODES_IO,
LOGIC,
PHYSIC_3D,
DASHBOARD)
class NetworkDefinition : public QObject {
Q_OBJECT
QML_WRITABLE_CSTREF_PROPERTY (QString, uid)
......@@ -26,6 +35,10 @@ class NetworkDefinition : public QObject {
QML_WRITABLE_VAR_PROPERTY (bool, dumpObjectsOnInit)
QML_WRITABLE_VAR_PROPERTY (bool, benchmarkSimulatorTick)
QML_WRITABLE_VAR_PROPERTY (bool, benchmarkCanFramesTiming)
QML_WRITABLE_VAR_PROPERTY (bool, hideSensorsPanel)
QML_WRITABLE_VAR_PROPERTY (bool, hideActuatorsPanel)
QML_WRITABLE_VAR_PROPERTY (bool, hideMessagesPanel)
QML_WRITABLE_VAR_PROPERTY (Tabs::Type, startTab)
QML_WRITABLE_PTR_PROPERTY (NodesList, nodesList)
QML_WRITABLE_PTR_PROPERTY (SensorsList, sensorsList)
QML_WRITABLE_PTR_PROPERTY (ActuatorsList, actuatorsList)
......
......@@ -76,6 +76,7 @@ void SharedObject::registerQmlTypes (QQmlEngine * qmlEngine) {
qmlRegisterSingletonType<SharedObject> (uri, maj, min, "Shared", &SharedObject::qmlSingletonProvider);
qmlRegisterSingletonType<Help> (uri, maj, min, "Help", &Help::qmlSingletonProvider);
// must not be instanciated in QML enum
qmlRegisterUncreatableType<Tabs> (uri, maj, min, "Tabs", msg);
qmlRegisterUncreatableType<Modes> (uri, maj, min, "Modes", msg);
qmlRegisterUncreatableType<ObjectFamily> (uri, maj, min, "ObjectFamily", msg);
qmlRegisterUncreatableType<ObjectType> (uri, maj, min, "ObjectType", msg);
......
......@@ -24,6 +24,43 @@ Window {
highlightSensor = null;
highlightActuator = null;
}
else {
if (network.hideSensorsPanel) {
panelSensors.collapse ();
}
else {
panelSensors.expand ();
}
if (network.hideActuatorsPanel) {
panelActuators.collapse ();
}
else {
panelActuators.expand ();
}
if (network.hideMessagesPanel) {
panelLogs.collapse ();
}
else {
panelLogs.expand ();
}
switch (network.startTab) {
case Tabs.NODES_IO:
tabsView.currentTab = tabElecNodes;
break;
case Tabs.DASHBOARD:
tabsView.currentTab = tabDashboard;
break;
case Tabs.LOGIC:
tabsView.currentTab = tabAppLogic;
break;
case Tabs.DATASHEET:
tabsView.currentTab = tabDatasheet;
break;
case Tabs.PHYSIC_3D:
tabsView.currentTab = tabPhysMachine;
break;
}
}
}
onHighlightIOChanged: {
if (highlightIO !== null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment