using Bodk.Device.Storage.EventArgs; namespace Bodk.Device.Storage.Modules; /// /// 龙门Y /// /// /// /// /// /// /// public class GantryY( Action alarmEventHandler, Action motionTimeoutAlarmEventHandler, Func writeCoilRegisterFunc, Func> readCoilRegisterFunc, Func> readHoldingRegistersFunc, Func writeHoldingRegistersFunc) : ModuleBase(alarmEventHandler, motionTimeoutAlarmEventHandler, writeCoilRegisterFunc, readCoilRegisterFunc, readHoldingRegistersFunc, writeHoldingRegistersFunc) { public override string Name => "GantryY"; public override string Descirption => "龙门Y轴"; public override int Id => 4; internal override ushort? EnableAddress => 103; internal override ushort? ResetAddress => 123; internal override ushort? CleanAddress => 143; internal override ushort? GotoOriginAddress => 163; internal override ushort? ForwardAddress => 183; internal override ushort? BackwardAddress => 203; internal override ushort? RelativeMoveAddress => 223; internal override ushort? AbsoluteMoveAddress => 243; internal override ushort? MotionTimeoutAlarmAddress => 283; internal override ushort? AlarmAddress => 303; internal override ushort? IsEnabledAddress => 333; internal override ushort? OriginFlagAddress => 353; internal override ushort? MoveDistanceAddress => 106; internal override ushort? CurrentPositionAddress => 130; internal override ushort? ManualSpeedAddress => 1006; internal override ushort? AutoSpeedAddress => 1046; internal override ushort? AccDecAddress => 1086; internal override ushort? GotoOriginHighSpeedAddress => 1126; internal override ushort? GotoOriginLowSpeedAddress => 1150; internal ushort StandbyAddress => 1378; internal ushort GraspFoamLidAddress => 1380; internal ushort PlaceFoamLidAddress => 1382; internal ushort BipolarModuleAAddress => 1384; internal ushort BipolarModuleBAddress => 1386; internal ushort BipolarModuleCAddress => 1388; internal ushort UnipolarModuleAAddress => 1390; internal ushort UnipolarModuleBAddress => 1392; internal ushort UnipolarModuleCAddress => 1394; /// /// 移动到待机位 /// public async Task MoveToStandbyPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(StandbyAddress)); } /// /// 移动到抓取泡沫盖位 /// public async Task MoveToGraspFoamLidPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(GraspFoamLidAddress)); } /// /// 移动到放泡沫盖位 /// public async Task MoveToPlaceFoamLidPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(PlaceFoamLidAddress)); } /// /// 移动到双极模组A位 /// public async Task MoveToBipolarModuleAPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(BipolarModuleAAddress)); } /// /// 移动到双极模组B位 /// public async Task MoveToBipolarModuleBPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(BipolarModuleBAddress)); } /// /// 移动到双极模组C位 /// public async Task MoveToBipolarModuleCPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(BipolarModuleCAddress)); } /// /// 移动到单极模组A位 /// public async Task MoveToUnipolarModuleAPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(UnipolarModuleAAddress)); } /// /// 移动到单极模组B位 /// public async Task MoveToUnipolarModuleBPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(UnipolarModuleBAddress)); } /// /// 移动到单极模组C位 /// public async Task MoveToUnipolarModuleCPositionAsync() { await AbsoluteMoveAsync(await ReadFloat(UnipolarModuleCAddress)); } /// /// 待机位 /// public float StandbyPosition { get { _standbyPosition ??= ReadFloat(StandbyAddress).Result; return _standbyPosition.Value; } set { _standbyPosition = value; WriteFloat(StandbyAddress, value); } } private float? _standbyPosition; }