public bool SendOilDot(int iAddr, string lstStrings) { lock (this) { try { ClearOldReadBuf(); int[] iArr = new int[12]; string[] strArr = lstStrings.Split(new char[] { '-' }); int i = 0; foreach (string strAstr in strArr) { int.TryParse(strArr[i], out iArr[i]); i++; } byte[] bBuf = GLLedProtocol.MakeCmdLedSetDecimal(iAddr, iArr); Write(bBuf, 0, bBuf.Length); Thread.Sleep(100); bool bError = false; byte[] bRead = Read(out bError); if (bRead != null) { LogMgr.WriteInfoDefSys("recbuf bytes:" + BitConverter.ToString(bRead)); } return(GLLedProtocol.AnalyeseRecSetDecemil(bRead, iAddr)); } catch (System.Exception ex) { LogMgr.WriteInfoDefSys("读写异常" + ex.Message); return(false); } } }
/// <summary> /// 设置油价牌卡上的小数点 /// </summary> /// <param name="iAddr">ID</param> /// <param name="iArrDecmails">每块牌上的小数点位置(一个控制卡可以接N个显示屏)</param> /// <returns></returns> public bool SetCardDecmial(int iAddr, int[] iArrDecmails) { ClearOldReadBuf(); byte[] bBuf = GLLedProtocol.MakeCmdLedSetDecimal(iAddr, iArrDecmails); Write(bBuf, 0, bBuf.Length); Thread.Sleep(1000); byte[] bRead = Read(); if (bRead == null) { LogMgr.WriteErrorDefSys("GetCfg RecBuf is Null"); return(false); } return(GLLedProtocol.AnalyeseRecSetDecemil(bRead, iAddr)); }