public static void Stop() { if (!IsRuning) { return; } if (DTUResolver1.IsRuning) { DTUResolver1.Stop(); if (DTUResolver1.IsRuning) { TraceManager.AppendErrMsg("DTU解析器1关闭出错"); } } if (DTUResolver2.IsRuning) { DTUResolver2.Stop(); if (DTUResolver1.IsRuning) { TraceManager.AppendErrMsg("DTU解析器2关闭出错"); } } if (DTUResolver3.IsRuning) { DTUResolver3.Stop(); if (DTUResolver3.IsRuning) { TraceManager.AppendErrMsg("DTU解析器3关闭出错"); } } IsRuning = false; }
public static void Append(GPRS_DATA_RECORD data) { if (!IsRuning) { return; } if (DTUResolver1.TaskNumber < 4000) { DTUResolver1.Append(data); } else { if (DTUResolver2.TaskNumber < 4000) { DTUResolver2.Append(data); } else { if (DTUResolver3.TaskNumber < 4000) { DTUResolver3.Append(data); } else { TraceManager.AppendWarning("DTU解析队列三个消费者队列已达到上线无法插入"); } } } }
public static void Start() { if (IsRuning) { return; } DTUResolver1.Start(); if (!DTUResolver1.IsRuning) { TraceManager.AppendErrMsg("DTU解析器1打开出错"); Stop(); return; } DTUResolver2.Start(); if (!DTUResolver2.IsRuning) { TraceManager.AppendErrMsg("DTU解析器2打开出错"); Stop(); return; } DTUResolver3.Start(); if (!DTUResolver3.IsRuning) { TraceManager.AppendErrMsg("DTU解析器3打开出错"); Stop(); return; } IsRuning = true; }