Index: sources/gui/qml/pages/settings/SettingsCalibrationSettings.qml =================================================================== diff -u -r50d6907ed1bef8273ad246a823073153016997e1 -r969fb65fb9857c0a6a84cb9f7d591d16de40e898 --- sources/gui/qml/pages/settings/SettingsCalibrationSettings.qml (.../SettingsCalibrationSettings.qml) (revision 50d6907ed1bef8273ad246a823073153016997e1) +++ sources/gui/qml/pages/settings/SettingsCalibrationSettings.qml (.../SettingsCalibrationSettings.qml) (revision 969fb65fb9857c0a6a84cb9f7d591d16de40e898) @@ -6,61 +6,44 @@ import "qrc:/globals" import "qrc:/components" import "qrc:/compounds" +import "qrc:/dialogs" SettingsBase { id: _root - property var fieldList : [] - itemIndex : SettingsStack.CalibrationSettings - confirmVisible : false - Component.onCompleted: _root.updateList (SettingsCalibrationSettings.Pressure) + Component.onCompleted: vCalibrationSettings.refreshList(SettingsCalibrationSettings.Pressure) - enum CalibrationSensor { - Pressure = 0, - Temperature = 1 + function openDialog( vIndex ) { + _calibrationDialog.openDialog( _componentComboBox.currentIndex, + vIndex, + _listView.model.get(vIndex)) } + CalibrationDialog { id: _calibrationDialog } + BaseComboBox { id: _componentComboBox anchors.top : _root.top anchors.topMargin : Variables.headerButtonsMargin anchors.horizontalCenter : parent.horizontalCenter height : Variables.contentHeight currentIndex : 0 model : [ - "Pressure Sensors" , - "Temperature" , - "Filters" + qsTr("Pressure Sensors" ) , + qsTr("Temperature" ) , + qsTr("Concentrate Pump" ) , + qsTr("Dialysate Pump (D48)" ) , + qsTr("Dialysate Pump (D1)" ) , + qsTr("Acid Types" ) , + qsTr("Bicarb Types" ) , + qsTr("Accelerometer" ) , + qsTr("Blood Leak" ) ] - onActivated: _root.updateList(currentIndex) + onActivated: vCalibrationSettings.refreshList(currentIndex) } - function updateList(vCurrentIndex) { - fieldList = [] - - switch(vCurrentIndex) { - case SettingsCalibrationSettings.Pressure: - fieldList.push("Gain") - fieldList.push("Offset") - fieldList.push("Offset") - fieldList.push("Offset") - - break - case SettingsCalibrationSettings.Temperature: - fieldList.push("3f34") - fieldList.push("34f43") - break - - default: - break - } - - // Notify QML that the array changed - fieldList = fieldList - } - component HeaderText: Text { id: _headerText property string title : "" anchors.verticalCenter : parent.verticalCenter @@ -73,7 +56,7 @@ contentItem: Item { id: _contentItem anchors.fill : parent - readonly property int contentWith: _listView.width - Variables.defaultMargin * 2 // added margin to have scroll bar show on right + readonly property int contentWith: _listView.width - Variables.defaultMargin //* 2 // added margin to have scroll bar show on right Rectangle { id: _header color : Colors.treatmentSectionHeader @@ -85,20 +68,23 @@ width : _contentItem.width height : Variables.institutionaltContainerHeight - HeaderText { id: _parameters; title: qsTr("Description"); width: _contentItem.width * 0.2 } - HeaderText { id: _minimum; title: qsTr("Component"); width: _contentItem.width * 0.2 } + HeaderText { title: qsTr("Description"); width: _contentItem.width * 0.3 } + HeaderText { title: qsTr("Component"); width: _contentItem.width * 0.1; leftPadding: 0 } Row { id: _headerComponentRow width : _contentItem.width * 0.6 height : Variables.institutionaltContainerHeight Repeater { id: _repeater - model : _root.fieldList + model : vCalibrationSettings.columnTitle delegate: HeaderText { - title : modelData + readonly property bool isCalTime: index === _repeater.count - 1 + + title : modelData height : Variables.institutionaltContainerHeight - width : _headerComponentRow.width / _root.fieldList.length + leftPadding : isCalTime ? Variables.defaultMargin : Variables.defaultMargin * 2 + width : _headerComponentRow.width / vCalibrationSettings.columnTitle.length verticalAlignment : Text.AlignVCenter } } @@ -128,11 +114,69 @@ } boundsBehavior : Flickable.StopAtBounds clip : true -// model : vInstitutionalRecord.model + model : vCalibrationSettings.model spacing : anchors.topMargin flickableDirection : Flickable.VerticalFlick - } + delegate: Rectangle { + height : Variables.institutionaltContainerHeight + width : _contentItem.contentWith + radius : 8.5 + color : Colors.panelBackgroundColor + border { + width: 1 + color: _mouseArea.pressed || _editButton.isPressed ? Colors.borderButton : Colors.panelBorderColor + } + MouseArea { id: _mouseArea + anchors.fill : parent + anchors.rightMargin: _contentItem.width / 2 + onClicked : _root.openDialog(index) + } + + IconButton { id : _editButton + anchors { + left : parent.left + leftMargin : Variables.defaultMargin / 2 + verticalCenter : parent.verticalCenter + } + iconImageSource : "qrc:/images/iEdit" + iconSize : Variables.iconsDiameter + onPressed : _root.openDialog( index ) + } + + Row { id: _delegateRow + width : _contentItem.width + height : Variables.institutionaltContainerHeight + + HeaderText { title: model.title; width: _contentItem.width * 0.3; font.weight: Font.Normal; leftPadding: Variables.defaultMargin * 3 } + HeaderText { title: model.component; width: _contentItem.width * 0.1 } + + Row { id: _delegateComponentRow + width : _contentItem.width * 0.6 + height : Variables.institutionaltContainerHeight + + Repeater { id: _delegateRepeater + model : payload + + delegate: HeaderText { + readonly property bool isCalTime: index === _delegateRepeater.count - 1 + + title : isCalTime ? modelData : Number(modelData).toFixed(3) + height : Variables.institutionaltContainerHeight + leftPadding : isCalTime ? 0 : Variables.defaultMargin * 2 + width : _delegateComponentRow.width / vCalibrationSettings.columnTitle.length + verticalAlignment : Text.AlignVCenter + font.pixelSize : isCalTime ? Fonts.fontPixelDefaultButton : Fonts.fontPixelTextRectTitle + + + } + } + } + } + } + + ScrollBar { flickable: _listView } + } } }