Skip to content

Commit

Permalink
System commands queue optimization
Browse files Browse the repository at this point in the history
File processing stops on reset
  • Loading branch information
IlyaChernov committed Sep 25, 2020
1 parent a74177f commit 1666fef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion grbl.Master.Service/CommandSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ public void Send(string command, string onResult = null)
{
lock (_lockObject)
{
SystemCommands.Add(command);
if (SystemCommands.CommandList.Count(x => x.Data == cmd.Data) < 3)
{
SystemCommands.Add(command);
}
}

break;
Expand Down
5 changes: 3 additions & 2 deletions grbl.Master.UI/ViewModels/MasterViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ public void FileOpen()
{
var openFileDialog = new OpenFileDialog
{
Filter =
"G-Code files (*.nc;*.g;*.gcode)|*.nc;*.g;*.gcode|All text files (*.*)|*.*"
Filter = "G-Code files (*.nc;*.g;*.gcode)|*.nc;*.g;*.gcode|All text files (*.*)|*.*"
};

if (openFileDialog.ShowDialog() == true && File.Exists(openFileDialog.FileName))
{
_gCodeFileService.Load(openFileDialog.FileName);
Expand Down Expand Up @@ -584,6 +584,7 @@ public void ReloadFile()

public void ResetGrbl()
{
this._commandSender.FileCommands.StopProcessing();
RealtimeIntCommand(24);
_commandSender.PurgeQueues();
}
Expand Down

0 comments on commit 1666fef

Please sign in to comment.