Пример #1
0
 public void LoadingDataPanelClearContents()
 {
     Controls.Remove(DataloadingMessage);
     Controls.Remove(DataLoadProgressBar1);
     Controls.Remove(DataloadingErrorMessage);
     ChoosedWeighScale.KillDataloggerLoad();
 }
        public void CompensationDoneDrawPanel()
        {
            int tabIndex = 0;

            SuspendLayout();
            //
            // CompensationDoneMessage1
            //
            if (CompensationDoneMessage1 == null)
            {
                CompensationDoneMessage1 = new System.Windows.Forms.Label();
            }
            CompensationDoneMessage1.Name      = "ConfirmCompensationMessage1";
            CompensationDoneMessage1.AutoSize  = false;
            CompensationDoneMessage1.TabIndex  = tabIndex++;
            CompensationDoneMessage1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            CompensationDoneMessage1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            CompensationDoneMessage1.Text      = ChoosedWeighScale.ToString() + "'s compensation is now defined, you  can click on \"Next\" to go to the main menu";
            Controls.Add(CompensationDoneMessage1);



            ResumeLayout(false);
            NextButton.Visible  = true;
            NextButton.Enabled  = true;
            PrevButton.Visible  = false;
            PrevButton.TabIndex = tabIndex++;
            NextButton.TabIndex = tabIndex++;
            CompensationDonePanelResize();
        }
Пример #3
0
 public void MonitorPanelClearContents()
 {
     Controls.Remove(MonitorMessage1);
     Controls.Remove(MonitorGraphContainer);
     Controls.Remove(ExportButton);
     ChoosedWeighScale.genericSensor.registerTimedReportCallback(null);
     ChoosedWeighScale.tsensor.registerTimedReportCallback(null);
     MonitorGraph = null;
     ChoosedWeighScale.KillDataloggerLoad();
 }
Пример #4
0
        private PanelDesc.WizardSteps ConfirmCompensationNextClicked()
        {
            double deltaRatioNum, avgRatioNum;

            System.Double.TryParse(deltaRatio.Text, out deltaRatioNum);
            System.Double.TryParse(avgRatio.Text, out avgRatioNum);
            ChoosedWeighScale.setCompensation(deltaRatioNum, avgRatioNum,
                                              deviceTempCompensationValues, deviceOffsetChgCompensationValues, deviceOffsetAvgCompensationValues);

            return(PanelDesc.WizardSteps.COMPENSATIONDONE);
        }
Пример #5
0
        public void WarningResetDrawPanel()
        {
            int tabIndex = 0;

            SuspendLayout();
            //
            // WarningResetMessage1
            //
            if (WarningResetMessage1 == null)
            {
                WarningResetMessage1 = new System.Windows.Forms.Label();
            }
            WarningResetMessage1.Name      = "WarningResetMessage1";
            WarningResetMessage1.AutoSize  = false;
            WarningResetMessage1.TabIndex  = tabIndex++;
            WarningResetMessage1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            WarningResetMessage1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            WarningResetMessage1.Text      = "You chose to calibrate " + ChoosedWeighScale.ToString();
            Controls.Add(WarningResetMessage1);

            if (WarningResetMessage2 == null)
            {
                WarningResetMessage2 = new System.Windows.Forms.Label();
            }
            WarningResetMessage2.Name     = "WarningResetMessage2";
            WarningResetMessage2.AutoSize = false;
            WarningResetMessage2.TabIndex = tabIndex++;

            WarningResetMessage2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            WarningResetMessage2.Text = "Be aware that the calibration process will erase all calibration settings and datalogger contents from this sensor. Please confirm  that you understand, then Click on Next to Continue";
            Controls.Add(WarningResetMessage2);

            if (WarningResetconfirm == null)
            {
                WarningResetconfirm = new CheckBox();
            }
            WarningResetconfirm.Name            = "WarningResetconfirm";
            WarningResetconfirm.AutoSize        = true;
            WarningResetconfirm.TabIndex        = tabIndex++;
            WarningResetconfirm.Text            = "Ok, I understand.";
            WarningResetconfirm.Checked         = false;
            WarningResetconfirm.CheckedChanged += WarningResetconfirm_CheckedChanged;
            Controls.Add(WarningResetconfirm);

            ResumeLayout(false);
            NextButton.Visible  = true;
            NextButton.Enabled  = false;
            PrevButton.Visible  = true;
            PrevButton.TabIndex = tabIndex++;
            NextButton.TabIndex = tabIndex++;
            WarningResetPanelResize();
        }
Пример #6
0
        public void ConfirmCompensationDrawPanel()
        {
            int tabIndex = 0;

            SuspendLayout();
            //
            // WarningResetMessage1
            //
            if (ConfirmCompensationMessage1 == null)
            {
                ConfirmCompensationMessage1 = new System.Windows.Forms.Label();
            }
            ConfirmCompensationMessage1.Name      = "ConfirmCompensationMessage1";
            ConfirmCompensationMessage1.AutoSize  = false;
            ConfirmCompensationMessage1.TabIndex  = tabIndex++;
            ConfirmCompensationMessage1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            ConfirmCompensationMessage1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            ConfirmCompensationMessage1.Text      = "You are about to inject the following compensation table in the sensor " + ChoosedWeighScale.ToString();
            Controls.Add(ConfirmCompensationMessage1);

            if (confirmTCRatioLabel == null)
            {
                confirmTCRatioLabel = new System.Windows.Forms.Label();
            }
            confirmTCRatioLabel.Name     = "confirmTCRatioLabel";
            confirmTCRatioLabel.TabIndex = tabIndex++;
            confirmTCRatioLabel.AutoSize = true;
            confirmTCRatioLabel.Font     = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTCRatioLabel.Text     = "Temperature change thermal inertia (‰):";
            Controls.Add(confirmTCRatioLabel);

            if (confirmTCRatioValue == null)
            {
                confirmTCRatioValue = new System.Windows.Forms.Label();
            }
            confirmTCRatioValue.Name      = "confirmTCRatioValue";
            confirmTCRatioValue.TabIndex  = tabIndex++;
            confirmTCRatioValue.AutoSize  = false;
            confirmTCRatioValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTCRatioValue.Width     = 80;
            confirmTCRatioValue.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTCRatioValue.Text      = deltaRatio.Text;
            Controls.Add(confirmTCRatioValue);

            if (confirmATRatioLabel == null)
            {
                confirmATRatioLabel = new System.Windows.Forms.Label();
            }
            confirmATRatioLabel.Name     = "confirmATRatioLabel";
            confirmATRatioLabel.TabIndex = tabIndex++;
            confirmATRatioLabel.AutoSize = true;
            confirmATRatioLabel.Font     = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmATRatioLabel.Text     = "Average temperature thermal inertia (‰):";
            Controls.Add(confirmATRatioLabel);

            if (confirmATRatioValue == null)
            {
                confirmATRatioValue = new System.Windows.Forms.Label();
            }
            confirmATRatioValue.Name      = "confirmATRatioValue";
            confirmATRatioValue.TabIndex  = tabIndex++;
            confirmATRatioValue.AutoSize  = false;
            confirmATRatioValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmATRatioValue.Width     = 80;
            confirmATRatioValue.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmATRatioValue.Text      = avgRatio.Text;
            Controls.Add(confirmATRatioValue);

            if (confirmTableTemp == null)
            {
                confirmTableTemp = new System.Windows.Forms.Label();
            }
            confirmTableTemp.Name     = "confirmTableTemp";
            confirmTableTemp.TabIndex = tabIndex++;
            confirmTableTemp.AutoSize = true;
            confirmTableTemp.Font     = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTemp.Text     = label10.Text;
            Controls.Add(confirmTableTemp);

            if (confirmTableTempMinus30 == null)
            {
                confirmTableTempMinus30 = new System.Windows.Forms.Label();
            }
            confirmTableTempMinus30.Name      = "confirmTableTempMinus30";
            confirmTableTempMinus30.AutoSize  = false;
            confirmTableTempMinus30.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableTempMinus30.Width     = 100;
            confirmTableTempMinus30.TabIndex  = tabIndex++;
            confirmTableTempMinus30.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTempMinus30.Text      = label11.Text;
            Controls.Add(confirmTableTempMinus30);

            if (confirmTableTempMinus30 == null)
            {
                confirmTableTempMinus30 = new System.Windows.Forms.Label();
            }
            confirmTableTempMinus30.Name      = "confirmTableTempMinus30";
            confirmTableTempMinus30.AutoSize  = false;
            confirmTableTempMinus30.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableTempMinus30.Width     = 100;
            confirmTableTempMinus30.TabIndex  = tabIndex++;
            confirmTableTempMinus30.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTempMinus30.Text      = label11.Text;
            Controls.Add(confirmTableTempMinus30);

            if (confirmTableTempZero == null)
            {
                confirmTableTempZero = new System.Windows.Forms.Label();
            }
            confirmTableTempZero.Name      = "confirmTableTempZero";
            confirmTableTempZero.AutoSize  = false;
            confirmTableTempZero.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableTempZero.Width     = 100;
            confirmTableTempZero.TabIndex  = tabIndex++;
            confirmTableTempZero.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTempZero.Text      = label13.Text;
            Controls.Add(confirmTableTempZero);

            if (confirmTableTemp100 == null)
            {
                confirmTableTemp100 = new System.Windows.Forms.Label();
            }
            confirmTableTemp100.Name      = "confirmTableTemp100";
            confirmTableTempZero.AutoSize = false;
            confirmTableTemp100.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableTemp100.TabIndex  = tabIndex++;
            confirmTableTemp100.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTemp100.Text      = label16.Text;
            Controls.Add(confirmTableTemp100);

            if (confirmTableTCC == null)
            {
                confirmTableTCC = new System.Windows.Forms.Label();
            }
            confirmTableTCC.Name     = "confirmTableTCC";
            confirmTableTCC.AutoSize = true;
            confirmTableTCC.TabIndex = tabIndex++;
            confirmTableTCC.Font     = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTCC.Text     = label3.Text;
            Controls.Add(confirmTableTCC);

            if (confirmTableTCCMinus30 == null)
            {
                confirmTableTCCMinus30 = new System.Windows.Forms.Label();
            }
            confirmTableTCCMinus30.Name      = "confirmTableTCCMinus30";
            confirmTableTCCMinus30.AutoSize  = false;
            confirmTableTCCMinus30.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableTCCMinus30.Width     = 100;
            confirmTableTCCMinus30.TabIndex  = tabIndex++;
            confirmTableTCCMinus30.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTCCMinus30.Text      = deltaCompMin.Text;
            Controls.Add(confirmTableTCCMinus30);

            if (confirmTableTCCZero == null)
            {
                confirmTableTCCZero = new System.Windows.Forms.Label();
            }
            confirmTableTCCZero.Name      = "confirmTableTCCZero";
            confirmTableTCCZero.AutoSize  = false;
            confirmTableTCCZero.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableTCCZero.Width     = 100;
            confirmTableTCCZero.TabIndex  = tabIndex++;
            confirmTableTCCZero.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTCCZero.Text      = deltaCompZero.Text;
            Controls.Add(confirmTableTCCZero);

            if (confirmTableTCC100 == null)
            {
                confirmTableTCC100 = new System.Windows.Forms.Label();
            }
            confirmTableTCC100.Name      = "confirmTableTCC100";
            confirmTableTCC100.AutoSize  = false;
            confirmTableTCC100.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableTCC100.Width     = 100;
            confirmTableTCC100.TabIndex  = tabIndex++;
            confirmTableTCC100.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableTCC100.Text      = deltaCompMax.Text;
            Controls.Add(confirmTableTCC100);

            if (confirmTableATC == null)
            {
                confirmTableATC = new System.Windows.Forms.Label();
            }
            confirmTableATC.Name     = "confirmTableATC";
            confirmTableATC.AutoSize = true;
            confirmTableATC.TabIndex = tabIndex++;
            confirmTableATC.Font     = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableATC.Text     = label5.Text;
            Controls.Add(confirmTableATC);

            if (confirmTableATCMinus30 == null)
            {
                confirmTableATCMinus30 = new System.Windows.Forms.Label();
            }
            confirmTableATCMinus30.Name      = "confirmTableATCMinus30";
            confirmTableATCMinus30.AutoSize  = false;
            confirmTableATCMinus30.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableATCMinus30.Width     = 100;
            confirmTableATCMinus30.TabIndex  = tabIndex++;
            confirmTableATCMinus30.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableATCMinus30.Text      = avgCompMin.Text;
            Controls.Add(confirmTableATCMinus30);

            if (confirmTableATCZero == null)
            {
                confirmTableATCZero = new System.Windows.Forms.Label();
            }
            confirmTableATCZero.Name      = "confirmTableATCZero";
            confirmTableATCZero.AutoSize  = false;
            confirmTableATCZero.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableATCZero.Width     = 100;
            confirmTableATCZero.TabIndex  = tabIndex++;
            confirmTableATCZero.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableATCZero.Text      = avgCompZero.Text;
            Controls.Add(confirmTableATCZero);

            if (confirmTableATC100 == null)
            {
                confirmTableATC100 = new System.Windows.Forms.Label();
            }
            confirmTableATC100.Name      = "confirmTableATC100";
            confirmTableATC100.AutoSize  = false;
            confirmTableATC100.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            confirmTableATC100.Width     = 100;
            confirmTableATC100.TabIndex  = tabIndex++;
            confirmTableATC100.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableATC100.Text      = avgCompMax.Text;
            Controls.Add(confirmTableATC100);


            if (confirmTableClickNext == null)
            {
                confirmTableClickNext = new System.Windows.Forms.Label();
            }
            confirmTableClickNext.Name      = "confirmTableATC100";
            confirmTableClickNext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            confirmTableClickNext.TabIndex  = tabIndex++;
            confirmTableClickNext.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            confirmTableClickNext.Text      = "Click on \"Next\" to continue";
            Controls.Add(confirmTableClickNext);
            ResumeLayout(false);
            NextButton.Visible  = true;
            NextButton.Enabled  = true;
            PrevButton.Visible  = false;
            PrevButton.TabIndex = tabIndex++;
            NextButton.TabIndex = tabIndex++;
            ConfirmCompensatioPanelResize();
        }
Пример #7
0
        public void LoadingDataDrawPanel()
        {
            int tabIndex = 0;

            SuspendLayout();

            //
            // ChooseDataSourceMessage
            //
            if (DataloadingMessage == null)
            {
                DataloadingMessage = new System.Windows.Forms.Label();
            }
            DataloadingMessage.Name      = "DataloadingMessage";
            DataloadingMessage.AutoSize  = false;
            DataloadingMessage.TabIndex  = tabIndex++;
            DataloadingMessage.Font      = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            DataloadingMessage.Text      = "Loading data, please wait...";
            DataloadingMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            Controls.Add(DataloadingMessage);


            //
            // DataLoadProgressBar1
            //
            if (DataLoadProgressBar1 == null)
            {
                DataLoadProgressBar1 = new ProgressBar();
            }
            DataLoadProgressBar1.Location = new System.Drawing.Point(192, 180);
            DataLoadProgressBar1.Name     = "DataLoadProgressBar1";
            DataLoadProgressBar1.Size     = new System.Drawing.Size(235, 23);
            DataLoadProgressBar1.TabIndex = tabIndex++;
            DataLoadProgressBar1.Value    = 0;
            Controls.Add(DataLoadProgressBar1);

            //
            // DataLoadProgressBar1
            //
            if (DataloadingErrorMessage == null)
            {
                DataloadingErrorMessage = new System.Windows.Forms.Label();
            }
            DataloadingErrorMessage.Name     = "DataloadingErrorMessage";
            DataloadingErrorMessage.AutoSize = false;
            DataloadingErrorMessage.TabIndex = tabIndex++;
            DataloadingErrorMessage.Text     = "";
            DataloadingErrorMessage.Visible  = false;

            DataloadingErrorMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            Controls.Add(DataloadingErrorMessage);
            LoadingDataPanelResize();

            ResumeLayout(false);
            NextButton.Visible  = true;
            NextButton.Enabled  = false;
            PrevButton.Visible  = true;
            PrevButton.TabIndex = tabIndex++;
            NextButton.TabIndex = tabIndex++;


            if (FromFileRadioButton.Checked)
            {
                DataloadingMessage.Text = "Loading data from file, please wait...";
                CSVDataloadProcess      = new BackgroundWorker();
                CSVDataloadProcess.WorkerReportsProgress = true;
                CSVDataloadProcess.DoWork             += new DoWorkEventHandler(CSVDataloadProcess_DoWork);
                CSVDataloadProcess.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CSVDataloadProcess_completed);
                CSVDataloadProcess.ProgressChanged    += new ProgressChangedEventHandler(CSVDataloadProcess_ProgressChanged);
                CSVDataloadProcess.RunWorkerAsync(null);
            }
            else
            if (FromDeviceRadioButton.Checked)
            {
                DataloadingMessage.Text = "Loading data from device, please wait...";
                ChoosedWeighScale.LoadDataLogger(DataloggerLoadCompleted,

                                                 DataloggerLoadProgress, false);
            }
        }
Пример #8
0
        public void ReadyForCompensationDrawPanel()
        {
            int tabIndex = 0;

            SuspendLayout();
            //
            // WarningResetMessage1
            //
            if (readyForCompensationMessage1 == null)
            {
                readyForCompensationMessage1 = new System.Windows.Forms.Label();
            }
            readyForCompensationMessage1.Name     = "readyForCompensationMessage1";
            readyForCompensationMessage1.AutoSize = false;
            readyForCompensationMessage1.TabIndex = tabIndex++;
            readyForCompensationMessage1.Text     = "Your weighscale is now ready for gathering the data required to compute temperature compensation.";
            readyForCompensationMessage1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            readyForCompensationMessage1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            Controls.Add(readyForCompensationMessage1);

            if (readyForCompensationMessage2 == null)
            {
                readyForCompensationMessage2 = new System.Windows.Forms.Label();
            }
            readyForCompensationMessage2.Name     = "readyForCompensationMessage2";
            readyForCompensationMessage2.AutoSize = false;
            readyForCompensationMessage2.TabIndex = tabIndex++;
            readyForCompensationMessage2.Text     = "You can either click on Next and start monitoring data gathering it unplug your device, install it at its planned location and power it again, data gathering will start automatically.\n\nIt is recommended to let the data gathering process run for several days so several day / night temperature cycles can be recorded.";
            readyForCompensationMessage2.Font     = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            Controls.Add(readyForCompensationMessage2);



            //
            // curentWeightValueLabel
            //
            if (currentWeightValueLabel == null)
            {
                currentWeightValueLabel = new System.Windows.Forms.Label();
            }
            currentWeightValueLabel.Name     = "readyForCompensationMessage1";
            currentWeightValueLabel.AutoSize = true;
            currentWeightValueLabel.TabIndex = tabIndex++;
            currentWeightValueLabel.Font     = new System.Drawing.Font("Microsoft Sans Serif", 24, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            currentWeightValueLabel.Text      = ChoosedWeighScale.sensor.get_currentValue().ToString() + ChoosedWeighScale.sensor.get_unit();
            currentWeightValueLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            Controls.Add(currentWeightValueLabel);
            //
            // ClickOnNextLabel
            //
            if (ClickOnNextLabel == null)
            {
                ClickOnNextLabel = new System.Windows.Forms.Label();
            }
            ClickOnNextLabel.Name     = "ClickOnNextLabel";
            ClickOnNextLabel.AutoSize = false;
            ClickOnNextLabel.TabIndex = tabIndex++;
            ClickOnNextLabel.Text     = "You can test the weighscale calibration, if you are not satisfied of the current calibration you can use the previous button to go back to the reference Weight step. If calibration seems good enough make sure the weightscale is free of any load and Click on Next, or disconnect the device, install it where it is supposed to be and power it again, data collection will start automatically.";
            ClickOnNextLabel.Font     = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            //  ClickOnNextLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            Controls.Add(ClickOnNextLabel);

            ResumeLayout(false);
            NextButton.Visible  = true;
            NextButton.Enabled  = false;
            PrevButton.Visible  = true;
            PrevButton.TabIndex = tabIndex++;
            NextButton.TabIndex = tabIndex++;
            ReadyForCompensationPanelResize();

            ChoosedWeighScale.sensor.registerValueCallback(newWeightValue2);


            ChoosedWeighScale.datalogger.set_autoStart(YDataLogger.AUTOSTART_ON);
            ChoosedWeighScale.datalogger.forgetAllDataStreams();
            ChoosedWeighScale.genericSensor.set_logFrequency("6/m");
            ChoosedWeighScale.genericSensor.set_reportFrequency("6/m");
            ChoosedWeighScale.tsensor.set_logFrequency("6/m");
            ChoosedWeighScale.tsensor.set_reportFrequency("6/m");
            ChoosedWeighScale.saveconfig();
        }
Пример #9
0
        public void MonitorPanelDrawPanel()
        {
            int tabIndex = 0;

            SuspendLayout();
            //
            // WarningResetMessage1
            //
            if (MonitorMessage1 == null)
            {
                MonitorMessage1 = new System.Windows.Forms.Label();
            }
            MonitorMessage1.Name     = "MonitorMessage1";
            MonitorMessage1.AutoSize = false;
            MonitorMessage1.TabIndex = tabIndex++;
            MonitorMessage1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            MonitorMessage1.Text = "Your device is gathering data at 0.1Hz, let the process run for several days to make sure that day/night temperature cycles are captured, then use this utility to analyze it and compute Temperature compensation. "
                                   + (RadioBtMonitor.Checked? " Once datalogger is loaded, you can export data at any time. ":"")
                                   + "Click on next to go back to the welcome page. You can also close this application, the capture process will still run in background.";



            MonitorMessage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));

            Controls.Add(MonitorMessage1);

            if (MonitorGraphContainer == null)
            {
                MonitorGraphContainer = new PictureBox();
            }
            MonitorGraphContainer.Name     = "MonitorGraphContainer";
            MonitorGraphContainer.TabIndex = tabIndex++;
            Controls.Add(MonitorGraphContainer);

            //
            // Export button
            //
            if (ExportButton == null)
            {
                ExportButton = new Button();
            }
            this.ExportButton.Name     = "ExportButton";
            this.ExportButton.AutoSize = false;
            this.ExportButton.Size     = new Size(75, 23);
            this.ExportButton.TabIndex = tabIndex++;
            this.ExportButton.Text     = "Export..";
            this.ExportButton.UseVisualStyleBackColor = true;

            this.ExportButton.Click += ExportButton_Click;
            ExportButton.Enabled     = false;
            Controls.Add(ExportButton);


            ResumeLayout(false);
            NextButton.Visible  = true;
            NextButton.Enabled  = true;
            PrevButton.Visible  = false;
            PrevButton.TabIndex = tabIndex++;
            NextButton.TabIndex = tabIndex++;
            MonitorPanelResize();

            MonitorGraph = new YGraph(MonitorGraphContainer, null);

            MonitorGraph.DisableRedraw();

            YAxis wAxis = MonitorGraph.addYAxis();

            wAxis.showGrid      = true;
            wAxis.visible       = true;
            wAxis.legend.title  = "Weight (" + ChoosedWeighScale.sensor.get_unit() + ")";
            wAxis.highlightZero = true;


            YAxis tAxis = MonitorGraph.addYAxis();

            tAxis.visible      = true;
            tAxis.legend.title = "Temperature (" + ChoosedWeighScale.tsensor.get_unit() + ")";
            tAxis.position     = YAxis.HrzPosition.RIGHT;



            MonitorGraph.navigator.enabled        = true;
            MonitorGraph.navigator.relativeheight = 12;
            MonitorGraph.xAxis.showGrid           = true;

            monitor_wData            = MonitorGraph.addSerie();
            monitor_wData.yAxisIndex = wAxis.index;
            monitor_wData.color      = Color.DarkBlue;
            wAxis.legend.font.color  = monitor_wData.color;

            monitor_tData            = MonitorGraph.addSerie();
            monitor_tData.yAxisIndex = tAxis.index;
            monitor_tData.color      = Color.DarkRed;
            tAxis.legend.font.color  = monitor_tData.color;


            progressPanel = MonitorGraph.addDataPanel();
            progressPanel.horizontalPosition = DataPanel.HorizontalPosition.RIGHTBORDER;
            progressPanel.verticalPosition   = DataPanel.VerticalPosition.TOPBORDER;
            progressPanel.horizontalMargin   = 5;
            progressPanel.verticalMargin     = 5;
            progressPanel.panelHrzAlign      = DataPanel.HorizontalAlign.LEFTOF;
            progressPanel.panelVrtAlign      = DataPanel.VerticalAlign.BELOW;
            progressPanel.borderColor        = Color.Black;
            progressPanel.borderthickness    = 1;

            progressPanel.enabled = true;



            MonitorGraph.AllowRedraw();
            WeightData = new List <pointXY>();
            TempData   = new List <pointXY>();

            ChoosedWeighScale.genericSensor.registerTimedReportCallback(newGenericSensorData);
            ChoosedWeighScale.tsensor.registerTimedReportCallback(newTempSensorData);

            //MonitorLoadProgress(0);
            ChoosedWeighScale.LoadDataLogger(MonitorLoadCompleted, MonitorLoadProgress, true);
        }