Exemple #1
0
 private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     settings_dialog = new SettingsSetup();
     settings_dialog.ShowDialog();
     if (settings_dialog.btnPressed())
     {
         changeInterval();
     }
 }
Exemple #2
0
        private void mainForm_Load(object sender, EventArgs e)
        {
            //Properties.Settings.Default.Reset();
            fullScreenToolStripMenuItem_Click(sender, e);

            comSerial = new SerialPort();
            aboutInfo = new AboutBox1();
            startToolStripMenuItem.Enabled = false;
            stopToolStripMenuItem.Enabled  = false;
            button1.Enabled   = false;
            isCollecting      = false;
            textBox2.KeyDown += new KeyEventHandler(OnKeyDownHandler);
            button2.Enabled   = false;

            button5.Enabled = false;
            button6.Enabled = false;

            currentpoint     = 0;
            currentProcpoint = 0;
            channels         = new Chart[NUM_CHANNELS * 2] {
                channel1, channel2, channel3, channel4, channel1_P, channel2_P, channel3_P, channel4_P
            };
            labels = new Label[NUM_CHANNELS * 2] {
                label1, label2, label3, label4, label5, label6, label7, label8
            };
            baselineTable = new Label[NUM_CHANNELS * 5] {
                label11, label12, label13, label14, label15,
                label16, label17, label18, label19, label20,
                label21, label22, label23, label24, label25,
                label26, label27, label28, label29, label30,
            };
            updateBaseline();
            for (int j = 0; j < NUM_CHANNELS * 2; j++)
            {
                channels[j].Visible = false;

                channels[j].Series[0].IsXValueIndexed = true;
                channels[j].Series[1].IsXValueIndexed = true;

                channels[j].ChartAreas[0].AxisX.Title = "Time (s)";

                if (j > 3)
                {
                    channels[j].ChartAreas[0].AxisY.Title = "%";
                }
                else
                {
                    channels[j].ChartAreas[0].AxisY.Title = "V";
                }

                labels[j].Visible = false;
            }
            label9.Visible = false;

            setUpInterval();
            changeInterval();


            foundSessions = new DataTable();
            foundSessions.Columns.Add("Session ID:", typeof(int));
            foundSessions.Columns.Add("Session Name:", typeof(string));
            foundSessions.Columns.Add("Session Size (Bytes):", typeof(long));
            foundSessions.Columns.Add("Date of Session:", typeof(DateTime));
            foundSessions.Columns.Add("Session Duration:", typeof(TimeSpan));
            foundSessions.Columns.Add("File Path:", typeof(string));
            foundSessions.Columns.Add("File Attribute:", typeof(string));



            dataGridView1.DataSource = foundSessions;
            DataGridViewCheckBoxColumn chk = new DataGridViewCheckBoxColumn();

            chk.HeaderText = "Select";
            dataGridView1.Columns.Add(chk);
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            folderBrowserDialog1.SelectedPath = GUI.Properties.Settings.Default.workingDirectory;
            ProcessDirectory(GUI.Properties.Settings.Default.workingDirectory);
            sessionPath   = GUI.Properties.Settings.Default.workingDirectory.ToString() + "\\session_" + (sessionsFound / 2).ToString() + ".drexel";
            processedPath = GUI.Properties.Settings.Default.workingDirectory.ToString() + "\\session_" + (sessionsFound / 2).ToString() + "_Processed.drexel";
            logPath       = GUI.Properties.Settings.Default.workingDirectory.ToString() + "log.csv";
            if (File.Exists(logPath))
            {
                File.Delete(logPath);
            }


            settings_dialog                 = new SettingsSetup();
            settings_dialog.TopLevel        = false;
            settings_dialog.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            groupBox3.Controls.Add(settings_dialog);

            //tabPage2.Controls.Add(settings_dialog);
            settings_dialog.Location = new Point(5, 50);
            settings_dialog.Visible  = true;


            comboBox1.Visible = false;
        }