Exemplo n.º 1
0
 public SerialLis(CommunicationFields serialFields)
 {
     BaudRate          = serialFields.BaudRate;
     SerialPort        = serialFields.Port;
     SerialParity      = serialFields.Parity;
     SerialDataBit     = serialFields.DataBit;
     SerialStopBit     = serialFields.StopBit;
     SerialFlowControl = serialFields.FlowControl;
 }
Exemplo n.º 2
0
        public CommunicationFields ReadJsonFile()
        {
            CommunicationFields communicationField = null;

            if (File.Exists(GetCommJsonFile))
            {
                communicationField = JsonConvert.DeserializeObject <CommunicationFields>(File.ReadAllText(GetCommJsonFile));
            }
            return(communicationField);
        }
Exemplo n.º 3
0
 public void WriteSerialJsonFile(CommunicationFields commFields)
 {
     if (File.Exists(GetCommJsonFile))
     {
         File.Delete(GetCommJsonFile);
     }
     using (StreamWriter file = File.CreateText(GetCommJsonFile)) {
         JsonSerializer serializer = new JsonSerializer();
         serializer.Serialize(file, commFields);
     }
 }
Exemplo n.º 4
0
 public SendReciver(CommunicationFields commFields, SerialMessageStatus serialMsgStatus,
                    TcpMesageStatus messageStatus, LisPatientFields lisPatF)
 {
     if (commFields != null)
     {
         _connType = commFields.ConnType;
         if (_connType == ConnectionType.Tcp)
         {
             _tcpConnMode = _communicationFields.TcpMode;
         }
         _communicationFields  = commFields;
         this._serialMsgStatus = serialMsgStatus;
         this._tcpMsgStatus    = messageStatus;
         _lisPatFields         = lisPatF;
     }
     _clsLog = new ClsLog();
 }
Exemplo n.º 5
0
 public TcpServerLis(CommunicationFields commFields)
 {
     IpAddress = commFields.TcpIpAddress;
     Port      = commFields.TcpPort;
 }
Exemplo n.º 6
0
 public TcpClientLis(CommunicationFields commFields)
 {
     IpAddress = commFields.TcpIpAddress;
     Port      = commFields.TcpPort;
 }