using BroadcastModule;
using DatabaseDLL;
using Monitor;
using NumMachine;
using PLCS7;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using WebServer;
namespace Monitor
{
public class Monitor : IMonitor
{
///
/// 监控模块单例
///
public static Monitor ins { get; set; }
///
/// 中控系统总状态
///
public static bool globalStatus = false;
///
/// 初始化步骤
///
public static int initializeState = 0;
///
/// PLC对象句柄
///
public static AbstractPLCLinker PLC = null;
public static string plcIPAddr { get; set; }
public static int plcRack { get; set; }
public static int plcSlot { get; set; }
public static string[] plcDatablockConfig { get; set; }
public static int plcTerminalCount { get; set; }
public static int plcParkingSpaceCount { get; set; }
public static int plcRefreshInterval { get; set; }
public static MainBlockStru mainBlockInfo { get; set; }
public static List parkingSpaceInfo { get; set; }
///
/// 远程数据库操作句柄
///
public static DBOperation remoteDBOper;
///
/// 本地数据库操作句柄
///
public static DBOperation localDBOper;
///
/// 显示板操作对象句柄
///
public static BroadcastBoard allInOneMachine;
public static string allInOneMachineIP { get; set; }
public static int allInOneMachinePort { get; set; }
///
/// 号牌机操作句柄
///
public static INumMachineLinker numMachineLinker;
public static IntPtr flpHandle;
///
/// 本地web操作句柄
///
public static IWebServer webServer;
public static int webPort { get; set; }
///
/// 系统初始化器句柄
///
internal static SystemInitializer sysInitializer;
///
/// 系统关闭状态
///
bool isClosing;
///
/// 车库ID
///
public static int garageID;
private void PLCUpdate()
{
while (!isClosing)
{
if (PLC != null && PLC.isConnected)
{
List