123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- using MECF.Framework.Common.CommonData.Prewet;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.OperationCenter;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- 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>
- /// SrdAwcCycleControl.xaml 的交互逻辑
- /// </summary>
- public partial class SrdAwcCycleControl : UserControl
- {
-
- public SrdAwcCycleControl()
- {
- InitializeComponent();
- }
- #region 属性
- public static readonly DependencyProperty SRDModuleNameProperty = DependencyProperty.Register(
- "SRDModuleName", typeof(ModuleName), typeof(SrdAwcCycleControl), new FrameworkPropertyMetadata(ModuleName.Unknown, FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// SRD ModuleName
- /// </summary>
- public ModuleName SRDModuleName
- {
- get
- {
- return (ModuleName)this.GetValue(SRDModuleNameProperty);
- }
- set
- {
- this.SetValue(SRDModuleNameProperty, value);
- }
- }
- public static readonly DependencyProperty CyclesProperty = DependencyProperty.Register(
- "Cycles", typeof(int), typeof(SrdAwcCycleControl), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// Cycles
- /// </summary>
- public int Cycles
- {
- get
- {
- return (int)this.GetValue(CyclesProperty);
- }
- set
- {
- this.SetValue(CyclesProperty, value);
- }
- }
- public static readonly DependencyProperty IsRunningProperty = DependencyProperty.Register(
- "IsRunning", typeof(bool), typeof(SrdAwcCycleControl),new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// IsRunning
- /// </summary>
- public bool IsRunning
- {
- get
- {
- return (bool)this.GetValue(IsRunningProperty);
- }
- set
- {
- this.SetValue(IsRunningProperty, value);
- }
- }
- #endregion
- private void Start_Click(object sender, RoutedEventArgs e)
- {
- if (Cycles == 0)
- {
- MessageBox.Show("Please Enter CycleTimes First!", "Current Cycle is 0", MessageBoxButton.OK, MessageBoxImage.Error);
- }
- else
- {
- if(SRDModuleName != ModuleName.Unknown)
- {
- InvokeClient.Instance.Service.DoOperation($"{SRDModuleName}.AWCCycle", Cycles);
- }
- else
- {
- MessageBox.Show("Please Select SRD Module First!", "No SRD Module is selected", MessageBoxButton.OK, MessageBoxImage.Error);
- }
- }
- }
- private void Stop_Click(object sender, RoutedEventArgs e)
- {
- InvokeClient.Instance.Service.DoOperation($"{SRDModuleName}.Abort");
- }
- private void SRDModuleName_Checked(object sender, RoutedEventArgs e)
- {
- RadioButton radioButton = (sender as RadioButton);
- if (radioButton != null && radioButton.Content != null)
- {
- SRDModuleName = (ModuleName)Enum.Parse(typeof(ModuleName), radioButton.Content.ToString());
- if(SRDModuleName == ModuleName.SRD1)
- {
- SRD2.IsChecked = false;
- }
- else if (SRDModuleName == ModuleName.SRD2)
- {
- SRD1.IsChecked = false;
- }
- }
- }
- }
- }
|