summaryrefstree
path: root/usr/bin/qml/Diag/DiagUpdate/Diag_SOCUPDATE.qml
blob: d52a830a707e6e14f13de11492d37c905babca0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import QtQuick 2.0
import Label 2.0
import "../../com/neusoft/auto/widgets"
import "../../layoutList.js" as Layout
import "../../windowsList.js" as WindowsList
import "../"

HMIMask
{
    id:socUpdateWindow
    widowsType: Layout.POP_TYPE//FOD #139403 2016/12/23 BAOJINFENG
    formId: WindowsList.DIAG_SOCUPDATE//FOD #139403 2016/12/23 BAOJINFENG
    mask_height:1280//FOD #139403 2016/12/23 BAOJINFENG

    property string bgImageStyle: systemCtrl.style

    property string mcuUpdateVersion:diagCtrl.sUpdateMCUVersion
    property string socUpdateVersion:diagCtrl.sUpdateSOCVersion
    property int bBtStatus: diagCtrl.bBtStatus//add #127989 20170116 liuming end
    Component.onCompleted:
    {
        visible:true
    }
    visible:false

    onVisibleChanged:
    {
        if (socUpdateWindow.visible == true)
        {
            updMcuDialog.isBottomBtn = true
        }
        else
        {

        }
    }

    //MCU SOC update dialog
    DiagDialog
    {
        y: 0
        id:updMcuDialog
        visible: true
        onVisibleChanged:
        {
            if(updMcuDialog.visible == true)
            {
                centerTitleColor = "red"
            }
            else
            {

            }
        }

        isCenterTitle:true
        isBottomBtn:true
        centerTitle:qsTr("Confirm to update?")
        //update by zlx 201/12/18 #315588 begin
        bottomLeftBtnText:qsTr("Update")//("Yes")
        bottomRightBtnText:qsTr("Cancel")//("No")
        //update by zlx 201/12/18 #315588 end
        HMILabel
        {
            id:textUpdSOCDialog1
            x: 160
            y: 405
            width: 842
            height: 40
            font.pixelSize:24
            horizontalAlignment: Label.AlignLeft
            text:"MCU Ver:" + mcuUpdateVersion
            color: "white"
        }
        HMILabel
        {
            id:textUpdSOCDialog2
            x: 160
            y: 480
            width: 640
            height: 40
            font.pixelSize: 24
            horizontalAlignment: Label.AlignLeft
            text:"SOC Ver:" + socUpdateVersion
            color: "white"
        }
        onLeftButtonClick:
        {
            //update by zlx 2018/12/29 #315935 begin
            if( 1 == USBControl1.getUsbConnectState())
            {
                //ADD  by lishunan for #318553 start
                USBControl1.usbPpmSavePtime()
                //ADD  by lishunan for #318553 end
                systemCtrl.setStateMaskHardkey(Layout.HK_MASK_STATE_UPDATE,Layout.HK_MASK_ON) //add by zhangna for qc bug #168982
                //add #127989 20170120 liuming begin
                if(bBtStatus == 1)
                {
                 btCtrl.setBtPowerOffForSleep();
                }
                else
                {
                    //
                }
                //add #127989 20170120 liuming end
                updMcuDialog.centerTitle = qsTr("Restarting...")
                updMcuDialog.isBottomBtn = false
                textUpdSOCDialog1.visible = false
                textUpdSOCDialog2.visible = false
                diagCtrl.reqStartUpdateSOCMCU()
                settingCtrl.setSocMcuUpdateFlag(1)//ADD #168534 #168208 2017/4/26 baojinfeng begin
            }
            else
            {
                ScreenManager.hideOverlay(WindowsList.DIAG_SOCUPDATE)
            }
            //update by zlx 2018/12/29 #315935 end
        }
        onRightButtonClick:
        {
            ScreenManager.hideOverlay(WindowsList.DIAG_SOCUPDATE)
        }
    }
    //update by zlx 2018/12/29 #315935 begin
    Connections
    {
        target: USBControl1
        onUsbDisconnect:
        {
            ScreenManager.hideOverlay(WindowsList.DIAG_SOCUPDATE)
        }
    }
    //update by zlx 2018/12/29 #315935 end
}