private void sendText(string context, int row) { LEDSender.Do_LED_Startup(); TSenderParam param = new TSenderParam(); ushort K; GetDeviceParam(ref param.devParam); param.notifyMode = LEDSender.NOTIFY_BLOCK; param.wmHandle = (UInt32)0; param.wmMessage = WM_LED_NOTIFY; System.Drawing.Font font = new System.Drawing.Font("宋体", float.Parse(zt)); K = (ushort)LEDSender.Do_MakeRoot(LEDSender.ROOT_PLAY, LEDSender.COLOR_MODE_DOUBLE, LEDSender.SURVIVE_ALWAYS); LEDSender.Do_AddChapter(K, 3000, LEDSender.WAIT_CHILD); LEDSender.Do_AddRegion(K, int.Parse(left), int.Parse(top) + font.Height * row + 3, int.Parse(width), int.Parse(height), 0);//-18 //第1页面 LEDSender.Do_AddLeaf(K, 3000, LEDSender.WAIT_CHILD); //自动换行的文字 // LEDSender.Do_AddText(K, 0, 0, 64, 16, LEDSender.V_TRUE, 0, "Hello world! 宁采成,HELLO WORLD!", "宋体", 9, 0xff, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 0, 1, 1, 1, 0, 1, 3); //非自动换行的文字 if (row >= 0) { LEDSender.Do_AddText(K, 0, 16, 64, 64, LEDSender.V_TRUE, 0, context, "宋体", int.Parse(zt), 0xff00, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 2, 3, 1, 1, 0, 0, 1);//0 静态显示 } //if (row >=1) // LEDSender.Do_AddText(K, 0, 16+font.Height*row+3, 64, 32, LEDSender.V_TRUE, 0, context, "宋体", int.Parse(zt), 0xff00, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 2, 3, 1, 1, 1, 0, 1); //System.Threading.Thread.Sleep(100000); // LEDSender.Do_AddText(K, 0, 16, 64, 32, LEDSender.V_TRUE, 0, "谢谢,收您1000.找您50", "宋体", 12, 0xff00, LEDSender.WFS_NONE, LEDSender.V_TRUE,0, 2, 3, 1, 1, 1, 1, 1); //第2页面 // LEDSender.Do_AddLeaf(K, 10000, LEDSender.WAIT_CHILD); //非自动换行的文字 // LEDSender.Do_AddText(K, 0, 0, 64, 16, LEDSender.V_TRUE, 0, "Hello world!", "宋体", 12, 0xffff, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 0, 1, 1, 1, 1, 1, 5); Parse2(LEDSender.Do_LED_SendToScreen(ref param, K)); }
int SendLEDMessage(string ip, ushort port, int colorMode, string deviceAddr, string position, string text, bool isFlash) { LogService.Debug(string.Format("SendLEDMessage->Start:Text={0}", text)); var strArr = position.Split(','); int ChapterIndex = Convert.ToInt32(strArr[0]), RegionIndex = Convert.ToInt32(strArr[1]), LeafIndex = Convert.ToInt32(strArr[2]), ObjectIndex = Convert.ToInt32(strArr[3]); TSenderParam param = new TSenderParam(); param.devParam.devType = LEDSender.DEVICE_TYPE_UDP; param.devParam.rmtHost = ip; param.devParam.locPort = port; param.devParam.rmtPort = 6666; param.devParam.dstAddr = ushort.Parse(deviceAddr); param.notifyMode = LEDSender.NOTIFY_EVENT; param.wmHandle = this.handle; param.wmMessage = WM_LED_NOTIFY; //这个操作中,ChapterIndex=0,RegionIndex=0,LeafIndex=0,ObjectIndex=0 只更新控制卡内第1个节目中的第1个分区中的第1个页面中的第1个对象 //如果ChapterIndex=1,RegionIndex=2,LeafIndex=1,ObjectIndex=2只更新控制卡内第2个节目中的第3个分区中的第2个页面中的第3个对象 //以此类推 ushort K = (ushort)LEDSender.Do_MakeObject(LEDSender.ROOT_PLAY_OBJECT, LEDSender.ACTMODE_REPLACE, ChapterIndex, RegionIndex, LeafIndex, ObjectIndex, colorMode); LEDSender.Do_AddText(K, rectText.Left, rectText.Top, rectText.Width, rectText.Height, LEDSender.V_TRUE, 0, text, this.fontName, this.fontSize, this.fontColor, this.fontStyle, LEDSender.V_FALSE, 1, 1, 5, 1, 5, isFlash ? 1 : 0, 1000, 10000); var result = LEDSender.Do_LED_SendToScreen(ref param, K); if (result == LEDSender.R_DEVICE_READY) { this.messageIndicator1.SetState(StateType.Success, "发送成功"); } else if (result == LEDSender.R_DEVICE_INVALID) { this.messageIndicator1.SetState(StateType.Success, "打开通讯设备失败"); } else if (result == LEDSender.R_DEVICE_BUSY) { this.messageIndicator1.SetState(StateType.Success, "设备忙,正在通讯中..."); } LogService.Debug("SendLEDMessage->End:Result=" + result); return(result); }