using MaxwellFramework.Core.Interfaces;
using MwFramework.Device;
using MwFramework.ManagerService;
using Stylet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace MainShell.AlgorithmCalib.ViewModel
{
    public class RotateCenterCalibViewModel:Screen,IPage
    {
        public string Name { get; set; } = "CameraRotateCenterCalib";
        public string CalibName { get; set; }

        private MwFramework.Controls.SystemCalib.RotateCenterSimpleViewModel _service;
        public MwFramework.Controls.SystemCalib.RotateCenterSimpleViewModel Service
        {
            get { return _service; }
            set
            {
                _service = value;
                NotifyOfPropertyChange();
            }
        }

        /// <summary>
        /// 无参构造函数
        /// </summary>
        public RotateCenterCalibViewModel()
        {

        }

        /// <summary>
        /// 手动创建时使用的静态工厂方法
        /// </summary>
        /// <param name="cameraName">相机名称，如 "BottomCamera"</param>
        /// <param name="device">对应的硬件设备</param>
        public static RotateCenterCalibViewModel Create(string calibName, List<HardwareDevice> device, IAxis rotateAxis)
        {
            var vm = new RotateCenterCalibViewModel();
            vm.Initialize(calibName, device, rotateAxis);
            return vm;
        }

        private void Initialize(string calibName, List<HardwareDevice> device, IAxis rotateAxis)
        {
            CalibName = calibName;
            var paramList = IoC.Get<IParameterManager>() as IParamList;

            Service = new MwFramework.Controls.SystemCalib.RotateCenterSimpleViewModel(
                device, rotateAxis, paramList);
            //这里参数站位

            Service.IsShowSolidLine = true;
            Service.ShapeThickness = 1;
            Service.DrawInConcurrency = false;
            Service.IsAxisControlLDBVisible = Visibility.Visible;
        }

    }
}
