using System; using System.Collections.Generic; using System.Linq; using System.Text; using IniFiles; namespace SCMCncLib { public enum NC_DEVICE_TYPE { VIRTUAL = 1, NUM_10x0, OSAI_510, ESAGV_KVARA, FILE_DEVICE }; /// /// Base class for devices /// public class thdNcBase { public bool Connected = false; protected bool requestStop = false; protected int PlcDelay; public bool Finished = false; // this flag will be true when execution is stopped (after a RequestStop) public string DeviceName = ""; // name of the device (just for display purpose) public NC_DEVICE_TYPE DeviceType = 0; // store type of device if needed /// /// Initialization: common operations for all devices. /// /// The f ini. public thdNcBase(IniFile fIni) { // set delay for execution cycle PlcDelay = fIni.ReadInteger("NC", "PlcDelay", 10); } /// /// Request to stop the thread /// public void RequestStop() { requestStop = true; } /// /// Virtual method for thread main execution /// public virtual void Execute() {} } }