public Kernel(ServerConfiguration config) { if (config == null) { scadaApplication = null; } else { scadaApplication = new ScadaApplication(config.file); } }
/// <summary> /// Loads the SCADA file. Converts XML to a ScadaApplication class /// </summary> /// <param name="scadafile"> /// A <see cref="System.String"/> containing the filename of the .scada file to open /// </param> public void LoadScadaFile(string scadafile) { // Creates the scada aplication based on the scada file scadaApplication = new ScadaApplication(scadafile); // Updates the TreeView with the application structure UpdateScadaApplicationsListTree(); // Fills the TextView with the content of the file UpdateTextView(); }
/// <summary> /// Constructor from a Configuration setup /// </summary> /// <param name="config"> /// A <see cref="Configuration"/> with the manager settings /// </param> public MainWindow(Configuration config) : base(Gtk.WindowType.Toplevel) { Build(); // Check if any configuration was provided if (config == null) { // If not, initializes an empty scada application scadaApplication = null; } else { // Else, creates a new scada application based on a .scada file scadaApplication = new ScadaApplication(config.file); UpdateScadaApplicationsListTree(); } }
/// <summary> /// Close any opened SCADA application /// </summary> private void CloseApplication() { // Check if is there any app loaded or not if (scadaApplication != null) { scadaApplication.Stop(); scadaApplication = null; } // Clean the application tree view CleanTreeView(); // Disable tooblar buttons disableToolBarButtons(); // Clear text view txvTextView.Buffer.Text = ""; // Refresh this.ShowAll(); }
/// <summary> /// Default constructor /// </summary> public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); scadaApplication = null; }