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

Commit

Permalink
- Replace Readline style serial io with Async Read for responsiveness…
Browse files Browse the repository at this point in the history
…, reliability

- Disable MDI if not connected
- Add direct set of offsets, thanks to @joebananas10, Issue #43
- Fix crash when getting Grbl offset information ($#) Issue #45
  • Loading branch information
gerritv committed Feb 3, 2016
1 parent 5625f4f commit f03f1da
Show file tree
Hide file tree
Showing 16 changed files with 499 additions and 250 deletions.
16 changes: 8 additions & 8 deletions Grbl-Panel/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<userSettings>
<GrblPanel.My.MySettings>
<setting name="Port" serializeAs="String">
<value/>
<value />
</setting>
<setting name="Baud" serializeAs="String">
<value>115200</value>
Expand Down Expand Up @@ -98,28 +98,28 @@
<value>1.5</value>
</setting>
<setting name="DefaultFileExt" serializeAs="String">
<value/>
<value />
</setting>
<setting name="IPAddress" serializeAs="String">
<value/>
<value />
</setting>
<setting name="ConnectionType" serializeAs="String">
<value>0</value>
</setting>
<setting name="Macro1" serializeAs="String">
<value/>
<value>Probe,G38.2 Z-30 F10</value>
</setting>
<setting name="Macro2" serializeAs="String">
<value/>
<value />
</setting>
<setting name="Macro3" serializeAs="String">
<value/>
<value />
</setting>
<setting name="Macro4" serializeAs="String">
<value/>
<value />
</setting>
<setting name="Macro5" serializeAs="String">
<value/>
<value />
</setting>
</GrblPanel.My.MySettings>
</userSettings>
Expand Down
7 changes: 6 additions & 1 deletion Grbl-Panel/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
This file documents changes made:
V1.0.8.0 - 2016 Feb 3
- Replace Readline style serial io with Async Read for responsiveness, reliability
- Disable MDI if not connected
- Add direct set of offsets, thanks to @joebananas10, Issue #43
- Fix crash when getting Grbl offset information ($#) Issue #45
V1.0.7.0 - 2016 Jan 20
- Added exception info to Serial Write error
- Added Macro button enhancement from @joebananas, thank you!!!! Issue 38
- Added Macro button enhancement from @joebananas10, thank you!!!! Issue 38
- Changed target to .NET 4.5.2 to fix issue #39, thanks matmurdock
- Added icon, thanks matmurdock
- Added DoEvents on file load to improve responsiveness while loading large files
Expand Down
2 changes: 1 addition & 1 deletion Grbl-Panel/CREDITS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ This tool would not have been possible without:
- Legendaire for testing beta versions
- Tyler for adding IP connectivity
- Peter Smid, for his amazing books on CNC and Gcode
- Ed Reed, aka JoeBananas10 for the Macro button code
- Ed Reed, aka JoeBananas10 for the Macro button code and OffSet setting changes
- matmurdock for adding the icon
2 changes: 1 addition & 1 deletion Grbl-Panel/Grbl-Panel.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
</EmbeddedResource>
<EmbeddedResource Include="GrblGui.resx">
<DependentUpon>GrblGui.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx">
<CustomToolNamespace>My.Resources</CustomToolNamespace>
Expand All @@ -182,7 +183,6 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Grbl-Panel_TemporaryKey.pfx" />
<None Include="My Project\app.manifest" />
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
Expand Down
3 changes: 2 additions & 1 deletion Grbl-Panel/GrblGcode.vb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Partial Class GrblGui
End If
' Allow UI to be somewhat responsive while loading large files
If _inputcount Mod 100 = 0 Then
' Console.WriteLine("loadGcodeFile: line count: {0}", _inputcount)
Application.DoEvents()
End If
Loop
Expand Down Expand Up @@ -429,7 +430,7 @@ Partial Class GrblGui
End If
End If
End If
' Check for status repsonses that we need to handle here
' Check for status responses that we need to handle here
' Extract status
Dim status = Split(data, ",")
If status(0) = "<Alarm" Or status(0).StartsWith("ALARM") Then
Expand Down
58 changes: 53 additions & 5 deletions Grbl-Panel/GrblGui.vb
Original file line number Diff line number Diff line change
Expand Up @@ -305,17 +305,19 @@ Public Class GrblGui
' Wake up the subsystems
' TODO Replace these calls with Event Connected handling in each object
status.enableStatus(True)
Sleep(tbSettingsStartupDelay.Text * 1000) ' Give Grbl time to wake up from Reset

gcode.enableGCode(True)
jogging.enableJogging(True)
position.enablePosition(True)
gcode.enableGCode(True)
offsets.enableOffsets(True)
state.EnableState(True)
settings.EnableState(True)
' Start the status poller
Sleep(tbSettingsStartupDelay.Text * 1000) ' Give Grbl time to wake up from Reset
statusPrompt("Start")

RaiseEvent connected("Connected") ' tell everyone of the happy event
setSubPanels("Idle")
' Start the status poller
statusPrompt("Start")
End If
Case "Disconnect"
' it must be a disconnect
Expand All @@ -337,6 +339,7 @@ Public Class GrblGui
settings.EnableState(False)

RaiseEvent connected("Disconnected")
setSubPanels("Disconnected") ' block GUI
Return
End Select
End Sub
Expand Down Expand Up @@ -403,6 +406,21 @@ Public Class GrblGui
gbSettingsPosition.Enabled = False
gbGrblSettings.Enabled = False

btnStatusGetParser.Enabled = False
Case "Disconnected"
' We are not connected so not much you can do
gbJogging.Enabled = False
gbPosition.Enabled = False
gbMDI.Enabled = False
gbGrbl.Enabled = True ' Allow only Connect
gbState.Enabled = False

gbSettingsJogging.Enabled = False
gbSettingsMisc.Enabled = False
gbSettingsOffsets.Enabled = False
gbSettingsPosition.Enabled = False
gbGrblSettings.Enabled = False

btnStatusGetParser.Enabled = False
Case "Idle"
' General use, no gcode streaming
Expand Down Expand Up @@ -487,5 +505,35 @@ Public Class GrblGui
gcode.sendGCodeLine(aData(iCounter))
Next
End Sub
''' <summary>
''' Handles the Click event of the btnFeedOverride controls.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
Private Sub btnFeedOverride_Click(sender As Object, e As EventArgs) Handles btnFeedCoarsePlus.Click, btnFeedCoarseMinus.Click,
btnFeedFinePlus.Click, btnFeedFineMinus.Click

Dim btn As Button = sender

Select Case DirectCast(btn.Tag, String)
Case "Coarse"
If btn.Text = "+" Then
grblPort.sendData(Chr(94))
Else
grblPort.sendData(Chr(42))
End If
Case "Fine"
If btn.Text = "+" Then
grblPort.sendData(Chr(147)) ' 0x93
Else
grblPort.sendData(Chr(148)) ' 0x94
End If
End Select
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

grblPort.sendData("#")
End Sub

End Class
End Class
Loading

0 comments on commit f03f1da

Please sign in to comment.