public MasterNode(MeasurementCache cache, IMaster master, ISimulatorNodeCallbacks callbacks, string alias) { this.cache = cache; this.master = master; this.callbacks = callbacks; this.alias = alias; this.callbacks.ChangeImage(IconIndex.Master); this.openAction = new NodeAction("Open", () => OpenForm()); }
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(); }
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); }
ISimulatorNode CreateMaster(ISimulatorNodeCallbacks callbacks) { using (var dialog = new Components.MasterDialog()) { dialog.ShowDialog(); if (dialog.DialogResult == DialogResult.OK) { var cache = new MeasurementCache(); var masterConfig = dialog.Configuration; var alias = dialog.SelectedAlias; var master = channel.AddMaster(alias, cache, DefaultMasterApplication.Instance, masterConfig); if (master == null) { return null; } else { master.Enable(); return new MasterNode(cache, master, callbacks, alias); } } else { return null; } } }