diff --git a/EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerGroup.qml b/EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerGroup.qml new file mode 100644 index 00000000..c612dee5 --- /dev/null +++ b/EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerGroup.qml @@ -0,0 +1,26 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 +import QtQuick.Dialogs 1.3 as Dialogs1 +import QtQuick.XmlListModel 2.13 + +import easyApp.Gui.Elements 1.0 as EaElements + +import Gui.Globals 1.0 as ExGlobals +import Gui.Pages.Sample.Layers 1.0 as ExLayers + +EaElements.GroupBox { + // When an item in the above table is selected, this box will become enabled. + // Allowing different parameters and layers to be defined for the item. + id: multilayerGroup + title: qsTr(ExGlobals.Constants.proxy.model.currentItemsName + " editor") + enabled: (itemsTable.model.count > 0) ? true : false //When a layer is selected + collapsible: false + last: true + + ExLayers.MultilayerTable{ + id: layersTable + } + + ExLayers.MultilayerRow{ + } +} \ No newline at end of file diff --git a/EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerRow.qml b/EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerRow.qml new file mode 100644 index 00000000..bb2f5eed --- /dev/null +++ b/EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerRow.qml @@ -0,0 +1,44 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 +import QtQuick.XmlListModel 2.13 + +import easyApp.Gui.Elements 1.0 as EaElements +import easyApp.Gui.Style 1.0 as EaStyle + +import Gui.Globals 1.0 as ExGlobals + +Row { + spacing: EaStyle.Sizes.fontPixelSize + + EaElements.SideBarButton { + width: (EaStyle.Sizes.sideBarContentWidth - (2 * (EaStyle.Sizes.tableRowHeight + EaStyle.Sizes.fontPixelSize)) - EaStyle.Sizes.fontPixelSize) / 2 + enabled: true + fontIcon: "plus-circle" + text: qsTr("Add layer") + onClicked: ExGlobals.Constants.proxy.model.addNewLayers() + } + + EaElements.SideBarButton { + width: (EaStyle.Sizes.sideBarContentWidth - (2 * (EaStyle.Sizes.tableRowHeight + EaStyle.Sizes.fontPixelSize)) - EaStyle.Sizes.fontPixelSize) / 2 + enabled: (layersTable.model.count > 0) ? true : false //when item is selected + fontIcon: "clone" + text: qsTr("Duplicate layer") + onClicked: ExGlobals.Constants.proxy.model.duplicateSelectedLayers() + } + + EaElements.SideBarButton { + width: EaStyle.Sizes.tableRowHeight + enabled: (layersTable.model.count > 0 && layersTable.currentIndex != 0) ? true : false//When item is selected + fontIcon: "arrow-up" + ToolTip.text: qsTr("Move layer up") + onClicked: ExGlobals.Constants.proxy.model.moveSelectedLayersUp() + } + + EaElements.SideBarButton { + width: EaStyle.Sizes.tableRowHeight + enabled: (layersTable.model.count > 0 && layersTable.currentIndex + 1 != layersTable.model.count) ? true : false + fontIcon: "arrow-down" + ToolTip.text: qsTr("Move layer down") + onClicked: ExGlobals.Constants.proxy.model.moveSelectedLayersDown() + } +} \ No newline at end of file diff --git a/EasyReflectometryApp/Gui/Pages/Sample/MultiLayerTable.qml b/EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerTable.qml similarity index 100% rename from EasyReflectometryApp/Gui/Pages/Sample/MultiLayerTable.qml rename to EasyReflectometryApp/Gui/Pages/Sample/Layers/MultilayerTable.qml diff --git a/EasyReflectometryApp/Gui/Pages/Sample/Layers/RepeatingMultilayerGroup.qml b/EasyReflectometryApp/Gui/Pages/Sample/Layers/RepeatingMultilayerGroup.qml new file mode 100644 index 00000000..f611a07a --- /dev/null +++ b/EasyReflectometryApp/Gui/Pages/Sample/Layers/RepeatingMultilayerGroup.qml @@ -0,0 +1,48 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 +import QtQuick.Dialogs 1.3 as Dialogs1 +import QtQuick.XmlListModel 2.13 + +import easyApp.Gui.Style 1.0 as EaStyle +import easyApp.Gui.Elements 1.0 as EaElements +import easyApp.Gui.Components 1.0 as EaComponents + +import Gui.Globals 1.0 as ExGlobals +import Gui.Pages.Sample.Layers 1.0 as ExLayers + +EaElements.GroupBox { +// id: repeatingMultilayerGroup + title: qsTr(ExGlobals.Constants.proxy.model.currentItemsName + " editor") + enabled: (itemsTable.model.count > 0) ? true : false //When a layer is selected + collapsible: false + last: true + Row { + spacing: EaStyle.Sizes.fontPixelSize * 0.5 + + // This integer defines how many repetitions of the layer structure should be + // used. + EaComponents.TableViewLabel{ + horizontalAlignment: Text.AlignRight + width: labelWidth() * 2.1 + ToolTip.text: qsTr("To create some repeating multilayer structure") + text: qsTr("Number of repetitions:") + } + EaElements.SpinBox { + id: repsSpinBox + editable: true + from: 1 + to: 9999 + value: layerRepetionsSpinBoxValue + onValueChanged: { + ExGlobals.Constants.proxy.model.currentItemsRepetitions = value + } + } + } + + ExLayers.MultilayerTable{ + id: layersTable + } + + ExLayers.MultilayerRow{ + } +} \ No newline at end of file diff --git a/EasyReflectometryApp/Gui/Pages/Sample/Layers/SurfactantGroup.qml b/EasyReflectometryApp/Gui/Pages/Sample/Layers/SurfactantGroup.qml new file mode 100644 index 00000000..b33e9059 --- /dev/null +++ b/EasyReflectometryApp/Gui/Pages/Sample/Layers/SurfactantGroup.qml @@ -0,0 +1,162 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 +import QtQuick.XmlListModel 2.13 + +import easyApp.Gui.Components 1.0 as EaComponents +import easyApp.Gui.Elements 1.0 as EaElements +import easyApp.Gui.Style 1.0 as EaStyle + +import Gui.Globals 1.0 as ExGlobals + + +EaElements.GroupBox { + id: surfactantGroup + title: qsTr(ExGlobals.Constants.proxy.model.currentItemsName + " editor") + enabled: (itemsTable.model.count > 0) ? true : false //When a layer is selected + collapsible: false + last: true + + EaComponents.TableView { + id: surfactantTable + + // Table model + + model: XmlListModel { + property int layersIndex: ExGlobals.Constants.proxy.model.currentLayersIndex + 1 + + xml: ExGlobals.Constants.proxy.model.layersAsXml + query: `/root/item[${itemsTable.currentIndex + 1}]/layers/item` + + XmlRole { name: "formula"; query: "chemical_structure/string()" } + XmlRole { name: "thick"; query: "thickness/value/number()" } + XmlRole { name: "thick_enabled"; query: "thickness/enabled/string()" } + XmlRole { name: "rough"; query: "roughness/value/number()" } + XmlRole { name: "rough_enabled"; query: "roughness/enabled/string()" } + XmlRole { name: "apm"; query: "area_per_molecule/value/number()" } + XmlRole { name: "apm_enabled"; query: "area_per_molecule/enabled/string()" } + XmlRole { name: "solvation"; query: "solvation/value/number()" } + XmlRole { name: "solvation_enabled"; query: "solvation/enabled/string()" } + XmlRole { name: "solvent"; query: "solvent/name/string()"} + } + + // Table rows + + delegate: EaComponents.TableViewDelegate { + property var surfactantModel: model + + EaComponents.TableViewTextInput { + horizontalAlignment: Text.AlignHCenter + width: EaStyle.Sizes.sideBarContentWidth - (thickLabel.width + roughLabel.width + solvLabel.width + apmLabel.width + solvMatLabel.width + 6 * EaStyle.Sizes.tableColumnSpacing) + headerText: "Formula" + text: surfactantModel.formula + onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersChemStructure(text) + } + + EaComponents.TableViewTextInput { + id: thickLabel + horizontalAlignment: Text.AlignHCenter + width: EaStyle.Sizes.fontPixelSize * 5.5 + headerText: "Thickness/Å" + enabled: model.thick_enabled == "True" + text: (isNaN(surfactantModel.thick)) ? '--' : surfactantModel.thick.toFixed(2) + onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersThickness(text) + } + + EaComponents.TableViewTextInput { + id: roughLabel + horizontalAlignment: Text.AlignHCenter + width: EaStyle.Sizes.fontPixelSize * 6.0 + headerText: "Roughness/Å" + enabled: model.rough_enabled == "True" + text: (isNaN(surfactantModel.rough)) ? '--' : surfactantModel.rough.toFixed(2) + onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersRoughness(text) + } + + EaComponents.TableViewTextInput { + id: solvLabel + horizontalAlignment: Text.AlignHCenter + width: EaStyle.Sizes.fontPixelSize * 4.5 + headerText: "Solvation" + enabled: model.solvation_enabled == "True" + text: (isNaN(surfactantModel.solvation)) ? '--' : surfactantModel.solvation + onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersSolvation(text) + } + + EaComponents.TableViewTextInput { + id: apmLabel + horizontalAlignment: Text.AlignHCenter + width: EaStyle.Sizes.fontPixelSize * 4.0 + headerText: "APM/Å2" + enabled: model.apm_enabled == "True" + text: (isNaN(surfactantModel.apm)) ? '--' : surfactantModel.apm + onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentItemApm(text) + } + + EaComponents.TableViewComboBox{ + id: solvMatLabel + horizontalAlignment: Text.AlignLeft + width: EaStyle.Sizes.fontPixelSize * 6.5 + headerText: "Solvent" + onActivated: { + ExGlobals.Constants.proxy.model.setCurrentLayersSolvent(currentIndex) + } + model: ExGlobals.Constants.proxy.material.materialsName + onModelChanged: { + currentIndex = indexOfValue(surfactantModel.solvent) + } + Component.onCompleted: { + currentIndex = indexOfValue(surfactantModel.solvent) + } + } + } + + onCurrentIndexChanged: { + ExGlobals.Constants.proxy.model.currentLayersIndex = surfactantTable.currentIndex + } + + } + + EaElements.GroupBox { + spacing: EaStyle.Sizes.fontPixelSize * 0.5 + collapsible: true + collapsed: true + + title: qsTr('Chemical Constraints') + Row { + EaElements.CheckBox { + checked: false + id: apm_check + text: qsTr("Area-per-molecule") + ToolTip.text: qsTr("Checking this box will ensure that the area-per-molecule of the head and tail layers is the same") + onCheckedChanged: ExGlobals.Constants.proxy.model.constrainApm = checked + } + EaElements.CheckBox { + checked: false + id: conformal + text: qsTr("Conformal roughness") + ToolTip.text: qsTr("Checking this box will ensure that the interfacial roughness is the same for all interfaces of the surfactant") + onCheckedChanged: ExGlobals.Constants.proxy.model.conformalRoughness = checked + } + } + + Row { + EaElements.CheckBox { + checked: false + id: solvent_rough + text: qsTr("Constrain roughness to item") + enabled: conformal.checked + ToolTip.text: qsTr("Checking this box allows another item to be selected and the conformal roughness will be constrained to this") + onCheckedChanged: checked ? ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(solvent_rough_item.currentText) : ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(null) + } + EaElements.ComboBox { + id: solvent_rough_item + enabled: solvent_rough.checked + onActivated: { + ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(null) + ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(currentText) + } + model: ExGlobals.Constants.proxy.model.itemsNamesConstrain + } + } + } +} \ No newline at end of file diff --git a/EasyReflectometryApp/Gui/Pages/Sample/Layers/qmldir b/EasyReflectometryApp/Gui/Pages/Sample/Layers/qmldir new file mode 100644 index 00000000..63f11082 --- /dev/null +++ b/EasyReflectometryApp/Gui/Pages/Sample/Layers/qmldir @@ -0,0 +1,7 @@ +module Layers + +MultilayerGroup 1.0 MultilayerGroup.qml +MultilayerTable 1.0 MultilayerTable.qml +MultilayerRow 1.0 MultilayerRow.qml +RepeatingMultilayerGroup 1.0 RepeatingMultilayerGroup.qml +SurfactantGroup 1.0 SurfactantGroup.qml diff --git a/EasyReflectometryApp/Gui/Pages/Sample/SideBarBasic.qml b/EasyReflectometryApp/Gui/Pages/Sample/SideBarBasic.qml index 9ded876c..c9d42803 100644 --- a/EasyReflectometryApp/Gui/Pages/Sample/SideBarBasic.qml +++ b/EasyReflectometryApp/Gui/Pages/Sample/SideBarBasic.qml @@ -3,19 +3,17 @@ import QtQuick.Controls 2.14 import QtQuick.Dialogs 1.3 as Dialogs1 import QtQuick.XmlListModel 2.13 -import easyApp.Gui.Globals 1.0 as EaGlobals import easyApp.Gui.Style 1.0 as EaStyle import easyApp.Gui.Elements 1.0 as EaElements import easyApp.Gui.Components 1.0 as EaComponents -import easyApp.Gui.Logic 1.0 as EaLogic import Gui.Globals 1.0 as ExGlobals -import Gui.Components 1.0 as ExComponents -import Gui.Pages.Sample 1.0 as ExSample +import Gui.Pages.Sample.Layers 1.0 as ExLayers EaComponents.SideBarColumn { property string currentItemsType: 'Multi-layer' + property int layerRepetionsSpinBoxValue: 1 EaElements.GroupBox { title: qsTr("Material editor") @@ -224,7 +222,7 @@ EaComponents.SideBarColumn { onCurrentIndexChanged: { ExGlobals.Constants.proxy.model.currentModelIndex = modelTable.currentIndex itemsTable.currentIndex = 0 - layersTable.currentIndex = 0 + //layersTable.currentIndex = 0 } } Row { @@ -348,7 +346,7 @@ EaComponents.SideBarColumn { onCurrentIndexChanged: { ExGlobals.Constants.proxy.model.currentItemsIndex = itemsTable.currentIndex currentItemsType = ExGlobals.Constants.proxy.model.currentItemsType - repsSpinBox.value = ExGlobals.Constants.proxy.model.currentItemsRepetitions + layerRepetionsSpinBoxValue = ExGlobals.Constants.proxy.model.currentItemsRepetitions } onModelChanged: currentIndex = 0 @@ -416,103 +414,19 @@ EaComponents.SideBarColumn { }*/ } - EaElements.GroupBox { - // When an item in the above table is selected, this box will become enabled. - // Allowing different parameters and layers to be defined for the item. - id: layersGroup - title: qsTr(ExGlobals.Constants.proxy.model.currentItemsName + " editor") - enabled: (itemsTable.model.count > 0) ? true : false //When a layer is selected - collapsible: false - last: true - Row { - visible: (currentItemsType == 'Repeating Multi-layer') ? true : false - spacing: EaStyle.Sizes.fontPixelSize * 0.5 - - // This integer defines how many repetitions of the layer structure should be - // used. - EaComponents.TableViewLabel{ - horizontalAlignment: Text.AlignRight - width: labelWidth() * 2.1 - ToolTip.text: qsTr("To create some repeating multilayer structure") - text: qsTr("Number of repetitions:") - } - EaElements.SpinBox { - id: repsSpinBox - editable: true - from: 1 - to: 9999 - value: ExGlobals.Constants.proxy.model.currentItemsRepetitions - onValueChanged: { - ExGlobals.Constants.proxy.model.currentItemsRepetitions = value - } - } - } - ExSample.SurfactantTable{ - id: surfactantTable - visible: (currentItemsType == 'Surfactant Layer') ? true : false - } - - ExSample.SurfactantGroup{ - visible: (currentItemsType == 'Surfactant Layer') ? true : false - } - - ExSample.MultiLayerTable{ - id: layersTable - visible: (currentItemsType == 'Repeating Multi-layer') || (currentItemsType == 'Multi-layer') ? true : false - } - - Row { - visible: (currentItemsType == 'Repeating Multi-layer') || (currentItemsType == 'Multi-layer') ? true : false - spacing: EaStyle.Sizes.fontPixelSize - - EaElements.SideBarButton { - width: (EaStyle.Sizes.sideBarContentWidth - (2 * (EaStyle.Sizes.tableRowHeight + EaStyle.Sizes.fontPixelSize)) - EaStyle.Sizes.fontPixelSize) / 2 - enabled: true - fontIcon: "plus-circle" - text: qsTr("Add layer") - onClicked: ExGlobals.Constants.proxy.model.addNewLayers() - } - - EaElements.SideBarButton { - width: (EaStyle.Sizes.sideBarContentWidth - (2 * (EaStyle.Sizes.tableRowHeight + EaStyle.Sizes.fontPixelSize)) - EaStyle.Sizes.fontPixelSize) / 2 - enabled: (layersTable.model.count > 0) ? true : false //when item is selected - fontIcon: "clone" - text: qsTr("Duplicate layer") - onClicked: ExGlobals.Constants.proxy.model.duplicateSelectedLayers() - } - - EaElements.SideBarButton { - width: EaStyle.Sizes.tableRowHeight - enabled: (layersTable.model.count > 0 && layersTable.currentIndex != 0) ? true : false//When item is selected - fontIcon: "arrow-up" - ToolTip.text: qsTr("Move layer up") - onClicked: ExGlobals.Constants.proxy.model.moveSelectedLayersUp() - } - - EaElements.SideBarButton { - width: EaStyle.Sizes.tableRowHeight - enabled: (layersTable.model.count > 0 && layersTable.currentIndex + 1 != layersTable.model.count) ? true : false - fontIcon: "arrow-down" - ToolTip.text: qsTr("Move layer down") - onClicked: ExGlobals.Constants.proxy.model.moveSelectedLayersDown() - } - } - - /*Row { - spacing: EaStyle.Sizes.fontPixelSize + ExLayers.MultilayerGroup { + visible: (currentItemsType == 'Multi-layer') ? true : false + } - EaElements.SideBarButton { - // In future this button will allow the use of custom (python) components. - // This will require a flexible table structure above I think and may not be - // possible. - enabled: false //not yet implemented - fontIcon: "puzzle-piece" - text: qsTr("Add a custom component") + ExLayers.RepeatingMultilayerGroup { + visible: (currentItemsType == 'Repeating Multi-layer') ? true : false } - }*/ + ExLayers.SurfactantGroup { + visible: (currentItemsType == 'Surfactant Layer') ? true : false } + // Logic function labelWidth() { diff --git a/EasyReflectometryApp/Gui/Pages/Sample/SurfactantGroup.qml b/EasyReflectometryApp/Gui/Pages/Sample/SurfactantGroup.qml deleted file mode 100644 index a6fda6cd..00000000 --- a/EasyReflectometryApp/Gui/Pages/Sample/SurfactantGroup.qml +++ /dev/null @@ -1,53 +0,0 @@ -import QtQuick 2.14 -import QtQuick.Controls 2.14 -import QtQuick.XmlListModel 2.13 - -import easyApp.Gui.Components 1.0 as EaComponents -import easyApp.Gui.Elements 1.0 as EaElements -import easyApp.Gui.Style 1.0 as EaStyle - -import Gui.Globals 1.0 as ExGlobals - -EaElements.GroupBox { - spacing: EaStyle.Sizes.fontPixelSize * 0.5 - collapsible: true - collapsed: true - - title: qsTr('Chemical Constraints') - Row { - EaElements.CheckBox { - checked: false - id: apm_check - text: qsTr("Area-per-molecule") - ToolTip.text: qsTr("Checking this box will ensure that the area-per-molecule of the head and tail layers is the same") - onCheckedChanged: ExGlobals.Constants.proxy.model.constrainApm = checked - } - EaElements.CheckBox { - checked: false - id: conformal - text: qsTr("Conformal roughness") - ToolTip.text: qsTr("Checking this box will ensure that the interfacial roughness is the same for all interfaces of the surfactant") - onCheckedChanged: ExGlobals.Constants.proxy.model.conformalRoughness = checked - } - } - - Row { - EaElements.CheckBox { - checked: false - id: solvent_rough - text: qsTr("Constrain roughness to item") - enabled: conformal.checked - ToolTip.text: qsTr("Checking this box allows another item to be selected and the conformal roughness will be constrained to this") - onCheckedChanged: checked ? ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(solvent_rough_item.currentText) : ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(null) - } - EaElements.ComboBox { - id: solvent_rough_item - enabled: solvent_rough.checked - onActivated: { - ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(null) - ExGlobals.Constants.proxy.model.currentSurfactantSolventRoughness(currentText) - } - model: ExGlobals.Constants.proxy.model.itemsNamesConstrain - } - } -} \ No newline at end of file diff --git a/EasyReflectometryApp/Gui/Pages/Sample/SurfactantTable.qml b/EasyReflectometryApp/Gui/Pages/Sample/SurfactantTable.qml deleted file mode 100644 index 0b82ee4e..00000000 --- a/EasyReflectometryApp/Gui/Pages/Sample/SurfactantTable.qml +++ /dev/null @@ -1,108 +0,0 @@ -import QtQuick 2.14 -import QtQuick.Controls 2.14 -import QtQuick.XmlListModel 2.13 - -import easyApp.Gui.Components 1.0 as EaComponents -import easyApp.Gui.Style 1.0 as EaStyle - -import Gui.Globals 1.0 as ExGlobals - -EaComponents.TableView { - id: surfactantTable - - // Table model - - model: XmlListModel { - property int layersIndex: ExGlobals.Constants.proxy.model.currentLayersIndex + 1 - - xml: ExGlobals.Constants.proxy.model.layersAsXml - query: `/root/item[${itemsTable.currentIndex + 1}]/layers/item` - - XmlRole { name: "formula"; query: "chemical_structure/string()" } - XmlRole { name: "thick"; query: "thickness/value/number()" } - XmlRole { name: "thick_enabled"; query: "thickness/enabled/string()" } - XmlRole { name: "rough"; query: "roughness/value/number()" } - XmlRole { name: "rough_enabled"; query: "roughness/enabled/string()" } - XmlRole { name: "apm"; query: "area_per_molecule/value/number()" } - XmlRole { name: "apm_enabled"; query: "area_per_molecule/enabled/string()" } - XmlRole { name: "solvation"; query: "solvation/value/number()" } - XmlRole { name: "solvation_enabled"; query: "solvation/enabled/string()" } - XmlRole { name: "solvent"; query: "solvent/name/string()"} - } - - // Table rows - - delegate: EaComponents.TableViewDelegate { - property var surfactantModel: model - - EaComponents.TableViewTextInput { - horizontalAlignment: Text.AlignHCenter - width: EaStyle.Sizes.sideBarContentWidth - (thickLabel.width + roughLabel.width + solvLabel.width + apmLabel.width + solvMatLabel.width + 6 * EaStyle.Sizes.tableColumnSpacing) - headerText: "Formula" - text: surfactantModel.formula - onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersChemStructure(text) - } - - EaComponents.TableViewTextInput { - id: thickLabel - horizontalAlignment: Text.AlignHCenter - width: EaStyle.Sizes.fontPixelSize * 5.5 - headerText: "Thickness/Å" - enabled: model.thick_enabled == "True" - text: (isNaN(surfactantModel.thick)) ? '--' : surfactantModel.thick.toFixed(2) - onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersThickness(text) - } - - EaComponents.TableViewTextInput { - id: roughLabel - horizontalAlignment: Text.AlignHCenter - width: EaStyle.Sizes.fontPixelSize * 6.0 - headerText: "Roughness/Å" - enabled: model.rough_enabled == "True" - text: (isNaN(surfactantModel.rough)) ? '--' : surfactantModel.rough.toFixed(2) - onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersRoughness(text) - } - - EaComponents.TableViewTextInput { - id: solvLabel - horizontalAlignment: Text.AlignHCenter - width: EaStyle.Sizes.fontPixelSize * 4.5 - headerText: "Solvation" - enabled: model.solvation_enabled == "True" - text: (isNaN(surfactantModel.solvation)) ? '--' : surfactantModel.solvation - onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentLayersSolvation(text) - } - - EaComponents.TableViewTextInput { - id: apmLabel - horizontalAlignment: Text.AlignHCenter - width: EaStyle.Sizes.fontPixelSize * 4.0 - headerText: "APM/Å2" - enabled: model.apm_enabled == "True" - text: (isNaN(surfactantModel.apm)) ? '--' : surfactantModel.apm - onEditingFinished: ExGlobals.Constants.proxy.model.setCurrentItemApm(text) - } - - EaComponents.TableViewComboBox{ - id: solvMatLabel - horizontalAlignment: Text.AlignLeft - width: EaStyle.Sizes.fontPixelSize * 6.5 - headerText: "Solvent" - onActivated: { - ExGlobals.Constants.proxy.model.setCurrentLayersSolvent(currentIndex) - } - model: ExGlobals.Constants.proxy.material.materialsName - onModelChanged: { - currentIndex = indexOfValue(surfactantModel.solvent) - } - Component.onCompleted: { - currentIndex = indexOfValue(surfactantModel.solvent) - } - } - } - - onCurrentIndexChanged: { - ExGlobals.Constants.proxy.model.currentLayersIndex = surfactantTable.currentIndex - } - -} \ No newline at end of file diff --git a/EasyReflectometryApp/Gui/Pages/Sample/qmldir b/EasyReflectometryApp/Gui/Pages/Sample/qmldir index e21be421..969175d1 100644 --- a/EasyReflectometryApp/Gui/Pages/Sample/qmldir +++ b/EasyReflectometryApp/Gui/Pages/Sample/qmldir @@ -4,6 +4,3 @@ MainContentModelView 1.0 MainContentModelView.qml SideBarAdvanced 1.0 SideBarAdvanced.qml SideBarBasic 1.0 SideBarBasic.qml -MultiLayerTable 1.0 MultiLayerTable.qml -SurfactantTable 1.0 SurfactantTable.qml -SurfactantGroup 1.0 SurfactantGroup.qml \ No newline at end of file