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

Add missing properties #126

Merged
merged 1 commit into from
Jun 11, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using AndreasReitberger.API.Print3dServer.Core.Events;
using Newtonsoft.Json;
using System;

namespace AndreasReitberger.API.Moonraker.Models
{
[Obsolete("Use PrintImageChangedEventArgs instead")]
public class KlipperCurrentPrintImageChangedEventArgs : Print3dBaseEventArgs
{
#region Properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using AndreasReitberger.API.Print3dServer.Core.Events;
using Newtonsoft.Json;
using System;
using System.Collections.ObjectModel;

namespace AndreasReitberger.API.Moonraker.Models
{
[Obsolete("Use JobListChangedEventArgs instead")]
public class KlipperJobListChangedEventArgs : Print3dBaseEventArgs
{
#region Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace AndreasReitberger.API.Moonraker.Models
{
[Obsolete("Use JsonConvertEventArgs instead")]
public class KlipperJsonConvertEventArgs : EventArgs
{
#region Properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using AndreasReitberger.API.Print3dServer.Core.Events;
using Newtonsoft.Json;
using System;

namespace AndreasReitberger.API.Moonraker.Models
{
[Obsolete("Use SessionChangedEventArgs instead")]
public class KlipperSessionChangedEventArgs : Print3dBaseEventArgs
{
#region Properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using AndreasReitberger.API.Print3dServer.Core.Events;
using Newtonsoft.Json;
using System;

namespace AndreasReitberger.API.Moonraker.Models
{
[Obsolete("Use WebsocketEventArgs instead")]
public class KlipperWebSocketDataEventArgs : Print3dBaseEventArgs
{
#region Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public partial class KlipperStatusExtruder : ObservableObject, IToolhead
public bool CanUpdateTarget = false;

[JsonIgnore]
public KlipperToolState State { get => GetCurrentState(); }
public Printer3dToolHeadState State { get => GetCurrentState(); }

[ObservableProperty, JsonIgnore]
Printer3dHeaterType type = Printer3dHeaterType.Other;
Expand All @@ -114,19 +114,19 @@ public partial class KlipperStatusExtruder : ObservableObject, IToolhead
#endregion

#region Methods
KlipperToolState GetCurrentState()
public Printer3dToolHeadState GetCurrentState()
{
try
{
if (TempSet == null || TempRead == null)
return KlipperToolState.Idle;
return Printer3dToolHeadState.Idle;
return TempSet <= 0
? KlipperToolState.Idle
: TempSet > TempRead && Math.Abs(Convert.ToDouble(TempSet - TempRead)) > 2 ? KlipperToolState.Heating : KlipperToolState.Ready;
? Printer3dToolHeadState.Idle
: TempSet > TempRead && Math.Abs(Convert.ToDouble(TempSet - TempRead)) > 2 ? Printer3dToolHeadState.Heating : Printer3dToolHeadState.Ready;
}
catch (Exception)
{
return KlipperToolState.Error;
return Printer3dToolHeadState.Error;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public partial class KlipperStatusHeaterBed : ObservableObject, IHeaterComponent
public bool CanUpdateTarget = false;

[JsonIgnore]
public KlipperToolState State { get => GetCurrentState(); }
public Printer3dToolHeadState State { get => GetCurrentState(); }

#region JsonIgnore
[ObservableProperty, JsonIgnore]
Expand All @@ -47,20 +47,20 @@ public partial class KlipperStatusHeaterBed : ObservableObject, IHeaterComponent
#endregion

#region Methods
KlipperToolState GetCurrentState()
public Printer3dToolHeadState GetCurrentState()
{
try
{
if (TempSet == null || TempRead == null)
return KlipperToolState.Idle;
return Printer3dToolHeadState.Idle;

return TempSet <= 0
? KlipperToolState.Idle
: TempSet > TempRead && Math.Abs(Convert.ToDouble(TempSet - TempRead)) > 2 ? KlipperToolState.Heating : KlipperToolState.Ready;
? Printer3dToolHeadState.Idle
: TempSet > TempRead && Math.Abs(Convert.ToDouble(TempSet - TempRead)) > 2 ? Printer3dToolHeadState.Heating : Printer3dToolHeadState.Ready;
}
catch (Exception)
{
return KlipperToolState.Error;
return Printer3dToolHeadState.Error;
}

}
Expand Down