Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the context.
 /// </summary>
 /// <returns></returns>
 protected TracerContext getContext()
 {
     return(TracerContext.getInstance());
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Ons the selected index changed.
        /// </summary>
        /// <param name="o">The o.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void onTraceListBoxSelectedIndexChanged(object o, EventArgs e)
        {
            debug("MainWindow.onTraceListBoxSelectedIndexChanged()");

            TraceGuiListItem traceItem = traceListBox.SelectedItem as TraceGuiListItem;

            if (traceItem == null)
            {
                return;
            }

            if (traceFileContentListBox.ActualFileName.CompareTo(traceItem.FileName) == 0)
            {
                labelTraceFileLine.Text = Convert.ToString(traceItem.LineNumber + 1);
                traceFileContentListBox.ActiveLineNumber = traceItem.LineNumber + 1;
                // ---------------------------------traceFileContentListBox.SelectedIndex = traceItem.LineNumber;
                //traceFileContentListBox.Refresh();
                //return;
            }

            labelTraceFilePath.Text = traceItem.FileName;
            labelTraceFileLine.Text = Convert.ToString(traceItem.LineNumber + 1);

            traceFileContentListBox.ActiveLineNumber = traceItem.LineNumber + 1;
            traceFileContentListBox.ActualFileName   = traceItem.FileName;
            //fileContentBindingList.Clear(); ------------------------------------------------------
            this.traceFileContentTextBox.Clear();

            string[] fileContent = File_Factory.FileFactory.getInstance().getFileContentAsLineArray(TracerContext.getInstance().BasicFilePath + traceItem.FileName);

            for (int i = 0; i < fileContent.Length; i++)
            {
                // -------------------------fileContentBindingList.Add(new TraceFileContentElement(i + 1, fileContent[i]));
                if (i == traceItem.LineNumber)
                {
                    this.traceFileContentTextBox.SelectionBackColor = Color.Blue;
                }
                else
                {
                    this.traceFileContentTextBox.SelectionBackColor = Color.DarkBlue;
                }

                this.traceFileContentTextBox.AppendText((i + 1) + "\t");
                this.traceFileContentTextBox.AppendText(fileContent[i]);
                this.traceFileContentTextBox.AppendText("\n");
            }

            traceFileContentTextBox.SelectionStart = traceFileContentTextBox.Find(traceFileContentTextBox.Lines[traceItem.LineNumber]);
            traceFileContentTextBox.ScrollToCaret();

            return;
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Starts the tracing.
 /// </summary>
 public void startTracing()
 {
     TracerContext.getInstance().TraceActive = true;
     engine.start(50);
 }
Ejemplo n.º 5
0
 public void setConnectionInterface(ICommonConnectionInterface iConnection)
 {
     TracerContext.getInstance().Connection = iConnection;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Stops the tracing.
 /// </summary>
 public void stopTracing()
 {
     TracerContext.getInstance().TraceActive = false;
     engine.stop();
 }