bool IBLL.IReadWeight.Ini() { _have_ini = true; IBLL.IPar par = new BLL.PACKCHEN(); string val = ""; port = par.Read("Communications", "Port"); this.start_str = par.Read("Communications", "CharStart"); this.end_str = par.Read("Communications", "CharEnd"); this.Thousands = par.Read("Communications", "Thousands"); int br; int.TryParse(par.Read("Communications", "Settings").Split(',')[0], out br); serialPort.PortName = port; serialPort.BaudRate = br; serialPort.DataBits = 8; serialPort.StopBits = StopBits.One; serialPort.Parity = Parity.None; serialPort.DataReceived += serialPort_DataReceived; serialPort.Open(); tmr.Interval = 20; tmr.Tick += tmr_tick; tmr.Enabled = true; return(true); }
bool IBLL.IReadWeight.have_bala() { IBLL.IPar par = new BLL.PACKCHEN(); string val = par.Read("Communications", "balance"); if (val == "1") { return(true); } else { return(false); } }