Exemple #1
0
        private void bwScanner_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (bCheckAllDbsDiag)
            {
                bCheckAllDbsDiag = false;
                comboBox1.Items.Clear();
                for (int i = 0; i < listDbsDiag.Count; i++)
                {
                    comboBox1.Items.Add(listDbsDiag[i]);
                }

                Fonctions.WriteListDbs(listDbsDiag);
            }
        }
Exemple #2
0
        private void bwScanner_DoWork(object sender, DoWorkEventArgs e)
        {
            if (_statusConnection)
            {
                // Check all Dbs diag
                if (bCheckAllDbsDiag)
                {
                    listDbsDiag.Clear();
                    for (int i = 100; i < 500; i++)
                    {
                        int dbToRead = i + 1000;
                        int result   = Fonctions.CheckDbsDiag(dbToRead);

                        if (result == 0)
                        {
                            listDbsDiag.Add("DB" + dbToRead.ToString() + " Moteur n°" + i.ToString());
                        }
                    }
                }
            }
        }
Exemple #3
0
        private void bwWork_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;
            var res = -1;

            bool CheckCon = Fonctions.CheckCon();

            if (CheckCon == true)
            {
                _statusConnection = true;
            }
            else
            {
                _statusConnection = false;
            }

            if (!_statusConnection)
            {
                res = Client.ConnectTo(boxAdresseIp.Text, 0, 2);
            }

            if (_statusConnection)
            {
                // Lecture dans PLC
                numDB = Int32.Parse("1" + boxMotor.Text);
                _arStateMotor.Clear();
                Fonctions.StateMotor(numDB);
                spdMotor = _dspdMotor.ToString("0.00") + "m/min";
                intMotor = _dintMotor.ToString("00");

                // Ecriture dans PLC
                if (bWriteReset)
                {
                    bWriteReset = false;
                    Fonctions.Reset();
                }

                if (bWriteBump)
                {
                    bWriteBump = false;
                    Fonctions.Bump(numDB);
                }

                if (bWriteForceOn)
                {
                    bWriteForceOn = false;
                    Fonctions.ForceOn(numDB);
                }

                if (bWriteForceCalib)
                {
                    bWriteForceCalib = false;
                    Fonctions.ForceCalib(numDB);
                }

                if (bWriteCalibSpeed)
                {
                    bWriteCalibSpeed = false;
                    Fonctions.WriteCalibSpeed(numDB, progressBarSpdF.Value * 100);
                }

                if (bWriteMesSpeed)
                {
                    bWriteMesSpeed = false;
                    Double dtemp = Fonctions.StrToDouble(boxMesSpeed.Text, '.', 100);
                    Fonctions.WriteMesSpeed(numDB, dtemp);
                }
            }
        }