|
@@ -5,40 +5,36 @@ namespace parkMonitor.entity
|
|
|
{
|
|
|
public abstract class AbstractMessage
|
|
|
{
|
|
|
- //public abstract bool Set(AbstractMessage msg);
|
|
|
}
|
|
|
|
|
|
//web
|
|
|
- public class MessageUTF8 : AbstractMessage
|
|
|
+ public class MessageUTF8 : AbstractMessage,ICloneable
|
|
|
{
|
|
|
public char cmd { set; get; }
|
|
|
public string context { set; get; }
|
|
|
public string sender { set; get; }
|
|
|
public string receiver { set; get; }
|
|
|
+ public int garageID { get; set; }
|
|
|
+
|
|
|
public MessageUTF8()
|
|
|
{
|
|
|
|
|
|
}
|
|
|
- public MessageUTF8(char cmd, string context, string sender, string receiver)
|
|
|
+
|
|
|
+ public MessageUTF8(char cmd, string context, string sender, string receiver, int garageID)
|
|
|
{
|
|
|
this.cmd = cmd;
|
|
|
this.context = context;
|
|
|
this.sender = sender;
|
|
|
this.receiver = receiver;
|
|
|
+ this.garageID = garageID;
|
|
|
+ }
|
|
|
+
|
|
|
+ public object Clone()
|
|
|
+ {
|
|
|
+ MessageUTF8 webMsg = new MessageUTF8(this.cmd,this.context,this.sender,this.receiver,this.garageID);
|
|
|
+ return webMsg;
|
|
|
}
|
|
|
- //public override bool Set(AbstractMessage msg)
|
|
|
- //{
|
|
|
- // if (!(msg.GetType().Equals(typeof(MessageUTF8))))
|
|
|
- // return false;
|
|
|
- // else
|
|
|
- // {
|
|
|
- // this.cmd = ((MessageUTF8)msg).cmd;
|
|
|
- // this.context = ((MessageUTF8)msg).context;
|
|
|
- // this.sender = ((MessageUTF8)msg).sender;
|
|
|
- // this.receiver = ((MessageUTF8)msg).receiver;
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- //}
|
|
|
}
|
|
|
|
|
|
//********************************************* plc ************************************************
|
|
@@ -162,16 +158,6 @@ namespace parkMonitor.entity
|
|
|
{
|
|
|
data = new List<NumberMachineNode>();
|
|
|
}
|
|
|
- //public override bool Set(AbstractMessage msg)
|
|
|
- //{
|
|
|
- // if (!(msg.GetType().Equals(typeof(LicValue))))
|
|
|
- // return false;
|
|
|
-
|
|
|
- // data = ((LicValue)msg).data;
|
|
|
- // closing = ((LicValue)msg).closing;
|
|
|
- // //devPushed = ((LicValue)msg).devPushed;
|
|
|
- // return true;
|
|
|
- //}
|
|
|
|
|
|
public override bool Equals(System.Object obj)
|
|
|
{
|
|
@@ -206,18 +192,6 @@ namespace parkMonitor.entity
|
|
|
this.status = status;
|
|
|
data = new Data();
|
|
|
}
|
|
|
- //public override bool Set(AbstractMessage msg)
|
|
|
- //{
|
|
|
- // if (!(msg.GetType().Equals(typeof(LaserValue))))
|
|
|
- // return false;
|
|
|
- // else
|
|
|
- // {
|
|
|
- // id = ((LaserValue)msg).id;
|
|
|
- // status = ((LaserValue)msg).status;
|
|
|
- // data.Copy(((LaserValue)msg).data);
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- //}
|
|
|
|
|
|
public object Clone()
|
|
|
{
|
|
@@ -258,29 +232,31 @@ namespace parkMonitor.entity
|
|
|
}
|
|
|
|
|
|
//********************************************** command **********************************************
|
|
|
- public enum EnumCommand
|
|
|
- {
|
|
|
- Fetch, Store
|
|
|
- }
|
|
|
-
|
|
|
public class Command:AbstractMessage,ICloneable
|
|
|
{
|
|
|
+ public char commandType;
|
|
|
public string LicenseNum;
|
|
|
- public EnumCommand command;
|
|
|
- public int recordingTime;
|
|
|
+ public string userID;
|
|
|
+ public int garageID;
|
|
|
+ public string TimeRecord;
|
|
|
|
|
|
public Command()
|
|
|
{
|
|
|
LicenseNum = "";
|
|
|
- command = EnumCommand.Fetch;
|
|
|
- recordingTime = 0;
|
|
|
+ TimeRecord = "";
|
|
|
+ userID = "";
|
|
|
+ garageID = 0;
|
|
|
+ TimeRecord = "";
|
|
|
}
|
|
|
+
|
|
|
public object Clone()
|
|
|
{
|
|
|
Command cmdClone = new Command();
|
|
|
+ cmdClone.commandType = commandType;
|
|
|
cmdClone.LicenseNum = LicenseNum;
|
|
|
- cmdClone.command = command;
|
|
|
- cmdClone.recordingTime = recordingTime;
|
|
|
+ cmdClone.userID = userID;
|
|
|
+ cmdClone.garageID = garageID;
|
|
|
+ cmdClone.TimeRecord = TimeRecord;
|
|
|
return cmdClone;
|
|
|
}
|
|
|
}
|