public static string GetPumpStatusEnum(PumpStatusEnum pumpStatusEnum) { switch (pumpStatusEnum) { case PumpStatusEnum.Idle: return("02"); case PumpStatusEnum.Reserved: return("0#"); case PumpStatusEnum.Authorized: return("0:"); case PumpStatusEnum.NozzlePickUp: return("0;"); case PumpStatusEnum.StartedDispend: return("0;"); case PumpStatusEnum.Dispensing: return("0?"); case PumpStatusEnum.DispenseCompleted: return("12"); case PumpStatusEnum.Finalized: return("42"); case PumpStatusEnum.NoRespond: return("00"); case PumpStatusEnum.NoAuthorise: return("03"); case PumpStatusEnum.PumpBlocked: return("82"); case PumpStatusEnum.Disabled: return("7F"); default: return($"[{pumpStatusEnum.ToString()}|{(int)pumpStatusEnum}]"); } }
/// <summary> /// /// </summary> /// <param name="pse"></param> /// <returns></returns> private PumpStatus IsPumpRun(PumpStatusEnum pse) { if (pse == PumpStatusEnum.Run) { return(PumpStatus.Run); } else if (pse == PumpStatusEnum.Stop) { return(PumpStatus.Stop); } throw new ArgumentException(pse.ToString()); }
/// <summary> /// /// </summary> /// <param name="value"></param> /// <returns></returns> static public PumpStatus Find(PumpStatusEnum value) { if (value == PumpStatusEnum.Run) { return(Run); } else if (value == PumpStatusEnum.Stop) { return(Stop); } else { throw new ArgumentException(value.ToString()); } }
/// <summary> /// /// </summary> /// <param name="pse"></param> /// <returns></returns> private PumpStatus IsPumpRun(PumpStatusEnum pse) { if (pse == PumpStatusEnum.Run) { return PumpStatus.Run; } else if (pse == PumpStatusEnum.Stop) { return PumpStatus.Stop; } throw new ArgumentException(pse.ToString()); }