using MECF.Framework.Common.OperationCenter;
using OpenSEMI.ClientBase;
using PunkHPX8_Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace PunkHPX8_Themes.UserControls
{
///
/// DMReservoirUIControl.xaml 的交互逻辑
///
public partial class DMReservoirUIControl : UserControl
{
public DMReservoirUIControl()
{
InitializeComponent();
}
public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
"ModuleName", typeof(string), typeof(DMReservoirUIControl),
new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
///
/// 模块名称
///
public string ModuleName
{
get
{
return (string)this.GetValue(ModuleNameProperty);
}
set
{
this.SetValue(ModuleNameProperty, value);
}
}
public static readonly DependencyProperty ANIsolationValveProerty = DependencyProperty.Register(
"ANIsolationValve", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// ANIsolationValve
///
public bool ANIsolationValve
{
get
{
return (bool)this.GetValue(ANIsolationValveProerty);
}
set
{
this.SetValue(ANIsolationValveProerty, value);
}
}
public static readonly DependencyProperty CAIsolationValveProerty = DependencyProperty.Register(
"CAIsolationValve", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// CAIsolationValve
///
public bool CAIsolationValve
{
get
{
return (bool)this.GetValue(CAIsolationValveProerty);
}
set
{
this.SetValue(CAIsolationValveProerty, value);
}
}
public static readonly DependencyProperty ReturnFlowValveProerty = DependencyProperty.Register(
"ReturnFlowValve", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// ReturnFlowValve
///
public bool ReturnFlowValve
{
get
{
return (bool)this.GetValue(ReturnFlowValveProerty);
}
set
{
this.SetValue(ReturnFlowValveProerty, value);
}
}
public static readonly DependencyProperty DegasValveProerty = DependencyProperty.Register(
"DegasValve", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// DegasValve
///
public bool DegasValve
{
get
{
return (bool)this.GetValue(DegasValveProerty);
}
set
{
this.SetValue(DegasValveProerty, value);
}
}
public static readonly DependencyProperty SampleValveProerty = DependencyProperty.Register(
"SampleValve", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// SampleValve
///
public bool SampleValve
{
get
{
return (bool)this.GetValue(SampleValveProerty);
}
set
{
this.SetValue(SampleValveProerty, value);
}
}
public static readonly DependencyProperty IsANPumpOpenProerty = DependencyProperty.Register(
"IsANPumpOpen", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// IsANPumpOpen
///
public bool IsANPumpOpen
{
get
{
return (bool)this.GetValue(IsANPumpOpenProerty);
}
set
{
this.SetValue(IsANPumpOpenProerty, value);
}
}
public static readonly DependencyProperty IsCAPumpOpenProerty = DependencyProperty.Register(
"IsCAPumpOpen", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// IsCAPumpOpen
///
public bool IsCAPumpOpen
{
get
{
return (bool)this.GetValue(IsCAPumpOpenProerty);
}
set
{
this.SetValue(IsCAPumpOpenProerty, value);
}
}
public static readonly DependencyProperty IsCALevelHighProerty = DependencyProperty.Register(
"IsCALevelHigh", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
///IsCALevelHigh
///
public bool IsCALevelHigh
{
get
{
return (bool)this.GetValue(IsCALevelHighProerty);
}
set
{
this.SetValue(IsCALevelHighProerty, value);
}
}
public static readonly DependencyProperty IsCALevelLowProerty = DependencyProperty.Register(
"IsCALevelLow", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
///IsCALevelLow
///
public bool IsCALevelLow
{
get
{
return (bool)this.GetValue(IsCALevelLowProerty);
}
set
{
this.SetValue(IsCALevelLowProerty, value);
}
}
public static readonly DependencyProperty IsANLevelHighProerty = DependencyProperty.Register(
"IsANLevelHigh", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
///IsANLevelHigh
///
public bool IsANLevelHigh
{
get
{
return (bool)this.GetValue(IsANLevelHighProerty);
}
set
{
this.SetValue(IsANLevelHighProerty, value);
}
}
public static readonly DependencyProperty IsANLevelLowProerty = DependencyProperty.Register(
"IsANLevelLow", typeof(bool), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
///
///IsANLevelLow
///
public bool IsANLevelLow
{
get
{
return (bool)this.GetValue(IsANLevelLowProerty);
}
set
{
this.SetValue(IsANLevelLowProerty, value);
}
}
public static readonly DependencyProperty ANFlowProperty = DependencyProperty.Register(
"ANFlow", typeof(double), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// ANFlow
///
public double ANFlow
{
get
{
return (double)this.GetValue(ANFlowProperty);
}
set
{
this.SetValue(ANFlowProperty, value);
}
}
public static readonly DependencyProperty CAFlowProperty = DependencyProperty.Register(
"CAFlow", typeof(double), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// CAFlow
///
public double CAFlow
{
get
{
return (double)this.GetValue(CAFlowProperty);
}
set
{
this.SetValue(CAFlowProperty, value);
}
}
public static readonly DependencyProperty CALevelProperty = DependencyProperty.Register(
"CALevel", typeof(double), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// CALevel
///
public double CALevel
{
get
{
return (double)this.GetValue(CALevelProperty);
}
set
{
this.SetValue(CALevelProperty, value);
}
}
public static readonly DependencyProperty CALevelRawProperty = DependencyProperty.Register(
"CALevelRaw", typeof(double), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// CALevelRaw
///
public double CALevelRaw
{
get
{
return (double)this.GetValue(CALevelRawProperty);
}
set
{
this.SetValue(CALevelRawProperty, value);
}
}
public static readonly DependencyProperty ReservoirTemperatureProperty = DependencyProperty.Register(
"ReservoirTemperature", typeof(double), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
///
/// ReservoirTemperature
///
public double ReservoirTemperature
{
get
{
return (double)this.GetValue(ReservoirTemperatureProperty);
}
set
{
this.SetValue(ReservoirTemperatureProperty, value);
}
}
public static readonly DependencyProperty TCStatusProperty = DependencyProperty.Register(
"TCStatus", typeof(string), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
///
/// TCStatus
///
public string TCStatus
{
get
{
return (string)this.GetValue(TCStatusProperty);
}
set
{
this.SetValue(TCStatusProperty, value);
}
}
public static readonly DependencyProperty TCEnableStatusProperty = DependencyProperty.Register(
"TCEnableStatus", typeof(string), typeof(DMReservoirUIControl), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
///
/// TCEnableStatus
///
public string TCEnableStatus
{
get
{
return (string)this.GetValue(TCEnableStatusProperty);
}
set
{
this.SetValue(TCEnableStatusProperty, value);
}
}
private void OpenANIsolationValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ANIsolationOn");
}
private void CloseANIsolationValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ANIsolationOff");
}
private void OpenCAIsolationValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.CAIsolationOn");
}
private void CloseCAIsolationValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.CAIsolationOff");
}
private void OpenReturnFlowValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ReturnValveOn");
}
private void CloseReturnFlowValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ReturnValveOff");
}
private void OpenDegasValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasValveOn");
}
private void CloseDegasValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.DegasValveOff");
}
private void OpenSampleValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SampleOutValveOn");
}
private void CloseSampleValve_Click(object sender, RoutedEventArgs e)
{
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SampleOutValveOff");
}
private void JumpToTCAction(object sender, MouseButtonEventArgs e)
{
GlobalEvents.OnSwitchFixedTabItem("HardWare", "TemperatureController", "TC1");
}
}
}