Commit e09ff0eb authored by dogmaphobic's avatar dogmaphobic

Completed

parent 45e27160
......@@ -15,15 +15,43 @@ FactPanel {
FactPanelController { id: controller; factPanel: panel }
property Fact _camTriggerMode: controller.getParameterFact(-1, "TRIG_MODE")
property Fact _camTriggerPol: controller.getParameterFact(-1, "TRIG_POLARITY", false) // Don't bitch about missing as these only exist if trigger mode is enabled
property Fact _auxPins: controller.getParameterFact(-1, "TRIG_PINS", false) // Ditto
property Fact _timeInterval: controller.getParameterFact(-1, "TRIG_INTERVAL", false) // Ditto
property Fact _distanceInterval:controller.getParameterFact(-1, "TRIG_DISTANCE", false) // Ditto
Column {
anchors.fill: parent
anchors.margins: 8
VehicleSummaryRow {
labelText: qsTr("Camera Trigger Mode:")
labelText: qsTr("Camera trigger mode:")
valueText: _camTriggerMode ? _camTriggerMode.enumStringValue : ""
}
VehicleSummaryRow {
visible: _timeInterval && _camTriggerMode.value === 2
labelText: qsTr("Time interval:")
valueText: _timeInterval ? _timeInterval.value : ""
}
VehicleSummaryRow {
visible: _distanceInterval && _camTriggerMode.value === 3
labelText: qsTr("Distance interval:")
valueText: _distanceInterval ? _distanceInterval.value : ""
}
VehicleSummaryRow {
visible: _auxPins
labelText: qsTr("AUX pins:")
valueText: _auxPins ? _auxPins.value : ""
}
VehicleSummaryRow {
visible: _camTriggerPol
labelText: qsTr("AUX pin polarity:")
valueText: _camTriggerPol ? (_camTriggerPol.value ? "High (3.3V)" : "Low (0V)") : ""
}
}
}
......@@ -129,13 +129,14 @@ void FactPanelController::_checkForMissingFactPanel(void)
}
}
Fact* FactPanelController::getParameterFact(int componentId, const QString& name)
Fact* FactPanelController::getParameterFact(int componentId, const QString& name, bool reportMissing)
{
if (_autopilot && _autopilot->parameterExists(componentId, name)) {
Fact* fact = _autopilot->getParameterFact(componentId, name);
QQmlEngine::setObjectOwnership(fact, QQmlEngine::CppOwnership);
return fact;
} else {
if(reportMissing)
_reportMissingParameter(componentId, name);
return NULL;
}
......
......@@ -47,8 +47,8 @@ public:
Q_PROPERTY(QQuickItem* factPanel READ factPanel WRITE setFactPanel)
Q_INVOKABLE Fact* getParameterFact(int componentId, const QString& name);
Q_INVOKABLE bool parameterExists(int componentId, const QString& name);
Q_INVOKABLE Fact* getParameterFact (int componentId, const QString& name, bool reportMissing = true);
Q_INVOKABLE bool parameterExists (int componentId, const QString& name);
QQuickItem* factPanel(void);
void setFactPanel(QQuickItem* panel);
......
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