2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
4 * Copyright (c) 2017, 2018 TOYOTA MOTOR CORPORATION
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 import QtQuick.Layouts 1.1
28 property date now: new Date
30 interval: 100; running: true; repeat: true;
31 onTriggered: root.now = new Date
40 if (condition.indexOf("clouds") != -1) {
41 icon = "WeatherIcons_Cloudy-01.png"
42 } else if (condition.indexOf("thunderstorm") != -1) {
43 icon = "WeatherIcons_Thunderstorm-01.png"
44 } else if (condition.indexOf("snow") != -1) {
45 icon = "WeatherIcons_Snow-01.png"
46 } else if (condition.indexOf("rain") != -1) {
47 icon = "WeatherIcons_Rain-01.png"
50 condition_item.source = icon ? './images/Weather/' + icon : ''
53 onTemperatureChanged: {
54 temperature_item.text = temperature.split(".")[0] + '°F'
62 Layout.fillWidth: true
63 Layout.fillHeight: true
64 Layout.preferredWidth: 295 - 76
70 Layout.fillWidth: true
71 Layout.fillHeight: true
72 text: Qt.formatDate(now, 'dddd').toUpperCase()
76 verticalAlignment: Text.AlignVCenter
78 // anchors.fill: parent
81 // border.color: 'blue'
87 Layout.fillWidth: true
88 Layout.fillHeight: true
89 text: Qt.formatTime(now, 'h:mm ap').toUpperCase()
93 horizontalAlignment: Text.AlignHCenter
94 verticalAlignment: Text.AlignVCenter
97 Layout.fillWidth: true
98 Layout.fillHeight: true
99 Layout.preferredHeight: 20
102 source: './images/Weather/WeatherIcons_Rain-01.png'
108 font.family: 'Helvetica'
116 Layout.fillWidth: true
117 Layout.fillHeight: true
118 Layout.preferredWidth: 76
123 Layout.preferredWidth: 77
124 Layout.preferredHeight: 73
125 source: connStatus ? './images/Status/HMI_Status_Bluetooth_On-01.png' : './images/Status/HMI_Status_Bluetooth_Inactive-01.png'
126 fillMode: Image.PreserveAspectFit
127 property string deviceName: "none"
128 property bool connStatus: false
132 //{"event":"Bluetooth-Manager\/connection","data":{"Status":"connected","Address":"88:BD:45:EC:3A:E6"},"jtype":"afb-event"}
133 //{"event":"Bluetooth-Manager\/connection","data":{"Status":"disconnected","Address":"88:BD:45:EC:3A:E6"},"jtype":"afb-event"}
135 // console.log("bluetooth connection is:", data.Status)
136 // console.log("onConnectionEvent bt_icon.deviceName:",bt_icon.deviceName, "bt_icon.connStatus:", bt_icon.connStatus)
137 if (data.Status == "connected"){
138 bt_icon.connStatus = true
139 } else if (data.Status == "disconnected"){
140 bt_icon.connStatus = false
143 //{"event":"Bluetooth-Manager\/device_updated","data":{"Address":"88:BD:45:EC:3A:E6","Name":"SG02","Paired":"True","Connected":"True","AVPConnected":"True","Metadata":{"Title":"","Artist":"","Status":"stop}
144 onDeviceUpdatedEvent: {
145 // console.log("bluetooth onDeviceUpdatedEvent date is:", data.Name, "Paired: ", data.Paired, "Connected: ", data.Connected)
146 // console.log("onDeviceUpdatedEvent bt_icon.deviceName:",bt_icon.deviceName, "bt_icon.connStatus:", bt_icon.connStatus)
147 if ( data.Paired == "True" && data.Connected == "True" ){
148 bt_icon.deviceName = data.Name
149 bt_icon.connStatus = true
151 if(bt_icon.deviceName == data.Name)
153 bt_icon.connStatus = false
160 model: StatusBarModel { objectName: "statusBar" }
162 Layout.preferredWidth: 77
163 Layout.preferredHeight: 73
164 source: model.modelData
165 fillMode: Image.PreserveAspectFit