Exemplo n.º 1
0
        private void btnReadVFDDefs_Click(object sender, EventArgs e)
        {
            if (V1000_xlRead_List.Count == 0)
            {
                MessageBox.Show("You must read the excel parameters first!!");
                return;
            }
            else
            {
                if (!bwrkReadVFDDefs.IsBusy)
                {
                    btnReadVFDDefs.Enabled = false;

                    // Initiation of progress reporting form pop-up.
                    ProgressArgs.ClearVFDReadVals();
                    ProgressArgs.Mode_Sel     = ProgressEventArgs.VFDReadMode;
                    ProgressArgs.VFDRead_Stat = 0x01;
                    frmProgReport frmVFDProg = new frmProgReport("VFD Read Parameter:", "Data Read Progress", "Cancel VFD Read");
                    frmVFDProg.ProgressCancelUpdated += new frmProgReport.ProgressCancelHandler(Progress_Cancel_Clicked);
                    ProgressEvent += frmVFDProg.ProgressReceived;

                    // start background worker thread for reading all the VFD values
                    bwrkReadVFDDefs.RunWorkerAsync();

                    // show the progress form.
                    frmVFDProg.Show();
                }
            }
        }
Exemplo n.º 2
0
 private void btnWriteExcel_Click(object sender, EventArgs e)
 {
     if (V1000_xlRead_List.Count == 0)
     {
         MessageBox.Show("You must read the excel parameters first!!");
         return;
     }
     else if (VFD_Vals.Count == 0)
     {
         MessageBox.Show("You must read the default VFD parameters first!!");
         return;
     }
     else
     {
         if (!bwrkWriteExcelFile.IsBusy)
         {
             btnWriteExcel.Enabled = false;
             ProgressArgs.ClearXLWriteVals();
             ProgressArgs.Mode_Sel     = ProgressEventArgs.xlWriteMode;
             ProgressArgs.VFDRead_Stat = 0x01;
             frmProgReport frmProgWrite = new frmProgReport("", "Data Write Progress:", "Cancel Data Write");
             frmProgWrite.ProgressCancelUpdated += new frmProgReport.ProgressCancelHandler(Progress_Cancel_Clicked);
             ProgressEvent += frmProgWrite.ProgressReceived;
             bwrkWriteExcelFile.RunWorkerAsync();
             frmProgWrite.Show();
         }
     }
 }
Exemplo n.º 3
0
 private void btnReadExcel_Click(object sender, EventArgs e)
 {
     if (!bwrkReadExcelFile.IsBusy)
     {
         btnReadExcel.Enabled = false;
         ProgressArgs.ClearXLReadVals();
         ProgressArgs.Mode_Sel    = ProgressEventArgs.xlReadMode;
         ProgressArgs.xlRead_Stat = 0x01;
         frmProgReport frmXLRead = new frmProgReport("", "Data Read Progress:", "Cancel Data Read");
         frmXLRead.ProgressCancelUpdated += new frmProgReport.ProgressCancelHandler(Progress_Cancel_Clicked);
         ProgressEvent += frmXLRead.ProgressReceived;
         bwrkReadExcelFile.RunWorkerAsync();
         frmXLRead.Show();
     }
 }