Skip to content
This repository has been archived by the owner on Apr 7, 2019. It is now read-only.

Commit

Permalink
V1.0.9.13 - 2017 Jan 27
Browse files Browse the repository at this point in the history
- Fix more things in Issue #84
- Add O key to Single Step a gcode file, Issue #84
- Fix missing Settings display if Grbl is 0.9, Issue #88
  • Loading branch information
gerritv committed Jan 29, 2017
1 parent a5bdfee commit edd083d
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
This file documents changes made:
V1.0.9.13 - 2017 Jan 27
- Fix more things in Issue #84
- Add F2 as key to run Macro 1 if it exists, Issue #84
- Add O key to Single Step a gcode file, Issue #84
- Fix missing Settings display if Grbl is 0.9, Issue #88
V1.0.9.12 - 2017 Jan 22
- Fix mistakes in keyboard shortcuts, Issue #84
V1.0.9.11 - 2017 Jan 15
Expand Down
5 changes: 5 additions & 0 deletions Grbl-Panel/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
This file documents changes made:
V1.0.9.13 - 2017 Jan 27
- Fix more things in Issue #84
- Add F2 as key to run Macro 1 if it exists, Issue #84
- Add O key to Single Step a gcode file, Issue #84
- Fix missing Settings display if Grbl is 0.9, Issue #88
V1.0.9.12 - 2017 Jan 22
- Fix mistakes in keyboard shortcuts, Issue #84
V1.0.9.11 - 2017 Jan 15
Expand Down
45 changes: 30 additions & 15 deletions Grbl-Panel/GrblGui.vb
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ Public Class GrblGui
''' <summary>
''' Handle key press overrides and keyboard mapping
''' </summary>
''' <param name="msg"></param>
''' <param name="msg"><DebuggerStepThrough()></param>
''' <returns>True if key msg was handled</returns>
<DebuggerStepThrough()> Private Function PreFilterMessage(ByRef msg As Message) As Boolean Implements IMessageFilter.PreFilterMessage
Private Function PreFilterMessage(ByRef msg As Message) As Boolean Implements IMessageFilter.PreFilterMessage
Dim handled As Boolean = False

If msg.Msg = &H100 Then ' We have a KeyDown event
Expand All @@ -158,7 +158,9 @@ Public Class GrblGui
_gui.btnZMinus.PerformClick()
handled = True
End Select
Return handled
If handled Then
Return True
End If
End If
End If

Expand All @@ -167,12 +169,10 @@ Public Class GrblGui
Not _gui.gbEditor.ContainsFocus Then ' in case user is working in MDI
Select Case msg.WParam
' Act on Distance Increment keyboard requests
Case Keys.Shift
Dim m As IntPtr = msg.WParam
Case Keys.Add
Case Keys.Add, Keys.Oemplus And My.Computer.Keyboard.ShiftKeyDown
_gui.changeDistanceIncrement(True)
handled = True
Case Keys.Subtract
Case Keys.Subtract, Keys.OemMinus
_gui.changeDistanceIncrement(False)
handled = True

Expand All @@ -185,7 +185,7 @@ Public Class GrblGui
handled = True

' Reset x,y,z axis to 0
Case Keys.X
Case Keys.X And Not My.Computer.Keyboard.CtrlKeyDown
_gui.btnWorkX0.PerformClick()
handled = True
Case Keys.Y
Expand All @@ -210,22 +210,35 @@ Public Class GrblGui
End If
handled = True

' Single Step
Case Keys.O
_gui.btnFileStep.PerformClick()
handled = True

' Macro 1 execute
Case Keys.F2
Dim macro1 As Button = _gui.IsMacroBtn1()
If Not IsNothing(macro1) Then
macro1.PerformClick()
handled = True
End If

' Grbl State
Case Keys.H And My.Computer.Keyboard.CtrlKeyDown 'Keys.ControlKey
Case Keys.H And My.Computer.Keyboard.CtrlKeyDown
_gui.btnHold.PerformClick()
handled = True
Case Keys.U And My.Computer.Keyboard.CtrlKeyDown 'Keys.ControlKey
Case Keys.U And My.Computer.Keyboard.CtrlKeyDown
_gui.btnUnlock.PerformClick()
handled = True
Case Keys.X And My.Computer.Keyboard.CtrlKeyDown 'Keys.ControlKey
Case Keys.X And My.Computer.Keyboard.CtrlKeyDown
_gui.btnReset.PerformClick()
handled = True

' Overrides
Case Keys.F And My.Computer.Keyboard.ShiftKeyDown
_gui.btnFeedPlus.PerformClick()
handled = True
Case Keys.F
Case Keys.F And Not (My.Computer.Keyboard.ShiftKeyDown Or My.Computer.Keyboard.CtrlKeyDown)
_gui.btnFeedMinus.PerformClick()
handled = True
Case Keys.F And My.Computer.Keyboard.CtrlKeyDown
Expand All @@ -234,7 +247,7 @@ Public Class GrblGui
Case Keys.S And My.Computer.Keyboard.ShiftKeyDown
_gui.btnSpindlePlus.PerformClick()
handled = True
Case Keys.S
Case Keys.S And Not (My.Computer.Keyboard.ShiftKeyDown Or My.Computer.Keyboard.CtrlKeyDown)
_gui.btnSpindleMinus.PerformClick()
handled = True
Case Keys.S And My.Computer.Keyboard.CtrlKeyDown
Expand All @@ -246,14 +259,16 @@ Public Class GrblGui
Case Keys.R And My.Computer.Keyboard.CtrlKeyDown
_gui.btnRapidOverride25.PerformClick()
handled = True
Case Keys.R
Case Keys.R And Not (My.Computer.Keyboard.ShiftKeyDown Or My.Computer.Keyboard.CtrlKeyDown)
_gui.btnRapidOverride50.PerformClick()
handled = True

End Select
End If

Return handled
If handled Then
Return True
End If

End If

Expand Down
12 changes: 12 additions & 0 deletions Grbl-Panel/GrblMacroButtons.vb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ Partial Class GrblGui
End If
End Sub

Public Function IsMacroBtn1() As Button
For iLoopCounter As Integer = (gbMDI.Controls.Count - 1) To 0 Step -1
Dim mButton As Control = gbMDI.Controls(iLoopCounter)

If mButton.Name = "btnMacro0" Then
Return mButton
End If
Next iLoopCounter

Return Nothing
End Function

Public ReadOnly Property macroNames As String()
Get
Return _macroNames
Expand Down
11 changes: 6 additions & 5 deletions Grbl-Panel/GrblStatus.vb
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,17 @@ Partial Class GrblGui
If data.StartsWith("ALARM") Then
statusSetIndicators(data.Substring(0, 6))
End If
End If

' TODO Move to Settings handler
If data(0) = "$" And IsNumeric(data(1)) Then
' we have a Grbl Settings response
settings.FillSettings(data)
End If
' TODO Move to Settings handler
If data(0) = "$" And IsNumeric(data(1)) Then
' we have a Grbl Settings response
settings.FillSettings(data)
End If




End Sub

Private Sub statusSetIndicators(ByVal status As String)
Expand Down
4 changes: 2 additions & 2 deletions Grbl-Panel/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.9.12")>
<Assembly: AssemblyFileVersion("1.0.9.12")>
<Assembly: AssemblyVersion("1.0.9.13")>
<Assembly: AssemblyFileVersion("1.0.9.13")>

<Assembly: NeutralResourcesLanguageAttribute("en-CA")>

0 comments on commit edd083d

Please sign in to comment.