| | |
| | | /// <summary> |
| | | /// 主é®ID |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_MODBUS_DATA_ID", IsPrimaryKey = true)] |
| | | public long Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°æ®è¯»åæ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ°æ®è¯»åæ¶é´")] |
| | | public DateTime ReadTime { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ°æ®è¯»åæ¶é´")] |
| | | public DateTime? ReadTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®åç§°ï¼æ¥èªé
ç½®ï¼ |
| | | /// </summary> |
| | | [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "项ç®åç§°")] |
| | | public string ProjectName { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "项ç®åç§°")] |
| | | public string? ProjectName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PLC IPå°å |
| | | /// </summary> |
| | | [SugarColumn(Length = 50, IsNullable = false, ColumnDescription = "PLC IPå°å")] |
| | | public string PlcIpAddress { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "PLC IPå°å")] |
| | | public string? PlcIpAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ§å¶ä¿¡å·æ°æ®ï¼JSONæ ¼å¼ï¼ |
| | |
| | | /// <summary> |
| | | /// æ°æ®å建æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è®°å½å建æ¶é´")] |
| | | public DateTime CreatedAt { get; set; } = DateTime.Now; |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "è®°å½å建æ¶é´")] |
| | | public DateTime? CreatedAt { get; set; } = DateTime.Now; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 主é®ID |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_COMMUNICATION_LOG_ID", IsPrimaryKey = true)] |
| | | public long Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥å¿æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¥å¿æ¶é´")] |
| | | public DateTime LogTime { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ¥å¿æ¶é´")] |
| | | public DateTime? LogTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®åç§° |
| | | /// </summary> |
| | | [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "项ç®åç§°")] |
| | | public string ProjectName { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "项ç®åç§°")] |
| | | public string? ProjectName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PLC IPå°å |
| | | /// </summary> |
| | | [SugarColumn(Length = 50, IsNullable = false, ColumnDescription = "PLC IPå°å")] |
| | | public string PlcIpAddress { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "PLC IPå°å")] |
| | | public string? PlcIpAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// äºä»¶ç±»åï¼Connected, Disconnected, DataReceived, Errorçï¼ |
| | | /// </summary> |
| | | [SugarColumn(Length = 50, IsNullable = false, ColumnDescription = "äºä»¶ç±»å")] |
| | | public string EventType { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "äºä»¶ç±»å")] |
| | | public string? EventType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// äºä»¶æè¿° |
| | |
| | | /// <summary> |
| | | /// æ¯å¦æå |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¯å¦æå")] |
| | | public bool IsSuccess { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ¯å¦æå")] |
| | | public bool? IsSuccess { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èæ¶ï¼æ¯«ç§ï¼ |
| | |
| | | /// <summary> |
| | | /// 主é®ID |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_ERROR_LOG_ID", IsPrimaryKey = true)] |
| | | public long Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é误åçæ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "é误åçæ¶é´")] |
| | | public DateTime ErrorTime { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "é误åçæ¶é´")] |
| | | public DateTime? ErrorTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®åç§° |
| | | /// </summary> |
| | | [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "项ç®åç§°")] |
| | | public string ProjectName { get; set; } = string.Empty; |
| | | |
| | | [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "项ç®åç§°")] |
| | | public string? ProjectName { get; set; } |
| | | /// <summary> |
| | | /// PLC IPå°å |
| | | /// </summary> |
| | | [SugarColumn(Length = 50, IsNullable = false, ColumnDescription = "PLC IPå°å")] |
| | | public string PlcIpAddress { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "PLC IPå°å")] |
| | | public string? PlcIpAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// é误类å |
| | | /// </summary> |
| | | [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "é误类å")] |
| | | public string ErrorType { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "é误类å")] |
| | | public string? ErrorType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè¯¯æ¶æ¯ |
| | | /// </summary> |
| | | [SugarColumn(Length = 1000, IsNullable = false, ColumnDescription = "éè¯¯æ¶æ¯")] |
| | | public string ErrorMessage { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 1000, IsNullable = true, ColumnDescription = "éè¯¯æ¶æ¯")] |
| | | public string? ErrorMessage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸å æ ä¿¡æ¯ |
| | |
| | | /// <summary> |
| | | /// é误严é级å«ï¼Critical, High, Medium, Lowï¼ |
| | | /// </summary> |
| | | [SugarColumn(Length = 20, IsNullable = false, ColumnDescription = "é误严é级å«")] |
| | | public string Severity { get; set; } = "Medium"; |
| | | [SugarColumn(Length = 20, IsNullable = true, ColumnDescription = "é误严é级å«")] |
| | | public string? Severity { get; set; } = "Medium"; |
| | | |
| | | /// <summary> |
| | | /// éè¯æ¬¡æ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "éè¯æ¬¡æ°")] |
| | | public int RetryCount { get; set; } = 0; |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "éè¯æ¬¡æ°")] |
| | | public int? RetryCount { get; set; } = 0; |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦å·²è§£å³ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¯å¦å·²è§£å³")] |
| | | public bool IsResolved { get; set; } = false; |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ¯å¦å·²è§£å³")] |
| | | public bool? IsResolved { get; set; } = false; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 主é®ID |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] |
| | | [SugarColumn(ColumnName = "ID", OracleSequenceName = "SEQ_STATISTICS_ID", IsPrimaryKey = true)] |
| | | public long Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»è®¡æ¶é´ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç»è®¡æ¶é´")] |
| | | public DateTime StatisticsTime { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç»è®¡æ¶é´")] |
| | | public DateTime? StatisticsTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 项ç®åç§° |
| | | /// </summary> |
| | | [SugarColumn(Length = 100, IsNullable = false, ColumnDescription = "项ç®åç§°")] |
| | | public string ProjectName { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 100, IsNullable = true, ColumnDescription = "项ç®åç§°")] |
| | | public string? ProjectName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PLC IPå°å |
| | | /// </summary> |
| | | [SugarColumn(Length = 50, IsNullable = false, ColumnDescription = "PLC IPå°å")] |
| | | public string PlcIpAddress { get; set; } = string.Empty; |
| | | [SugarColumn(Length = 50, IsNullable = true, ColumnDescription = "PLC IPå°å")] |
| | | public string? PlcIpAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿æ¥å°è¯æ»æ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è¿æ¥å°è¯æ»æ°")] |
| | | public int TotalConnectionAttempts { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "è¿æ¥å°è¯æ»æ°")] |
| | | public int? TotalConnectionAttempts { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿æ¥æåæ»æ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è¿æ¥æåæ»æ°")] |
| | | public int SuccessfulConnections { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "è¿æ¥æåæ»æ°")] |
| | | public int? SuccessfulConnections { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°æ®è¯»åæ»æ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ°æ®è¯»åæ»æ°")] |
| | | public int TotalDataReads { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ°æ®è¯»åæ»æ°")] |
| | | public int? TotalDataReads { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°æ®è¯»åæåæ»æ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ°æ®è¯»åæåæ»æ°")] |
| | | public int SuccessfulDataReads { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ°æ®è¯»åæåæ»æ°")] |
| | | public int? SuccessfulDataReads { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè¯¯æ»æ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "éè¯¯æ»æ°")] |
| | | public int TotalErrors { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "éè¯¯æ»æ°")] |
| | | public int? TotalErrors { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¹³åååºæ¶é´ï¼æ¯«ç§ï¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "å¹³åååºæ¶é´æ¯«ç§")] |
| | | public double AverageResponseTimeMs { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "å¹³åååºæ¶é´æ¯«ç§")] |
| | | public double? AverageResponseTimeMs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå¤§ååºæ¶é´ï¼æ¯«ç§ï¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æå¤§ååºæ¶é´æ¯«ç§")] |
| | | public int MaxResponseTimeMs { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æå¤§ååºæ¶é´æ¯«ç§")] |
| | | public int? MaxResponseTimeMs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æå°ååºæ¶é´ï¼æ¯«ç§ï¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æå°ååºæ¶é´æ¯«ç§")] |
| | | public int MinResponseTimeMs { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æå°ååºæ¶é´æ¯«ç§")] |
| | | public int? MinResponseTimeMs { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¿æ¥æåç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è¿æ¥æåç")] |
| | | public double ConnectionSuccessRate { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "è¿æ¥æåç")] |
| | | public double? ConnectionSuccessRate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°æ®è¯»åæåç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ°æ®è¯»åæåç")] |
| | | public double DataReadSuccessRate { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ°æ®è¯»åæåç")] |
| | | public double? DataReadSuccessRate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»è®¡æ¶é´èå´å¼å§ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç»è®¡æ¶é´èå´å¼å§")] |
| | | public DateTime PeriodStart { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç»è®¡æ¶é´èå´å¼å§")] |
| | | public DateTime? PeriodStart { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»è®¡æ¶é´èå´ç»æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç»è®¡æ¶é´èå´ç»æ")] |
| | | public DateTime PeriodEnd { get; set; } |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ç»è®¡æ¶é´èå´ç»æ")] |
| | | public DateTime? PeriodEnd { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public static class EventTypes |
| | | { |
| | | public const string Connected = "Connected"; |
| | | public const string Disconnected = "Disconnected"; |
| | | public const string DataReceived = "DataReceived"; |
| | | public const string ConnectionError = "ConnectionError"; |
| | | public const string DataReadError = "DataReadError"; |
| | | public const string ConfigurationLoaded = "ConfigurationLoaded"; |
| | | public const string SystemStarted = "SystemStarted"; |
| | | public const string SystemStopped = "SystemStopped"; |
| | | public const string? Connected = "Connected"; |
| | | public const string? Disconnected = "Disconnected"; |
| | | public const string? DataReceived = "DataReceived"; |
| | | public const string? ConnectionError = "ConnectionError"; |
| | | public const string? DataReadError = "DataReadError"; |
| | | public const string? ConfigurationLoaded = "ConfigurationLoaded"; |
| | | public const string? SystemStarted = "SystemStarted"; |
| | | public const string? SystemStopped = "SystemStopped"; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public static class ErrorSeverity |
| | | { |
| | | public const string Critical = "Critical"; // ç³»ç»æ æ³ç»§ç»è¿è¡ |
| | | public const string High = "High"; // åè½åå°ä¸¥éå½±å |
| | | public const string Medium = "Medium"; // åè½åå°å½±åä½å¯ç»§ç» |
| | | public const string Low = "Low"; // 轻微é®é¢ï¼ä¸å½±å主è¦åè½ |
| | | public const string? Critical = "Critical"; // ç³»ç»æ æ³ç»§ç»è¿è¡ |
| | | public const string? High = "High"; // åè½åå°ä¸¥éå½±å |
| | | public const string? Medium = "Medium"; // åè½åå°å½±åä½å¯ç»§ç» |
| | | public const string? Low = "Low"; // 轻微é®é¢ï¼ä¸å½±å主è¦åè½ |
| | | } |
| | | } |