Пример #1
0
        private IDataPolicy _CreateDataPolicy(CommandOutput output)
        {
            IDataPolicy dataPolicy = _dataPolicyFactory.CreateDataPolicy();

            _AddDataPolicy(output, dataPolicy);
            return(dataPolicy);
        }
Пример #2
0
        internal OutputController(Guid id, string name, IOutputMediator <CommandOutput> outputMediator,
                                  IHardware executionControl,
                                  IOutputModuleConsumer <IControllerModuleInstance> outputModuleConsumer)
        {
            if (outputMediator == null)
            {
                throw new ArgumentNullException("outputMediator");
            }
            if (executionControl == null)
            {
                throw new ArgumentNullException("executionControl");
            }
            if (outputModuleConsumer == null)
            {
                throw new ArgumentNullException("outputModuleConsumer");
            }

            Id                    = id;
            Name                  = name;
            _outputMediator       = outputMediator;
            _executionControl     = executionControl;
            _outputModuleConsumer = outputModuleConsumer;

            _dataPolicy = ControllerModule.DataPolicyFactory.CreateDataPolicy();

            ControllerModule.DataPolicyFactoryChanged += DataPolicyFactoryChanged;
        }
Пример #3
0
 private ICommand _GenerateOutputCommand(CommandOutput output)
 {
     if (output.State != null)
     {
         IDataPolicy effectiveDataPolicy = _dataPolicyProvider.GetDataPolicyForOutput(output);
         return(effectiveDataPolicy.GenerateCommand(output.State));
     }
     return(null);
 }
Пример #4
0
        private ICommand _GenerateOutputCommand(CommandOutput output)
        {
            if (output.State != null)
            {
                var lst = output.State.Value as List <IIntentState>;

                IDataPolicy effectiveDataPolicy = _dataPolicyProvider.GetDataPolicyForOutput(output);
                return(effectiveDataPolicy.GenerateCommand(output.State));
            }
            return(null);
        }
Пример #5
0
 private ICommand _GenerateOutputCommand(CommandOutput output)
 {
     if (output.State != null)
     {
         IDataPolicy effectiveDataPolicy = _dataPolicyProvider.GetDataPolicyForOutput(output);
         ICommand    command             = effectiveDataPolicy.GenerateCommand(output.State);
         if (command != null)
         {
             List <ICommand> commands = new List <ICommand>();
             commands.Add(command);
             CommandsDataFlowData data = new CommandsDataFlowData(commands);
             command = effectiveDataPolicy.GenerateCommand(data);
         }
         return(command);
     }
     return(null);
 }
Пример #6
0
 private void DataPolicyFactoryChanged(object sender, EventArgs eventArgs)
 {
     _dataPolicy = ControllerModule.DataPolicyFactory.CreateDataPolicy();
 }
Пример #7
0
 private void _AddDataPolicy(CommandOutput output, IDataPolicy dataPolicy)
 {
     lock (_outputDataPolicies) {
         _outputDataPolicies[output.Id] = dataPolicy;
     }
 }
Пример #8
0
 private void _AddDataPolicy(CommandOutput output, IDataPolicy dataPolicy)
 {
     lock (_outputDataPolicies) {
         _outputDataPolicies[output.Id] = dataPolicy;
     }
 }