Exemplo n.º 1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (objGeneralDba == null)
            {
                objGeneralDba = new GeneralDba();
            }
            if (objPSDba == null)
            {
                objPSDba = new PSDba();
            }

            if (!objPSDba.GetPSSwitchOffStatus(this.MachineCode))
            {
                AsynchReadSettingsForPS();
                //pallet.Dispatcher.BeginInvoke(DispatcherPriority.Background,
                //  new InvokeDelegate(SetPalletPresentStatus), GetPalletPresentStatusFromOpc());
            }


            this.timerToUpdateStatus          = new System.Timers.Timer();
            this.timerToUpdateStatus.Enabled  = true;
            this.timerToUpdateStatus.Interval = 3000;
            this.timerToUpdateStatus.Start();
            this.timerToUpdateStatus.Elapsed += new System.Timers.ElapsedEventHandler(timerToUpdateStatus_Elapsed);
        }
Exemplo n.º 2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (objGeneralDba == null)
     {
         objGeneralDba = new GeneralDba();
     }
     if (objPSDba == null)
     {
         objPSDba = new PSDba();
     }
     lblMachineName.Content = this.MachineCode;
     SetTriggerStatus(objGeneralDba.GetMachineTriggerStatus(this.MachineCode));
     SetEnableStatus(objPSDba.GetPSEnabledStatus(this.MachineCode));
     ShowSwitchOffStatus();
 }
Exemplo n.º 3
0
        private void chkStatus_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton radio = sender as RadioButton;

            if (objPSDba == null)
            {
                objPSDba = new PSDba();
            }
            if (radio.Name.Equals(chkEnable.Name))
            {
                objPSDba.SetPSEnabledStatus(this.MachineCode, true);
            }
            else if (radio.Name.Equals(chkDisable.Name))
            {
                objPSDba.SetPSEnabledStatus(this.MachineCode, false);
            }
        }