You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
41 lines
1.2 KiB
|
4 weeks ago
|
using System.Timers;
|
||
|
|
|
||
|
|
namespace EGFramework
|
||
|
|
{
|
||
|
|
public class EGBlazorController : IEGBehavior, IEGFramework
|
||
|
|
{
|
||
|
|
private EGProtocolSchedule? ProtocolSchedule { set; get; }
|
||
|
|
private System.Timers.Timer ProcessTimer { set; get; } = new System.Timers.Timer(20);
|
||
|
|
|
||
|
|
public void Init()
|
||
|
|
{
|
||
|
|
ProtocolSchedule = this.GetModule<EGProtocolSchedule>();
|
||
|
|
this.GetModule<EGMessage>().SetDelay(100);
|
||
|
|
ProcessTimer.Elapsed += this.Process;
|
||
|
|
ProcessTimer.AutoReset = true;
|
||
|
|
ProcessTimer.Enabled = true;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void Start()
|
||
|
|
{
|
||
|
|
ProtocolSchedule?.EnabledTool<EGTCPServer>();
|
||
|
|
// ProtocolSchedule?.EnabledTool<EGTCPClient>();
|
||
|
|
ProtocolSchedule?.EnabledTool<EGSerialPort>();
|
||
|
|
ProtocolSchedule?.EnabledTool<EGUDP>();
|
||
|
|
this.GetModule<ModelSerialServer>();
|
||
|
|
this.GetModule<ModelSerialTest>();
|
||
|
|
this.GetModule<ModelControlServer>();
|
||
|
|
}
|
||
|
|
|
||
|
|
public void Process(object? source, ElapsedEventArgs e)
|
||
|
|
{
|
||
|
|
ProtocolSchedule?.CheckedProcess();
|
||
|
|
}
|
||
|
|
|
||
|
|
public void Exit()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|