private void LoadInitialValuesForPVL() { if (objPVLDba == null) { objPVLDba = new PVLDba(); } string sourceName = null; string machineCode = null; bool isMin = false; int window = 0; foreach (LabelTextBox tb in FindVisualChildren <LabelTextBox>(pvlConfigGrid)) { sourceName = tb.sourceName; machineCode = sourceName.Split(':')[0]; isMin = sourceName.Split(':')[1] == "MIN"; if (isMin) { window = objPVLDba.GetPVLMinSlotRange(machineCode); } else { window = objPVLDba.GetPVLMaxSlotRange(machineCode); } tb.text1.Text = window.ToString(); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } if (objPVLDba == null) { objPVLDba = new PVLDba(); } try { AsynchReadSettingsForPVL(); pallet.Dispatcher.BeginInvoke(DispatcherPriority.Background, new InvokeDelegate(SetPalletPresentStatus), GetPalletPresentStatusFromOpc()); } catch (Exception ex) { } 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 resetBut_Click(object sender, RoutedEventArgs e) { if (objPVLDba == null) { objPVLDba = new PVLDba(); } objPVLDba.ResetPVLZone(); LoadInitialValuesForPVL(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } if (objPVLDba == null) { objPVLDba = new PVLDba(); } lblMachineName.Content = this.MachineCode; SetTriggerStatus(objGeneralDba.GetMachineTriggerStatus(this.MachineCode)); SetEnableStatus(objPVLDba.GetPVLEnabledStatus(this.MachineCode)); }
private void chkStatus_Checked(object sender, RoutedEventArgs e) { RadioButton radio = sender as RadioButton; if (objPVLDba == null) { objPVLDba = new PVLDba(); } if (radio.Name.Equals(chkEnable.Name)) { objPVLDba.SetPVLEnabledStatus(this.MachineCode, true); } else if (radio.Name.Equals(chkDisable.Name)) { objPVLDba.SetPVLEnabledStatus(this.MachineCode, false); } }
private void labelText_PreviewKeyUp(object sender, KeyEventArgs e) { LabelTextBox objTextBox = sender as LabelTextBox; if (e.Key == Key.Enter) { if (objPVLDba == null) { objPVLDba = new PVLDba(); } string sourceName = null; string machineCode = null; bool isMin = false; int window = 0; string textValue; sourceName = objTextBox.sourceName; machineCode = sourceName.Split(':')[0]; isMin = sourceName.Split(':')[1] == "MIN"; textValue = objTextBox.text1.Text; if (int.TryParse(textValue, out window)) { if (isMin) { objPVLDba.SetPVLMinSlotRange(machineCode, window); window = objPVLDba.GetPVLMinSlotRange(machineCode); } else { objPVLDba.SetPVLMaxSlotRange(machineCode, window); window = objPVLDba.GetPVLMaxSlotRange(machineCode); } objTextBox.text1.Text = window.ToString(); } } }