Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layers #1826

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Layers #1826

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions LaserGRBL.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1705
# Visual Studio Version 17
VisualStudioVersion = 17.1.32421.90
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaserGRBL", "LaserGRBL\LaserGRBL.csproj", "{839698EC-FE05-4112-ACCB-A5D7556714F0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Debug|x86.ActiveCfg = Debug|x86
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Debug|x86.Build.0 = Debug|x86
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|Any CPU.Build.0 = Release|Any CPU
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|x86.ActiveCfg = Release|x86
{839698EC-FE05-4112-ACCB-A5D7556714F0}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 3 additions & 3 deletions LaserGRBL/App.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.net" type="System.Net.Configuration.NetSectionGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
Expand All @@ -14,6 +14,6 @@
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
</configuration>
19 changes: 17 additions & 2 deletions LaserGRBL/ColorScheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ static ColorScheme()

Color.DodgerBlue, //link color
Color.Purple, //visited link color

Color.Green, //preview laser 2
Color.Black, //preview laser 3
});
mData.Add(Scheme.RedLaser, new Color[]
{
Expand Down Expand Up @@ -81,6 +84,9 @@ static ColorScheme()

Color.DodgerBlue, //link color
Color.Purple, //visited link color

Color.Green, //preview laser 2
Color.Black, //preview laser 3
});
mData.Add(Scheme.Dark, new Color[]
{
Expand Down Expand Up @@ -111,6 +117,9 @@ static ColorScheme()

Color.Yellow, //link color
Color.Violet, //visited link color

Color.Green, //preview laser 2
Color.Black, //preview laser 3
});
mData.Add(Scheme.Hacker, new Color[]
{
Expand Down Expand Up @@ -141,6 +150,9 @@ static ColorScheme()

Color.Yellow, //link color
Color.Violet, //visited link color

Color.Green, //preview laser 2
Color.Black, //preview laser 3
});
mData.Add(Scheme.Nighty, new Color[]
{
Expand Down Expand Up @@ -171,6 +183,9 @@ static ColorScheme()

Color.Yellow, //link color
Color.Violet, //visited link color

Color.Green, //preview laser 2
Color.Black, //preview laser 3
});

CurrentScheme = Scheme.RedLaser;
Expand Down Expand Up @@ -233,8 +248,8 @@ public static Color PreviewFirstMovement
{ get { return GetColor(6); } }
public static Color PreviewOtherMovement
{ get { return GetColor(7); } }
public static Color PreviewLaserPower
{ get { return GetColor(8); } }
public static Color[] PreviewLaserPower
{ get { return new Color[] { GetColor(8), GetColor(23), GetColor(24) }; } }
public static Color PreviewCross
{ get { return GetColor(9); } }

Expand Down
876 changes: 575 additions & 301 deletions LaserGRBL/ConnectLogForm.Designer.cs

Large diffs are not rendered by default.

131 changes: 118 additions & 13 deletions LaserGRBL/ConnectLogForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class ConnectLogForm : System.Windows.Forms.UserControl
public ComWrapper.WrapperType currentWrapper;

GrblCore Core;
private string mLoadedFileName;
private string[] mLoadedFileName = new string[3];

public ConnectLogForm()
{
Expand All @@ -31,7 +31,7 @@ public void SetCore(GrblCore core)
{
Core = core;
Core.OnFileLoaded += OnFileLoaded;
Core.OnLoopCountChange += OnLoopCountChanged;
core.OnLoopCountChange += OnLoopCountChanged;

CmdLog.SetCom(core);

Expand All @@ -46,16 +46,17 @@ public void SetCore(GrblCore core)
TimerUpdate();
}

void OnLoopCountChanged(decimal current)
void OnLoopCountChanged(decimal current, int nLayer)
{
if (InvokeRequired)
{
Invoke(new GrblCore.dlgOnLoopCountChange(OnLoopCountChanged), current);
Invoke(new GrblCore.dlgOnLoopCountChange(OnLoopCountChanged), current, nLayer);
}
else
{
if (UDLoopCounter.Value != current)
UDLoopCounter.Value = current;
if (nLayer == 0) if (UDLoopCounter.Value != current) UDLoopCounter.Value = current;
if (nLayer == 1) if (UDLoopCounter1.Value != current) UDLoopCounter1.Value = current;
if (nLayer == 2) if (UDLoopCounter2.Value != current) UDLoopCounter2.Value = current;
}
}

Expand All @@ -69,16 +70,18 @@ private void RestoreConf()
TxtAddress.Text = Settings.GetObject("Websocket URL", "ws://127.0.0.1:81/");
}

void OnFileLoaded(long elapsed, string filename)
void OnFileLoaded(long elapsed, string filename, int nLayer)
{
if (InvokeRequired)
{
Invoke(new GrblFile.OnFileLoadedDlg(OnFileLoaded), elapsed, filename);
Invoke(new GrblFile.OnFileLoadedDlg(OnFileLoaded), elapsed, filename, nLayer);
}
else
{
mLoadedFileName = filename;
TbFileName.Text = System.IO.Path.GetFileName(filename);
mLoadedFileName[nLayer] = filename;
if (nLayer == 0) TbFileName.Text = System.IO.Path.GetFileName(filename);
if (nLayer == 1) TbFileName1.Text = System.IO.Path.GetFileName(filename);
if (nLayer == 2) TbFileName2.Text = System.IO.Path.GetFileName(filename);
}
}

Expand Down Expand Up @@ -194,6 +197,7 @@ void ApplyConfig()

void BtnOpenClick(object sender, EventArgs e)
{
Tools.Project.ClearSettings(0);
Core.OpenFile(ParentForm);
}

Expand Down Expand Up @@ -329,7 +333,8 @@ private void ITcpPort_CurrentValueChanged(object sender, int NewValue, bool ByUs

private void UDLoopCounter_ValueChanged(object sender, EventArgs e)
{
Core.LoopCount = UDLoopCounter.Value;
Core.LoopCount(0, (int)UDLoopCounter.Value);
((MainForm)ParentForm).TimerUpdate();
}

internal void OnColorChange()
Expand All @@ -350,15 +355,36 @@ private void TxtManualCommand_Leave(object sender, EventArgs e)
private void TbFileName_MouseEnter(object sender, EventArgs e)
{
if (mLoadedFileName != null)
TT.Show(mLoadedFileName, TbFileName, 5000);
TT.Show(mLoadedFileName[0], TbFileName, 5000);
}

private void TbFileName_MouseLeave(object sender, EventArgs e)
{
TT.Hide(TbFileName);
}
private void TbFileName1_MouseEnter(object sender, EventArgs e)
{
if (mLoadedFileName != null)
TT.Show(mLoadedFileName[1], TbFileName, 5000);
}

private void TbFileName1_MouseLeave(object sender, EventArgs e)
{
TT.Hide(TbFileName);
}

private void TbFileName2_MouseEnter(object sender, EventArgs e)
{
if (mLoadedFileName != null)
TT.Show(mLoadedFileName[2], TbFileName, 5000);
}

private void TbFileName2_MouseLeave(object sender, EventArgs e)
{
TT.Hide(TbFileName);
}

private void BtnAbortProgram_Click(object sender, EventArgs e)
private void BtnAbortProgram_Click(object sender, EventArgs e)
{
if (MessageBox.Show(Strings.BoxAbortProgramConfirm, Strings.WarnMessageBoxHeader, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
Core.AbortProgram();
Expand All @@ -376,6 +402,85 @@ internal void ConfigFromDiscovery(string config)
}
}

private void PB_Load(object sender, EventArgs e)
{

}

private void BtnOpen1_Click(object sender, EventArgs e)
{
Tools.Project.ClearSettings(1);
Core.OpenFile(ParentForm, nLayer: 1);
}
private void BtnOpen2_Click(object sender, EventArgs e)
{
Tools.Project.ClearSettings(2);
Core.OpenFile(ParentForm, nLayer: 2);
}

private void BtnReOpenClick(object sender, EventArgs e)
{
Tools.Project.ClearSettings(0);
Core.ReOpenFile(ParentForm, 0);
}

private void BtnReOpen1_Click(object sender, EventArgs e)
{
Tools.Project.ClearSettings(1);
Core.ReOpenFile(ParentForm, 1);
}

private void BtnReOpen2_Click(object sender, EventArgs e)
{
Tools.Project.ClearSettings(2);
Core.ReOpenFile(ParentForm, 2);
}

private void UDLoopCounter1_ValueChanged(object sender, EventArgs e)
{
Core.LoopCount(1, (int)UDLoopCounter1.Value);
((MainForm)ParentForm).TimerUpdate();
}

private void UDLoopCounter2_ValueChanged(object sender, EventArgs e)
{
Core.LoopCount(2, (int)UDLoopCounter2.Value);
((MainForm)ParentForm).TimerUpdate();
}

private void BtnFileAppend_Click(object sender, EventArgs e)
{
Core.OpenFile(ParentForm, null, true);
}

private void BtnFileAppend1_Click(object sender, EventArgs e)
{
Core.OpenFile(ParentForm, null, true, 1);
}

private void BtnFileAppend2_Click(object sender, EventArgs e)
{
Core.OpenFile(ParentForm, null, true, 2);
}

private void chkFileEnable_CheckedChanged(object sender, EventArgs e)
{
Core.LayerEnabled(0, chkFileEnable.Checked);
((MainForm)ParentForm).TimerUpdate();
}

private void chkFileEnable1_CheckedChanged(object sender, EventArgs e)
{
Core.LayerEnabled(1, chkFileEnable1.Checked);
((MainForm)ParentForm).TimerUpdate();
}

private void chkFileEnable2_CheckedChanged(object sender, EventArgs e)
{
Core.LayerEnabled(2, chkFileEnable2.Checked);
((MainForm)ParentForm).TimerUpdate();
}

internal void ConfigFromOrtur(string config)
{
if (config != null)
Expand Down
20 changes: 13 additions & 7 deletions LaserGRBL/ConnectLogForm.it.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="GBCommands.Size" type="System.Drawing.Size, System.Drawing">
<value>281, 255</value>
</data>
Expand Down Expand Up @@ -146,7 +146,7 @@
<value>62, 13</value>
</data>
<data name="LblFilename.Text" xml:space="preserve">
<value>File</value>
<value>File (Engrave)</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 13</value>
Expand All @@ -169,7 +169,7 @@
<data name="BtnOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAJxAIA3kywAAACBjSFJNAABu
lQAAdA4AAPGBAACFRgAAZO0AAPeGAABJ4gAAHljF0QxvAAAACXBIWXMAAAsSAAALEgHS3X78AAADQElE
lQAAdA4AAPGBAACFRgAAZO0AAPeGAABJ4gAAHljF0QxvAAAACXBIWXMAAAsOAAALDgFAvuFBAAADQElE
QVQ4T3WTW0hTcRzHf12o16KnLrq5s013ph4921ymS/M6yyyzmuKclaJGN1pE2kP1UBRdhS4kUVBgF4LC
ktIkIy1tF1dTj7u5uemmWallZhbhr7NZRkkPXw7n4fPhx//3/YFMIgOlMgMyM9fBlsKtUFpSCkmrkkAR
p4AYaQzIZXKIjqIhRiafX1RUrBSLyNn8EB4ICX4g/xXExcYBzYJSWgpUBDX3/PmLJ0dGPn3PydmUGLR4
Expand All @@ -196,7 +196,7 @@
<data name="BtnRunProgram.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAK
7wAACu8BfXaKSAAAAAd0SU1FB9MCGhU2KcxZSDgAAAIpSURBVDhPtdJfSNNRFAfws5L+DNrcJkGEL0aK
6wAACusBgosNWgAAAAd0SU1FB9MCGhU2KcxZSDgAAAIpSURBVDhPtdJfSNNRFAfws5L+DNrcJkGEL0aK
abq2oZWUhRGVYFbDCh3OzOafbWxuWi1nrnItM5FNiAZR9JAvBZHpcoqxFKc2beiwKUQvSUlP0mQv5bcf
cmEIYj7U5/Ge873ncLn075SSPuVm8gJVUIA0lMNO109ojJ+f/DaOzo9PIL239zd3iZvqSczKf5dgSlh4
GXqOtsE7aBlqQPkLJfi1W77TNSphLWsT1YoWnk50oLHfAOPbUtR4lNB485HhSlwiM/XRbdrNWlcnNsX/
Expand All @@ -221,7 +221,7 @@
<data name="CBPort.Size" type="System.Drawing.Size, System.Drawing">
<value>178, 21</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="CBSpeed.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left, Right</value>
</data>
Expand Down Expand Up @@ -418,4 +418,10 @@
<data name="TxtManualCommand.WaterMark" xml:space="preserve">
<value>scrivi gcode</value>
</data>
<data name="LblFilename1.Text" xml:space="preserve">
<value>File 2 (Raster)</value>
</data>
<data name="LblFilename2.Text" xml:space="preserve">
<value>File 3 (Cut)</value>
</data>
</root>
Loading