Esempio n. 1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public MainWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            Build ();

            scadaApplication = null;
        }
Esempio n. 2
0
 public Kernel(ServerConfiguration config)
 {
     if(config == null)
     {
         scadaApplication = null;
     }
     else
     {
         scadaApplication = new ScadaApplication(config.file);
     }
 }
Esempio n. 3
0
        /// <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();
        }
Esempio n. 4
0
        /// <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 ();
            }
        }
Esempio n. 5
0
        /// <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();
        }