aboutsummaryrefslogtreecommitdiffstats
path: root/GUIModel/ShiftPosition/ShiftPosition.qml
blob: 33e43026104fd5e2fc9b5ebb5c32ae9ffea7b30b (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
/*
 * Copyright 2020,2021 Panasonic Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import QtQuick 2.14

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

    onShiftIdChanged: {
        idchange()
    }

    Connections{
        target: rootItem
        onTransNormalToAdas:{
            normalToAdasAnimationShift.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
        }
    }
}