Esempio n. 1
0
 internal SECS1Reader(string name, SECS1Port secs1, SECS1Writer writer, SECS1EventExecutor exe)
 {
     this.name          = name;
     this.secs1         = secs1;
     this.writer        = writer;
     this.eventExecutor = exe;
 }
Esempio n. 2
0
 internal void Initialize()
 {
     this.timer = new SECS1Timer(this.SECS1Para.T1, this.SECS1Para.T2, (long)this.SECS1Para.T3, (long)this.SECS1Para.T4, this.SECS1Para.SerialPort);
     this.timer.OnSECS1Timeout       += new SECS1Timer.OnTimeout(this.OnTimeout);
     this.timer.Logger                = this.Logger;
     this.eventExecutor               = new SECS1EventExecutor(this.SECS1Para.SerialPort, this);
     this.eventExecutor.OnSECS1Event += new SECS1Port.SECS1EventHandler(this.eventExecutor_OnSECS1Event);
     this.eventExecutor.Logger        = this.Logger;
     this.writer        = new SECS1Writer(this.SECS1Para.SerialPort, this);
     this.writer.Logger = this.Logger;
     this.reader        = new SECS1Reader(this.SECS1Para.SerialPort, this, this.writer, this.eventExecutor);
     this.reader.Logger = this.Logger;
     this.commport      = new CommPort();
     this.commport.CommSetting.baudRate = this.SECS1Para.Baudrate;
     this.commport.CommSetting.port     = this.SECS1Para.SerialPort;
     this.commport.DataReceived        += new CommPort.DataReceivedHandler(this.DataReceived);
     this.portstatus = eSECS1_PORT_STATUS.PortIdle;
     this.writer.Start();
     this.timer.Start();
     this.eventExecutor.Start();
     this.commport.Open();
 }