Class Revlev
Standard IPyramidDevice revision descriptor. A revision can be compared using fluent comparison operations such as Equals, Less Than, Greater Than, etc. Older firmware is considerd "less than" newer firmware using semantic versioning rules.
0.0.0 is an invalid firmware revision and is used as the default "invalid" revision.
Inheritance
Implements
Namespace: PTIRelianceLib
Assembly: PTIRelianceLib.dll
Syntax
public class Revlev : IComparable, IParseable, IEquatable<Revlev>
Constructors
| Improve this Doc View SourceRevlev()
Create a new Revlev object with default value of 0.0.0
.
Declaration
public Revlev()
Revlev(Int32, Int32, Int32)
Explicitly construct a new revlev in proper order of
maj
.min
.build
.
Only positive values will be stored.
Declaration
public Revlev(int maj, int min, int build)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maj | First part of revision |
System.Int32 | min | Middle part of revision |
System.Int32 | build | Last part of revision |
Revlev(String)
Build a new Revlev type by parsing revlev
in the
format X.X.XX
.
The minor and build fields may be omitted. In this case, the values will be set to 0.
If a non-numeric or otheriwse invalid revlev
is provided, an exception
of type ArgumentException will be thrown.
Declaration
public Revlev(string revlev)
Parameters
Type | Name | Description |
---|---|---|
System.String | revlev | String of conforming format |
Fields
| Improve this Doc View SourceBuild
Third component of version Major.Minor.Build
Declaration
public readonly int Build
Field Value
Type | Description |
---|---|
System.Int32 | Build component of revision |
Major
First component of version Major.Minor.Build
Declaration
public readonly int Major
Field Value
Type | Description |
---|---|
System.Int32 | Major component of revision |
Minor
Second component of version Major.Minor.Build
Declaration
public readonly int Minor
Field Value
Type | Description |
---|---|
System.Int32 | Minor component of revision |
Methods
| Improve this Doc View SourceCompareTo(Object)
Compares this Revlev to another object obj
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to compare |
Returns
Type | Description |
---|---|
System.Int32 |
|
Equals(Revlev)
Compares this to another Revlev.
Declaration
public bool Equals(Revlev other)
Parameters
Type | Name | Description |
---|---|---|
Revlev | other | Object to compare to |
Returns
Type | Description |
---|---|
System.Boolean | True if equal |
Equals(Object)
Compares this to another Object.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other | Object to compare to |
Returns
Type | Description |
---|---|
System.Boolean | True if equal |
GetHashCode()
Returns hashcode for this revision
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Integer hashcode |
Serialize()
Declaration
public byte[] Serialize()
Returns
Type | Description |
---|---|
System.Byte[] | Payload data |
ToString()
Returns this object in the format X.X.XX
If the device is not conneted, the string "Not Connected"
will instead be returned.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | string formatted as |
Operators
| Improve this Doc View SourceEquality(Revlev, Revlev)
Returns true if r1
is == r2
Declaration
public static bool operator ==(Revlev r1, Revlev r2)
Parameters
Type | Name | Description |
---|---|---|
Revlev | r1 | Left hand side |
Revlev | r2 | Right hand side |
Returns
Type | Description |
---|---|
System.Boolean | bool |
GreaterThan(Revlev, Revlev)
Returns true if r1
is > r2
Declaration
public static bool operator>(Revlev r1, Revlev r2)
Parameters
Type | Name | Description |
---|---|---|
Revlev | r1 | Left hand side |
Revlev | r2 | Right hand side |
Returns
Type | Description |
---|---|
System.Boolean | bool |
GreaterThanOrEqual(Revlev, Revlev)
Returns true if r1
is >= r2
Declaration
public static bool operator >=(Revlev r1, Revlev r2)
Parameters
Type | Name | Description |
---|---|---|
Revlev | r1 | Left hand side |
Revlev | r2 | Right hand side |
Returns
Type | Description |
---|---|
System.Boolean | bool |
Inequality(Revlev, Revlev)
Returns true if r1
is != r2
Declaration
public static bool operator !=(Revlev r1, Revlev r2)
Parameters
Type | Name | Description |
---|---|---|
Revlev | r1 | Left hand side |
Revlev | r2 | Right hand side |
Returns
Type | Description |
---|---|
System.Boolean | bool |
LessThan(Revlev, Revlev)
Returns true if r1
is < r2
Declaration
public static bool operator <(Revlev r1, Revlev r2)
Parameters
Type | Name | Description |
---|---|---|
Revlev | r1 | Left hand side |
Revlev | r2 | Right hand side |
Returns
Type | Description |
---|---|
System.Boolean | bool |
LessThanOrEqual(Revlev, Revlev)
Returns true if r1
is <= r2
Declaration
public static bool operator <=(Revlev r1, Revlev r2)
Parameters
Type | Name | Description |
---|---|---|
Revlev | r1 | Left hand side |
Revlev | r2 | Right hand side |
Returns
Type | Description |
---|---|
System.Boolean | bool |