123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412 |
- 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
- {
- /// <summary>
- /// DMReservoirUIControl.xaml 的交互逻辑
- /// </summary>
- public partial class DMReservoirUIControl : UserControl
- {
- public DMReservoirUIControl()
- {
- InitializeComponent();
- }
- public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
- "ModuleName", typeof(string), typeof(DMReservoirUIControl),
- new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// 模块名称
- /// </summary>
- 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));
- /// <summary>
- /// ANIsolationValve
- /// </summary>
- 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));
- /// <summary>
- /// CAIsolationValve
- /// </summary>
- 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));
- /// <summary>
- /// ReturnFlowValve
- /// </summary>
- 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));
- /// <summary>
- /// DegasValve
- /// </summary>
- 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));
- /// <summary>
- /// SampleValve
- /// </summary>
- 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));
- /// <summary>
- /// IsANPumpOpen
- /// </summary>
- 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));
- /// <summary>
- /// IsCAPumpOpen
- /// </summary>
- 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));
- /// <summary>
- ///IsCALevelHigh
- /// </summary>
- 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));
- /// <summary>
- ///IsCALevelLow
- /// </summary>
- 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));
- /// <summary>
- ///IsANLevelHigh
- /// </summary>
- 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));
- /// <summary>
- ///IsANLevelLow
- /// </summary>
- 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));
- /// <summary>
- /// ANFlow
- /// </summary>
- 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));
- /// <summary>
- /// CAFlow
- /// </summary>
- 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));
- /// <summary>
- /// CALevel
- /// </summary>
- 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));
- /// <summary>
- /// CALevelRaw
- /// </summary>
- 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));
- /// <summary>
- /// ReservoirTemperature
- /// </summary>
- 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));
- /// <summary>
- /// TCStatus
- /// </summary>
- 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));
- /// <summary>
- /// TCEnableStatus
- /// </summary>
- 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");
- }
- }
- }
|