Files
OpenNest/OpenNest/Forms/TimingForm.cs
T
ajandClaude Opus 5.5 6cb56a6afd feat(desktop): share the cut-time report and cut simulation playhead
CutTimeReport computes and words what Calculate Cut Time shows for a plate
or nest (time from the simulation with acceleration plus clamp removal,
distances and counts from the timing info) as the WinForms timing window.
CutTimeEntry and CutTimeMachineChoice hold the dialog's box ranges, the
entered values' cut parameters and the Acceleration list's entries.
CutSimulationPlayback is the simulator's playhead without drawing: play,
pause and speed, scrubbing, part, cutout and move stepping, retiming that
keeps the torch in place and which parts it has not reached;
CutSimulationStatus words its status rows.

The WinForms timing window, cut parameters dialog, machine box, simulator
and overlay now call them; their behavior is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 18:45:44 -05:00

64 lines
1.9 KiB
C#

using System;
using System.Windows.Forms;
namespace OpenNest.Forms
{
public partial class TimingForm : Form
{
public TimingForm()
{
InitializeComponent();
}
public Units Units { get; set; }
public void SetCutTime(TimeSpan timeSpan)
{
cutTimeLabel.Text = GetTimeMsg(timeSpan);
}
public void SetCutDistance(double dist)
{
cutDistanceLabel.Text = CutTimeReport.DistanceText(dist, Units);
}
public void SetRapidDistance(double dist)
{
rapidDistanceLabel.Text = CutTimeReport.DistanceText(dist, Units);
}
public void SetIntersectionCount(int count)
{
interectionsLabel.Text = count.ToString();
}
public void SetPierceCount(int count)
{
piercesLabel.Text = count.ToString();
}
public void SetCutParameters(CutParameters cutparams)
{
feedrateLabel.Text = CutTimeReport.RateText(cutparams.Feedrate, Units);
rapidLabel.Text = CutTimeReport.RateText(cutparams.RapidTravelRate, Units);
pierceTimeLabel.Text = GetTimeMsg(cutparams.PierceTime);
}
/// <summary>Shows everything <paramref name="report"/> holds, in its units.</summary>
public void SetReport(CutTimeReport report)
{
Units = report.Units;
cutTimeLabel.Text = report.CutTimeText;
cutDistanceLabel.Text = report.CutDistanceText;
rapidDistanceLabel.Text = report.RapidDistanceText;
interectionsLabel.Text = report.IntersectionCountText;
piercesLabel.Text = report.PierceCountText;
feedrateLabel.Text = report.FeedrateText;
rapidLabel.Text = report.RapidText;
pierceTimeLabel.Text = report.PierceTimeText;
}
public static string GetTimeMsg(TimeSpan time) => CutTimeReport.FormatTime(time);
}
}