private void button1_Click(object sender, RoutedEventArgs e) { wafer.DataContext = new RegisterDeviceInfo() { Progress=10, Status="Idle", TimeRemain=0, WarningMessage="" }; RegisterDeviceInfo[] datas = new RegisterDeviceInfo[] { wafer.DataContext as RegisterDeviceInfo }; listBox1.ItemsSource = datas; wafer.BindingChanged(); }
public void UpdateTimerAndButtonState(RegisterDeviceInfo info) { // this.textBlock1.Text = info.Status; if (dictToggleButtons.ContainsKey(info.PcName)) { DispatcherTimer but = dictToggleButtons[info.PcName]; if (info.Status == "Idle") { // but.Foreground = new SolidColorBrush(Colors.Black); if(but!=null) { but.Stop(); dictDeviceInfo[info.PcName].IsBusy = false; dictDeviceInfo[info.PcName].MiscRemark = "Success"; //info.IsBusy = false; //info.MiscRemark = "Success"; // (but.DataContext as RegisterDeviceInfo).IsBusy = false; // (but.DataContext as RegisterDeviceInfo).MiscRemark = "Success"; but = null; } } else if (info.Status == "Down") { // but.Foreground = new SolidColorBrush(Colors.Black); if (but != null) { but.Stop(); dictDeviceInfo[info.PcName].IsBusy = false; dictDeviceInfo[info.PcName].MiscRemark = "Success"; // info.IsBusy = false; ; //info.MiscRemark = "Success"; but = null; } //else //{ // MessageBox.Show(info.PcName+"but tag null"); //} } else { info.IsBusy = false; ; // but.Foreground = new SolidColorBrush(Colors.Black); } } //else //{ // MessageBox.Show(info.PcName + " button not found!"); //} }
void client_OnClientStatusChanged(string Pcname, RegisterDeviceInfo info) { if (items == null) return; RegisterDeviceInfo inf = (from n in items where n.PcName == info.PcName select n).FirstOrDefault<RegisterDeviceInfo>(); if (inf != null) { inf.ConnectedTime = info.ConnectedTime; inf.CurrentWaferId = info.CurrentWaferId; inf.ProbeCardId = info.ProbeCardId; inf.Status = info.Status; inf.tested_num_chip = info.tested_num_chip; inf.tested_num_wafer = info.tested_num_wafer; inf.TimeRemain = info.TimeRemain; inf.total_num_chip = info.total_num_chip; inf.total_num_wafer = info.total_num_wafer; inf.WarningMessage = info.WarningMessage; inf.WarningType = info.WarningType; inf.Progress = info.Progress; inf.StatusBeginTime = info.StatusBeginTime; inf.WarningBeginTime = info.WarningBeginTime; inf.eq_comment = info.eq_comment; inf.lot_id = info.lot_id; inf.yield = info.yield; inf.IsExportPending = info.IsExportPending; this.SetYieldFields(inf); //info.total_num_chip_string = ""; //force ui refresh //info.total_num_wafer_string = ""; //info.tested_num_chip_string = ""; //info.tested_num_wafer_string = ""; this.Dispatcher.BeginInvoke( new Action( () => { inf.total_num_chip_string = ""; //force ui refresh inf.total_num_wafer_string = ""; inf.tested_num_chip_string = ""; inf.tested_num_wafer_string = ""; } )); } else { items.Add(info); } // FilterAndBinding(); }
void SetYieldFields(RegisterDeviceInfo inf) { if (inf == null) return; // inf.yield = yield; if (inf.Status == "Product") inf.YieldColor = new SolidColorBrush((inf.yield < 80 && inf.yield > 0) ? Colors.Orange : Colors.Transparent); else inf.YieldColor = new SolidColorBrush(Colors.Transparent); }
public void NotifyStatusChanged(string pcname, RegisterDeviceInfo info) { if (this.OnClientStatusChanged != null) this.OnClientStatusChanged(pcname,info); // throw new NotImplementedException(); }