Example #1
0
        private void BbtnApply_Click(object sender, EventArgs e)
        {
            if (!((DMP_Main_MDIParent)this.MdiParent).GetCTMconnection ||
                !((DMP_Main_MDIParent)this.MdiParent).GetINSconnection)
            {
                CustomMsgBox.Show("Hardware is not connected.\nApplying new settings is currently not possible.", "Error", "OK");
            }
            else
            {
                if (((DMP_Main_MDIParent)this.MdiParent).StimSettingsCheck(this))
                {
                    if (((DMP_Main_MDIParent)this.MdiParent).WriteStimulationSettingsFile())
                    {
                        this.Setlabel_settingsTimeText("Setting successfully saved: " + String.Format("{0:G}", DateTime.Now));
                    }

                    // ask if to start or test stim
                    DialogResult dialogResult = CustomMsgBox.Show("Settings are saved!\nWould you like to start stimulation with current settings or\ntest current stimulation settings?",
                                                                  "Apply Stimulation Settings",
                                                                  "Start Stimulation", "Test Stimulation", "Done");

                    if (dialogResult == DialogResult.No) // Test Stimulation
                    {
                        stimTest = new StimTest((DMP_Main_MDIParent)this.MdiParent);
                        stimTest.ShowDialog();
                    }
                    else if (dialogResult == DialogResult.Yes) // Start Stimulation
                    {
                        new Thread(() => ((DMP_Main_MDIParent)this.MdiParent).StartStim(this)).Start();
                    }
                }
            }
        }
Example #2
0
 private void BtnTest_Click(object sender, EventArgs e)
 {
     if (!((DMP_Main_MDIParent)this.MdiParent).GetCTMconnection ||
         !((DMP_Main_MDIParent)this.MdiParent).GetINSconnection)
     {
         CustomMsgBox.Show("Hardware is not connected.\nTesting new settings is currently not possible.", "Error", "OK");
     }
     else
     {
         if (((DMP_Main_MDIParent)this.MdiParent).StimSettingsCheck(this))
         {
             stimTest = new StimTest((DMP_Main_MDIParent)this.MdiParent);
             stimTest.ShowDialog();
         }
     }
 }