CONFIGURATION.cs 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Wayne.Lib.StateEngine;
  7. namespace SinochemInternetPlusApp.States.CarPlateManualMode
  8. {
  9. static class CONFIGURATION
  10. {
  11. // make sure entry point is Init, and exit point is Final
  12. public static void Config(StateTransitionLookup sl)
  13. {
  14. sl.AddTransition<Init, Shared.AuthorizePump>(TransitionType.NozzleLifted);
  15. sl.AddTransition<Shared.AuthorizePump, Shared.ShowTrxListFueling>(TransitionType.PumpAuthOk);
  16. sl.AddTransition<Shared.AuthorizePump, Error>(TransitionType.PumpAuthFailed);
  17. sl.AddTransition<Shared.AuthorizePump, Error>(TransitionType.Timeout);
  18. ////大屏显示“加油中”
  19. sl.AddTransition<Shared.ShowTrxListFueling, Shared.Fueling>(TransitionType.Done);
  20. sl.AddTransition<Shared.ShowTrxListFueling, Shared.Fueling>(TransitionType.Timeout);
  21. sl.AddTransition<Shared.Fueling, Shared.WaitForPayableTrx>(TransitionType.NozzleReplaced);
  22. sl.AddTransition<Shared.WaitForPayableTrx, Shared.ShowTrxListReadyForPay>(TransitionType.FuelingDone);
  23. sl.AddTransition<Shared.WaitForPayableTrx, Shared.ShowTrxListFillingPaid>(TransitionType.Timeout);
  24. ////大屏显示“待支付”
  25. sl.AddTransition<Shared.ShowTrxListReadyForPay, Shared.PayTrx>(TransitionType.Done);
  26. sl.AddTransition<Shared.ShowTrxListReadyForPay, Shared.PayTrx>(TransitionType.Timeout);
  27. sl.AddTransition<Shared.PayTrx, Shared.NotifyPOS>(TransitionType.CloudPaymentOk);
  28. sl.AddTransition<Shared.PayTrx, Shared.PrintReceipt>(TransitionType.CloudPaymentFailed);
  29. sl.AddTransition<Shared.PayTrx, Shared.PrintReceipt>(TransitionType.QRCodePayment);
  30. sl.AddTransition<Shared.NotifyPOS, Shared.ShowTrxListFillingPaid>(TransitionType.PosNotifyOk);
  31. sl.AddTransition<Shared.NotifyPOS, Shared.ShowTrxListFillingPaid>(TransitionType.PosNotifyFailed);
  32. ////大屏显示“加油结果”
  33. sl.AddTransition<Shared.ShowTrxListFillingPaid, ShowPaymentResult>(TransitionType.Done);
  34. sl.AddTransition<Shared.ShowTrxListFillingPaid, ShowPaymentResult>(TransitionType.Timeout);
  35. ////大屏显示“支付结果”
  36. //sl.AddTransition<ShowPaymentResult,Final >(TransitionType.Done);
  37. //sl.AddTransition<ShowPaymentResult, Final>(TransitionType.Timeout);
  38. sl.AddTransition<ShowPaymentResult, Shared.PrintReceipt>(TransitionType.Done);
  39. sl.AddTransition<ShowPaymentResult, Shared.PrintReceipt>(TransitionType.Timeout);
  40. ////打印小票
  41. sl.AddTransition<Shared.PrintReceipt, Shared.WaitForPrinterIdle>(TransitionType.Abort);
  42. sl.AddTransition<Shared.WaitForPrinterIdle, Shared.PrintReceipt>(TransitionType.Timeout);
  43. sl.AddTransition<Shared.WaitForPrinterIdle, Shared.PrintReceipt>(TransitionType.Done);
  44. sl.AddTransition<Shared.PrintReceipt, Shared.PrintReceipt>(TransitionType.Next);
  45. sl.AddTransition<Shared.PrintReceipt, Final>(TransitionType.Done);
  46. sl.AddTransition<Shared.PrintReceipt, Error>(TransitionType.Timeout);
  47. //sl.AddTransition<Error, Final>(TransitionType.Error);
  48. sl.AddTransition<AnyState, Final>(BasicTransitionType.Error);
  49. }
  50. }
  51. }