2 using System.Collections.Generic;
6 using System.Windows.Controls;
7 using System.Windows.Data;
8 using System.Windows.Documents;
9 using System.Windows.Input;
10 using System.Windows.Media;
11 using System.Windows.Media.Imaging;
12 using System.Windows.Navigation;
13 using System.Windows.Shapes;
15 namespace SeciControls
20 public partial class NavBar : UserControl
91 InitializeComponent();
103 #region IsBigFontsProperty Dependency Property
105 public static readonly DependencyProperty
IsBigFontsProperty = DependencyProperty.RegisterAttached(
"IsBigFonts", typeof(Boolean),
106 typeof(
NavBar),
new FrameworkPropertyMetadata(
false, FrameworkPropertyMetadataOptions.Inherits));
196 #region Open Genie Tab
266 #region Journal Viewer Tab
280 #region System Messages Tab
294 #region Beam Status Tab
308 #region ISIS Messages Tab
322 #region Lost Time & Maintenace Tab
368 _lastSelected.IsSelected =
false;
372 btnSender.IsSelected =
true;
381 btnAdvanced.Visibility = Visibility.Visible;
385 btnAdvanced.Visibility = Visibility.Collapsed;
390 btnDae.Visibility = Visibility.Visible;
394 btnDae.Visibility = Visibility.Collapsed;
399 btnLabview.Visibility = Visibility.Visible;
400 btnLabview.SetExpansionToDefault();
404 btnLabview.SetExpansionToDefault();
405 btnLabview.Visibility = Visibility.Collapsed;
412 btnGraphs.Visibility = Visibility.Visible;
416 btnGraphs.Visibility = Visibility.Collapsed;
421 btnJournal.Visibility = Visibility.Visible;
425 btnJournal.Visibility = Visibility.Collapsed;
430 btnSettings.Visibility = Visibility.Visible;
434 btnSettings.Visibility = Visibility.Collapsed;
439 btnLostTime.Visibility = Visibility.Visible;
443 btnLostTime.Visibility = Visibility.Collapsed;
451 _lastSelected.IsSelected =
false;
457 if (numQuestions > 0)
459 txtLvQuestions.Text =
"Number of LabVIEW Questions: " + numQuestions;
460 txtLvQuestions.Visibility = Visibility.Visible;
461 btnSystem.ShowWarning =
true;
465 txtLvQuestions.Visibility = Visibility.Collapsed;
466 btnSystem.ShowWarning =
false;
471 txtLvErrors.Text =
"Number of LabVIEW Errors: " + numErrors;
472 txtLvErrors.Visibility = Visibility.Visible;
473 btnSystem.ShowWarning =
false;
474 btnSystem.ShowError =
true;
478 txtLvErrors.Visibility = Visibility.Collapsed;
479 btnSystem.ShowError =
false;
486 stkOrderable.Children.Clear();
488 foreach (KeyValuePair<String, String> pair
in order)
490 String realname = pair.Key;
491 String newname = pair.Value;
493 if (realname ==
"Experiment Details")
497 btnExperimentDetails.Content = newname;
499 stkOrderable.Children.Add(btnExperimentDetails);
501 else if (realname ==
"LabVIEW VIs")
505 btnLabview.SetText(newname);
507 stkOrderable.Children.Add(btnLabview);
509 else if (realname ==
"Open Genie (Scripting)")
513 btnOpenGenie.Content = newname;
515 stkOrderable.Children.Add(btnOpenGenie);
517 else if (realname ==
"Graphs")
521 btnGraphs.Content = newname;
523 stkOrderable.Children.Add(btnGraphs);
525 else if (realname ==
"Settings")
529 btnSettings.Content = newname;
531 stkOrderable.Children.Add(btnSettings);
533 else if (realname ==
"DAE")
537 btnDae.Content = newname;
539 stkOrderable.Children.Add(btnDae);
546 List<KeyValuePair<String, String>> order =
new List<KeyValuePair<String, String>>();
548 foreach (var btn
in stkOrderable.Children)
554 order.Add(
new KeyValuePair<string, string>(navbtn.DefaultName, navbtn.Content.ToString()));
556 else if (labbtn != null)
558 order.Add(
new KeyValuePair<string, string>(labbtn.DefaultName, labbtn.Content.ToString()));
567 btnOpenGenie.Visibility = Visibility.Collapsed;
EventHandler OnGraphsClicked
Boolean JournelViewerVisible
void btnSystem_Click(object sender, RoutedEventArgs e)
void btnGraph_Click(object sender, RoutedEventArgs e)
static void SetIsBigFonts(UIElement element, Boolean value)
void btnLabview_OnDisplayBlocksClicked(object sender, EventArgs e)
void btnLabview_OnConfigureVIClicked(object sender, EventArgs e)
EventHandler OnDaeClicked
EventHandler OnHelpClicked
EventHandler OnDisplayBlocksClicked
void btnUserDetails_Click(object sender, RoutedEventArgs e)
EventHandler OnSettingsClicked
void btnISIS_Click(object sender, RoutedEventArgs e)
void btnJournal_Click(object sender, RoutedEventArgs e)
void btnHelp_Click(object sender, RoutedEventArgs e)
void btnLabview_OnConfigureBlocksClicked(object sender, EventArgs e)
EventHandler OnLostTimeClicked
void btnDae_Click(object sender, RoutedEventArgs e)
Boolean _visVisibleForUser
void SetTabsVisibility(Boolean manager)
EventHandler OnReportProblemClicked
EventHandler OnConfigureBlocksClicked
NavBarButton _lastSelected
EventHandler OnAdvancedClicked
Boolean _userCanEditVISettings
Boolean _twoGeniesAvailable
void setIndicator(object sender)
List< KeyValuePair< String, String > > GetButtonOrderAndNames()
Boolean _daeVisibleForUser
void SetErrorCounter(int numErrors, int numQuestions)
void SetButtonOrderAndNames(List< KeyValuePair< String, String >> order)
void btnOpenGenie_Click(object sender, RoutedEventArgs e)
void btnLabview_OnVIsClicked(object sender, EventArgs e)
void btnLabview_OnEditTabsClicked(object sender, EventArgs e)
EventHandler OnBeamStatusClicked
void btnReport_Click(object sender, RoutedEventArgs e)
Interaction logic for NavBar.xaml
EventHandler OnConfigureVIClicked
EventHandler OnExperimentDetailsClicked
Boolean UserCanEditVISettings
void DeselectSelectedItem()
void btnBeam_Click(object sender, RoutedEventArgs e)
static Boolean GetIsBigFonts(UIElement element)
void btnSettings_Click(object sender, RoutedEventArgs e)
EventHandler OnVIsClicked
void btnLostTime_Click(object sender, RoutedEventArgs e)
EventHandler OnRemoveVIClicked
EventHandler OnJournalViewerClicked
EventHandler OnIsisMessagesClicked
EventHandler OnOpenGenieClicked
Boolean _journelViewerVisible
EventHandler OnSystemMessagesClicked
void btnLabview_OnAddVIClicked(object sender, EventArgs e)
EventHandler OnEditTabsClicked
void btnLabview_OnRemoveVIClicked(object sender, EventArgs e)
Boolean VisVisibleForUser
EventHandler OnAddVIClicked
static readonly DependencyProperty IsBigFontsProperty
void btnAdvanced_Click(object sender, RoutedEventArgs e)
Boolean TwoGeniesAvailable
Boolean DaeVisibleForUser