@@ -17,7 +17,8 @@ public class HotKeysManager : List<HotKeysManager.HotKey>
17
17
{
18
18
[ NonSerialized ] private GrblCore mCore ;
19
19
[ NonSerialized ] private PreviewForm mPreviewForm ;
20
- [ NonSerialized ] List < int > mCustomButtonPressed ;
20
+ [ NonSerialized ] private JogForm mJogForm ;
21
+ [ NonSerialized ] List < int > mCustomButtonPressed ;
21
22
[ NonSerialized ] private bool mJogKeyRequested = false ;
22
23
23
24
[ Serializable ]
@@ -30,6 +31,7 @@ public enum Actions
30
31
HelpOnline = 30 ,
31
32
Reset = 100 , Homing = 101 , Unlock = 102 , PauseJob = 103 , ResumeJob = 104 , SetNewZero = 105 ,
32
33
JogHome = 1000 , JogN = 1001 , JogNE = 1002 , JogE = 1003 , JogSE = 1004 , JogS = 1005 , JogSW = 1006 , JogW = 1007 , JogNW = 1008 , JogUp = 1009 , JogDown = 1010 ,
34
+ JogStepIncrease = 1020 , JogStepDecrease = 1021 ,
33
35
OverridePowerDefault = 1100 , OverridePowerUp = 1101 , OverridePowerDown = 1102 ,
34
36
OverrideLinearDefault = 1110 , OverrideLinearUp = 1111 , OverrideLinearDown = 1112 ,
35
37
OverrideRapidDefault = 1120 , OverrideRapidUp = 1121 , OverrideRapidDown = 1122 ,
@@ -133,7 +135,10 @@ private void AddAllFeatures()
133
135
AddNew ( new HotKey ( HotKey . Actions . JogUp , ( Keys ) 107 ) ) ;
134
136
AddNew ( new HotKey ( HotKey . Actions . JogDown , ( Keys ) 109 ) ) ;
135
137
136
- AddNew ( new HotKey ( HotKey . Actions . OverridePowerDefault , Keys . None ) ) ;
138
+ AddNew ( new HotKey ( HotKey . Actions . JogStepIncrease , Keys . Multiply ) ) ;
139
+ AddNew ( new HotKey ( HotKey . Actions . JogStepDecrease , Keys . Divide ) ) ;
140
+
141
+ AddNew ( new HotKey ( HotKey . Actions . OverridePowerDefault , Keys . None ) ) ;
137
142
AddNew ( new HotKey ( HotKey . Actions . OverridePowerUp , Keys . None ) ) ;
138
143
AddNew ( new HotKey ( HotKey . Actions . OverridePowerDown , Keys . None ) ) ;
139
144
@@ -166,10 +171,11 @@ private void AddNew(HotKey toadd)
166
171
Add ( toadd ) ;
167
172
}
168
173
169
- public void Init ( GrblCore core , PreviewForm cbform )
174
+ public void Init ( GrblCore core , PreviewForm cbform , JogForm jogform )
170
175
{
171
176
mCore = core ;
172
177
mPreviewForm = cbform ;
178
+ mJogForm = jogform ;
173
179
mCustomButtonPressed = new List < int > ( ) ;
174
180
AddAllFeatures ( ) ;
175
181
Sort ( CompareKey ) ;
@@ -259,13 +265,19 @@ private bool PerformAction(HotKey.Actions action)
259
265
case HotKey . Actions . JogW :
260
266
RequestJog ( GrblCore . JogDirection . W ) ; break ;
261
267
case HotKey . Actions . JogNW :
262
- RequestJog ( GrblCore . JogDirection . NW ) ; break ;
263
- case HotKey . Actions . JogUp :
264
- RequestJog ( GrblCore . JogDirection . Zup ) ; break ;
265
- case HotKey . Actions . JogDown :
266
- RequestJog ( GrblCore . JogDirection . Zdown ) ; break ;
267
- case HotKey . Actions . OverridePowerDefault :
268
- case HotKey . Actions . OverridePowerUp :
268
+ RequestJog ( GrblCore . JogDirection . NW ) ; break ;
269
+ case HotKey . Actions . JogUp :
270
+ RequestJog ( GrblCore . JogDirection . Zup ) ; break ;
271
+ case HotKey . Actions . JogDown :
272
+ RequestJog ( GrblCore . JogDirection . Zdown ) ; break ;
273
+ case HotKey . Actions . JogStepIncrease :
274
+ ChangeJogStep ( true ) ;
275
+ break ;
276
+ case HotKey . Actions . JogStepDecrease :
277
+ ChangeJogStep ( false ) ;
278
+ break ;
279
+ case HotKey . Actions . OverridePowerDefault :
280
+ case HotKey . Actions . OverridePowerUp :
269
281
case HotKey . Actions . OverridePowerDown :
270
282
case HotKey . Actions . OverrideLinearDefault :
271
283
case HotKey . Actions . OverrideLinearUp :
@@ -275,27 +287,27 @@ private bool PerformAction(HotKey.Actions action)
275
287
case HotKey . Actions . OverrideRapidDown :
276
288
mCore . HotKeyOverride ( action ) ; break ;
277
289
case HotKey . Actions . CustomButton1 :
278
- EmulateCustomButtonDown ( 0 ) ; break ;
290
+ EmulateCustomButtonDown ( 0 ) ; break ;
279
291
case HotKey . Actions . CustomButton2 :
280
- EmulateCustomButtonDown ( 1 ) ; break ;
292
+ EmulateCustomButtonDown ( 1 ) ; break ;
281
293
case HotKey . Actions . CustomButton3 :
282
- EmulateCustomButtonDown ( 2 ) ; break ;
294
+ EmulateCustomButtonDown ( 2 ) ; break ;
283
295
case HotKey . Actions . CustomButton4 :
284
- EmulateCustomButtonDown ( 3 ) ; break ;
296
+ EmulateCustomButtonDown ( 3 ) ; break ;
285
297
case HotKey . Actions . CustomButton5 :
286
- EmulateCustomButtonDown ( 4 ) ; break ;
298
+ EmulateCustomButtonDown ( 4 ) ; break ;
287
299
case HotKey . Actions . CustomButton6 :
288
- EmulateCustomButtonDown ( 5 ) ; break ;
300
+ EmulateCustomButtonDown ( 5 ) ; break ;
289
301
case HotKey . Actions . CustomButton7 :
290
- EmulateCustomButtonDown ( 6 ) ; break ;
302
+ EmulateCustomButtonDown ( 6 ) ; break ;
291
303
case HotKey . Actions . CustomButton8 :
292
- EmulateCustomButtonDown ( 7 ) ; break ;
304
+ EmulateCustomButtonDown ( 7 ) ; break ;
293
305
case HotKey . Actions . CustomButton9 :
294
- EmulateCustomButtonDown ( 8 ) ; break ;
306
+ EmulateCustomButtonDown ( 8 ) ; break ;
295
307
case HotKey . Actions . CustomButton10 :
296
- EmulateCustomButtonDown ( 9 ) ; break ;
308
+ EmulateCustomButtonDown ( 9 ) ; break ;
297
309
default :
298
- break ;
310
+ break ;
299
311
}
300
312
301
313
//ConnectDisconnect = 10, Connect = 11, Disconnect = 12,
@@ -308,6 +320,14 @@ private bool PerformAction(HotKey.Actions action)
308
320
return true ;
309
321
}
310
322
323
+ private void ChangeJogStep ( bool increase )
324
+ {
325
+ if ( mCore . JogEnabled )
326
+ {
327
+ mJogForm . ChangeJogStepIndexBy ( increase ? 1 : - 1 ) ;
328
+ }
329
+ }
330
+
311
331
private void RequestJog ( GrblCore . JogDirection dir )
312
332
{
313
333
mJogKeyRequested = true ;
0 commit comments