-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added PerfCounterSensor, GraphTrayIndicator; fixed minor issues
- Loading branch information
1 parent
436b179
commit 68726fc
Showing
26 changed files
with
649 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Sensor.Core | ||
{ | ||
public interface IConfigurable | ||
{ | ||
void Configure(IEnumerable<(string, string)> properties); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
namespace Sensor.Core | ||
using System; | ||
|
||
namespace Sensor.Core | ||
{ | ||
public enum SensorState | ||
public class SensorState | ||
{ | ||
Offline, | ||
Connecting, | ||
Online, | ||
Disconnecting | ||
public string Title { get; set; } | ||
public SensorException Error { get; set; } | ||
public SensorStatus Status { get; set; } | ||
public object Value { get; set; } | ||
public DateTime Timestamp { get; } = DateTime.Now; | ||
|
||
public static bool IsUpdated(SensorState newSensorState, SensorState oldSensorState) { | ||
if (newSensorState == null && oldSensorState == null) { | ||
return false; | ||
} | ||
if (newSensorState == null || oldSensorState == null) { | ||
return true; | ||
} | ||
return newSensorState.Timestamp >= oldSensorState.Timestamp && ( | ||
!Equals(newSensorState.Value, oldSensorState.Value) | ||
|| newSensorState.Status != oldSensorState.Status | ||
|| !ReferenceEquals(newSensorState.Error, oldSensorState.Error) | ||
|| !string.Equals(newSensorState.Title, oldSensorState.Title) | ||
); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Sensor.Core | ||
{ | ||
public enum SensorStatus | ||
{ | ||
Offline, | ||
Connecting, | ||
Online, | ||
Disconnecting | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
|
||
namespace Sensor.Core | ||
{ | ||
public class SensorStatusEventArgs : EventArgs | ||
{ | ||
public SensorStatus Status { get; } | ||
|
||
public SensorStatusEventArgs(SensorStatus status) { | ||
Status = status; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.