123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.OperationCenter;
- using CyberX8_Themes.CustomControls;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics.Eventing.Reader;
- using System.Linq;
- 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 CyberX8_Themes.UserControls
- {
- /// <summary>
- /// Pump1.xaml 的交互逻辑
- /// </summary>
- public partial class ReservoirPump : UserControl
- {
-
- public ReservoirPump()
- {
- InitializeComponent();
- }
- public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
- "ModuleName", typeof(string), typeof(ReservoirPump),
- new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// 模块名称
- /// </summary>
- public string ModuleName
- {
- get
- {
- return (string)this.GetValue(ModuleNameProperty);
- }
- set
- {
- this.SetValue(ModuleNameProperty, value);
- }
- }
- public static readonly DependencyProperty PumpTypeProperty = DependencyProperty.Register(
- "PumpType", typeof(string), typeof(ReservoirPump),
- new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// Pump类型
- /// </summary>
- public string PumpType
- {
- get
- {
- return (string)this.GetValue(PumpTypeProperty);
- }
- set
- {
- this.SetValue(PumpTypeProperty, value);
- }
- }
- public static readonly DependencyProperty IsOpenPumpProperty = DependencyProperty.Register(
- "IsOpenPump", typeof(bool), typeof(ReservoirPump), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
- public bool IsOpenPump
- {
- get { return (bool)this.GetValue(IsOpenPumpProperty); }
- set { SetValue(IsOpenPumpProperty, value); }
- }
- public static readonly DependencyProperty RotateTransformValueProperty = DependencyProperty.Register(
- "RotateTransformValue", typeof(int), typeof(ReservoirPump));
- public int RotateTransformValue
- {
- get { return (int)this.GetValue(RotateTransformValueProperty); }
- set { this.SetValue(RotateTransformValueProperty, value); }
- }
- private void OpenClick(object sender, RoutedEventArgs e)
- {
- //IsOpenPump = true;
- if (PumpType.Contains("Replen"))
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ReplenPumpOn", PumpType);
- }
- else
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{PumpType}On");
- }
-
- }
- private void CloseClick(object sender, RoutedEventArgs e)
- {
- //IsOpenPump = false;
- if (PumpType.Contains("Replen"))
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ReplenPumpOff", PumpType);
- }
- else
- {
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{PumpType}Off");
- }
-
- }
- }
- }
|