Ejemplo n.º 1
0
        public StatusManager(EposDevice device)
        {
            _stopRequestEvent = new ManualResetEvent(false);
            _running          = new ManualResetEvent(false);

            _device = device;
        }
        public CommunicationStatusManager(EposDevice device)
        {
            _device = device;

            if (_device != null)
            {
                LockingObjectName = $"Global\\VcsDevice{_device.Family}{_device.InterfaceName}{_device.PortName}";
            }
        }
Ejemplo n.º 3
0
        private async Task <bool> ConnectDevice(EposDevice device)
        {
            bool result = false;

            if (CloudAgent != null)
            {
                device.CloudAgent = CloudAgent;

                result = await device.Connect();
            }
            else
            {
                MsgLogger.WriteError($"{GetType().Name} - ConnectDevice", $"connection to {device.Family} failed, agent not ready!");
            }

            return(result);
        }
        public static EposDeviceIdentification CreateIdentification(EposDevice device)
        {
            EposDeviceIdentification result = null;

            switch (device.Family)
            {
            case "EPOS2":
                result = new Epos2DeviceIdentification(device);
                break;

            case "EPOS4":
                result = new Epos4DeviceIdentification(device);
                break;
            }

            return(result);
        }
Ejemplo n.º 5
0
        public static EposDevice CreateDevice(string deviceName, string interfaceName, string protocolStackName, string portName, uint updateInterval, uint timeout, int nodeId)
        {
            EposDevice result = null;
            string     deviceDescriptionFile = GetDeviceDescriptionFile(deviceName, interfaceName, protocolStackName, portName);

            switch (deviceName)
            {
            case "EPOS2":
                result = new Epos2Device(deviceDescriptionFile, updateInterval, timeout, nodeId)
                {
                    InterfaceName = interfaceName, ProtocolStackName = protocolStackName, PortName = portName
                };
                break;

            case "EPOS4":
                result = new Epos4Device(deviceDescriptionFile, updateInterval, timeout, nodeId)
                {
                    InterfaceName = interfaceName, ProtocolStackName = protocolStackName, PortName = portName
                };
                break;
            }

            return(result);
        }
Ejemplo n.º 6
0
 private void UnregisterDeviceEvents(EposDevice device)
 {
     device.StatusChanged -= OnDeviceStatusChanged;
 }
Ejemplo n.º 7
0
 public EposDeviceIdentification(EposDevice device)
 {
     _device = device;
 }
Ejemplo n.º 8
0
 public Epos4DeviceIdentification(EposDevice device) : base(device)
 {
 }
Ejemplo n.º 9
0
 public EposDeviceVersion(EposDevice device)
 {
     _device = device;
 }
Ejemplo n.º 10
0
 public Epos4DeviceCommunication(EposDevice device)
     : base(device)
 {
     _statusManager = new CommunicationStatusManager(device);
 }