示例#1
0
 /// <summary>
 /// Prepares this instance.
 /// </summary>
 public void prepare()
 {
     comboBoxComport.Items.AddRange(SerialIOFactory.getInstance().getSerialConnection().getAvailablePorts());
     comboBoxBaudrate.Items.AddRange(SerialIOFactory.getInstance().getSerialConnection().getAvailableBaudrates());
     comboBoxBaudrate.SelectedIndex = 0; // selects the first entry in the list
 }
示例#2
0
        public MainWindow()
        {
            DebugFactory.getInstance().DebugLevel = DEBUG_LEVEL.ALL;
            debugMode = DEBUG_MODE.CONSOLE;

            initUserContext();

            InitializeComponent();

            this.Visible = true;

            traceElementList = new List <TraceElement>();

            // ----------------------------------------------------------------

            traceListBox     = new TraceGuiListBox();
            traceBindingList = new BindingList <TraceGuiListItem>();

            tableLayoutPanel1.Controls.Add(traceListBox, 0, 0);

            traceListBox.Dock = System.Windows.Forms.DockStyle.Fill;
            traceListBox.FormattingEnabled = true;
            traceListBox.Location          = new System.Drawing.Point(3, 3);
            traceListBox.Size                  = new System.Drawing.Size(656, 389);
            traceListBox.TabIndex              = 0;
            traceListBox.SelectedIndexChanged += new EventHandler(onTraceListBoxSelectedIndexChanged);

            traceListBox.HorizontalScrollbar = true;
            traceListBox.DataSource          = traceBindingList;

            // ------------------------------------------------------

            traceFileContentListBox = new TracerGuiFileContentListBox();
            fileContentBindingList  = new BindingList <TraceFileContentElement>();

            /*
             * this.tableLayoutPanel1.Controls.Add(this.traceFileContentListBox, 1, 0);
             */
            this.traceFileContentListBox.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.traceFileContentListBox.Location = new System.Drawing.Point(339, 3);
            this.traceFileContentListBox.Size     = new System.Drawing.Size(320, 409);
            this.traceFileContentListBox.TabIndex = 0;
            this.traceFileContentListBox.Text     = "";

            traceFileContentListBox.HorizontalScrollbar = true;
            traceFileContentListBox.DataSource          = fileContentBindingList;

            // ------------------------------------------------------


            // ------------------------------------------------------

            TracerFactory.getInstance().getInterface().init();
            TracerFactory.getInstance().getInterface().setConnectionInterface(SerialIOFactory.getInstance().getSerialConnection());
            TracerFactory.getInstance().getInterface().getUpdateHandler().Event_UpdateNotification += new TracerUpdateNotification.UpdateNotificationHandler(onTraceEvent);

            this.traceListBox.KeyDown += new KeyEventHandler(onKeyDown);
            this.KeyDown += new KeyEventHandler(onKeyDown);
            this.traceFileContentListBox.KeyDown += new KeyEventHandler(onKeyDown);
            this.traceFileContentTextBox.KeyDown += new KeyEventHandler(onKeyDown);

            progressTraceWindow = new TraceInProgressWindow();
            progressTraceWindow.Event_UpdateNotification += new CommonWindow.UpdateNotificationHandler(onWindowEvent);

            comportWindow = new ComportSelectionWindow();
            comportWindow.prepare();
            comportWindow.StartPosition             = FormStartPosition.CenterParent;
            comportWindow.Event_UpdateNotification += new CommonWindow.UpdateNotificationHandler(onWindowEvent);
            comportWindow.ShowDialog(this);
        }