123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Documents;
- using MECF.Framework.Simulator.Core.Driver;
- namespace Venus_Simulator.Devices
- {
- class RevtechMatchMockPMA : SerialPortDeviceSimulator
- {
- private const string EOF = "\n";
- private const char MSG_DELIMITER = '\n';
- private const string MOCKUP_PORT = "COM32";
- private List<string> info = new List<string>();
-
- public RevtechMatchMockPMA() : base(MOCKUP_PORT, -1, EOF, MSG_DELIMITER)
- {
- info.Add("1");//Mode
- info.Add("1");
- info.Add("1");
- info.Add("1");
- info.Add("1");
- info.Add("1");
- info.Add("1");
- info.Add("1");
- info.Add("20");//C1
- info.Add("30");//C2
- info.Add("1");
- info.Add("1");
- info.Add("1");
- info.Add("1");
- info.Add("1");
- }
- protected override void ProcessUnsplitMessage(string message)
- {
- if (string.IsNullOrEmpty(message))
- throw new ArgumentException("Hardware command message is invalid");
- string sRes = string.Empty;
- if (message.Contains(EOF))
- {
- message = message.Remove(message.Length - 1);
- }
- string[] msgs = message.Split('\n');
- foreach(string msg in msgs)
- {
- switch (msg)
- {
-
- }
- Thread.Sleep(200);
- sRes += "\n";
- OnWriteMessage(sRes);
- }
- }
- }
- }
|