Skip to content

Commit

Permalink
fix #113 and add "type gcode here" placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
arkypita committed Sep 25, 2017
1 parent ec6668a commit 2db1072
Show file tree
Hide file tree
Showing 8 changed files with 282 additions and 25 deletions.
2 changes: 1 addition & 1 deletion LaserGRBL/AssemblyInfo.cs
Expand Up @@ -31,5 +31,5 @@
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// utilizzando l'asterisco (*) come descritto di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("2.8.5")]
[assembly: AssemblyVersion ("2.8.6")]
[assembly: NeutralResourcesLanguageAttribute("en")]
4 changes: 4 additions & 0 deletions LaserGRBL/ConnectLogForm.Designer.cs

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

12 changes: 6 additions & 6 deletions LaserGRBL/ConnectLogForm.resx
Expand Up @@ -148,7 +148,7 @@
<value>TxtManualCommand</value>
</data>
<data name="&gt;&gt;TxtManualCommand.Type" xml:space="preserve">
<value>LaserGRBL.UserControls.GrblTextBox, LaserGRBL, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>LaserGRBL.UserControls.GrblTextBox, LaserGRBL, Version=2.8.5.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;TxtManualCommand.Parent" xml:space="preserve">
<value>tableLayoutPanel6</value>
Expand All @@ -175,7 +175,7 @@
<value>CmdLog</value>
</data>
<data name="&gt;&gt;CmdLog.Type" xml:space="preserve">
<value>LaserGRBL.UserControls.CommandLog, LaserGRBL, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>LaserGRBL.UserControls.CommandLog, LaserGRBL, Version=2.8.5.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;CmdLog.Parent" xml:space="preserve">
<value>tableLayoutPanel6</value>
Expand Down Expand Up @@ -373,7 +373,7 @@
<value>PB</value>
</data>
<data name="&gt;&gt;PB.Type" xml:space="preserve">
<value>LaserGRBL.UserControls.DoubleProgressBar, LaserGRBL, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>LaserGRBL.UserControls.DoubleProgressBar, LaserGRBL, Version=2.8.5.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;PB.Parent" xml:space="preserve">
<value>tableLayoutPanel5</value>
Expand Down Expand Up @@ -427,7 +427,7 @@
<value>BtnOpen</value>
</data>
<data name="&gt;&gt;BtnOpen.Type" xml:space="preserve">
<value>LaserGRBL.UserControls.ImageButton, LaserGRBL, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>LaserGRBL.UserControls.ImageButton, LaserGRBL, Version=2.8.5.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BtnOpen.Parent" xml:space="preserve">
<value>tableLayoutPanel5</value>
Expand Down Expand Up @@ -476,7 +476,7 @@
<value>BtnRunProgram</value>
</data>
<data name="&gt;&gt;BtnRunProgram.Type" xml:space="preserve">
<value>LaserGRBL.UserControls.ImageButton, LaserGRBL, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>LaserGRBL.UserControls.ImageButton, LaserGRBL, Version=2.8.5.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BtnRunProgram.Parent" xml:space="preserve">
<value>tableLayoutPanel5</value>
Expand Down Expand Up @@ -822,7 +822,7 @@
<value>BtnConnectDisconnect</value>
</data>
<data name="&gt;&gt;BtnConnectDisconnect.Type" xml:space="preserve">
<value>LaserGRBL.UserControls.ImageButton, LaserGRBL, Version=2.8.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>LaserGRBL.UserControls.ImageButton, LaserGRBL, Version=2.8.5.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;BtnConnectDisconnect.Parent" xml:space="preserve">
<value>tableLayoutPanel4</value>
Expand Down
9 changes: 5 additions & 4 deletions LaserGRBL/GrblCore.cs
Expand Up @@ -916,10 +916,10 @@ private void ParseMachineStatus(string data)
try { var = (MacStatus)Enum.Parse(typeof(MacStatus), data); }
catch (Exception ex) { Logger.LogException("ParseMachineStatus", ex); }

if (var == MacStatus.Idle && mQueuePtr.Count == 0 && mPending.Count == 0)
if (InProgram && mQueuePtr.Count == 0 && mPending.Count == 0)
OnProgramEnd();

if (mTP.InProgram && var == MacStatus.Idle) //bugfix for grbl sending Idle on G4
if (InProgram && var == MacStatus.Idle) //bugfix for grbl sending Idle on G4
var = MacStatus.Run;

SetStatus(var);
Expand Down Expand Up @@ -949,7 +949,7 @@ public bool CanLoadNewFile
{ get { return !InProgram; } }

public bool CanSendFile
{ get { return IsOpen && MachineStatus == MacStatus.Idle && HasProgram; } }
{ get { return IsOpen && IdleOrCheck && HasProgram; } }

public bool CanImportExport
{ get { return IsOpen && MachineStatus == MacStatus.Idle; } }
Expand All @@ -975,7 +975,8 @@ public decimal LoopCount
private StreamingMode CurrentStreamingMode
{ get {return (StreamingMode)Settings.GetObject("Streaming Mode", StreamingMode.Buffered); }}

//public bool IsImportExportStream { get { return !object.ReferenceEquals(mQueue, mQueuePtr); } }
private bool IdleOrCheck
{ get { return MachineStatus == MacStatus.Idle || MachineStatus == MacStatus.Check; } }

private static string mDataPath;
public static string DataPath
Expand Down
3 changes: 3 additions & 0 deletions LaserGRBL/LaserGRBL.csproj
Expand Up @@ -359,6 +359,9 @@
<Compile Include="UserControls\LabelTB.Designer.cs">
<DependentUpon>LabelTB.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\PlaceholderTextbox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="UserControls\WaitingProgressBar.cs">
<SubType>UserControl</SubType>
</Compile>
Expand Down
16 changes: 3 additions & 13 deletions LaserGRBL/Logger/Logger.cs
Expand Up @@ -35,7 +35,6 @@ internal static void Start()
{
try
{

if (System.IO.File.Exists(filename))
{
int MAXLINE = 1000;
Expand Down Expand Up @@ -63,6 +62,8 @@ internal static void Start()
}
written = true;
}

reader.Close();
}

if (written)
Expand Down Expand Up @@ -116,18 +117,7 @@ private static void LogMultiLine(string context, string text)
}

static string filename
{
get
{
string basename = "sessionlog.txt";
string fullname = System.IO.Path.Combine(GrblCore.DataPath, basename);

if (!System.IO.File.Exists(fullname) && System.IO.File.Exists(basename))
System.IO.File.Copy(basename, fullname);

return fullname;
}
}
{get{return System.IO.Path.Combine(GrblCore.DataPath, "sessionlog.txt");}}

public static bool ExistLog
{ get { return System.IO.File.Exists(filename); } }
Expand Down
2 changes: 1 addition & 1 deletion LaserGRBL/UserControls/GrblTextBox.cs
Expand Up @@ -17,7 +17,7 @@ namespace LaserGRBL.UserControls
/// <summary>
/// Description of GrblTextBox.
/// </summary>
public partial class GrblTextBox : TextBox
public partial class GrblTextBox : PlaceholderTextBox
{
public delegate void CommandEnteredDlg(string command);
public event CommandEnteredDlg CommandEntered;
Expand Down

0 comments on commit 2db1072

Please sign in to comment.