private void saveBtn_Click(object sender, RoutedEventArgs e)
        {
            var id = (Rs232Action.Rs232ActionType)Enum.Parse(typeof(Rs232Action.Rs232ActionType), operationCmb.Text);
            var data = new Rs232Action.Rs232ActionData()
                                                   {
                                                       Port = portCmb.Text,
                                                       BaudRate = baudRateCmb.Text,
                                                       Command = commandTxb.Text,
                                                       DataBits = dataBitsCmb.Text,
                                                       Dtr = dtrCmb.Text,
                                                       Handshake = HandshakeCmb.Text,
                                                       Parity = parityCmb.Text,
                                                       Rts = rtsCmb.Text,
                                                       StopBits = stopBitsCmb.Text,
                                                       TargetVar = targetVarCmb.Text,
                                                       LogFileName = logCmb.Text,
                                                       AsBytes = asBytesCmb.Text,
                                                       SendLineFeed = lineFeedCmb.Text,
                                                       SendSingleChar = singleCharCmb.Text
                                                   };

            var rsObj = new Rs232Action(id, data);
            var entity = new StepEntity(rsObj);
            entity.Comment = string.Format("Rs232 Action - {0}", operationCmb.Text);
            Singleton.Instance<SaveData>().AddStepEntity(entity);
        }
Exemple #2
0
 public Rs232Obj(Rs232Action.Rs232ActionData data)
 {
     _data = data;
 }