/**Iastantiation**********************************************************/

        public Plotter(RealTimeDB Database)
        {
            //Initialize the Form
            InitializeComponent();

            //Attatch to the database
            DB = Database;
            updateSignalNames();

            //Format X axis to show tens of timescale
            Chart.ChartAreas[0].AxisX.LabelStyle.Format = "#.##";

            //Event Handlers
            this.Resize      += new EventHandler(FrmResize);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FrmClosing);


            // Create a Timer to update the Plot Data.
            AutoResetEvent autoEvent = new AutoResetEvent(false);
            TimerCallback  tcb       = Update;

            updateTimer = new System.Threading.Timer(tcb, autoEvent, 100, 200);

            this.Chart.ChartAreas[0].AxisX.Minimum = 0;
            TB_XAxisTime.Text = XAxisScale.ToString();
            FrmResize(this, new System.EventArgs());
        }
Ejemplo n.º 2
0
        public MAIN()
        {
            InitializeComponent();
            this.Resize += new EventHandler(FrmResize);
            cmb_baud.Items.Add(300);
            cmb_baud.Items.Add(600);
            cmb_baud.Items.Add(1200);
            cmb_baud.Items.Add(2400);
            cmb_baud.Items.Add(4800);
            cmb_baud.Items.Add(9600);
            cmb_baud.Items.Add(14400);
            cmb_baud.Items.Add(19200);
            cmb_baud.Items.Add(28800);
            cmb_baud.Items.Add(38400);
            cmb_baud.Items.Add(57600);
            cmb_baud.Items.Add(115200);

            ComPort.DataReceived += new SerialDataReceivedEventHandler(ComPort_DataReceived);
            ComPortStatus         = EnumComPortStatus.NotConnected;
            btn_connect.Enabled   = false;

            EOLChars.Add("None", "");
            EOLChars.Add("Newline", "\n");
            EOLChars.Add("Carraige Regurn", "\r");
            EOLChars.Add("Both NL and CR", "\n\r");

            cmb_eol.DataSource    = new BindingSource(EOLChars, null);
            cmb_eol.DisplayMember = "Key";
            cmb_eol.ValueMember   = "Value";

            DB  = new RealTimeDB();
            ASI = new AdvancedSerial_API(DB);

            //Initialized the Buffer
            Buffer.Add("TEST_sin", new List <Tuple <Single, Single> >());
            Buffer.Add("TEST_cos", new List <Tuple <Single, Single> >());

            //Create a Timer to update the test data
            sw = new Stopwatch();
            TimerCallback tcb = UpdateTestData;

            updateTimer = new System.Threading.Timer(tcb, sw, 0, 100);
            sw.Start();
        }
Ejemplo n.º 3
0
 //Instantiation
 public AdvancedSerial_API(RealTimeDB DatabaseRef)
 {
     DB = DatabaseRef;
 }