예제 #1
0
        public Rs232Action(Rs232ActionType type, Rs232ActionData actionData)
            : base(Enums.ActionTypeId.Rs232Operations)
        {
            _actionData = actionData;
            _type = type;

            Details.Add(type.ToString());
            Details.Add(_actionData.Port); //1
            Details.Add(_actionData.Handshake); //2
            Details.Add(_actionData.Rts); //3
            Details.Add(_actionData.Dtr); //4
            Details.Add(_actionData.Parity); //5
            Details.Add(_actionData.StopBits); //6
            Details.Add(_actionData.DataBits); //7
            Details.Add(_actionData.BaudRate); //8
            Details.Add(_actionData.TargetVar); //9
            Details.Add(_actionData.Command); //10
            Details.Add(_actionData.LogFileName); //11
            Details.Add(_actionData.AsBytes.ToString()); //12
            Details.Add(_actionData.SendLineFeed.ToString()); //13
            Details.Add(_actionData.SendSingleChar.ToString()); //14
        }
예제 #2
0
 public override void Construct()
 {
     _type = (Rs232ActionType)Enum.Parse(typeof(Rs232ActionType), Details[0]);
     _actionData = new Rs232ActionData()
     {
         Port = Details[1],
         Handshake = Details[2],
         Rts = Details[3],
         Dtr = Details[4],
         Parity = Details[5],
         StopBits = Details[6],
         DataBits = Details[7],
         BaudRate = Details[8],
         TargetVar = Details[9],
         Command = Details[10],
         LogFileName = Details.Count > 11 ? Details[11] : string.Empty,
         AsBytes = Details.Count > 12 ? Details[12] : false.ToString(),
         SendLineFeed = Details.Count > 13 ? Details[13] : false.ToString(),
         SendSingleChar = Details.Count > 14 ? Details[14] : false.ToString(),
     };
 }