Skip to content

Commit e8ac06f

Browse files
author
tchap
committed
Fixups
1 parent 5d6c004 commit e8ac06f

File tree

9 files changed

+74
-31
lines changed

9 files changed

+74
-31
lines changed

PrintrBotPlugin.v11.suo

0 Bytes
Binary file not shown.

PrintrBotPlugin/PrintrBotPanel.Designer.cs

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PrintrBotPlugin/PrintrBotPanel.cs

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,30 @@ public partial class PrintrBotPanel : UserControl,IHostComponent
3636
public PrintrBotPanel()
3737
{
3838
InitializeComponent();
39+
this.InitializeStrings();
40+
}
3941

42+
private void InitializeStrings()
43+
{
44+
this.buttonLoad.Text = Properties.Resources.LoadingButton_Load;
45+
this.buttonUnload.Text = Properties.Resources.LoadingButton_Unload;
46+
this.groupFilament.Text = Properties.Resources.FilamentPanelTitle;
47+
this.buttonCancel.Text = Properties.Resources.CalibrateButton_Cancel;
48+
this.groupPreheating.Text = Properties.Resources.PreheatPanelTitle;
49+
this.buttonPreheat.Text = Properties.Resources.PreheatButton_Do;
50+
this.labelPreheatingStatus.Text = Properties.Resources.PreheatLabel_NotHeating;
51+
this.labelPreheatingTemp.Text = Properties.Resources.LabelPreheating;
52+
this.labelTitlePanel.Text = Properties.Resources.Title;
53+
this.groupCalibration.Text = Properties.Resources.CalibratePanelTitle;
54+
this.buttonCalibrationOK.Text = Properties.Resources.Calibrate_Step3_OK;
55+
this.buttonTooFar.Text = Properties.Resources.Calibrate_Step3_TooFar;
56+
this.buttonTooClose.Text = Properties.Resources.Calibrate_Step3_TooClose;
57+
this.labelCalibration.Text = Properties.Resources.CalibrateHelp;
58+
this.buttonCalibrate.Text = Properties.Resources.CalibrateButton_Do;
59+
this.labelConnection.Text = Properties.Resources.PrinterDisconnected_Label;
60+
this.buttonCheckConnection.Text = Properties.Resources.PrinterDisconnected_Button;
4061
}
41-
62+
4263
#region IHostComponent implementation
4364

4465
// Name inside component repository
@@ -383,8 +404,10 @@ private void buttonCalibrate_Click(object sender, EventArgs e)
383404
this.injectCommand("G28 X0 Y0");
384405
this.injectCommand("G28 Z0");
385406
this.injectCommand("G29");
386-
387407

408+
System.Threading.Thread.Sleep(3); // Wait for G29 a bit
409+
410+
/* STEP 2 */
388411
// Then run job
389412
var context = TaskScheduler.FromCurrentSynchronizationContext();
390413

@@ -394,7 +417,7 @@ private void buttonCalibrate_Click(object sender, EventArgs e)
394417
{
395418
string line;
396419
double count = 0.0;
397-
while ((line = reader.ReadLine()) != null && calibrating == true)
420+
while ((line = reader.ReadLine()) != null && this.calibrating == true)
398421
{
399422
count++;
400423
var token = Task.Factory.CancellationToken;
@@ -419,15 +442,19 @@ private void buttonCalibrate_Click(object sender, EventArgs e)
419442

420443
}).ContinueWith(_ => {
421444

422-
// We want to retrieve the M212 Offsets, so we trigger a M501 and handle the response below
423-
host.Connection.eventResponse += Connection_eventResponse;
424-
host.Connection.injectManualCommand("M501");
425-
426-
labelCalibration.Text = Properties.Resources.Calibrate_Step2Done;
427-
buttonTooClose.Visible = true;
428-
buttonCalibrationOK.Visible = true;
429-
buttonTooFar.Visible = true;
430-
buttonCalibrate.Visible = false;
445+
/* STEP 3 */
446+
if (this.calibrating == true)
447+
{
448+
// We want to retrieve the M212 Offsets, so we trigger a M501 and handle the response below
449+
host.Connection.eventResponse += Connection_eventResponse;
450+
host.Connection.injectManualCommand("M501");
451+
452+
labelCalibration.Text = Properties.Resources.Calibrate_Step2Done;
453+
buttonTooClose.Visible = true;
454+
buttonCalibrationOK.Visible = true;
455+
buttonTooFar.Visible = true;
456+
buttonCalibrate.Visible = false;
457+
}
431458

432459
}, context);
433460

@@ -451,7 +478,7 @@ private void changeZProbeOffset(double offset)
451478
{
452479
if (this.M212_Z_Offset != 1000 ) // <> not probed yet
453480
{
454-
// Change offset by "offset"
481+
// Change offset by "offset" -1 < Z < 1
455482
this.injectCommand(String.Format("M212 Z{0:f1}", Math.Min(1,Math.Max(this.M212_Z_Offset + offset, -1.0))));
456483
this.injectCommand("M500"); // Saves
457484
}

PrintrBotPlugin/Properties/Resources.Designer.cs

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PrintrBotPlugin/Properties/Resources.resx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<value>Calibrate</value>
125125
</data>
126126
<data name="CalibrateHelp" xml:space="preserve">
127-
<value>To calibrate the Z axis, you need to find the correct offset for the nozzle first, and then calculate the planearity of the plate</value>
127+
<value>The process of calibration will first home all axes thanks to the endstops on each axis.Then, the printer will heat up and print a calibration layer. Once this is done, you will be able to tell if the printed layer is too squashed or too far from the plate.Start the calibration again until the layers are perfectly consistent.</value>
128128
</data>
129129
<data name="CalibratePanelTitle" xml:space="preserve">
130130
<value>Calibration</value>
@@ -196,7 +196,7 @@
196196
<value>Going up a bit ...</value>
197197
</data>
198198
<data name="Calibrate_Step2" xml:space="preserve">
199-
<value>Printing calibration cube ...</value>
199+
<value>Printing calibration layer ...</value>
200200
</data>
201201
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
202202
<data name="calibration_cube" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -232,4 +232,7 @@
232232
<data name="NumberOfLinesInCalibrationGCODE" xml:space="preserve">
233233
<value>210.0</value>
234234
</data>
235+
<data name="Calibrate_Step3_OK" xml:space="preserve">
236+
<value>All is OK</value>
237+
</data>
235238
</root>
Binary file not shown.
Binary file not shown.
512 Bytes
Binary file not shown.
4 KB
Binary file not shown.

0 commit comments

Comments
 (0)