5import QtQuick.Window 2.2
7import "../constants" 1.0
8import QtQuick.Layouts 1.2
9import QtQuick.Controls 2.0
13 title: devicesPage.deviceName + " - " + tabBar.currentItem.text
15 property string deviceName
16 property ImagePreview imagePreview: null
29 imgSource:
"../images/left-arrow.png"
32 if(!tabBar.contentItem.atXBeginning) {
46 imgSource:
"../images/right-arrow.png"
49 if(!tabBar.contentItem.atXEnd) {
65 Layout.fillHeight:
true
72 Component.onCompleted: {
73 contentItem.flickDeceleration = 1000
76 background: Rectangle {
77 color: Num.sysPalette.base
84 Layout.fillHeight:
true
85 Layout.fillWidth:
true
86 currentIndex: tabBar.currentIndex
89 property var groups: []
93 onCurrentIndexChanged: {
94 tabBar.currentIndex = currentIndex
100 if(devicesPage.deviceName === deviceName) {
101 if(deviceSwipeView.groups.indexOf(groupName) == -1) {
102 deviceSwipeView.groups.push(groupName)
103 var newTabComp =
Qt.createComponent(
"../modules/KSTab.qml");
104 var newTab = newTabComp.createObject(deviceSwipeView)
105 newTab.title = groupName
107 var columnForTab =
Qt.createQmlObject(
'import QtQuick 2.7
108 import QtQuick.Layouts 1.3
111 }', newTab.contentItem)
113 newTab.rootItem = columnForTab
114 var tabButton =
Qt.createQmlObject(
'import QtQuick 2.7;
115 import QtQuick.Controls 2.0
119 tabButton.text = groupName
120 if(tabBar.count == 1) {
122 tabBar.currentItemChanged()
125 deviceSwipeView.tabs.push(newTab)
126 if(groupName ==
"Motion Control") {
127 var component =
Qt.createComponent(
"modules/MotionControl.qml");
128 var motionControl = component.createObject(newTab)
129 motionControl.deviceName = deviceName
133 if(groupName !=
"Motion Control") {
134 for(var i = 0; i < deviceSwipeView.tabs.length; ++i) {
135 var tab = deviceSwipeView.tabs[i]
136 if(tab.title === groupName) {
137 var propComp =
Qt.createComponent(
"modules/Property.qml");
138 var
property = propComp.createObject(tab.rootItem)
139 property.propName = propName
140 property.label =
label
141 property.deviceName = deviceName
142 property.parentTab = tab
143 if(propName ==
"CCD_EXPOSURE" && devicesPage.imagePreview == null) {
144 var imgPreviewComp =
Qt.createComponent(
"ImagePreview.qml");
145 devicesPage.imagePreview = imgPreviewComp.createObject(window)
146 devicesPage.imagePreview.deviceName = devicesPage.deviceName
154 onRemoveINDIProperty: {
155 for(var i = 0; i < deviceSwipeView.tabs.length; ++i) {
156 var tab = deviceSwipeView.tabs[i]
157 if(tab.title === groupName && groupName !=
"Motion Control") {
158 var contentItem = deviceSwipeView.tabs[i].rootItem
159 for(var c = 0; c < contentItem.children.length; ++c) {
160 if(contentItem.children[c].propName === propName) {
161 contentItem.children[c].destroy()
164 if(contentItem.children.length == 0) {
165 var groups = deviceSwipeView.groups
166 groups.splice(groups.indexOf(groupName), 1)
QString label(StandardShortcut id)
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)