MenuMotion.xaml.cs 1.97 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
using FLY.Thick.Base.IService;
using MultiLayout.UiModule;
using System.Windows;
using System.Windows.Controls;
using Unity;

namespace FLY.Thick.Base.UI.UiModule
{
    /// <summary>
    /// MenuMotion.xaml 的交互逻辑
    /// </summary>
    public partial class MenuMotion : UserControl
    {
14
        ITDGageService gageService;
15 16 17 18 19
        public MenuMotion()
        {
            InitializeComponent();
        }
        [InjectionMethod]
20
        public void Init(ITDGageService gageService)
21
        {
22 23 24
            this.gageService = gageService;
            this.DataContext = gageService;
            //gageService.DynArea.ControllerState
25 26 27
        }
        private void btnBackwClick(object sender, RoutedEventArgs e)
        {
28
            gageService.StartP2(Base.Common.STARTP2_MODE.BACKW);
29 30 31 32 33

        }

        private void btnForwClick(object sender, RoutedEventArgs e)
        {
34
            gageService.StartP2(Base.Common.STARTP2_MODE.FORW);
35 36 37 38
        }

        private void btnOrgClick(object sender, RoutedEventArgs e)
        {
39
            gageService.StartP2(Base.Common.STARTP2_MODE.ORG);
40 41 42 43
        }

        private void btnStopClick(object sender, RoutedEventArgs e)
        {
44
            gageService.StartP2(Base.Common.STARTP2_MODE.STOP);
45 46 47 48
        }

        private void btnScanClick(object sender, RoutedEventArgs e)
        {
49
            gageService.StartP1();
50 51 52 53 54
        }
    }

    public class UiModule2_MenuMotion : IUiModule2
    {
55
        public string Title => "测厚.扫描运行";
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78

        public ComponentType Type => ComponentType.Menu;

        public bool IsUnique => true;

        public FrameworkElement GetComponent(int id, IUnityContainer container)
        {
            MenuMotion menu = new MenuMotion();
            container.BuildUp(menu);
            return menu;
        }

        public FrameworkElement GetThumbnail()
        {
            return new System.Windows.Controls.Grid();
        }

        public void MatchParam(int[] IDs)
        {

        }
    }
}