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

Commit

Permalink
Fix Issue #110
Browse files Browse the repository at this point in the history
Implement keymapping for macros Issue #115
  • Loading branch information
gerritv committed Jun 23, 2017
1 parent c9ee442 commit 6fa40b7
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
This file documents changes made:
V1.0.9.15 - 2017 May 30
- Fix exception when USB cable is unplugged, Issue #110
- Add keymapping for all 5 macro buttons, Issue #115
V1.0.9.14 - 2017 Apr 30
- Fix licence.rtf, deleted the file, Issue #106
- Fix missing error texts, Issue #108
- Add feature to track Grbl setting $13 (Inch/Metric display) to Jogging configuration. Issue #109
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
Expand Down
3 changes: 3 additions & 0 deletions Grbl-Panel/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
This file documents changes made:
V1.0.9.15 - 2017 May 30
- Fix exception when USB cable is unplugged, Issue #110
- Add keymapping for all 5 macro buttons, Issue #115
V1.0.9.14 - 2017 Apr 30
- Fix licence.rtf, deleted the file, Issue #106
- Fix missing error texts, Issue #108
Expand Down
1 change: 1 addition & 0 deletions Grbl-Panel/Grbl-Panel.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
</EmbeddedResource>
<EmbeddedResource Include="GrblGui.fr.resx">
<DependentUpon>GrblGui.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="GrblGui.resx">
<DependentUpon>GrblGui.vb</DependentUpon>
Expand Down
29 changes: 28 additions & 1 deletion Grbl-Panel/GrblGui.vb
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,31 @@ Public Class GrblGui

' Macro 1 execute
Case Keys.F2
Dim macro1 As Button = _gui.IsMacroBtn1()
Dim macro1 As Button = _gui.IsMacroBtn(1)
If Not IsNothing(macro1) Then
macro1.PerformClick()
handled = True
End If
Case Keys.F3
Dim macro1 As Button = _gui.IsMacroBtn(2)
If Not IsNothing(macro1) Then
macro1.PerformClick()
handled = True
End If
Case Keys.F4
Dim macro1 As Button = _gui.IsMacroBtn(3)
If Not IsNothing(macro1) Then
macro1.PerformClick()
handled = True
End If
Case Keys.F5
Dim macro1 As Button = _gui.IsMacroBtn(4)
If Not IsNothing(macro1) Then
macro1.PerformClick()
handled = True
End If
Case Keys.F6
Dim macro1 As Button = _gui.IsMacroBtn(5)
If Not IsNothing(macro1) Then
macro1.PerformClick()
handled = True
Expand Down Expand Up @@ -306,8 +330,11 @@ Public Class GrblGui
Return True
End If
End If
' Process setting of offset from main display
' TODO Add code
End If


' we didn't do anything with the key so pass it on
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
Expand Down
1 change: 1 addition & 0 deletions Grbl-Panel/GrblIF.vb
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ Public Class GrblIF
RaiseEvent serialDataEvent(System.Text.ASCIIEncoding.ASCII.GetString(_received))
_client_ComReadData() ' reprime the read
Catch e As System.InvalidOperationException
Catch e As System.UnauthorizedAccessException
Catch e As System.IO.IOException
Debug.WriteLine("_client_ComReadData: error on reading from port " + e.Message)
Catch e As TimeoutException
Expand Down
6 changes: 3 additions & 3 deletions Grbl-Panel/GrblMacroButtons.vb
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ Partial Class GrblGui
End If
End Sub

Public Function IsMacroBtn1() As Button
Public Function IsMacroBtn(num As Integer) 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
Dim m As String = "btnMacro" & (num - 1)
If mButton.Name = m Then '"btnMacro" + ToString(num - 1) Then
Return mButton
End If
Next iLoopCounter
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.14")>
<Assembly: AssemblyFileVersion("1.0.9.14")>
<Assembly: AssemblyVersion("1.0.9.15")>
<Assembly: AssemblyFileVersion("1.0.9.15")>

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

0 comments on commit 6fa40b7

Please sign in to comment.