Ejemplo n.º 1
0
        private void startPumping(PacientCodeEnum patCodeEnum, int periodSecounds)
        {
            if (dictPacientPump.ContainsKey(patCodeEnum))
            {
                MessageBox.Show("The selecteed pacient has the pump already started");
                return;
            }
            PumpSensorValues sensorValuesPump = new PumpSensorValues(patCodeEnum.ToString(), periodSecounds);

            sensorValuesPump.StartPumping();
            sensorValuesPump.newSensorValueEvent += new OnNewSensorValue(OnNewSensorValueHandler);
            dictPacientPump.Add(patCodeEnum, sensorValuesPump);
        }
Ejemplo n.º 2
0
        private void bStopPumping_Click(object sender, EventArgs e)
        {
            PacientCodeEnum currPacientStop = (PacientCodeEnum)cbPacientCodeStart.SelectedItem;

            if (dictPacientPump.ContainsKey(currPacientStop))
            {
                PumpSensorValues pumpToBeStoped = dictPacientPump[currPacientStop];
                pumpToBeStoped.StopPumping();
                dictPacientPump.Remove(currPacientStop);
            }
            else
            {
                MessageBox.Show("The selected pacient has no pump values started");
            }
        }
Ejemplo n.º 3
0
        private void bStartPumping_Click(object sender, EventArgs e)
        {
            int timePeriodSecounds = 1;

            if (cbPacientCodeStart.SelectedItem != null && tbTimePeriod.Text != string.Empty)
            {
                try
                {
                    timePeriodSecounds = Convert.ToInt32(tbTimePeriod.Text);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: Time period input cannot be converted to int ->" + ex.Message);
                }
                PacientCodeEnum currPacient = (PacientCodeEnum)cbPacientCodeStart.SelectedItem;
                startPumping(currPacient, timePeriodSecounds);
            }
        }