Esempio n. 1
0
            public Limits temperatureLims; /* temperature limits in the experiment */

            #endregion Fields

            #region Constructors

            /*(lm, int.Parse(this.txtbox_delta_time.Text), ParserClass_.ParseNumberFloat(this.txtbox_sample_V.Text), ParserClass_.ParseNumberFloat(this.txtbox_env.Text), ParserClass_.ParseNumberFloat(this.txtbox_set_point.Text), this.txtbox_comment.Text);*/
            public Parameters(Limits tLims, int deltaT, float aV, float envT, float desiR, String commentS)
            {
                Contract.Ensures(0 < aV);
                 this.deltaTime = deltaT;
                 this.temperatureLims = tLims;
                 this.amperimeterVoltage0 = aV;
                 this.envTemperature = envT;
                 this.desiredRate = desiR;
                 this.commentsSample = commentS;
            }
Esempio n. 2
0
        private void threadExperiment_DoWork(object sender, DoWorkEventArgs e)
        {
            Random random = new Random();
            BackgroundWorker worker = sender as BackgroundWorker;

            exp = new ConductivityExperiment();

            /* temperature limits in the experiment */
            /* Minimum temperature, Maximum temperature */
            lm = new Limits(ParserClass_.ParseNumberFloat(this.txtbox_min_temp.Text), ParserClass_.ParseNumberFloat(this.txtbox_max_temp.Text));

            //Tlim,aV,envT,desiR
            /* Amperimeter voltage, Temperature rate, Environment temperature */
            prmt = new pidcon.ConductivityExperiment.Parameters(lm, int.Parse(this.txtbox_delta_time.Text), ParserClass_.ParseNumberFloat(this.txtbox_sample_V.Text), ParserClass_.ParseNumberFloat(this.txtbox_env.Text), ParserClass_.ParseNumberFloat(this.txtbox_set_point.Text), this.txtbox_comment.Text);

            //lmt = new pidcon.Limits();
            //exp.Init(10);

            pidd = new PID.Controller();

            //TestEvents.EventListener evl = new TestEvents.EventListener();
            exp._mainForm = this;

            exp.RunExperiment(prmt, pidd.parms);

            /*
            while ( true )
            {
                if (worker.CancellationPending == true)
                {
                    e.Cancel = true;
                    break;
                }
                else
                {
                    resistorVoltage = random.Next(0, 100);
                    sampleVoltage = random.Next(0, 100);
                    resistorCurrent = random.Next(0, 100);
                    sampleCurrent = random.Next(0, 100);

                    if (flag == 0)
                    {
                        temperature = temperature + 1;
                        if (temperature > 50)
                            flag = 1;
                    }
                    else
                    {
                        temperature = temperature - 1;
                        if (temperature < 5)
                            flag = 0;
                    }

                    // Perform a time consuming operation and report progress.
                    System.Threading.Thread.Sleep(40);
                    worker.ReportProgress(1);
                }
            }
            */
        }
Esempio n. 3
0
        private void threadMonitor_DoWork(object sender, DoWorkEventArgs e)
        {
            Random random = new Random();
            BackgroundWorker worker = sender as BackgroundWorker;

            exp = new ConductivityExperiment();

            /* temperature limits in the experiment */
            /* Minimum temperature, Maximum temperature */
            lm = new Limits(ParserClass_.ParseNumberFloat(this.txtbox_min_temp.Text), ParserClass_.ParseNumberFloat(this.txtbox_max_temp.Text));

            //Tlim,aV,envT,desiR
            /* Amperimeter voltage, Temperature rate, Environment temperature */
            prmt = new pidcon.ConductivityExperiment.Parameters(lm, int.Parse(this.txtbox_delta_time.Text), ParserClass_.ParseNumberFloat(this.txtbox_sample_V.Text), ParserClass_.ParseNumberFloat(this.txtbox_env.Text), ParserClass_.ParseNumberFloat(this.txtbox_set_point.Text), this.txtbox_comment.Text);

            //lmt = new pidcon.Limits();
            //exp.Init(10);

            pidd = new PID.Controller();

            exp._mainForm = this;

            exp.RunMonitor(prmt);
        }
            public Limits temperatureLims; /* temperature limits in the experiment */

            #endregion Fields

            #region Constructors

            public Parameters(Limits tLims, float aV, float envT, float desiR)
            {
                Contract.Ensures(0 < aV);
                 this.temperatureLims = tLims;
                 this.amperimeterVoltage0 = aV;
                 this.envTemperature = envT;
                 this.desiredRate = desiR;
            }