1234567891011121314151617181920212223242526272829303132333435363738 |
- using MECF.Framework.Simulator.Core.Driver;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading;
- using System.Threading.Tasks;
- namespace Venus_Simulator.Devices
- {
- public class VPASimulator : SerialPortDeviceSimulator
- {
- private const string EOF = "\r";
- private const char MSG_DELIMITER = ' ';
- private const string VPA_Port = "COM159";
- public VPASimulator() : base(VPA_Port, -1, EOF, MSG_DELIMITER)
- {
- }
- protected override void ProcessUnsplitMessage(string message)
- {
- if (string.IsNullOrEmpty(message))
- throw new ArgumentException("Hardware command message is invalid");
- Thread.Sleep(3000);
- if (message == "RSLT\r")
- {
- OnWriteMessage("DATA 0000 1230 01000 01000 Y" + EOF);
- Thread.Sleep(500);
- }
- OnWriteMessage("_RDY" + EOF);
- }
- }
- }
|