123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Xml;
- using Aitex.Core.RT.IOCore;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using Aitex.Core.RT.Log;
- using System.Timers;
- using System.Diagnostics;
- using System.Collections.Concurrent;
- namespace Aitex.Core.RT.Device
- {
- public interface IDevice
- {
- string Module { get; set; }
- string Name { get; set; }
- bool Initialize();
- void Monitor();
- void Terminate();
- void Reset();
- }
- public interface IModuleDevice
- {
- bool IsReady { get; }
- bool IsError { get; }
- bool IsInit { get; }
- bool Home(out string reason);
- }
- public class BaseDevice
- {
- public string UniqueName { get; set; }
- public string Module { get; set; }
- public string Name { get; set; }
- public string Display { get; set; }
- public string DeviceID { get; set; }
-
- private DeviceTimer counter = new DeviceTimer();
- public string ScBasePath { get; set; }
- public string IoBasePath { get; set; }
- public List<string> SerachCommandList;
- public BlockingCollection<string> SetPointCommandQueue = new BlockingCollection<string>();
- public Stopwatch baseStopwatch = new Stopwatch();
- public int intervalTime = 500;
- public BaseDevice()
- {
- ScBasePath = "System";
- IoBasePath = "System";
- }
- public BaseDevice(string module, string name, string display, string id):this()
- {
- display = string.IsNullOrEmpty(display) ? name : display;
- id = string.IsNullOrEmpty(id) ? name : id;
- Module = module;
- Name = name;
- Display = display;
- DeviceID = id;
- UniqueName = $"{module}.{name}";
- }
- }
- }
|