Пример #1
0
 private void nruMaxTime_ValueChanged(object sender, EventArgs e)
 {
     if (checkMinMax())
     {
         oSimCon.setMaxTime((int)nruMaxTime.Value);
     }
 }
Пример #2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (checkMinMax())
            {
                oSimCon.Disconnect();
                oSimCon = null;
                oSimCon = new Simcon(this);
                oSimCon.Connect();
                oSimCon.setMinAlt((int)nruMinAlt.Value);
                oSimCon.setMaxAlt((int)nruMaxAlt.Value);
                oSimCon.setMinTime((int)nruMinTime.Value);
                oSimCon.setMaxTime((int)nruMaxTime.Value);
                oSimCon.setMinSpeed((int)nruMinSpeed.Value);
                oSimCon.setMaxSpeed((int)nruMaxSpeed.Value);
                oSimCon.setMaxNoFails((int)nruNoFails.Value);
                if (!cbInstant.Checked && !cbTaxi.Checked && !cbTime.Checked && !cbAlt.Checked && !cbSpeed.Checked)
                {
                    MessageBox.Show("At least one checkbox in \"When fail can occur\" have to be checked", "Error", MessageBoxButtons.OK);
                }
                else
                {
                    oSimCon.setWhenFail(cbInstant.Checked, cbTaxi.Checked, cbTime.Checked, cbAlt.Checked, cbSpeed.Checked);
                    oSimCon.prepareFailures();

                    btnStop.Enabled = true;
                    stopToolStripMenuItem.Enabled = true;
                    btnStart.Enabled = false;
                    StartToolStripMenuItem.Enabled = false;
                }
            }
        }