1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using DbCommon.Enties.DbModels;
- using ProjectManagementSystem.Device.CommandCallback;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ProjectManagementSystem.DispatchPack
- {
- public static class StationInfoTools
- {
- public static byte GetDBAgvId(this StationInfo info)
- {
- return info.Online ? (byte)info.AgvId : (byte)0;
- }
- public static byte GetDBRunValues(this StationInfo info)
- {
- if(!info.Online)
- {
- return (byte)DBRunValues.Unknow;
- }
- if(info.HasCar)
- {
- return (byte)DBRunValues.StopOnStation;
- }
- if(info.AgvStausValue == (byte)EnumInfoAgvStatus.运行)
- {
- return (byte)DBRunValues.Running;
- }
- if (info.AgvStausValue == (byte)EnumInfoAgvStatus.暂停)
- {
- return (byte)DBRunValues.Pause;
- }
- return (byte)DBRunValues.Unknow;
- }
- public static byte GetDBAgvFalut(this StationInfo info)
- {
- return info.Online ? info.AgvAlarm : (byte)0;
- }
- }
- public enum DBControlValues : int
- {
- NoAction = 0,
- OKRelease = 1,
- NGRelease = 2,
- StopImmediate = 3,
- StopRelease = 4
- }
- public enum DBRunValues : byte
- {
- Unknow = 0,
- Running = 1,
- Pause = 2,
- StopOnStation = 3,
- EmergencyStop = 4
- }
- }
|