Beispiel #1
0
        public OutstationForm(IOutstation outstation, ProxyCommandHandler commandHandler)
        {
            InitializeComponent();

            this.outstation     = outstation;
            this.commandHandler = commandHandler;

            commandHandler.CommandProxy = this; // proxy commands to the form
        }
Beispiel #2
0
        public OutstationInstance(ProxyCommandHandler handler, EventedOutstationApplication application, IOutstation outstation, OutstationStackConfig config, string alias)
        {
            this.handler     = handler;
            this.application = application;
            this.outstation  = outstation;
            this.alias       = alias;

            this.cache = new MeasurementCache(config.databaseTemplate);
        }
Beispiel #3
0
        public OutstationInstance(ProxyCommandHandler handler, EventedOutstationApplication application, IOutstation outstation, OutstationStackConfig config, string alias)
        {
            this.handler     = handler;
            this.application = application;
            this.outstation  = outstation;
            this.alias       = alias;

            this.form = new OutstationForm(outstation, handler);
        }
        public OutstationForm(IOutstation outstation, ProxyCommandHandler commandHandler)
        {
            InitializeComponent();

            this.outstation = outstation;
            this.commandHandler = commandHandler;

            commandHandler.CommandProxy = this; // proxy commands to the form
        }
Beispiel #5
0
        public OutstationNode(IOutstation outstation, IOutstationInstance instance, ISimulatorNodeCallbacks callbacks)
        {
            this.outstation = outstation;
            this.instance   = instance;
            this.callbacks  = callbacks;

            this.openAction = new NodeAction("Open", () => OpenForm());

            this.callbacks.ChangeImage(IconIndex.Outstation);
        }
        public OutstationNode(IOutstation outstation, IOutstationInstance instance, ISimulatorNodeCallbacks callbacks)
        {
            this.outstation = outstation;
            this.instance = instance;
            this.callbacks = callbacks;

            this.openAction = new NodeAction("Open", () => OpenForm());

            this.callbacks.ChangeImage(IconIndex.Outstation);
        }
Beispiel #7
0
        public OutstationNode(MeasurementCache cache, ProxyCommandHandler handler, EventedOutstationApplication application, IDNP3Config config, IOutstation outstation, ISimulatorNodeCallbacks callbacks, string alias)
        {
            this.cache       = cache;
            this.handler     = handler;
            this.application = application;
            this.config      = config;
            this.outstation  = outstation;
            this.callbacks   = callbacks;
            this.alias       = alias;

            this.callbacks.ChangeImage(IconIndex.Outstation);

            this.openAction = new NodeAction("Open", () => OpenForm());
        }
Beispiel #8
0
        public OutstationForm(IOutstation outstation, EventedOutstationApplication application, MeasurementCache cache, ProxyCommandHandler proxy, String alias)
        {
            InitializeComponent();

            this.outstation  = outstation;
            this.application = application;
            this.cache       = cache;
            this.proxy       = proxy;

            this.database = new MultiplexedDatabase(cache, outstation.GetDatabase());

            this.Text = String.Format("DNP3 Outstation ({0})", alias);
            this.comboBoxTypes.DataSource = System.Enum.GetValues(typeof(MeasType));

            this.commandHandlerControl1.Configure(proxy, database);

            this.comboBoxColdRestartMode.DataSource = System.Enum.GetValues(typeof(RestartMode));

            this.application.ColdRestart += application_ColdRestart;
            this.application.TimeWrite   += application_TimeWrite;

            this.CheckState();
        }
        public OutstationForm(IOutstation outstation, EventedOutstationApplication application, MeasurementCache cache, ProxyCommandHandler proxy, String alias)
        {
            InitializeComponent();

            this.outstation = outstation;
            this.application = application;
            this.cache = cache;
            this.proxy = proxy;

            this.loader = new ProxyLoader(outstation, cache);

            this.Text = String.Format("DNP3 Outstation ({0})", alias);
            this.comboBoxTypes.DataSource = System.Enum.GetValues(typeof(MeasType));

            this.commandHandlerControl1.Configure(proxy, loader);

            this.comboBoxColdRestartMode.DataSource = System.Enum.GetValues(typeof(RestartMode));

            this.application.ColdRestart += application_ColdRestart;
            this.application.TimeWrite += application_TimeWrite;

            this.CheckState();
        }
        private void ConfigureOutstation()
        {
            var outstationConfig = new OutstationStackConfig();

            // configure the various measurements in our database
            //outstationConfig.databaseTemplate = new DatabaseTemplate(4, 1, 1, 1, 1, 1, 1, 0);
            outstationConfig.databaseTemplate = new DatabaseTemplate(
                (ushort)0,
                (ushort)0,
                (ushort)255,
                (ushort)0,
                (ushort)0,
                (ushort)0,
                (ushort)0,
                (ushort)0);

            var template = outstationConfig.databaseTemplate;


            outstationConfig.outstation.config.allowUnsolicited = true;

            outstationConfig.link.localAddr  = 10;
            outstationConfig.link.remoteAddr = 1;
            outstationConfig.outstation.buffer.maxAnalogEvents             = (uint)random.Next();
            outstationConfig.outstation.buffer.maxAnalogOutputStatusEvents = (uint)random.Next();
            outstationConfig.outstation.buffer.maxBinaryEvents             = (uint)random.Next();
            outstationConfig.outstation.buffer.maxBinaryOutputStatusEvents = (uint)random.Next();
            outstationConfig.outstation.buffer.maxCounterEvents            = (uint)random.Next();
            outstationConfig.outstation.buffer.maxDoubleBinaryEvents       = (uint)random.Next();
            outstationConfig.outstation.buffer.maxFrozenCounterEvents      = (uint)random.Next();

            outstation = channel.AddOutstation("outstation", RejectingCommandHandler.Instance, DefaultOutstationApplication.Instance, outstationConfig);
            if (outstation != null)
            {
                outstation.Enable(); // enable communications
            }
        }
Beispiel #11
0
 IOutstationInstance IOutstationFactory.CreateInstance(IOutstation outstation, string name, OutstationStackConfig config)
 {
     return(new OutstationInstance(commandHandler, application, outstation, config, name));
 }
        public OutstationInstance(ProxyCommandHandler handler, EventedOutstationApplication application, IOutstation outstation, OutstationStackConfig config, string alias)
        {
            this.handler = handler;
            this.application = application;
            this.outstation = outstation;
            this.alias = alias;

            this.cache = new MeasurementCache(config.databaseTemplate);
        }
 IOutstationInstance IOutstationFactory.CreateInstance(IOutstation outstation, string name, OutstationStackConfig config)
 {
     return new OutstationInstance(commandHandler, application, outstation, config, name);
 }
        public OutstationInstance(ProxyCommandHandler handler, EventedOutstationApplication application, IOutstation outstation, OutstationStackConfig config, string alias)
        {
            this.handler = handler;
            this.application = application;
            this.outstation = outstation;
            this.alias = alias;

            this.form = new OutstationForm(outstation, handler);
        }