Пример #1
0
 private void Override_State_Click(object sender, RoutedEventArgs e, Valve passed)
 {
     if (passed.IsOverriden)
     {
         if (sender == Override_Open)
         {
             passed.Open();
             Override_Open.Background  = Brushes.Green;
             Override_Close.Background = Brushes.Red;
         }
         else if (sender == Override_Close)
         {
             passed.Close();
             Override_Close.Background = Brushes.Green;
             Override_Open.Background  = Brushes.Red;
         }
     }
 }
Пример #2
0
 private void UpdateValve(obj Object, Valve valve)
 {
     if (Object.Value == "Open")
     {
         valve.Open();
     }
     else if (Object.Value == "Close")
     {
         valve.Close();
     }
     //update feedback
     if (Object.Feedback == "Nom")
     {
         valve.Feedback = Valve.State.Nominal;
     }
     else if (Object.Feedback == "Fail")
     {
         valve.Feedback = Valve.State.Failure;
     }
     else
     {
         valve.Feedback = Valve.State.Unknown;
     }
 }