Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ework into v3.5-dev
  • Loading branch information
chrishamm committed Mar 1, 2024
2 parents 8951972 + d901139 commit d951dc3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/common/duetcontrolserver/opt/dsf/conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
],
"PrintTimeFilters": [
{
"Pattern": "estimated printing time .*= ((?<h>(\\d+))h\\s*)?((?<m>(\\d+))m\\s*)?((?<s>(\\d+))s)?",
"Pattern": "estimated printing time .*= ((?<d>(\\d+))d\\s*)?((?<h>(\\d+))h\\s*)?((?<m>(\\d+))m\\s*)?((?<s>(\\d+))s)?",
"Options": 17
},
{
Expand Down
10 changes: 10 additions & 0 deletions src/DuetAPI/ObjectModel/Boards/Board.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ public string? IapFileNameSD
}
private string? _iapFileNameSD;

/// <summary>
/// Information about an inductive sensor or null if not present
/// </summary>
public InductiveSensor? InductiveSensor
{
get => _inductiveSensor;
set => SetPropertyValue(ref _inductiveSensor, value);
}
private InductiveSensor? _inductiveSensor;

/// <summary>
/// Maximum number of heaters this board can control
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions src/DuetAPI/ObjectModel/Boards/InductiveSensor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace DuetAPI.ObjectModel
{
/// <summary>
/// Information about an inductive sensor
/// </summary>
public class InductiveSensor : ModelObject
{
// still empty
}
}
6 changes: 6 additions & 0 deletions src/DuetControlServer/Files/InfoParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ private static bool FindPrintTime(string line, ref GCodeFileInfo fileInfo)
{
switch (grp.Name)
{
case "d":
seconds += (long)Math.Round(printTime) * 86400L;
break;
case "h":
seconds += (long)Math.Round(printTime) * 3600L;
break;
Expand Down Expand Up @@ -503,6 +506,9 @@ private static bool FindSimulatedTime(string line, ref GCodeFileInfo fileInfo)
{
switch (grp.Name)
{
case "d":
seconds += simulatedTime * 86400;
break;
case "h":
seconds += simulatedTime * 3600;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/DuetControlServer/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public static class Settings
/// </summary>
public static List<Regex> PrintTimeFilters { get; set; } = new()
{
new Regex(@"estimated printing time .*= ((?<h>(\d+))h\s*)?((?<m>(\d+))m\s*)?((?<s>(\d+))s)?", RegexFlags), // Slic3r PE
new Regex(@"estimated printing time .*= ((?<d>(\d+))d\s*)?((?<h>(\d+))h\s*)?((?<m>(\d+))m\s*)?((?<s>(\d+))s)?", RegexFlags), // Slic3r PE
new Regex(@"TIME:(?<s>(\d+\.?\d*))", RegexFlags), // Cura
new Regex(@"Build Time:\s+((?<h>(\d+\.?\d*)) hour(s)?\s*)?((?<m>(\d+\.?\d*)) minute(s)?\s*)?((?<s>(\d+\.?\d*)) second(s)?)?", RegexFlags), // Simplify3D, KISSlicer, Canvas, IceSL
new Regex(@"print time:\s+(?<s>(\d+\.?\d*))(s)?", RegexFlags), // Kiri:Moto, and IdeaMaker v4
Expand Down

0 comments on commit d951dc3

Please sign in to comment.