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 MenuMotion2 : UserControl
    {
        ITDGageService tDGageService;
        public MenuMotion2()
        {
            InitializeComponent();
        }
        [InjectionMethod]
        public void Init(ITDGageService tDGageService)
        {
            this.tDGageService = tDGageService;
        }
        private void btnBackwClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.BACKW);

        }

        private void btnForwClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.FORW);
        }

        private void btnOrgClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.ORG);
        }

        private void btnStopClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP2(Base.Common.STARTP2_MODE.STOP);
        }

        private void btnScanClick(object sender, RoutedEventArgs e)
        {
            tDGageService.StartP1();
        }
    }

    public class UiModule2_MenuMotion2 : IUiModule2
    {
        public string Title => "测厚.扫描运行2";

        public ComponentType Type => ComponentType.Menu;

        public bool IsUnique => true;

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

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

        public void MatchParam(int[] IDs)
        {

        }
    }
}
