Esempio n. 1
0
    public void Should_calculate_minutes()
    {
        var focusSession = new FocusTimer();

        focusSession.Start(10 * 60, "", inTotalSilcene:true, withDistractions:false);
        Assert.That(focusSession.MinutesWithModificators, Is.EqualTo(15));

        focusSession.Start(10 * 60, "", inTotalSilcene: false, withDistractions: true);
        Assert.That(focusSession.MinutesWithModificators, Is.EqualTo(3));
    }
Esempio n. 2
0
 private void FocusPage_Load(object sender, EventArgs e)
 {
     FocusTimer.Start();
 }
Esempio n. 3
0
        private void button_Start_Click(object sender, EventArgs e)
        {
            if (button_Start.Text == "Start")
            {
                masterCode = comboBox_Master.Text;
                boxCode    = comboBox_BoxCode.Text;
                lotCode    = comboBox_LotCode.Text;

                masterIndex = comboBox_Master.SelectedIndex;
                boxIndex    = comboBox_BoxCode.SelectedIndex;
                lotIndex    = comboBox_LotCode.SelectedIndex;

                try
                {
                    this.tray_1Box   = Int32.Parse(textBox_TRAYperBox.Text);
                    this.sample_Tray = Int32.Parse(textBox_SAMPLEperTray.Text);
                }
                catch
                {
                    if (function.BOX_LOT_CODE == false && function.COUNT_SETUP == false)
                    {
                        MessageBox.Show(this, "Must write down \"Box Qty\" and \"Lot Qty\" Number!", "[Error]", MessageBoxButtons.OK);
                        return;
                    }
                }

                this.sample_1Box          = this.tray_1Box * this.sample_Tray;
                textBox_SAMPLEperBOX.Text = this.sample_1Box.ToString();

                currentLotNumber = 1;
                sumOfLot         = 1;
                currentSeqQty    = 0;
                currentTestCount = 0;
                failCount        = 0;
                passCount        = 0;
                sumOfPassCount   = 0;

                if (function.COUNT_SETUP == false)
                {
                    this.label_TrayNumber.Text = this.sumOfLot.ToString();
                    this.label_TestCount.Text  = this.currentSeqQty.ToString();
                }
                else
                {
                    this.label_TrayNumber.Text = "";
                    this.label_TestCount.Text  = "";
                }

                this.button_PassFail.Text = "PASS (" + (this.passCount).ToString() + ") / FAIL (" + (this.failCount).ToString() + ")";

                comboBox_Master.DropDownStyle = ComboBoxStyle.Simple;

                if (function.BOX_LOT_CODE == false)
                {
                    comboBox_BoxCode.Enabled       = true;
                    comboBox_LotCode.Enabled       = true;
                    comboBox_BoxCode.DropDownStyle = ComboBoxStyle.Simple;
                    comboBox_LotCode.DropDownStyle = ComboBoxStyle.Simple;
                }
                else
                {
                    comboBox_BoxCode.Text    = "";
                    comboBox_LotCode.Text    = "";
                    comboBox_BoxCode.Enabled = false;
                    comboBox_LotCode.Enabled = false;
                }

                button_Start.BackColor = Color.Tomato;
                button_Start.Text      = "Stop";

                textBox_Scanned.Text = "";

                FocusTimer.Enabled = true;
                FocusTimer.Start();
            }
            else
            {
                masterCode = "";
                boxCode    = "";
                lotCode    = "";

                masterIndex = 0;
                boxIndex    = 0;
                lotIndex    = 0;

                currentLotNumber = 1;
                sumOfLot         = 1;
                currentSeqQty    = 0;

                textBox_SAMPLEperBOX.Text  = "";
                textBox_TRAYperBox.Text    = "";
                textBox_SAMPLEperTray.Text = "";
                this.label_TrayNumber.Text = "0";

                comboBox_Master.DropDownStyle  = ComboBoxStyle.DropDown;
                comboBox_BoxCode.DropDownStyle = ComboBoxStyle.DropDown;
                comboBox_LotCode.DropDownStyle = ComboBoxStyle.DropDown;

                button_Start.BackColor = Color.LimeGreen;
                button_Start.Text      = "Start";

                FocusTimer.Enabled = false;
                FocusTimer.Stop();
            }
        }