aboutsummaryrefslogtreecommitdiffstats
path: root/GUIModel/ShiftPosition/ShiftPosition.qml
blob: 9d32a777530dd60d3e993c1c90f194d7de286b99 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
/*
 * Copyright (c) 2020,2021 Panasonic Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

import QtQuick 2.14

Item {
    id: shift
    property int shiftId  : 0
    property Image mId

    onShiftIdChanged: {
        idchange()
    }

    Connections{
        target: rootItem
        onTransNormalToAdas:{
            normalToAdasAnimationShift.start()
        }

        onTransAdasToMap:{
            /**/
        }

        onTransMapToNormal:{
            mapToNormalAnimationShift.start()
        }
    }

    function idchange(){

        shiftL.width = 126
        shiftN.width = 126
        shiftR.width = 126
        shiftP.width = 126
        shiftD.width = 126
        shiftL.height = 136
        shiftN.height = 136
        shiftR.height = 136
        shiftP.height = 136
        shiftD.height = 136

        if(shftTimer.running){
            shftTimer.stop()
        }

        switch(shiftId){
        case(1):
            mId = shiftD
            shiftL.visible = false
            shiftN.visible = false
            shiftR.visible = false
            shiftP.visible = false
            shiftD.visible = true
            break
        case(2):
            mId = shiftL
            shiftD.visible = false
            shiftN.visible = false
            shiftR.visible = false
            shiftP.visible = false
            shiftL.visible = true
            break
        case(3):
            mId = shiftN
            shiftD.visible = false
            shiftL.visible = false
            shiftR.visible = false
            shiftP.visible = false
            shiftN.visible = true
            break
        case(4):
            mId = shiftR
            shiftD.visible = false
            shiftL.visible = false
            shiftN.visible = false
            shiftP.visible = false
            shiftR.visible = true
            break
        case(5):
            mId = shiftP
            shiftD.visible = false
            shiftL.visible = false
            shiftN.visible = false
            shiftR.visible = false
            shiftP.visible = true
            break
        default:
            //mId = 0
            shiftD.visible = false
            shiftL.visible = false
            shiftN.visible = false
            shiftR.visible = false
            shiftP.visible = false
            break
        }
        shftTimer.start()
    }

    Timer {
        id:shftTimer
        interval: 300
        repeat: false
        running: false
        onTriggered: {
            shiftAnimScale.start()
        }
    }




/***********shiftParts************/
    Item{
        id: shiftParts
        x:356
        y:156
        width:126
        height:136
        Image{
          id: shiftD
          source: "qrc:/Images/NormalView/SHIFT/shift-d.png"
          width:126
          height:136
          visible: false
          anchors.centerIn: parent
        }
        Image{
          id: shiftL
          source: "qrc:/Images/NormalView/SHIFT/shift-l.png"
          width:126
          height:136
          visible: false
          anchors.centerIn: parent
        }
        Image{
          id: shiftN
          source: "qrc:/Images/NormalView/SHIFT/shift-n.png"
          width:126
          height:136
          visible: false
          anchors.centerIn: parent
        }
        Image{
          id: shiftR
          source: "qrc:/Images/NormalView/SHIFT/shift-r.png"
          width:126
          height:136
          visible: false
          anchors.centerIn: parent
        }
        Image{
          id: shiftP
          source: "qrc:/Images/NormalView/SHIFT/shift-p.png"
          width:126
          height:136
          visible: false
          anchors.centerIn: parent
        }

        SequentialAnimation{
            id:normalToAdasAnimationShift
            onStarted: rootItem.focus=false
            PauseAnimation{
                duration: 330
            }

            PathAnimation{
                target: shiftParts
                duration: 891
                easing.type: Easing.InOutSine

                path:Path {
                    startX: 356; startY: 156
                    PathArc {
                        x: 157; y: 336
                        radiusX: 180; radiusY: 180
                        direction: PathArc.Counterclockwise
                    }
                }
            }
        }

/*****************shit_animation******************/
        SequentialAnimation{
            id:mapToNormalAnimationShift
            onStarted: rootItem.focus=false
            PauseAnimation{
                duration:254 + 330
            }

            PathAnimation{
                target: shiftParts
                duration: 891
                easing.type: Easing.InOutSine

                path:Path {
                    startX: 157; startY: 336
                    PathArc {
                        x: 356; y: 156
                        radiusX: 180; radiusY: 180
                        direction: PathArc.Clockwise
                    }
                }
            }

        }

    }

    ParallelAnimation{
        id: shiftAnimScale
        PropertyAnimation {
            target: mId
            properties: "width"
            duration: 40
            easing.type: Easing.Linear
            to: 90.0
        }
        PropertyAnimation {
            target: mId
            properties: "height"
            duration: 40
            easing.type: Easing.Linear
            to: 97.0
        }
    }
}