public TSerialPortController(TSerialPortModel serialPortModel)
 {
     //this._Port.PortName = serialPortModel.PortName;
     //this._Port.BaudRate = serialPortModel.BaudRate;
     //this._Port.DataBits = serialPortModel.DataBit;
     //this._Port.StopBits = serialPortModel.StopBit;
     //this._Port.DataReceived += new SerialDataReceivedEventHandler(Sub_DataReceivedEventHandler);
 }
Exemplo n.º 2
0
 public static TSerialPortController Initalize(TSerialPortModel portModel)
 {
     if (!_FlyweightFactoryDictionary.ContainsKey(portModel.COMID))
     {
         lock (_lock)
         {
             if (!_FlyweightFactoryDictionary.ContainsKey(portModel.COMID))
             {
                 TSerialPortController portController = new TSerialPortController(portModel);
                 _FlyweightFactoryDictionary.Add(portModel.COMID, portController);
             }
         }
     }
     return(_FlyweightFactoryDictionary[portModel.COMID]);
 }