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.16 - 2017 Nov 10
Browse files Browse the repository at this point in the history
- Fix crash on invalid tool number< Issue #128
- Implement configurable rounding, Issue #116
- Fix 'default file extension not working', Issue #119
- Implement direct setting of Work Pos on main tab, Issue #111, Issue #12
  • Loading branch information
gerritv committed Nov 9, 2017
1 parent 6fa40b7 commit a2f66b7
Show file tree
Hide file tree
Showing 18 changed files with 6,358 additions and 3,147 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.16 - 2017 Nov 10
- Fix crash on invalid tool number< Issue #128
- Implement configurable rounding, Issue #116
- Fix 'default file extension not working', Issue #119
- Implement direct setting of Work Pos on main tab, Issue #111, Issue #12
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
Expand Down
Binary file modified Grbl-Panel-Example.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion Grbl-Panel/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<value>1.5</value>
</setting>
<setting name="DefaultFileExt" serializeAs="String">
<value />
<value>txt</value>
</setting>
<setting name="IPAddress" serializeAs="String">
<value />
Expand All @@ -124,6 +124,9 @@
<setting name="UpgradeSettings" serializeAs="String">
<value>True</value>
</setting>
<setting name="TruncationDigits" serializeAs="String">
<value>0</value>
</setting>
</GrblPanel.My.MySettings>
</userSettings>
</configuration>
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.16 - 2017 Nov 10
- Fix crash on invalid tool number< Issue #128
- Implement configurable rounding, Issue #116
- Fix 'default file extension not working', Issue #119
- Implement direct setting of Work Pos on main tab, Issue #111, Issue #12
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
Expand Down
3 changes: 2 additions & 1 deletion Grbl-Panel/GrblErrorsSingleton.vb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Public Class GrblErrorsSingleton
{"34", Resources.GrblGcodeView_ArcRadiusError},
{"35", Resources.GrblGcodeView_NoOffsetsInPlane},
{"36", Resources.GrblGcodeView_UnusedWords},
{"37", Resources.GrblGcodeView_G43DynamicAxisError}
{"37", Resources.GrblGcodeView_G43DynamicAxisError},
{"38", Resources.GrblGcodeView_InvalidToolNumber}
}
Return _errors
End Function
Expand Down
3 changes: 2 additions & 1 deletion Grbl-Panel/GrblGui.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@
<data name="GroupBox1.Text" xml:space="preserve">
<value>Décalage Actif</value>
</data>
<data name="tbWorkX.ToolTip" xml:space="preserve">
<data name="
.ToolTip" xml:space="preserve">
<value>Position Travail X</value>
</data>
<data name="tbMachX.ToolTip" xml:space="preserve">
Expand Down
42 changes: 39 additions & 3 deletions Grbl-Panel/GrblGui.vb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ Public Class GrblGui

' Non-jog mappings
If Not _gui.tbSendData.ContainsFocus And
Not _gui.gbEditor.ContainsFocus Then ' in case user is working in MDI
Not _gui.gbEditor.ContainsFocus And
Not _gui.gbSettingsMisc.ContainsFocus And
Not _gui.gbSettingsJogging.ContainsFocus And
Not _gui.gbSettingsPosition.ContainsFocus Then ' in case user is working in MDI
Select Case msg.WParam
' Act on Distance Increment keyboard requests
Case Keys.Add, Keys.Oemplus And My.Computer.Keyboard.ShiftKeyDown
Expand Down Expand Up @@ -331,10 +334,23 @@ Public Class GrblGui
End If
End If
' Process setting of offset from main display
' TODO Add code
If tbWorkX.ContainsFocus Then
SendOffsets(lblPositionCurrentOffset.Text + "X", tbWorkX.Text)
tabCtlPosition.Focus()
Return True
End If
If tbWorkY.ContainsFocus Then
SendOffsets(lblPositionCurrentOffset.Text + "Y", tbWorkY.Text)
tabCtlPosition.Focus()
Return True
End If
If tbWorkZ.ContainsFocus Then
SendOffsets(lblPositionCurrentOffset.Text + "Z", tbWorkZ.Text)
tabCtlPosition.Focus()
Return True
End If
End If


' we didn't do anything with the key so pass it on
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
Expand Down Expand Up @@ -650,4 +666,24 @@ Public Class GrblGui
Next
End Sub

Private Sub tbWorkX_TextChanged(sender As Object, e As EventArgs) Handles tbWorkX.DoubleClick
Dim Index As String = ""
Dim sndr As TextBox = DirectCast(sender, TextBox)
Select Case lblPositionCurrentOffset.Text.Substring(0, 3) ' Get the offset value
Case "G54"
Index = "P1"
Case "G55"
Index = "P2"
Case "G56"
Index = "P3"
Case "G57"
Index = "P4"
Case "G58"
Index = "P5"
Case "G59"
Index = "P6"
End Select
gcode.sendGCodeLine("G10 L2 " + Index + " " + sndr.Tag.ToString + sndr.Text)
End Sub

End Class
8 changes: 7 additions & 1 deletion Grbl-Panel/GrblOffsets.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Imports GrblPanel.GrblIF

Imports System.Threading.Thread
Imports GrblPanel.GrblIF
Imports System.Xml
Partial Class GrblGui
Public Class GrblOffsets
Expand Down Expand Up @@ -203,9 +205,13 @@ Partial Class GrblGui
index = "P6"
End Select
gcode.sendGCodeLine("G10 L2 " + index + " " + axis + value)
Sleep(400) ' Have to wait for EEProm write
btnOffsetsRetrieve_Click(Nothing, Nothing)
End If
If tag.Contains("G43") Then
gcode.sendGCodeLine("G43.1" + axis + value)
Sleep(400) ' Have to wait for EEProm write
btnOffsetsRetrieve_Click(Nothing, Nothing)
End If

End Sub
Expand Down
70 changes: 54 additions & 16 deletions Grbl-Panel/GrblPosition.vb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Partial Class GrblGui
Public Sub New(ByRef gui As GrblGui)
_gui = gui
' For Connected events
AddHandler (GrblGui.Connected), AddressOf GrblConnected
AddHandler(GrblGui.Connected), AddressOf GrblConnected
AddHandler(_gui.settings.GrblSettingsRetrievedEvent), AddressOf GrblSettingsRetrieved
End Sub

Expand Down Expand Up @@ -133,28 +133,37 @@ Partial Class GrblGui
Case "MPos"
' We get Mpos but no WPos depending on $10
Dim machPos = Split(portion(1), ",")
tbMachX.Text = machPos(0).ToString
tbMachY.Text = machPos(1).ToString
tbMachZ.Text = machPos(2).ToString

tbWorkX.Text = (machPos(0) - position.WcoX).ToString("0.000")
tbWorkY.Text = (machPos(1) - position.WcoY).ToString("0.000")
tbWorkZ.Text = (machPos(2) - position.WcoZ).ToString("0.000")

tbMachX.Text = TruncRound(Convert.ToDecimal(machPos(0))).ToString
tbMachY.Text = TruncRound(Convert.ToDecimal(machPos(1))).ToString
tbMachZ.Text = TruncRound(Convert.ToDecimal(machPos(2))).ToString
If Not tbWorkX.ContainsFocus Then
tbWorkX.Text = TruncRound(Convert.ToDecimal(machPos(0)) - position.WcoX).ToString
End If
If Not tbWorkY.ContainsFocus Then
tbWorkY.Text = TruncRound(Convert.ToDecimal(machPos(1)) - position.WcoY).ToString
End If
If Not tbWorkZ.ContainsFocus Then
tbWorkZ.Text = TruncRound(Convert.ToDecimal(machPos(2)) - position.WcoZ).ToString
End If
'Set same values into the repeater view on Offsets page
tbOffSetsMachX.Text = tbMachX.Text
tbOffSetsMachY.Text = tbMachY.Text
tbOffSetsMachZ.Text = tbMachZ.Text
Case "WPos"
' We get WPos but no MPos depending on $10
Dim workPos = Split(portion(1), ",")
tbWorkX.Text = workPos(0).ToString
tbWorkY.Text = workPos(1).ToString
tbWorkZ.Text = workPos(2).ToString

tbMachX.Text = (workPos(0) + position.WcoX).ToString("0.000")
tbMachY.Text = (workPos(1) + position.WcoY).ToString("0.000")
tbMachZ.Text = (workPos(2) + position.WcoZ).ToString("0.000")
If Not tbWorkX.ContainsFocus Then
tbWorkX.Text = TruncRound(Convert.ToDecimal(workPos(0))).ToString
End If
If Not tbWorkY.ContainsFocus Then
tbWorkY.Text = TruncRound(Convert.ToDecimal(workPos(1))).ToString
End If
If Not tbWorkZ.ContainsFocus Then
tbWorkZ.Text = TruncRound(Convert.ToDecimal(workPos(2))).ToString
End If
tbMachX.Text = TruncRound(Convert.ToDecimal(workPos(0)) + position.WcoX).ToString
tbMachY.Text = TruncRound(Convert.ToDecimal(workPos(1)) + position.WcoY).ToString
tbMachZ.Text = TruncRound(Convert.ToDecimal(workPos(2)) + position.WcoZ).ToString

End Select
Next
Expand All @@ -163,6 +172,25 @@ Partial Class GrblGui
End If
End Sub

''' <summary>
''' Round per Settings
''' </summary>
''' <returns></returns>
Private Function TruncRound(value As Decimal) As Decimal


If tbTruncationDigits.Text = "0" Then
Return value
Else
If IsNumeric(tbTruncationDigits.Text) Then
Return Math.Round(Convert.ToDecimal(value), Convert.ToInt16(tbTruncationDigits.Text))
End If
Return value
End If



End Function
Private Sub btnPosition_Click(sender As Object, e As EventArgs) Handles btnWork0.Click, btnHome.Click, btnWorkSoftHome.Click, btnWorkSpclPosition.Click
Dim b As Button = sender
Select Case DirectCast(b.Tag, String)
Expand Down Expand Up @@ -192,5 +220,15 @@ Partial Class GrblGui
End Select

End Sub
''' <summary>
''' Support for entering Work Pos directly, clear text on focus
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub tbWork_Click(sender As Object, e As EventArgs) Handles tbWorkX.Click, tbWorkY.Click, tbWorkZ.Click
Dim tb As TextBox = sender

tb.Text = ""
End Sub

End Class
2 changes: 1 addition & 1 deletion Grbl-Panel/GrblState.vb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
_gui.cbxStateUnits.SelectedItem = find(_gui.cbxStateUnits, code)
Case "G54", "G55", "G56", "G57", "G58", "G59"
_gui.cbxStateOffset.SelectedItem = find(_gui.cbxStateOffset, code)
_gui.lblPositionCurrentOffset.Text = find(_gui.cbxStateOffset, code)
_gui.lblPositionCurrentOffset.Text = code 'find(_gui.cbxStateOffset, code)
Case "G90", "G91"
_gui.cbxStateDistance.SelectedItem = find(_gui.cbxStateDistance, code)
Case "G93", "G94"
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.15")>
<Assembly: AssemblyFileVersion("1.0.9.15")>
<Assembly: AssemblyVersion("1.0.9.16")>
<Assembly: AssemblyFileVersion("1.0.9.16")>

<Assembly: NeutralResourcesLanguageAttribute("en-CA")>
11 changes: 10 additions & 1 deletion Grbl-Panel/My Project/Resources.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Grbl-Panel/My Project/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -468,4 +468,7 @@
<data name="GrblSettings_LaserMode" xml:space="preserve">
<value>laser mode</value>
</data>
<data name="GrblGcodeView_InvalidToolNumber" xml:space="preserve">
<value>Tool number &gt;max supported</value>
</data>
</root>
18 changes: 15 additions & 3 deletions Grbl-Panel/My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Grbl-Panel/My Project/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<Value Profile="(Default)">1.5</Value>
</Setting>
<Setting Name="DefaultFileExt" Type="System.String" Scope="User">
<Value Profile="(Default)" />
<Value Profile="(Default)">txt</Value>
</Setting>
<Setting Name="IPAddress" Type="System.String" Scope="User">
<Value Profile="(Default)" />
Expand All @@ -116,5 +116,8 @@
<Setting Name="UpgradeSettings" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="TruncationDigits" Type="System.String" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>
Loading

0 comments on commit a2f66b7

Please sign in to comment.