/// <summary> /// Loads the traces from interface. /// </summary> private void loadTracesFromInterface() { TraceElement traceElement = TracerFactory.getInstance().getInterface().getNextElement(); int elementCoutner = 0; while (traceElement != null) { elementCoutner += 1; // -------------------traceBindingList.Add(new TraceGuiListItem(traceElement)); traceElementList.Add(traceElement); traceElement = TracerFactory.getInstance().getInterface().getNextElement(); } labelTraceCount.Text = Convert.ToString(traceBindingList.Count); debug("MainWindow.loadTracesFromInterface() - New Element count: " + elementCoutner); }
/// <summary> /// Ons the window event. /// </summary> private void onWindowEvent() { debug("MainWindow.onWindowEvent()"); if (comportWindow.hasChanged()) { if (comportWindow.isValid()) { startNewTrace(); } } if (progressTraceWindow.hasChanged()) { TracerFactory.getInstance().getInterface().stopTracing(); loadTracesIntoList(); } }
/// <summary> /// Starts the new trace. /// </summary> private void startNewTrace() { traceBindingList.Clear(); fileContentBindingList.Clear(); traceElementList.Clear(); traceFileContentListBox.ActiveLineNumber = -1; traceFileContentListBox.ActualFileName = "null"; labelTraceCount.Text = "0"; getUserContext().ComportSelection = comportWindow.Comport; getUserContext().BaudrateSelection = comportWindow.Baudrate; TracerContext.getInstance().Comport = comportWindow.Comport; TracerContext.getInstance().Baudrate = comportWindow.Baudrate; TracerContext.getInstance().TraceActive = true; TracerFactory.getInstance().getInterface().startTracing(); progressTraceWindow.StartPosition = FormStartPosition.CenterParent; progressTraceWindow.ShowDialog(this); }
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); }