12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- using System;
- using System.Threading;
- using MECF.Framework.Simulator.Core.Driver;
- using CyberX8_Simulator.Instances;
- using Aitex.Core.RT.SCCore;
- using MECF.Framework.Common.SCCore;
- using MECF.Framework.Common.DataCenter;
- using Aitex.Core.Util;
- using System.IO;
- namespace CyberX8_Simulator.Devices
- {
- class SMCChillerMock : SerialPortDeviceSimulator
- {
- public enum SMCChillerStatus
- {
- Open,
- Close,
- }
- public static SMCChillerStatus _simPumpStatus;
- private const string EOF = "\r\n";
- private const char MSG_DELIMITER = ' ';
-
- public SMCChillerMock(string port) : base(port, -1, EOF, MSG_DELIMITER)
- {
- _simPumpStatus = SMCChillerStatus.Close;
- }
- protected override void ProcessUnsplitMessage(string message)
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- void SetTemp(int temp)
- {
- string module;
- switch (PortName)
- {
- case "COM43":
- case "COM53":
- module = "PMA";
- break;
- case "COM45":
- module = "PMB";
- break;
- case "COM86":
- module = "PMC";
- break;
- case "COM28":
- module = "PMD";
- break;
- default:
- module = "PMB";
- break;
- }
-
- double _OffsetTemp = SystemConfig.Instance.GetValue<double>($"{module}.Chiller.ChillerTemperatureOffset");
- SimulatorSystem.Instance.SetCoolantOutletTemp(module, temp / 10 + (int)_OffsetTemp);
- }
- }
- }
|