100 lines
2.8 KiB
C#
100 lines
2.8 KiB
C#
using Aurora.Api.Manager;
|
|
using Aurora.View;
|
|
using AuroraACS;
|
|
using AuroraMotionBoard.Ajin;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
|
|
namespace ILSOS_PrismaticGun.Views
|
|
{
|
|
public class UCMotorAxsesViewModel : NotifyPropertyChangedBase
|
|
{
|
|
public ICommand CMD_InitAll { get; }
|
|
public ICommand CMD_AXInit { get; }
|
|
public ICommand CMD_AYInit { get; }
|
|
public ICommand CMD_BXInit { get; }
|
|
public ICommand CMD_BYInit { get; }
|
|
public ICommand CMD_ZInit { get; }
|
|
|
|
private readonly IDeviceManager DeviceManager;
|
|
public ACSMotor AX { get; set; }
|
|
public ACSMotor AY { get; set; }
|
|
public ACSMotor BX { get; set; }
|
|
public ACSMotor BY { get; set; }
|
|
public AJINMotor Z { get; set; }
|
|
public UCMotorAxsesViewModel(IDeviceManager devMngr)
|
|
{
|
|
CMD_InitAll= new DelegateCommand(InitAllAxses);
|
|
CMD_AXInit = new DelegateCommand(AXInit);
|
|
CMD_AYInit = new DelegateCommand(AYInit);
|
|
CMD_BXInit = new DelegateCommand(BXInit);
|
|
CMD_BYInit = new DelegateCommand(BYInit);
|
|
CMD_ZInit = new DelegateCommand(ZInit);
|
|
DeviceManager = devMngr;
|
|
AX = DeviceManager[MotorIds.ALineX] as ACSMotor;
|
|
AY = DeviceManager[MotorIds.ALineY] as ACSMotor;
|
|
BX = DeviceManager[MotorIds.BLineX] as ACSMotor;
|
|
BY = DeviceManager[MotorIds.BLineY] as ACSMotor;
|
|
Z = DeviceManager[MotorIds.MotorZ] as AJINMotor;
|
|
}
|
|
private void AXInit(object obj)
|
|
{
|
|
if (!AX.IsActivated)
|
|
{
|
|
return;
|
|
}
|
|
AX.Init();
|
|
}
|
|
private void AYInit(object obj)
|
|
{
|
|
if (!AY.IsActivated)
|
|
{
|
|
return;
|
|
}
|
|
AY.Init();
|
|
}
|
|
private void BXInit(object obj)
|
|
{
|
|
if (!BX.IsActivated)
|
|
{
|
|
return;
|
|
}
|
|
BX.Init();
|
|
}
|
|
private void BYInit(object obj)
|
|
{
|
|
if (!BY.IsActivated)
|
|
{
|
|
return;
|
|
}
|
|
BY.Init();
|
|
}
|
|
private void ZInit(object obj)
|
|
{
|
|
if (!Z.IsActivated)
|
|
{
|
|
return;
|
|
}
|
|
Z.Init();
|
|
}
|
|
|
|
private void InitAllAxses(object obj)
|
|
{
|
|
if (!AX.IsActivated || !AY.IsActivated || !BX.IsActivated || !BY.IsActivated)// || !AJIN.IsActivated)
|
|
{
|
|
return;
|
|
}
|
|
AX.Init();
|
|
AY.Init();
|
|
BX.Init();
|
|
BY.Init();
|
|
Z.Init();
|
|
}
|
|
|
|
}
|
|
}
|