private void UpdateLagerBelegungUi() { if (this.Dispatcher.CheckAccess()) { if(this.band.ZwischenlagerBelegt[0] == true) { LP1.Text = "Ja"; } else { LP1.Text = "Nein"; } if (this.band.ZwischenlagerBelegt[1] == true) { LP2.Text = "Ja"; } else { LP2.Text = "Nein"; } if (this.band.LagerBelegt[0] == true) { BP1.Text = "Ja"; } else { BP1.Text = "Nein"; } if (this.band.LagerBelegt[1] == true) { BP2.Text = "Ja"; } else { BP2.Text = "Nein"; } if (this.band.LagerBelegt[2] == true) { BP3.Text = "Ja"; } else { BP3.Text = "Nein"; } if (this.band.LagerBelegt[3] == true) { BP4.Text = "Ja"; } else { BP4.Text = "Nein"; } } else { UiUpdateHandler handler = new UiUpdateHandler(this.UpdateLagerBelegungUi); this.Kran.Dispatcher.BeginInvoke(handler); } }
private void UpdatePositionUI() { if (this.Dispatcher.CheckAccess()) { UIYPOS.Text = kranarm.YKoordinate.ToString(); UIXPOS.Text = kranarm.XKoordinate.ToString(); } else { UiUpdateHandler handler = new UiUpdateHandler(this.UpdatePositionUI); this.Kran.Dispatcher.BeginInvoke(handler); } }
private void UpdateStatusBox() { if(this.Dispatcher.CheckAccess()) { if(connection == true) { if (kranarm.armMoving()) { Status.Text = "Kranarm bewegt sich"; } else { Status.Text = "Ready for Input"; } } else { Status.Text = "No Connection: Reconnect"; } } else { UiUpdateHandler handler = new UiUpdateHandler(this.UpdateStatusBox); this.Kran.Dispatcher.BeginInvoke(handler); } }