|
|
@@ -16,52 +16,44 @@ namespace parkMonitor.server.CoreThread
|
|
|
public abstract class AbstractCmd
|
|
|
{
|
|
|
public int equipmentStatus_address { set; get; }
|
|
|
+ public int park_completed_address { set; get; }
|
|
|
public int parkingEntX { set; get; }
|
|
|
+ public int parkingEntY { set; get; }
|
|
|
+ public int parkingEntZ { set; get; }
|
|
|
+ public int fetch_completed_address { set; get; }
|
|
|
+ public IEquipments PLC { set; get; }
|
|
|
+ public IEquipments queuingThread { set; get; }
|
|
|
+ public DBOperation oper { set; get; }
|
|
|
+ public IEquipments NumMachine { set; get; }
|
|
|
+ public CEntrance c { set; get; }
|
|
|
+ public AllotParkingSpace aps { set; get; }
|
|
|
public abstract void executeCmd(Command queueCmd);
|
|
|
|
|
|
public AbstractCmd()
|
|
|
{
|
|
|
equipmentStatus_address = Convert.ToInt32(ConfigurationManager.AppSettings["equipmentStatus_address"]);
|
|
|
- //int park_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["park_completed_address"]);
|
|
|
+ park_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["park_completed_address"]);
|
|
|
parkingEntX = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntX"]);
|
|
|
- //int parkingEntY = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntY"]);
|
|
|
- //int parkingEntZ = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntZ"]);
|
|
|
- ////取车完成
|
|
|
- //int fetch_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["fetch_completed_address"]);
|
|
|
- ////获取PLC句柄
|
|
|
- //IEquipments PLC = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.PLC);
|
|
|
- ////获取队列句柄
|
|
|
- //IEquipments queuingThread = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.Queue);
|
|
|
- ////数据库
|
|
|
- //DBOperation oper = new DBOperation();
|
|
|
- ////获取号牌句柄
|
|
|
- //IEquipments NumMachine = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.NumMachine);
|
|
|
- ////车位分配
|
|
|
- //CEntrance c = new CEntrance();
|
|
|
- //AllotParkingSpace aps = new AllotParkingSpace();
|
|
|
+ parkingEntY = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntY"]);
|
|
|
+ parkingEntZ = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntZ"]);
|
|
|
+ //取车完成
|
|
|
+ fetch_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["fetch_completed_address"]);
|
|
|
+ //获取PLC句柄
|
|
|
+ PLC = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.PLC);
|
|
|
+ //获取队列句柄
|
|
|
+ queuingThread = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.Queue);
|
|
|
+ //数据库
|
|
|
+ oper = new DBOperation();
|
|
|
+ //获取号牌句柄
|
|
|
+ NumMachine = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.NumMachine);
|
|
|
+ //车位分配
|
|
|
+ c = new CEntrance();
|
|
|
+ aps = new AllotParkingSpace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public class StopCmd : AbstractCmd
|
|
|
{
|
|
|
- // int equipmentStatus_address = Convert.ToInt32(ConfigurationManager.AppSettings["equipmentStatus_address"]);
|
|
|
- int park_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["park_completed_address"]);
|
|
|
- // int parkingEntX = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntX"]);
|
|
|
- int parkingEntY = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntY"]);
|
|
|
- int parkingEntZ = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntZ"]);
|
|
|
- //取车完成
|
|
|
- int fetch_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["fetch_completed_address"]);
|
|
|
- //获取PLC句柄
|
|
|
- IEquipments PLC = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.PLC);
|
|
|
- //获取队列句柄
|
|
|
- IEquipments queuingThread = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.Queue);
|
|
|
- //数据库
|
|
|
- DBOperation oper = new DBOperation();
|
|
|
- //获取号牌句柄
|
|
|
- IEquipments NumMachine = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.NumMachine);
|
|
|
- //车位分配
|
|
|
- CEntrance c = new CEntrance();
|
|
|
- AllotParkingSpace aps = new AllotParkingSpace();
|
|
|
public override void executeCmd(Command queueCmd)
|
|
|
{
|
|
|
PLCMessage PLCMsg = null;
|
|
|
@@ -206,24 +198,6 @@ namespace parkMonitor.server.CoreThread
|
|
|
|
|
|
public class FetchCmd : AbstractCmd
|
|
|
{
|
|
|
- int equipmentStatus_address = Convert.ToInt32(ConfigurationManager.AppSettings["equipmentStatus_address"]);
|
|
|
- int park_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["park_completed_address"]);
|
|
|
- int parkingEntX = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntX"]);
|
|
|
- int parkingEntY = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntY"]);
|
|
|
- int parkingEntZ = Convert.ToInt32(ConfigurationManager.AppSettings["parkingEntZ"]);
|
|
|
- //取车完成
|
|
|
- int fetch_completed_address = Convert.ToInt32(ConfigurationManager.AppSettings["fetch_completed_address"]);
|
|
|
- //获取PLC句柄
|
|
|
- IEquipments PLC = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.PLC);
|
|
|
- //获取队列句柄
|
|
|
- IEquipments queuingThread = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.Queue);
|
|
|
- //数据库
|
|
|
- DBOperation oper = new DBOperation();
|
|
|
- //获取号牌句柄
|
|
|
- IEquipments NumMachine = EquipmentSimpleFactory.ins.FindEquipment(EquipmentName.NumMachine);
|
|
|
- //车位分配
|
|
|
- CEntrance c = new CEntrance();
|
|
|
- AllotParkingSpace aps = new AllotParkingSpace();
|
|
|
public override void executeCmd(Command queueCmd)
|
|
|
{
|
|
|
PLCMessage PLCMsg = null;
|
|
|
@@ -279,7 +253,6 @@ namespace parkMonitor.server.CoreThread
|
|
|
|
|
|
public class ExceptionCmd : AbstractCmd
|
|
|
{
|
|
|
- DBOperation oper = new DBOperation();
|
|
|
public override void executeCmd(Command queueCmd)
|
|
|
{
|
|
|
if (queueCmd.commandType == 'e')
|