| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487 |
- using Common;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MeterPlugInLibrary
- {
- public class LED_Control
- {
- private Log lg = Log.GetInstance(); //写日志
- public LED_Control(string Ip)
- {
- int nResult;
- LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
- CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
- CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
- CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
- nResult = LedDll.LV_SetBasicInfo(ref CommunicationInfo, 2, 128, 48);//设置屏参,屏的颜色为2即为双基色,128为屏宽点数,48为屏高点数,具体函数参数说明见函数声明注示
- if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- //设置失败
- }
- else
- {
- //设置成功
- }
- }
- public void setOneLineMsg(string Ip,string ledInfo)
- {
- int nResult;
- LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
-
- CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
- CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
- CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
-
- int hProgram;//节目句柄
- hProgram = LedDll.LV_CreateProgram(128, 48, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
- //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
- nResult = LedDll.LV_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
- if (nResult != 0)
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- return;
- }
- LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
- /*
- AreaRect.left = 0;
- AreaRect.top = 0;
- AreaRect.width = 128;
- AreaRect.height = 12;
- LedDll.DIGITALCLOCKAREAINFO DigitalClockAreaInfo = new LedDll.DIGITALCLOCKAREAINFO();
- DigitalClockAreaInfo.TimeColor = LedDll.COLOR_RED;
- DigitalClockAreaInfo.ShowStrFont.FontName = "宋体";
- DigitalClockAreaInfo.ShowStrFont.FontSize = 10;
- DigitalClockAreaInfo.IsShowHour = 1;
- DigitalClockAreaInfo.IsShowMinute = 1;
- nResult = LedDll.LV_AddDigitalClockArea(hProgram, 1, 1, ref AreaRect, ref DigitalClockAreaInfo);//注意区域号不能一样,详见函数声明注示
- //*/
- AreaRect.left = 0;
- AreaRect.top = 8;
- AreaRect.width = 128;
- AreaRect.height = 34;
- LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
- FontProp.FontName = "宋体";
- FontProp.FontSize = 24;
- FontProp.FontColor = LedDll.COLOR_RED;
- FontProp.FontBold = 0;
- //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
- nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
- LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
- if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- }
- else
- {
- //"发送成功";
- }
- }
- public void setTwoLineMsg(string Ip, string msg1, string msg2)
- {
- int nResult;
- LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
- CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
- CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
- CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
- int hProgram;//节目句柄
- hProgram = LedDll.LV_CreateProgram(128, 48, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
- //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
- nResult = LedDll.LV_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
- if (nResult != 0)
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- return;
- }
- LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
- AreaRect.left = 0;
- AreaRect.top = 0;
- AreaRect.width = 128;
- AreaRect.height = 8;
- LedDll.DIGITALCLOCKAREAINFO DigitalClockAreaInfo = new LedDll.DIGITALCLOCKAREAINFO();
- DigitalClockAreaInfo.TimeColor = LedDll.COLOR_RED;
- DigitalClockAreaInfo.ShowStrFont.FontName = "宋体";
- DigitalClockAreaInfo.ShowStrFont.FontSize = 6;
- DigitalClockAreaInfo.IsShowHour = 1;
- DigitalClockAreaInfo.IsShowMinute = 1;
- nResult = LedDll.LV_AddDigitalClockArea(hProgram, 1, 1, ref AreaRect, ref DigitalClockAreaInfo);//注意区域号不能一样,详见函数声明注示
- AreaRect.left = 0;
- AreaRect.top = 8;
- AreaRect.width = 128;
- AreaRect.height = 20;
- LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
- FontProp.FontName = "宋体";
- FontProp.FontSize = 12;
- FontProp.FontColor = LedDll.COLOR_RED;
- FontProp.FontBold = 0;
- //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
- nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, msg1, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- AreaRect.left = 0;
- AreaRect.top = 28;
- AreaRect.width = 128;
- AreaRect.height = 20;
- nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 3, ref AreaRect, LedDll.ADDTYPE_STRING, "智能计量系统", ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
- LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
- if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- }
- else
- {
- //"发送成功";
- }
- }
- #region 成品秤添加一个静止的图文区域显示重量
- public void setProductOneLineMsg(string Ip, string ledInfo)
- {
- int nResult;
- LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
- CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
- CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
- CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
- nResult = LedDll.LV_SetBasicInfo(ref CommunicationInfo, 2, 192, 64);//设置屏参,屏的颜色为2即为双基色,64为屏宽点数,32为屏高点数,具体函数参数说明见函数声明注示
- int hProgram;//节目句柄
- hProgram = LedDll.LV_CreateProgram(192, 64, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
- //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
- nResult = LedDll.LV_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
- if (nResult != 0)
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- return;
- }
- LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
- AreaRect.left = 0;
- AreaRect.top = 8;
- AreaRect.width = 192;
- AreaRect.height = 34;
- LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
- FontProp.FontName = "宋体";
- FontProp.FontSize = 24;
- FontProp.FontColor = LedDll.COLOR_RED;
- FontProp.FontBold = 0;
- //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
- nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
- LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
- if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- }
- else
- {
- //"发送成功";
- }
- }
- public void setStaticLineMsg(string Ip, string ledInfo)
- {
- try
- {
- if (ledInfo == null) return;
- ledInfo = ledInfo.Replace(",", "\r\n");
- if (PbCache.OldLedInfo == ledInfo) return;
- lg.WriteLog(26, "led推送信息开始时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"));
- PbCache.OldLedInfo = ledInfo;
- lg.WriteLog(26, PbCache.lockCarNo + "led推送信息:" + ledInfo);
- int nResult;
- LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
- CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
- CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
- CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
- nResult = LedDll.LV_SetBasicInfo(ref CommunicationInfo, 2, 96, 64);//设置屏参,屏的颜色为2即为双基色,64为屏宽点数,32为屏高点数,具体函数参数说明见函数声明注示
- int hProgram;//节目句柄
- hProgram = LedDll.LV_CreateProgram(96, 64, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
- //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
- nResult = LedDll.LV_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
- if (nResult != 0)
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- return;
- }
- LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
- AreaRect.left = 0;
- AreaRect.top = 0;
- AreaRect.width = 96;
- AreaRect.height = 64;
- LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
- FontProp.FontName = "宋体";
- FontProp.FontSize = 10;
- FontProp.FontColor = LedDll.COLOR_RED;
- FontProp.FontBold = 0;
- //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
- nResult = LedDll.LV_AddImageTextArea(hProgram, 1, 2, ref AreaRect, 0);
- //nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
- LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
- if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- }
- else
- {
- //"发送成功";
- }
- lg.WriteLog(26, "led推送信息结束时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"));
- }
- catch (Exception ex)
- {
- lg.WriteLog(25, PbCache.lockCarNo + "led_trycatch事件异常:" + ex.Message);
- }
- }
- public void setStaticLineMsgOut(string Ip, string ledInfo)
- {
- try
- {
- if (ledInfo == null) return;
- ledInfo = ledInfo.Replace(",", "\r\n");
- if (PbCache.OldLedInfo == ledInfo) return;
- lg.WriteLog(26, "led推送信息开始时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"));
- PbCache.OldLedInfo = ledInfo;
- lg.WriteLog(26, PbCache.lockCarNo + "led推送信息:" + ledInfo);
- int nResult;
- LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
- CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
- CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
- CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
- nResult = LedDll.LV_SetBasicInfo(ref CommunicationInfo, 2, 96, 64);//设置屏参,屏的颜色为2即为双基色,64为屏宽点数,32为屏高点数,具体函数参数说明见函数声明注示
- int hProgram;//节目句柄
- hProgram = LedDll.LV_CreateProgram(96, 64, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
- //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
- nResult = LedDll.LV_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
- if (nResult != 0)
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- return;
- }
- LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
- AreaRect.left = 0;
- AreaRect.top = 0;
- AreaRect.width = 96;
- AreaRect.height = 64;
- LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
- FontProp.FontName = "宋体";
- FontProp.FontSize = 13;
- FontProp.FontColor = LedDll.COLOR_RED;
- FontProp.FontBold = 0;
- //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
- nResult = LedDll.LV_AddImageTextArea(hProgram, 1, 2, ref AreaRect, 0);
- //nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
- LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
- if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- }
- else
- {
- //"发送成功";
- }
- lg.WriteLog(26, "led推送信息结束时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"));
- }
- catch (Exception ex)
- {
- lg.WriteLog(25, PbCache.lockCarNo + "led_trycatch事件异常:" + ex.Message);
- }
- }
- public void setStatic4LineMsg(string Ip, string ledInfo)
- {
- string info1 = "";
- string info2 = "";
- string info3 = "";
- string info4 = "";
- //split ledInfo
- string[] list = ledInfo.Split(',');
- for (int i = 0; i < list.Length; i++)
- {
- if (i == 0) info1 = list[0];
- if (i == 1) info2 = list[1];
- if (i == 2) info3 = list[2];
- if (i == 3) info4 = list[3];
- }
- int nResult;
- LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
- CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
- CommunicationInfo.IpStr = Ip;//给IpStr赋值LED控制卡的IP
- CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和248通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
- nResult = LedDll.LV_SetBasicInfo(ref CommunicationInfo, 2, 192, 64);//设置屏参,屏的颜色为2即为双基色,64为屏宽点数,32为屏高点数,具体函数参数说明见函数声明注示
- int hProgram;//节目句柄
- hProgram = LedDll.LV_CreateProgram(192, 64, 2);//根据传的参数创建节目句柄,128是屏宽点数,48是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
- //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功,一般不会失败
- nResult = LedDll.LV_AddProgram(hProgram, 1, 0, 1);//添加一个节目,参数说明见函数声明注示
- if (nResult != 0)
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- return;
- }
- LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
- AreaRect.left = 0;
- AreaRect.top = 0;
- AreaRect.width = 192;
- AreaRect.height = 16;
- //nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 2, ref AreaRect, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 4);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
- FontProp.FontName = "宋体";
- FontProp.FontSize = 10;
- FontProp.FontColor = LedDll.COLOR_RED;
- FontProp.FontBold = 0;
- //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
- nResult = LedDll.LV_AddImageTextArea(hProgram, 1, 2, ref AreaRect, 0);
- nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- AreaRect.left = 0;
- AreaRect.top = 16;
- AreaRect.width = 192;
- AreaRect.height = 16;
- nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info2, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- AreaRect.left = 0;
- AreaRect.top = 32;
- AreaRect.width = 192;
- AreaRect.height = 16;
- nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info3, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- AreaRect.left = 0;
- AreaRect.top = 48;
- AreaRect.width = 192;
- AreaRect.height = 16;
- nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, info4, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
- nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
- LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
- if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
- {
- string ErrStr;
- ErrStr = LedDll.LS_GetError(nResult);
- }
- else
- {
- //"发送成功";
- }
- }
- #endregion
- }
- }
|