Sfoglia il codice sorgente

图片和LED提交

BourneCao 4 anni fa
parent
commit
d7f4e30e58

+ 2 - 2
CarMeterSystem/App.config

@@ -6,10 +6,10 @@
 	<appSettings>
 	<appSettings>
 		<!--<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />-->
 		<!--<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />-->
     <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
     <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
-    <add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />
+    <!--<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />-->
 		<!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
 		<!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
     <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
     <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
-    <!--<add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>-->
+    <add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>
     <!--实时库地址-->
     <!--实时库地址-->
 		<add key="icoredbTcp" value="tarantool://guest@10.99.200.86:2101" />
 		<add key="icoredbTcp" value="tarantool://guest@10.99.200.86:2101" />
 		<!--SFTP或者vsftp服务端连接及地址-->
 		<!--SFTP或者vsftp服务端连接及地址-->

+ 1 - 1
CarMeterSystem/Form1.cs

@@ -703,7 +703,7 @@ namespace CarMeterSystem
                             }
                             }
 
 
                             //led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
                             //led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
-                            led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                            led_controler.setStatic4LineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
 
 
                             isLedWrite = false;
                             isLedWrite = false;
 
 

+ 66 - 0
MeterPlugInLibrary/LED/LED_Control.cs

@@ -267,6 +267,70 @@ namespace MeterPlugInLibrary
             nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
             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
+            {
+                //"发送成功";
+            }
+        }
+
+        public void setStatic4LineMsg(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();//区域坐标属性结构体变量
+
+            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);//快速通过字符添加一个单行文本区域,函数见函数声明注示
+            AreaRect.left = 0;
+            AreaRect.top = 0;
+            AreaRect.width = 192;
+            AreaRect.height = 64;
+
+            nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
+
+
+            AreaRect.left = 0;
+            AreaRect.top = 20;
+            AreaRect.width = 192;
+            AreaRect.height = 64;
+
+            nResult = LedDll.LV_AddStaticTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, ledInfo, ref FontProp, 1, 2, 1);//快速通过字符添加一个单行文本区域,函数见函数声明注示
+
+
+
             nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
             nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
             LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
             LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
             if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
             if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
@@ -282,4 +346,6 @@ namespace MeterPlugInLibrary
 
 
         #endregion
         #endregion
     }
     }
+
+
 }
 }

+ 11 - 2
MeterPlugInLibrary/图片处理/ImageCurlControl.cs

@@ -136,6 +136,7 @@ namespace MeterPlugInLibrary
                     //filename :  计量作业编号_序号.jpg   计量作业编号:计量点编号+年月日时分秒
                     //filename :  计量作业编号_序号.jpg   计量作业编号:计量点编号+年月日时分秒
                     MeterWorkImage ci = ParseFileName(filename, ftpdir.Replace("upload", "download"));
                     MeterWorkImage ci = ParseFileName(filename, ftpdir.Replace("upload", "download"));
 
 
+
                     if (ci == null) continue;
                     if (ci == null) continue;
 
 
                     // 上传文件
                     // 上传文件
@@ -148,7 +149,7 @@ namespace MeterPlugInLibrary
                     if (rm.Succeed)
                     if (rm.Succeed)
                     {
                     {
                         WriteLog(string.Format("更新图片记录[{0}]:{1}", ci.actualFirstNo, filename));
                         WriteLog(string.Format("更新图片记录[{0}]:{1}", ci.actualFirstNo, filename));
-                        File.Delete(_filepath);
+                        //File.Delete(_filepath);
                     }
                     }
                     else
                     else
                     {
                     {
@@ -225,7 +226,15 @@ namespace MeterPlugInLibrary
             }
             }
 
 
             string fullfilename = ftpdir + "/" + filename;
             string fullfilename = ftpdir + "/" + filename;
-            fullfilename = fullfilename.Replace("//", "/").Replace("//", "/");
+            if(fullfilename.Substring(0,8) == "https://")
+            {
+                fullfilename = fullfilename.Substring(0, 8) + fullfilename.Substring(8).Replace("//", "/").Replace("//", "/");
+            }
+            else
+            {
+                fullfilename = fullfilename.Replace("//", "/").Replace("//", "/");
+            }
+            
             PropertyInfo pi = null;
             PropertyInfo pi = null;
             try
             try
             {
             {