Auto: focas-f1b — parts count + cycle time

Closes #258
This commit is contained in:
Joseph Doherty
2026-04-25 14:14:54 -04:00
parent 329e222aa2
commit 3d9697b918
5 changed files with 318 additions and 0 deletions

View File

@@ -88,6 +88,17 @@ internal static class FwlibNative
[DllImport(Library, EntryPoint = "cnc_statinfo", ExactSpelling = true)]
public static extern short StatInfo(ushort handle, ref ODBST buffer);
// ---- Timers ----
/// <summary>
/// <c>cnc_rdtimer</c> — read CNC running timers. <paramref name="type"/>: 0 = power-on
/// time (ms), 1 = operating time (ms), 2 = cycle time (ms), 3 = cutting time (ms).
/// Only the cycle-time variant is consumed today (issue #258); the call is generic
/// so the surface can grow without another P/Invoke.
/// </summary>
[DllImport(Library, EntryPoint = "cnc_rdtimer", ExactSpelling = true)]
public static extern short RdTimer(ushort handle, short type, ref IODBTMR buffer);
// ---- Structs ----
/// <summary>
@@ -129,6 +140,17 @@ internal static class FwlibNative
public short DecVal; // decimal-point count
}
/// <summary>
/// IODBTMR — running-timer read buffer per <c>fwlib32.h</c>. Minute portion in
/// <see cref="Minute"/>; sub-minute remainder in milliseconds in <see cref="Msec"/>.
/// </summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct IODBTMR
{
public int Minute;
public int Msec;
}
/// <summary>ODBST — CNC status info. Machine state, alarm flags, automatic / edit mode.</summary>
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ODBST