private void Window_Loaded(object sender, RoutedEventArgs e) { if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } if (objPSTDba == null) { objPSTDba = new PSTDba(); } lblMachineName.Content = this.MachineCode; SetTriggerStatus(objGeneralDba.GetMachineTriggerStatus(this.MachineCode)); SetEnableStatus(objPSTDba.GetPSTEnabledStatus(this.MachineCode)); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (objPSTDba == null) { objPSTDba = new PSTDba(); } AsynchReadSettingsForPST(); palletGrid.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetPalletPresentStatus), GetPalletCountFromOpc()); 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); }
private void chkStatus_Checked(object sender, RoutedEventArgs e) { RadioButton radio = sender as RadioButton; if (objPSTDba == null) { objPSTDba = new PSTDba(); } if (radio.Name.Equals(chkEnable.Name)) { objPSTDba.SetPSTEnabledStatus(this.MachineCode, true); } else if (radio.Name.Equals(chkDisable.Name)) { objPSTDba.SetPSTEnabledStatus(this.MachineCode, false); } }