Example #1
0
 private void initToDeafult()
 {
     deviceList   = null;
     deviceLstCnt = 0;
     cbPp         = null;
     progressInfo = new backupNRestoreProgressInfo();
     mbAccess     = new ModbusRegisterAccess();
     devIdObj     = new deviceIdentification();
     cParam       = new TeSysTConfFileCompatibilityParam();
 }
Example #2
0
        public void callback_ProcessProgress(backupNRestoreProgressInfo pInfo)
        {
            Action cmd;

            try
            {
                if (pInfo.actOn == actionOnControl.NO_ACTION)
                {
                    return;
                }


                if (pInfo.actOn == actionOnControl.PROGRESS_BAR)
                {
                    if (pInfo.pbVal == 0)
                    {
                        cmd = () => bnrWin.pbBnR.Maximum = pInfo.pbMax;
                        Application.Current.Dispatcher.Invoke(cmd);

                        cmd = () => bnrWin.pbBnR.Minimum = pInfo.pbMin;
                        Application.Current.Dispatcher.Invoke(cmd);

                        // IP address lebel clean up
                        cmd = () => bnrWin.lblDeviceId.Content = " ";
                        Application.Current.Dispatcher.Invoke(cmd);
                    }

                    cmd = () => bnrWin.pbBnR.Value = pInfo.pbVal;
                    Application.Current.Dispatcher.Invoke(cmd);
                }
                else if (pInfo.actOn == actionOnControl.LEBEL)
                {
                    cmd = () => bnrWin.lblDeviceId.Content = pInfo.dEntry.deviceIP;
                    Application.Current.Dispatcher.Invoke(cmd);
                }
                else if (pInfo.actOn == actionOnControl.PROCESS_COMPLETED)
                {
                    cmd = () => bnrWin.pbBnR.Value = 0;
                    Application.Current.Dispatcher.Invoke(cmd);
                    // IP address lebel clean up
                    cmd = () => bnrWin.lblDeviceId.Content = " ";
                    Application.Current.Dispatcher.Invoke(cmd);

                    cmd = () => bnrWin.lblDeviceId.Content = "Backup or Restore Process Completed";
                    Application.Current.Dispatcher.Invoke(cmd);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Example #3
0
        private void initToDeafult()
        {
            deviceList   = null;
            deviceLstCnt = 0;
            confileNames = new TeSysTConfiFile();
            Config8Amp   = new modbusTable[MAX_CONF_FILE_SIZE];
            Config27Amp  = new modbusTable[MAX_CONF_FILE_SIZE];
            Config100Amp = new modbusTable[MAX_CONF_FILE_SIZE];

            isConfig8AmpAvailable   = false;
            isConfig27AmpAvailable  = false;
            isConfig100AmpAvailable = false;

            cbPp         = null;
            progressInfo = new backupNRestoreProgressInfo();
            mbAccess     = new ModbusRegisterAccess();
        }