blob: b1f930f59c237f8032fb5c2d838c5c3c5c74261d (
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
|
/*
* =====================================================================================
*
* Filename: ALCSlider.qml
*
* Description:
*
* Version: 1.0
* Created: 2014-05-08
* Revision: none
* Compiler: gcc
*
* Author: zhou-hb@neusoft.com
* Organization: www.neusoft.com
*
* =====================================================================================
*/
import QtQuick 2.0
import "./"
import "../com/neusoft/auto/widgets"
Item
{
id: rectdrag
property int value: 0
property int xPosition:(barPoint.x)/add - value//(org + ((barPoint.x-barPoint.x%add)/add+((barPoint.x%add)/add>0.5?1:0)) * 0.2)
property int yPosition:(-((barPoint.y)/add_y - value))//(org + ((barPoint.x-barPoint.x%add)/add+((barPoint.x%add)/add>0.5?1:0)) * 0.2)
property int enterValue
property string bgImageStyle: systemCtrl.style
onEnterValueChanged:
{
barPoint.x = enterValue
}
property int enterValue_y
onEnterValue_yChanged:
{
barPoint.y = enterValue_y
}
property int exportValue: barPoint.x
property int exportValue_Y: barPoint.y
//property alias imagebarBackgroundMiddleSource: image_background_Middle.source
property alias barBackgroundMiddle_X: barBackground_Middle.x
property alias barBackgroundMiddle_Y: barBackground_Middle.y
property alias barBackgroundMiddle_H: barBackground_Middle.height
property alias barBackgroundMiddle_W: barBackground_Middle.width
property alias barPoint_X: barPoint.x
property alias barPoint_Y: barPoint.y
property alias barPoint_H: barPoint.height
property alias barPoint_W: barPoint.width
property alias barPointSource: barPoint.source
property int barBackgroundMiddle_space: 0 //grid space
property double add : (maxDrag / sliderpartnum) //slider'unit of distance
property double add_y : (maxDrag_y / sliderpartnum) //slider'unit of distance
property int sliderpartnum: 14
property int minDrag: (0)
property int minDrag_y: (0)
property int maxDrag: image_background_Middle.width
property int maxDrag_y: image_background_Middle.height
property alias barBackgroundMiddlemouse:barBackground_Middlemouse.opacity
property int barPointX_backup: 0 //backup barPointX
property int barPointY_backup: 0 //backup barPointX
//add by y-xue for ST_Bug #ST_Bug #153531
property int barPointX_onpressed_value: 0 //onPressed barPoint.x
property int barPointY_onpressed_value: 0 //onPressed barPoint.y
//add by y-xue for ST_Bug #ST_Bug #153531
signal clickSlider_x();
signal clickSlider_y();
signal dragBarPoint();
width: barBackground_Middle.width//+/*bar_left.width+bar_right.width + */barPoint.width
height: barBackground_Middle.height//+/*bar_up.height+bar_down.height + */barPoint.height
/*Up button*/
HMIButton
{
id:barPointUp_btn
x:453// 456
//FOD F0056 2016/10/24 liuming begin
//y: 316
y:311//326
//FOD F0056 2016/10/24 liuming end
width: 54//48
height:52// 45
btnImg: pressed?"qrc:MATERIAL/MATERIAL_ARROW_U_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_ARROW_U"+bgImageStyle
onClicked:
{
if(yPosition <7 )
{
barPoint.y = barPoint.y - add_y
barPointY_backup = barPoint.y
clickSlider_y();
}
}
}
/*Down button*/
HMIButton
{
id:barPointDown_btn
x: 453//456
//FOD F0056 2016/10/24 liuming begin
//y: 623
y: 617//633
//FOD F0056 2016/10/24 liuming end
width: 54//48
height:52// 45
btnImg: pressed?"qrc:MATERIAL/MATERIAL_ARROW_D_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_ARROW_D"+bgImageStyle
onClicked:
{
if(yPosition > -7 )
{
barPoint.y = barPoint.y + add_y
barPointY_backup = barPoint.y
clickSlider_y();
}
}
}
/*Left button*/
HMIButton
{
id:barPointLeft_btn
x: 301//304
//FOD F0056 2016/10/24 liuming begin
//y: 469
y:463//478
//FOD F0056 2016/10/24 liuming end
width: 52//45
height: 54//48
btnImg: pressed?"qrc:MATERIAL/MATERIAL_ARROW_L_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_ARROW_L"+bgImageStyle
onClicked:
{
if(xPosition > -7 )
{
barPoint.x = barPoint.x - add
barPointX_backup = barPoint.x;
clickSlider_x();
}
}
}
/*Right button*/
HMIButton
{
id:barPointRight_btn
x: 607//611
//FOD F0056 2016/10/24 liuming begin
//y: 469
y:463//478
//FOD F0056 2016/10/24 liuming end
width: 52//45
height: 54//48
btnImg: pressed?"qrc:MATERIAL/MATERIAL_ARROW_R_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_ARROW_R"+bgImageStyle
onClicked:
{
if(xPosition < 7 )
{
barPoint.x = barPoint.x + add
barPointX_backup = barPoint.x;
//add by plc
clickSlider_x();
}
}
}
/*Frame*/
Item
{
id:barBackground_Middle
x:351//298//-barPoint.width / 2
//FOD F0056 2016/10/24 liuming begin
//y: 358//-barPoint.height / 2
y:358//368
//FOD F0056 2016/10/24 liuming begin
//FOD #137680 2016/12/21 baojinfeng begin
width:265//(image_background_Middle.width + barPoint.width)
height:265//(image_background_Middle.height + barPoint.height)
//FOD #137680 2016/12/21 baojinfeng end
opacity: 1
Item
{
id:image_background_Middle
//FOD #F0182 2017/02/03 baojinfeng begin
x:44//41//barPoint.width / 2
y:44//41//barPoint.height / 2
width: 170//186//268-82
height:172//186//268-82
//FOD #F0182 2017/02/03 baojinfeng end
//source: "qrc:MATERIAL/MATERIAL_M8X_SOUND-FRAME"+bgImageStyle
//anchors.verticalCenter: parent.verticalCenter
//anchors.horizontalCenter: parent.horizontalCenter
HMIMouseArea
{
id:barBackground_Middlemouse
anchors.fill: parent
onClicked:
{
//FOD #137680 2016/12/21 baojinfeng begin
if(mouseX<0)
{
barPoint.x=0
}
else if(mouseX>image_background_Middle.width)
{
barPoint.x=image_background_Middle.width
}
else
{
barPoint.x=add*((mouseX-mouseX%add)/add+((mouseX%add)/add>0.5?1:0)) //- barPoint.width / 2// + barBackgroundMiddle_space/2
}
if(mouseY<0)
{
barPoint.y=0
}
else if(mouseY>image_background_Middle.height)
{
barPoint.y=image_background_Middle.height
}
else
{
barPoint.y=add_y*((mouseY-mouseY%add_y)/add_y+((mouseY%add_y)/add_y>0.5?1:0)) //- barPoint.height / 2// + barBackgroundMiddle_space/2
}
//FOD #137680 2016/12/21 baojinfeng end
barPointX_backup = barPoint.x;
barPointY_backup = barPoint.y;
clickSlider_x();
clickSlider_y();
}
onReleased:
{
}
}
}
/* barPoint Image*/
Image
{
id:barPoint
x:84//436//439//93//439-346
//FOD F0056 2016/10/24 liuming begin
//y:451//93//451-358
y:86//446//461
//FOD F0056 2016/10/24 liuming begin
width: 88//82
height: 88//82
source: (barPoint_mouseArea.pressed||barPointUp_btn.pressed||barPointDown_btn.pressed||barPointRight_btn.pressed||barPointLeft_btn.pressed)?"qrc:MATERIAL/MATERIAL_SOUND-ICON_P"+bgImageStyle:"qrc:MATERIAL/MATERIAL_SOUND-ICON"+bgImageStyle//FOD H0017 2016/11/10 baojinfeng begin
// anchors.horizontalCenter: parent.horizontalCenter
// anchors.verticalCenter: parent.verticalCenter
}
//ADD #H0017 2016/11/02 baojinfeng Begin
HMIMouseArea
{
id:barPoint_mouseArea
//FOD F0056 2016/11/04 liuming begin
//FOD #137680 2016/12/21 baojinfeng begin
x: 0//barPoint.width / 2
y: 0//barPoint.height / 2
//FOD #137680 2016/12/21 baojinfeng end
//FOD F0056 2016/11/04 liuming begin
enabled: true
anchors.rightMargin: 0
anchors.bottomMargin: 0
anchors.leftMargin: 0
anchors.topMargin: 0
//FOD #137680 2016/12/21 baojinfeng begin
width:258//268//- barPoint.width / 2//FOD H0017 2016/11/10 baojinfeng begin
height: 256//268// - barPoint.height / 2//FOD H0017 2016/11/10 baojinfeng begin
//FOD #137680 2016/12/21 baojinfeng end
//anchors.fill: image_background_Middle//parent
drag.target: barPoint
drag.axis: Drag.XAndYAxis
drag.minimumX: 0//-barPoint.width/2
drag.maximumX: 170//227//image_background_Middle.width+41//-barPoint.width/2//FOD #F0182 2017/02/03 baojinfeng begin
drag.minimumY: 0//ADD #147502 2017/2/14 baojinfeng End
drag.maximumY: 172//227//ADD #147502 2017/2/14 baojinfeng End
onMouseXChanged:
{
if((mouseX > 41) && (mouseX <(image_background_Middle.width+41)))//FOD #137680 2016/12/21 baojinfeng
{
barPoint.x=add*(((mouseX-41)-(mouseX-41)%add)/add+(((mouseX-41)%add)/add>0.5?1:0)) //- barPoint.width / 2// + barBackgroundMiddle_space/2 //FOD #137680 2016/12/21 baojinfeng
}
else if(mouseX <= 41)//FOD #137680 2016/12/21 baojinfeng
{
barPoint.x = 0//-barPoint.width/2
}
else if(mouseX >= (image_background_Middle.width+41))//FOD #137680 2016/12/21 baojinfeng
{
barPoint.x = image_background_Middle.width// - barPoint.width/2
}
else
{
//do nothing
}
}
onMouseYChanged:
{
if((mouseY > 41) && (mouseY <(image_background_Middle.height+41)))//FOD #137680 2016/12/21 baojinfeng
{
barPoint.y=add_y*(((mouseY-41)-(mouseY-41)%add_y)/add_y+(((mouseY-41)%add_y)/add_y>0.5?1:0)) //- barPoint.height / 2// + barBackgroundMiddle_space/2 //FOD #137680 2016/12/21 baojinfeng
}
else if(mouseY <= 41) //FOD #137680 2016/12/21 baojinfeng begin
{
barPoint.y = 0//-barPoint.width/2
}
else if(mouseY >= (image_background_Middle.height+41))
{
barPoint.y = image_background_Middle.height// - barPoint.width/2
}
else
{
//do nothing
}
}
onReleased:
{
if (((barPoint.x >= 0) && (barPoint.x <=image_background_Middle.width))&&((barPoint.y >= 0) && (barPoint.y <=image_background_Middle.height))&&(barPointX_backup != barPoint.x||barPointY_backup != barPoint.y)) //fod #147502 2017/2/14 baojinfeng End
{
barPointX_backup = barPoint.x;
barPointY_backup = barPoint.y;
clickSlider_x();
clickSlider_y();
}
else
{
//do nothing
}
}
onPressed:
{
//add by y-xue for ST_Bug #ST_Bug #153531
barPointX_onpressed_value = barPoint.x;
barPointY_onpressed_value = barPoint.y;
//console.log("onPressed--->barPointX_onpressed_value-->" + barPoint.x)
//console.log("onPressed--->barPointY_onpressed_value-->" + barPoint.y)
//add by y-xue for ST_Bug #ST_Bug #153531
}
onCanceled:
{
//add by y-xue for ST_Bug #ST_Bug #153531
if (((barPoint.x >= 0) && (barPoint.x <=image_background_Middle.width))&&((barPoint.y >= 0) && (barPoint.y <=image_background_Middle.height))&&(barPointX_backup != barPoint.x||barPointY_backup != barPoint.y)) //fod #147502 2017/2/14 baojinfeng End
{
barPoint.x = barPointX_onpressed_value;
barPointX_backup = barPointX_onpressed_value;
barPoint.y = barPointY_onpressed_value;
barPointY_backup = barPointY_onpressed_value;
clickSlider_x();
clickSlider_y();
}
else
{
//do nothing
}
//add by y-xue for ST_Bug #ST_Bug #153531
}
}
//ADD #H0017 2016/11/02 baojinfeng End
}
}
|