1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using athosRT.tool;
- using Caliburn.Micro;
- using MECF.Framework.Common.Device.Bases;
- using MECF.Framework.Common.Equipment;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace athosRT.FSM
- {
- public interface IRoutine
- {
- RState Start(params object[] objs);
- RState Monitor();
- void Abort();
- }
- public class ModuleRoutineBase
- {
- public ModuleName Module { get; set; }
- public string Name { get; set; }
- public bool NullFun() => true;
- public RoutineRunner Runner = new RoutineRunner();
- protected readonly int _delay_50ms = 50;
- protected readonly int _delay_1s = 1000;
- protected readonly int _delay_2s = 2000;
- protected readonly int _delay_3s = 3000;
- protected readonly int _delay_4s = 4000;
- protected readonly int _delay_5s = 5000;
- protected readonly int _delay_10s = 10000;
- protected readonly int _delay_20s = 20000;
- protected readonly int _delay_30s = 30000;
- protected readonly int _delay_60s = 60000;
- protected readonly int _delay_2m = 120000;
- protected readonly int _delay_3m = 180000;
- protected readonly int _delay_5m = 300000;
- public ModuleRoutineBase(ModuleName module)
- {
- Module = module;
- Runner.Reset();
- }
- protected void Notify(string message)
- {
- //log4net
- LogObject.Info("Notify:", message);
- }
- protected void Stop(string failReason)
- {
- //log4net
- LogObject.Info("Notify:", failReason);
- }
- public void Reset()
- {
- Runner.Reset();
- }
- }
- }
|