Ejemplo n.º 1
0
        public async Task AddCommand(ScadaCommand command)
        {
            var commands = await this.StateManager.GetOrAddAsync <IReliableDictionary <string, List <ScadaCommand> > >("commands", TimeSpan.FromSeconds(60));

            if (command.RegisterType == SCADA.Common.DataModel.RegisterType.BINARY_INPUT)
            {
                using (var tx = this.StateManager.CreateTransaction())
                {
                    if (await commands.GetCountAsync(tx) == 0)
                    {
                        await commands.SetAsync(tx, "scada", new List <ScadaCommand>(), TimeSpan.FromSeconds(60), CancellationToken.None);
                    }
                    await tx.CommitAsync();
                }
                localCommands = new List <ScadaCommand>();
                return;
            }
            AddLocalCommand(command);
        }
Ejemplo n.º 2
0
 public async Task ExecuteCommand(ScadaCommand command)
 {
     var client = BuildClient();
     await client.InvokeWithRetryAsync(x => x.Channel.ExecuteCommand(command));
 }
Ejemplo n.º 3
0
 public Task AddCommand(ScadaCommand command)
 {
     _fep.ExecuteCommand(command);
     return(Task.CompletedTask);
 }
Ejemplo n.º 4
0
        public Task Commmand(ScadaCommand command)
        {
            var client = BuildClient();

            return(client.InvokeWithRetryAsync(x => x.Channel.Commmand(command)));
        }
Ejemplo n.º 5
0
 public Task ExecuteCommand(ScadaCommand command)
 {
     ServiceEventSource.Current.ServiceMessage(_context, "FEP - ExecuteCommand called!");
     _addCommand(command);
     return(Task.CompletedTask);
 }
Ejemplo n.º 6
0
 public void ExecuteCommand(ScadaCommand command)
 {
     processingManager.ExecuteWriteCommand(command.RegisterType, command.Index, command.Value);
 }
Ejemplo n.º 7
0
 public void AddLocalCommand(ScadaCommand command)
 {
     localCommands.Add(command);
 }