public EposDeviceManager(MasterSettings settings, SyncCloudAgent cloudAgent) : base(cloudAgent) { _deviceScanner = new DeviceScanner(settings); RegisterEvents(); }
public MasterChannelControllerAdapter(SyncCloudAgent agent, string channelId) : base(agent.Url, channelId, agent.Identity, agent.UpdateInterval, agent.Timeout) { _executeCommandCache = new ExecuteCommandCache(); _agent = agent; WsChannelName = "Master"; WsChannelId = $"{channelId}_Master"; }
internal DeviceVcs(SyncCloudAgent masterAgent, EltraDevice deviceNode, uint updateInterval, uint timeout) { if (deviceNode != null) { _deviceNode = deviceNode; Timeout = DefaultTimeout; Agent = new DeviceAgent(masterAgent, deviceNode, updateInterval, timeout); Agent.ParameterValueChanged += OnParameterValueChanged; _deviceNode.CloudConnector = Agent; } }
public UserCloudAgent(SyncCloudAgent masterAgent, EltraDevice deviceNode, uint updateInterval, uint timeout) { _status = AgentStatus.Undefined; _identity = masterAgent.Identity; _channel = new Channel() { Status = ChannelStatus.Offline }; _executedCommands = new List <DeviceCommand>(); _channelAdapter = new SlaveChannelControllerAdapter(masterAgent.Url, deviceNode.ChannelId, masterAgent.Identity, updateInterval, timeout) { ConnectionManager = masterAgent.ConnectionManager }; Initialize(masterAgent, deviceNode); }
internal bool StartCounting(SyncCloudAgent agent, string source, int step, int delay) { Console.WriteLine($"start counting (node id = {Device.NodeId}), step = {step}, delay = {delay}"); StopCounting(); _countingTask = Task.Run(async() => { var stopWatch = new Stopwatch(); const double maxRunTimeInMs = 60000; _countingRunning = true; _counterValue = 0; agent.RemoteChannelStatusChanged += (a, o) => { if (o.Id == source && o.Status == ChannelStatus.Offline) { _countingRunning = false; } }; stopWatch.Start(); do { _counterValue = _counterValue + step; if (!_counterParameter.SetValue(_counterValue)) { MsgLogger.WriteError($"{GetType().Name} - DummyDeviceCommunication", "set counter parameter value failed!"); } await Task.Delay(delay); }while (_countingRunning && stopWatch.ElapsedMilliseconds < maxRunTimeInMs); }); return(true); }
public MasterDeviceManager(SyncCloudAgent cloudAgent) { CloudAgent = cloudAgent; }
/// <summary> /// MasterVcs /// </summary> /// <param name="masterAgent"></param> /// <param name="device"></param> /// <param name="updateInterval"></param> /// <param name="timeout"></param> public MasterVcs(SyncCloudAgent masterAgent, EltraDevice device, uint updateInterval, uint timeout) : base(masterAgent.Url, device.ChannelId, masterAgent.Identity, updateInterval, timeout) { Device = device; }
internal DeviceAgent(SyncCloudAgent masterAgent, EltraDevice device, uint updateInterval, uint timeout) : base(masterAgent, device, updateInterval, timeout) { }