import QtQuick 2.3
import QtQuick.Layouts 1.1
Core {
id: container
/*
* Pojedyńcza instancja MapperIO dla statusu (wartość 0 i 1).
* Aktualny stan graficzny z opisem, nastawialny tryb, nastawialny stan w trybie manualnym
*/
/*
* Property do ustawienia przy tworzeniu
*/
property string prop_title: "" // nagłówek parametru
property int prop_index_output_value : -1 // index parametru output.value
property int prop_index_setting_mode : -1 // index parametru setting.mode
property int prop_index_setting_manual_value : -1 // index parametru setting.manual.value
property string prop_symbol_on: "arrow_red.svg" // symbol - stan 1
property string prop_symbol_off: "arrow_blue.svg" // symbol - stan 0
property string prop_symbol_width: "44" // szerokość symbolu
property string prop_symbol_height: "64" // wysokość symbolu
property string prop_text_on: "Otwarty" // tekst dla stanu 1
property string prop_text_off: "Zamknięty" // tekst dla stanu 0
/*
* Property prywatne pozostałe
*/
property int prv_initialized : 0 // kontrolka została zainicjalizowana
property int prv_offset : 8 //
Layout.fillWidth: true
Layout.minimumWidth: 150
Layout.maximumWidth: 600
Layout.fillHeight: true
Layout.minimumHeight: 100
Layout.maximumHeight: 250
Layout.alignment: Qt.AlignHCenter
width: 100
height: 300
color: "#00000000"
Component.onCompleted: {
if (!prv_initialized) {
valueChanged.connect(menuChanged);
prv_initialized = 1;
}
}
Item {
id: itm_group
x: 0
y: 0
width: parent.width
height: parent.height
Rectangle {
id: rec_background
x: 0
y: 10
width: parent.width
height: parent.height - y
color: "lightgray"
border.color: "gray"
radius: 5
opacity: 1
}
Item {
id: itm_title
x: 20
y: 0
width: parent.width - 40
height: 20
Rectangle {
x: 0
y: 0
width: parent.width
height: parent.height
color: "lightgray"
border.color: "gray"
opacity: 1
}
Text {
id: txt_title
x: 10
y: 0
width: parent.width - 20
height: parent.height
color: "#6e6e6e"
text: prop_title
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.family: "Mukti Narrow"
font.strikeout: false
font.bold: false
font.italic: false
fontSizeMode : Text.Fit
minimumPixelSize: 10
font.pixelSize: 0.8 * parent.height
}
}
C_graphic_status_view_02 {
id: param_value
x: prv_offset
y: 15 + prv_offset
width: parent.width - 2 * prv_offset
height: 100
prop_title: "Stan"
prop_index: prop_index_output_value
prop_p_0 : prop_symbol_on + ";" + prop_symbol_off + ";" + prop_symbol_width + ";" + prop_symbol_height + ";" + prop_text_on + ";" + prop_text_off
}
C_combo_set_01 {
id: param_mode
x: prv_offset
y: param_value.y + param_value.height + prv_offset
width: parent.width - 2 * prv_offset
height: 100
prop_title: "Tryb"
prop_index: prop_index_setting_mode
prop_p_0 : "AUTO|Ręczny;0|1"
}
C_combo_set_01 {
id: param_manual_value
x: prv_offset
y: param_mode.y + param_mode.height + prv_offset
width: parent.width - 2 * prv_offset
height: 100
prop_title: "Stan w trybie ręcznym"
prop_index: prop_index_setting_manual_value
prop_p_0 : prop_text_off + "|" + prop_text_on + ";0|1"
}
}
}