SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
AdvancedOptions.xaml.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Windows;
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;
14 
15 namespace SeciUserInterface.Controls
16 {
20  public partial class AdvancedOptions : UserControl
21  {
23 
24  //User settings
25  public event EventHandler OnDaeAvailableCheckChanged;
26  public event EventHandler OnVisAvailableCheckChanged;
27  public event EventHandler OnModifyVisCheckChanged;
28  public event EventHandler OnUserCanSaveCheckChanged;
29  public event EventHandler OnHideTabsClicked;
30 
31  //Web dashboard settings
32  public event EventHandler OnWebDashboardEnabledCheckChanged;
33  public event EventHandler OnWebDashboardShowTitleCheckChanged;
34 
35  //General settings
36  public event EventHandler OnUsePythonChanged;
37  public event EventHandler OnTwoGeniesCheckChanged;
38  public event EventHandler OnShowBeamloggerCheckChanged;
39  public event EventHandler OnBigFontsDashboardCheckChanged;
40  public event EventHandler OnJournelViewerCheckChanged;
41  public event EventHandler OnShowLostTimeCheckChanged;
42 
43  //Executables
44  public event EventHandler OnAddExeClicked;
45  public event EventHandler OnRemoveExeClicked;
46 
47  //Assoc files
48  public event EventHandler OnAddAssocFileClicked;
49  public event EventHandler OnRemoveAssocFileClicked;
50 
51  //Graphs
52  public event EventHandler OnConfigureGraphsClicked;
53  public event EventHandler OnPlotOnGenieTabCheckChanged;
54 
55  //Sub-Configs
56  public event EventHandler OnAddSubConfigClicked;
57  public event EventHandler OnRemoveSubConfigClicked;
58  public event EventHandler OnEditSubConfigClicked;
59 
60  //Alerts
61  public event EventHandler OnConfigAlertsClicked;
62 
63  public bool? VisAvailable { get { return chkVisAvailable.IsChecked; } set { chkVisAvailable.IsChecked = value; } }
64  public bool? DaeAvailable { get { return chkDaeAvailable.IsChecked; } set { chkDaeAvailable.IsChecked = value; } }
65  public bool? UsePython { get { return chkUsePython.IsChecked; } set { chkUsePython.IsChecked = value; } }
66  public bool? TwoGeniesAvailable { get { return chkTwoGenies.IsChecked; } set { chkTwoGenies.IsChecked = value; } }
67  public bool? PlotOnGenieTab { set { chkPlotOnGenie.IsChecked = value; } }
68  public bool? ShowBeamlogger { get { return chkShowBeamLogger.IsChecked; } set { chkShowBeamLogger.IsChecked = value; } }
69  public bool? BigFontsDashboard { get { return chkBigFontsDashboard.IsChecked; } set { chkBigFontsDashboard.IsChecked = value; } }
70  public bool? ShowJournalViewer { get { return chkJournalViewer.IsChecked; } set { chkJournalViewer.IsChecked = value; } }
71  public bool? ShowWebDashboard { set { chkWebDashEnabled.IsChecked = value; } }
72  public bool? WebDashboardShowTitle { set { chkWebTitleEnabled.IsChecked = value; } }
73  public bool? LogBlocksEnabled { set { chkBlocksLogged.IsChecked = value; } }
74  public bool? ShowLostTime { get { return chkShowLostTime.IsChecked; } set { chkShowLostTime.IsChecked = value; } }
75 
76  public bool? PythonAvailable
77  {
78  set
79  {
80  if (value == true)
81  {
82  chkUsePython.IsEnabled = true;
83  }
84  else
85  {
86  chkUsePython.IsEnabled = false;
87  chkUsePython.IsChecked = false;
88  }
89  }
90  }
91 
92  public AdvancedOptions()
93  {
94  InitializeComponent();
95  }
96 
97  private void UserControl_Loaded(object sender, RoutedEventArgs e)
98  {
99  //Set up the binding for LogBlocksEnabled
100  Binding LoggingBinding = new Binding();
101  LoggingBinding.Source = _model;
102  LoggingBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
103  LoggingBinding.Mode = BindingMode.TwoWay;
104  LoggingBinding.Path = new PropertyPath("LogValuesEnabled");
105  chkBlocksLogged.SetBinding(CheckBox.IsCheckedProperty, LoggingBinding);
106 
107  //Set initial value
108  _model.LogValuesEnabled = Properties.Settings.Default.LogBlocks;
109 
110  }
111 
112  private void chkDaeAvailable_CheckChanged(object sender, RoutedEventArgs e)
113  {
114  if (OnDaeAvailableCheckChanged != null)
115  {
116  OnDaeAvailableCheckChanged(sender, e);
117  }
118  }
119 
120  private void chkVisAvailable_CheckChanged(object sender, RoutedEventArgs e)
121  {
122  if (OnVisAvailableCheckChanged != null)
123  {
124  OnVisAvailableCheckChanged(sender, e);
125  }
126  }
127 
128  private void chkModifyVis_CheckChanged(object sender, RoutedEventArgs e)
129  {
130  if (OnModifyVisCheckChanged != null)
131  {
132  OnModifyVisCheckChanged(sender, e);
133  }
134  }
135 
136  private void chkUserCanSave_CheckChanged(object sender, RoutedEventArgs e)
137  {
138  if (OnUserCanSaveCheckChanged != null)
139  {
140  OnUserCanSaveCheckChanged(sender, e);
141  }
142  }
143 
144  private void chkShowBeamLogger_CheckChanged(object sender, RoutedEventArgs e)
145  {
146  if (OnShowBeamloggerCheckChanged != null)
147  {
148  OnShowBeamloggerCheckChanged(sender, e);
149  }
150  }
151 
152  private void chkTwoGenies_CheckChanged(object sender, RoutedEventArgs e)
153  {
154  if (OnTwoGeniesCheckChanged != null)
155  {
156  OnTwoGeniesCheckChanged(sender, e);
157  }
158  }
159 
160  private void chkBigFontsDashboard_CheckChanged(object sender, RoutedEventArgs e)
161  {
162  if (OnBigFontsDashboardCheckChanged != null)
163  {
164  OnBigFontsDashboardCheckChanged(sender, e);
165  }
166  }
167 
168  private void chkJournalViewer_CheckChanged(object sender, RoutedEventArgs e)
169  {
170  if (OnJournelViewerCheckChanged != null)
171  {
172  OnJournelViewerCheckChanged(sender, e);
173  }
174  }
175 
176  private void chkWebDashEnabled_CheckChanged(object sender, RoutedEventArgs e)
177  {
178  if (chkWebTitleEnabled != null)
179  {
180  if (chkWebDashEnabled.IsChecked == true)
181  {
182  chkWebTitleEnabled.IsEnabled = true;
183  }
184  else
185  {
186  chkWebTitleEnabled.IsEnabled = false;
187  }
188  }
189 
190  if (OnWebDashboardEnabledCheckChanged != null)
191  {
192  OnWebDashboardEnabledCheckChanged(sender, e);
193  }
194  }
195 
196  private void chkWebTitleEnabled_CheckChanged(object sender, RoutedEventArgs e)
197  {
198  if (OnWebDashboardShowTitleCheckChanged != null)
199  {
200  OnWebDashboardShowTitleCheckChanged(sender, e);
201  }
202  }
203 
204  private void btnRemoveExe_Click(object sender, RoutedEventArgs e)
205  {
206  if (OnRemoveExeClicked != null)
207  {
208  OnRemoveExeClicked(sender, e);
209  }
210  }
211 
212  private void btnAddExe_Click(object sender, RoutedEventArgs e)
213  {
214  if (OnAddExeClicked != null)
215  {
216  OnAddExeClicked(sender, e);
217  }
218  }
219 
220  private void btnConfigureGraphs_Click(object sender, RoutedEventArgs e)
221  {
222  if (OnConfigureGraphsClicked != null)
223  {
224  OnConfigureGraphsClicked(sender, e);
225  }
226  }
227 
228  private void btnAddAssocFiles_Click(object sender, RoutedEventArgs e)
229  {
230  if (OnAddAssocFileClicked != null)
231  {
232  OnAddAssocFileClicked(sender, e);
233  }
234  }
235 
236  private void btnRemoveAssocFiles_Click(object sender, RoutedEventArgs e)
237  {
238  if (OnRemoveAssocFileClicked != null)
239  {
240  OnRemoveAssocFileClicked(sender, e);
241  }
242  }
243 
244  private void btnAddSubConfig_Click(object sender, RoutedEventArgs e)
245  {
246  if (OnAddSubConfigClicked != null)
247  {
248  OnAddSubConfigClicked(sender, e);
249  }
250  }
251 
252  private void btnRemoveSubConfig_Click(object sender, RoutedEventArgs e)
253  {
254  if (OnRemoveSubConfigClicked != null)
255  {
256  OnRemoveSubConfigClicked(sender, e);
257  }
258  }
259 
260  private void btnEditSubConfig_Click(object sender, RoutedEventArgs e)
261  {
262  if (OnEditSubConfigClicked != null)
263  {
264  OnEditSubConfigClicked(sender, e);
265  }
266  }
267 
268  private void chkPlotOnGenie_CheckChanged(object sender, RoutedEventArgs e)
269  {
270  if (OnPlotOnGenieTabCheckChanged != null)
271  {
272  OnPlotOnGenieTabCheckChanged(sender, e);
273  }
274  }
275 
276  private void btnConfigAlerts_Click(object sender, RoutedEventArgs e)
277  {
278  if (OnConfigAlertsClicked != null)
279  {
280  OnConfigAlertsClicked(sender, e);
281  }
282  }
283 
284  private void btnHideTabs_Click(object sender, RoutedEventArgs e)
285  {
286  if (OnHideTabsClicked != null)
287  {
288  OnHideTabsClicked(sender, e);
289  }
290  }
291 
292  private void chkBlocksLogged_CheckChanged(object sender, RoutedEventArgs e)
293  {
294  _model.LogValuesEnabled = (bool)chkBlocksLogged.IsChecked;
295  }
296 
297  private void chkUsePython_CheckChanged(object sender, RoutedEventArgs e)
298  {
299  if (OnUsePythonChanged != null)
300  {
301  OnUsePythonChanged(sender, e);
302  }
303  }
304 
305  private void chkShowLostTime_CheckChanged(object sender, RoutedEventArgs e)
306  {
307  if (OnShowLostTimeCheckChanged != null)
308  {
309  OnShowLostTimeCheckChanged(sender, e);
310  }
311  }
312  }
313 }
void btnConfigAlerts_Click(object sender, RoutedEventArgs e)
void btnRemoveSubConfig_Click(object sender, RoutedEventArgs e)
void chkVisAvailable_CheckChanged(object sender, RoutedEventArgs e)
void chkTwoGenies_CheckChanged(object sender, RoutedEventArgs e)
void btnAddAssocFiles_Click(object sender, RoutedEventArgs e)
void btnAddSubConfig_Click(object sender, RoutedEventArgs e)
void chkUsePython_CheckChanged(object sender, RoutedEventArgs e)
void chkBlocksLogged_CheckChanged(object sender, RoutedEventArgs e)
void btnEditSubConfig_Click(object sender, RoutedEventArgs e)
void chkPlotOnGenie_CheckChanged(object sender, RoutedEventArgs e)
void btnConfigureGraphs_Click(object sender, RoutedEventArgs e)
void chkShowBeamLogger_CheckChanged(object sender, RoutedEventArgs e)
void chkJournalViewer_CheckChanged(object sender, RoutedEventArgs e)
void btnAddExe_Click(object sender, RoutedEventArgs e)
void btnHideTabs_Click(object sender, RoutedEventArgs e)
Interaction logic for AdvancedOptions.xaml
void chkUserCanSave_CheckChanged(object sender, RoutedEventArgs e)
void chkWebTitleEnabled_CheckChanged(object sender, RoutedEventArgs e)
void chkDaeAvailable_CheckChanged(object sender, RoutedEventArgs e)
void chkShowLostTime_CheckChanged(object sender, RoutedEventArgs e)
void chkWebDashEnabled_CheckChanged(object sender, RoutedEventArgs e)
void UserControl_Loaded(object sender, RoutedEventArgs e)
void chkBigFontsDashboard_CheckChanged(object sender, RoutedEventArgs e)
void btnRemoveExe_Click(object sender, RoutedEventArgs e)
void btnRemoveAssocFiles_Click(object sender, RoutedEventArgs e)
void chkModifyVis_CheckChanged(object sender, RoutedEventArgs e)