Class DriverId
Class representing a driver identifier
Inheritance
System.Object
DriverId
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: DuetAPI.Utility
Assembly: DuetAPI.dll
Syntax
[JsonConverter(typeof(DriverIdJsonConverter))]
public sealed class DriverId
Constructors
DriverId()
Default constructor of this class
Declaration
public DriverId()
DriverId(Int32, Int32)
Constructor for creating a new instance from a board and a port
Declaration
public DriverId(int board, int port)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | board | Board number |
System.Int32 | port | Port number |
DriverId(String)
Constructor for creating a new instance from a string
Declaration
public DriverId(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | String value |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Driver ID could not be parsed |
DriverId(UInt32)
Constructor for creating a new instance from an unsigned integer
Declaration
public DriverId(uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | Unsigned integer |
Properties
Board
Board of this driver identifier
Declaration
public int Board { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Port
Port of this driver identifier
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Equals(Object)
Checks whether this instance is equal to another
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Other instance |
Returns
Type | Description |
---|---|
System.Boolean | Whether this and the other instance are equal |
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Compute a hash code for this instance
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code |
Overrides
System.Object.GetHashCode()
ToString()
Convert this instance to a string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation |
Overrides
System.Object.ToString()
Operators
Implicit(DriverId to String)
Convert an instance to a string
Declaration
public static implicit operator string (DriverId id)
Parameters
Type | Name | Description |
---|---|---|
DriverId | id | Driver ID to convert |
Returns
Type | Description |
---|---|
System.String |
Implicit(DriverId to UInt32)
Convert an instance to an unsigned integer as expected by RepRapFirmware
Declaration
public static implicit operator uint (DriverId id)
Parameters
Type | Name | Description |
---|---|---|
DriverId | id | Driver ID to convert |
Returns
Type | Description |
---|---|
System.UInt32 |