WdVelocity.xaml.cs 2.05 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2
using FLY.Integrated.IService;
using FLY.OBJComponents.Client;
潘栩锋's avatar
潘栩锋 committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16
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.Shapes;
潘栩锋's avatar
潘栩锋 committed
17
using Unity;
潘栩锋's avatar
潘栩锋 committed
18

潘栩锋's avatar
潘栩锋 committed
19
namespace FLY.Integrated.UI.Client.UiModule
潘栩锋's avatar
潘栩锋 committed
20 21 22 23 24 25
{
    /// <summary>
    /// Window_Frequency.xaml 的交互逻辑
    /// </summary>
    public partial class WdVelocity : FLY.ControlLibrary.WindowBigClose
    {
潘栩锋's avatar
潘栩锋 committed
26
        IIntegratedSystemService integratedSystemService;
潘栩锋's avatar
潘栩锋 committed
27 28 29 30 31 32 33 34 35 36 37 38 39
        FLY.OBJComponents.Client.SetPLCUpdatePlan setPlan;

        public WdVelocity()
        {
            InitializeComponent();
            this.Closed += WdVelocity_Closed;
        }

        private void WdVelocity_Closed(object sender, EventArgs e)
        {
            setPlan.Dispose();
        }

潘栩锋's avatar
潘栩锋 committed
40 41 42 43
        [InjectionMethod]
        public void Init(
            IIntegratedSystemService integratedSystemService
            )
潘栩锋's avatar
潘栩锋 committed
44
        {
潘栩锋's avatar
潘栩锋 committed
45 46
            this.integratedSystemService = integratedSystemService;
            this.DataContext = integratedSystemService.Accessory;
潘栩锋's avatar
潘栩锋 committed
47 48 49

            //注册属性更新计划
            setPlan = new SetPLCUpdatePlan(
潘栩锋's avatar
潘栩锋 committed
50 51
                 integratedSystemService.PLCos,
                 integratedSystemService.Accessory,
潘栩锋's avatar
潘栩锋 committed
52 53 54 55 56 57 58
                 new string[] {
                     "TractionVelocitySet"
                 });
        }

        private void btnPlusClick(object sender, RoutedEventArgs e)
        {
潘栩锋's avatar
潘栩锋 committed
59 60
            if (integratedSystemService.Accessory.TractionVelocitySet < 999.0)
                integratedSystemService.Accessory.TractionVelocitySet += 0.1f;
潘栩锋's avatar
潘栩锋 committed
61 62 63 64
        }

        private void btnMinusClick(object sender, RoutedEventArgs e)
        {
潘栩锋's avatar
潘栩锋 committed
65 66
            if (integratedSystemService.Accessory.TractionVelocitySet >= 0.1)
                integratedSystemService.Accessory.TractionVelocitySet -= 0.1f;
潘栩锋's avatar
潘栩锋 committed
67 68 69
        }
    }
}