Files
MewtocolNet/MewtocolNet/Mewtocol/PLCInfo.cs
Felix Weiß ba48d97c2b Added missing async write methods
- refactoring
2022-06-20 17:09:48 +02:00

43 lines
1.4 KiB
C#

namespace MewtocolNet.Registers {
/// <summary>
/// Contains generic information about the plc
/// </summary>
public class PLCInfo {
/// <summary>
/// Contains information about the PLCs cpu
/// </summary>
public CpuInfo CpuInformation {get;set;}
/// <summary>
/// Contains information about the PLCs operation modes
/// </summary>
public PLCMode OperationMode {get;set;}
/// <summary>
/// Current error code of the PLC
/// </summary>
public string ErrorCode {get;set;}
/// <summary>
/// Current station number of the PLC
/// </summary>
public int StationNumber { get;set;}
/// <summary>
/// Generates a string containing some of the most important informations
/// </summary>
/// <returns></returns>
public override string ToString () {
return $"Type: {CpuInformation.Cputype},\n" +
$"Capacity: {CpuInformation.ProgramCapacity}k\n" +
$"CPU v: {CpuInformation.CpuVersion}\n" +
$"Station Num: {StationNumber}\n" +
$"--------------------------------\n" +
$"OP Mode: {(OperationMode.RunMode ? "Run" : "Prog")}\n" +
$"Error Code: {ErrorCode}";
}
}
}