2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 import QtQuick.Layouts 1.1
27 property date now: new Date
29 interval: 100; running: true; repeat: true;
30 onTriggered: root.now = new Date
39 if (condition.indexOf("clouds") != -1) {
40 icon = "WeatherIcons_Cloudy-01.png"
41 } else if (condition.indexOf("thunderstorm") != -1) {
42 icon = "WeatherIcons_Thunderstorm-01.png"
43 } else if (condition.indexOf("snow") != -1) {
44 icon = "WeatherIcons_Snow-01.png"
45 } else if (condition.indexOf("rain") != -1) {
46 icon = "WeatherIcons_Rain-01.png"
49 condition_item.source = icon ? './images/Weather/' + icon : ''
52 onTemperatureChanged: {
53 temperature_item.text = temperature.split(".")[0] + '°F'
61 Layout.fillWidth: true
62 Layout.fillHeight: true
63 Layout.preferredWidth: 295 - 76
69 Layout.fillWidth: true
70 Layout.fillHeight: true
71 text: Qt.formatDate(now, 'dddd').toUpperCase()
75 verticalAlignment: Text.AlignVCenter
77 // anchors.fill: parent
80 // border.color: 'blue'
86 Layout.fillWidth: true
87 Layout.fillHeight: true
88 text: Qt.formatTime(now, 'h:mm ap').toUpperCase()
92 horizontalAlignment: Text.AlignHCenter
93 verticalAlignment: Text.AlignVCenter
96 Layout.fillWidth: true
97 Layout.fillHeight: true
98 Layout.preferredHeight: 20
101 source: './images/Weather/WeatherIcons_Rain-01.png'
107 font.family: 'Helvetica'
115 Layout.fillWidth: true
116 Layout.fillHeight: true
117 Layout.preferredWidth: 76
120 Layout.preferredWidth: 77
121 Layout.preferredHeight: 55
126 Layout.preferredWidth: 77
127 Layout.preferredHeight: 55
128 source: connStatus ? './images/Status/HMI_Status_Bluetooth_On-01.png' : './images/Status/HMI_Status_Bluetooth_Inactive-01.png'
129 fillMode: Image.PreserveAspectFit
130 property string deviceName: "none"
131 property bool connStatus: false
135 console.log("onConnectionEvent", data.Status)
136 if (data.Status === "connected") {
137 bt_icon.connStatus = true
138 } else if (data.Status === "disconnected") {
139 bt_icon.connStatus = false
142 onDeviceUpdateEvent: {
143 console.log("onConnectionEvent", data.Paired)
144 if (data.Paired === "True" && data.Connected === "True") {
145 bt_icon.deviceName = data.name
146 bt_icon.connStatus = true
148 if(bt_icon.deviceName === data.Name)
150 bt_icon.connStatus = false
158 model: StatusBarModel { objectName: "statusBar" }
160 Layout.preferredWidth: 77
161 Layout.preferredHeight: 55
162 source: model.modelData
163 fillMode: Image.PreserveAspectFit