浏览代码

加入调试窗口

yc_t 7 年之前
父节点
当前提交
349134c661
共有 26 个文件被更改,包括 8167 次插入8 次删除
  1. 6 1
      parkMonitor/model/StyleModel.cs
  2. 60 1
      parkMonitor/parkMonitor.csproj
  3. 7 1
      parkMonitor/server/CoreThread/CoreThreadTest.cs
  4. 2 2
      parkMonitor/server/CoreThread/QueuingThread.cs
  5. 2 1
      parkMonitor/server/PLCLinker/PLCLinker.cs
  6. 140 0
      parkMonitor/view/FormModbus/BaseConfig_From.cs
  7. 374 0
      parkMonitor/view/FormModbus/BaseConfig_From.designer.cs
  8. 120 0
      parkMonitor/view/FormModbus/BaseConfig_From.resx
  9. 1787 0
      parkMonitor/view/FormModbus/FormModbus.Designer.cs
  10. 1532 0
      parkMonitor/view/FormModbus/FormModbus.cs
  11. 126 0
      parkMonitor/view/FormModbus/FormModbus.resx
  12. 66 0
      parkMonitor/view/FormModbus/Jsonhelper.cs
  13. 62 0
      parkMonitor/view/FormModbus/NetCfg_Form.cs
  14. 131 0
      parkMonitor/view/FormModbus/NetCfg_Form.designer.cs
  15. 120 0
      parkMonitor/view/FormModbus/NetCfg_Form.resx
  16. 350 0
      parkMonitor/view/FormModbus/RVideoCfg_Form.cs
  17. 541 0
      parkMonitor/view/FormModbus/RVideoCfg_Form.designer.cs
  18. 120 0
      parkMonitor/view/FormModbus/RVideoCfg_Form.resx
  19. 719 0
      parkMonitor/view/FormModbus/RuleCfg_Form.cs
  20. 315 0
      parkMonitor/view/FormModbus/RuleCfg_Form.designer.cs
  21. 120 0
      parkMonitor/view/FormModbus/RuleCfg_Form.resx
  22. 65 0
      parkMonitor/view/FormModbus/StrToJson.cs
  23. 614 0
      parkMonitor/view/FormModbus/VideoCfg_Form.cs
  24. 665 0
      parkMonitor/view/FormModbus/VideoCfg_Form.designer.cs
  25. 120 0
      parkMonitor/view/FormModbus/VideoCfg_Form.resx
  26. 3 2
      parkMonitor/view/menuBox/MenuBox.xaml.cs

+ 6 - 1
parkMonitor/model/StyleModel.cs

@@ -7,12 +7,17 @@ using System.Windows.Media;
 
 namespace parkMonitor.model {
 	public enum DevTreeItemShowType {
+        /// <summary>文字</summary>
 		Default,
+        /// <summary>图片</summary>
 		Image,
+        /// <summary>图片文字</summary>
 		ImageValue,
+        /// <summary>图片list</summary>
 		ImageList,
+        /// <summary>文字list</summary>
 		TextList
-	}
+    }
 
 	/// <summary>样式model</summary>
 	public class StyleModel {

+ 60 - 1
parkMonitor/parkMonitor.csproj

@@ -49,7 +49,10 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>sdk\log4net\log4net.dll</HintPath>
     </Reference>
-    <Reference Include="MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
+    <Reference Include="MySql.Data, Version=6.0.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>sdk\mysql\MySql.Data.dll</HintPath>
+    </Reference>
     <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>sdk\HslCommunication\Newtonsoft.Json.dll</HintPath>
@@ -202,6 +205,44 @@
     <Compile Include="view\deviceViewWin\DeviceViewWin.xaml.cs">
       <DependentUpon>DeviceViewWin.xaml</DependentUpon>
     </Compile>
+    <Compile Include="view\FormModbus\BaseConfig_From.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="view\FormModbus\BaseConfig_From.designer.cs">
+      <DependentUpon>BaseConfig_From.cs</DependentUpon>
+    </Compile>
+    <Compile Include="view\FormModbus\FormModbus.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="view\FormModbus\FormModbus.Designer.cs">
+      <DependentUpon>FormModbus.cs</DependentUpon>
+    </Compile>
+    <Compile Include="view\FormModbus\Jsonhelper.cs" />
+    <Compile Include="view\FormModbus\NetCfg_Form.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="view\FormModbus\NetCfg_Form.designer.cs">
+      <DependentUpon>NetCfg_Form.cs</DependentUpon>
+    </Compile>
+    <Compile Include="view\FormModbus\RuleCfg_Form.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="view\FormModbus\RuleCfg_Form.designer.cs">
+      <DependentUpon>RuleCfg_Form.cs</DependentUpon>
+    </Compile>
+    <Compile Include="view\FormModbus\RVideoCfg_Form.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="view\FormModbus\RVideoCfg_Form.designer.cs">
+      <DependentUpon>RVideoCfg_Form.cs</DependentUpon>
+    </Compile>
+    <Compile Include="view\FormModbus\StrToJson.cs" />
+    <Compile Include="view\FormModbus\VideoCfg_Form.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="view\FormModbus\VideoCfg_Form.designer.cs">
+      <DependentUpon>VideoCfg_Form.cs</DependentUpon>
+    </Compile>
     <Compile Include="view\okBoxWin\OkBoxWin.xaml.cs">
       <DependentUpon>OkBoxWin.xaml</DependentUpon>
     </Compile>
@@ -436,6 +477,24 @@
     <EmbeddedResource Include="server\NumMachine\NumMachine.resx">
       <DependentUpon>NumMachine.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="view\FormModbus\BaseConfig_From.resx">
+      <DependentUpon>BaseConfig_From.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="view\FormModbus\FormModbus.resx">
+      <DependentUpon>FormModbus.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="view\FormModbus\NetCfg_Form.resx">
+      <DependentUpon>NetCfg_Form.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="view\FormModbus\RuleCfg_Form.resx">
+      <DependentUpon>RuleCfg_Form.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="view\FormModbus\RVideoCfg_Form.resx">
+      <DependentUpon>RVideoCfg_Form.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="view\FormModbus\VideoCfg_Form.resx">
+      <DependentUpon>VideoCfg_Form.cs</DependentUpon>
+    </EmbeddedResource>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>

+ 7 - 1
parkMonitor/server/CoreThread/CoreThreadTest.cs

@@ -9,6 +9,7 @@ using parkMonitor.entity;
 using parkMonitor.model;
 using System.Configuration;
 using System.Threading;
+using parkMonitor.server.uiLogServer;
 
 namespace parkMonitor.server.CoreThread
 {
@@ -145,6 +146,7 @@ namespace parkMonitor.server.CoreThread
                         {
                             LogFile logError = LogFile.ERROR;
                             Log.WriteLog(logError,"ip为 "+node.ip+" 的号牌机 连接中断。");
+                            UILogServer.ins.error("ip为 " + node.ip + " 的号牌机 连接中断。");
                         }
                     }
                 }
@@ -168,7 +170,7 @@ namespace parkMonitor.server.CoreThread
                     PLC.SetMessage(pm);
                     Console.WriteLine("取车:" + queueCmd.LicenseNum);
                     Log.WriteLog("取车:" + queueCmd.LicenseNum);
-
+                    UILogServer.ins.error("取车:" + queueCmd.LicenseNum);
                     //等待PLC取车完成信号
                     Task signalFromPLC = Task.Factory.StartNew(() =>
                     {
@@ -209,6 +211,7 @@ namespace parkMonitor.server.CoreThread
                         oper.InsertToMessageQueue(userId,"停车异常,请联系管理员!",2);
                         LogFile logFile = LogFile.ERROR_NUMBERPLATE;
                         Log.WriteLog(logFile, "过期用户指令");
+                        UILogServer.ins.error("过期用户指令");
                         continue;
                     }
                     int status = 1;//停车
@@ -217,6 +220,7 @@ namespace parkMonitor.server.CoreThread
                     PLC.SetMessage(pm);
                     Console.WriteLine("停车,开激光:" + queueCmd.LicenseNum);
                     Log.WriteLog("停车,开激光:" + queueCmd.LicenseNum);
+                    UILogServer.ins.error("停车,开激光:" + queueCmd.LicenseNum);
                     c.parkingEntX = parkingEntX;
                     c.parkingEntY = parkingEntY;
                     c.parkingEntZ = parkingEntZ;
@@ -285,6 +289,7 @@ namespace parkMonitor.server.CoreThread
 
                     Console.WriteLine("停车,抓车:" + queueCmd.LicenseNum);
                     Log.WriteLog("停车,抓车:" + queueCmd.LicenseNum);
+                    UILogServer.ins.error("停车,抓车:" + queueCmd.LicenseNum);
                     Task storeSignal = Task.Factory.StartNew(() =>
                     {
                         while (true)
@@ -305,6 +310,7 @@ namespace parkMonitor.server.CoreThread
                     PLC.SetMessage(pm);
                     Console.WriteLine("停车完成,状态复位");
                     Log.WriteLog("停车完成,状态复位");
+                    UILogServer.ins.error("停车完成,状态复位");
                     //根据号牌查找车型
                     int vehicleTypeID = oper.getVehicleTypeID(numberPlate);
                     //判断测量数据是否准确

+ 2 - 2
parkMonitor/server/CoreThread/QueuingThread.cs

@@ -100,7 +100,7 @@ namespace parkMonitor.server.CoreThread
                     cmd = StoreCmdQueue.Dequeue();
                     //指令超时处理
                     TimeSpan userTimeSpan = DateTime.Now - DateTime.Parse(cmd.TimeRecord);
-                    Console.WriteLine("指令已扫描时间:" + userTimeSpan.TotalSeconds);
+                    //Console.WriteLine("指令已扫描时间:" + userTimeSpan.TotalSeconds);
                     if (userTimeSpan.TotalMinutes >= userTime)
                     {
                         cmd.LicenseNum = "";
@@ -128,7 +128,7 @@ namespace parkMonitor.server.CoreThread
                 {
                     TimeSpan licTimeSpan = DateTime.Now - DateTime.Parse(license.TimeRecord);
                     //测试,超过5分钟自动出队
-                    Console.WriteLine("号牌已扫描时间:"+ licTimeSpan.TotalSeconds);
+                    //Console.WriteLine("号牌已扫描时间:"+ licTimeSpan.TotalSeconds);
                     if (licTimeSpan.TotalMinutes >= licenseTime && license.ip!="")
                     {
                         license.ip = "";

+ 2 - 1
parkMonitor/server/PLCLinker/PLCLinker.cs

@@ -238,6 +238,7 @@ namespace parkMonitor.server
                         {
                             while (true)
                             {
+                                Console.WriteLine("尝试重连plc");
                                 LinkStart();
                                 Thread.Sleep(10000);
                                 if (isConnection)
@@ -573,6 +574,7 @@ namespace parkMonitor.server
 
         private void LinkStart()
         {
+            InitTimer();//启动
             if (busTcpClient != null)
             {
                 busTcpClient.ConnectClose();
@@ -586,7 +588,6 @@ namespace parkMonitor.server
                     AsyncCmdServer.ins.send(AsyncCmdType.PLCOnline);
                     Console.WriteLine("连接成功");
                     isConnection = true;
-                    InitTimer();//启动
                     linkCount = 0;
                 }
                 else

+ 140 - 0
parkMonitor/view/FormModbus/BaseConfig_From.cs

@@ -0,0 +1,140 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+
+namespace VzClientSDKDemo
+{
+    public partial class BaseConfig_From : Form
+    {
+        public BaseConfig_From()
+        {
+            InitializeComponent();           
+        }
+
+        private int m_hLPRClient = 0;
+        public void SetLPRHandle(int hLPRClient)
+        {
+            m_hLPRClient = hLPRClient;
+        }
+        //获取识别类型
+        private void getPlateRecType()
+        {
+            int uBitsRecType = 0;
+            VzClientSDK.VzLPRClient_GetPlateRecType(m_hLPRClient, ref uBitsRecType);            
+            m_chkBlue.Checked       = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_BLUE);
+            m_chkYellow.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_YELLOW);
+            m_chkBlack.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_BLACK);
+            m_chkCoach.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_COACH);
+            m_chkTablets.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_POLICE);
+            m_chkArm.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_AMPOL);
+            m_chkTag.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_ARMY);
+            m_chkHK.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_GANGAO);
+            m_chkEC.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_EMBASSY);
+            m_chkAviation.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_AVIATION);
+            m_chkEnergy.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_ENERGY);
+            m_chkNoPlate.Checked = Convert.ToBoolean((int)uBitsRecType & VzClientSDK.VZ_LPRC_REC_NO_PLATE);
+        }
+        //设置识别类型
+        private bool setPlateRecType()
+        {
+            Int32 uBitsRecType = 0;            
+            uBitsRecType |= m_chkBlue.Checked       ? VzClientSDK.VZ_LPRC_REC_BLUE : 0;
+            uBitsRecType |= m_chkYellow.Checked     ? VzClientSDK.VZ_LPRC_REC_YELLOW : 0;
+            uBitsRecType |= m_chkBlack.Checked      ? VzClientSDK.VZ_LPRC_REC_BLACK : 0;
+            uBitsRecType |= m_chkCoach.Checked      ? VzClientSDK.VZ_LPRC_REC_COACH : 0;
+            uBitsRecType |= m_chkTablets.Checked    ? VzClientSDK.VZ_LPRC_REC_POLICE : 0;
+            uBitsRecType |= m_chkArm.Checked        ? VzClientSDK.VZ_LPRC_REC_AMPOL : 0;
+            uBitsRecType |= m_chkTag.Checked        ? VzClientSDK.VZ_LPRC_REC_ARMY : 0;
+            uBitsRecType |= m_chkHK.Checked         ? VzClientSDK.VZ_LPRC_REC_GANGAO : 0;
+            uBitsRecType |= m_chkEC.Checked         ? VzClientSDK.VZ_LPRC_REC_EMBASSY : 0;
+            uBitsRecType |= m_chkAviation.Checked   ? VzClientSDK.VZ_LPRC_REC_AVIATION : 0;
+            uBitsRecType |= m_chkEnergy.Checked     ? VzClientSDK.VZ_LPRC_REC_ENERGY : 0;
+            uBitsRecType |= m_chkNoPlate.Checked    ? VzClientSDK.VZ_LPRC_REC_NO_PLATE : 0;
+            int nRet = VzClientSDK.VzLPRClient_SetPlateRecType(m_hLPRClient, (UInt32)uBitsRecType);
+            bool bFuncRet = true;
+            if (nRet != 0)
+            {
+                MessageBox.Show("设置识别类型失败!");
+                bFuncRet = false;
+            }
+            return bFuncRet;
+        }
+        //获取车牌识别类型
+        private void getTrigType()
+        {
+            int uBitsTrigType = 0;           
+            VzClientSDK.VzLPRClient_GetPlateTrigType(m_hLPRClient, ref uBitsTrigType);
+            m_chkStableTri.Checked = Convert.ToBoolean((int)uBitsTrigType & VzClientSDK.VZ_LPRC_TRIG_ENABLE_STABLE);
+            m_chkVirtualTri.Checked = Convert.ToBoolean((int)uBitsTrigType & VzClientSDK.VZ_LPRC_TRIG_ENABLE_VLOOP);
+            m_chkIO1.Checked = Convert.ToBoolean((int)uBitsTrigType & VzClientSDK.VZ_LPRC_TRIG_ENABLE_IO_IN1);
+            m_chkIO2.Checked = Convert.ToBoolean((int)uBitsTrigType & VzClientSDK.VZ_LPRC_TRIG_ENABLE_IO_IN2);
+            m_chkIO3.Checked = Convert.ToBoolean((int)uBitsTrigType & VzClientSDK.VZ_LPRC_TRIG_ENABLE_IO_IN3);            
+        }
+        //设置车牌识别类型
+        private bool setTrigType()
+        {
+            Int32 uBitsTrigType = 0;            
+            uBitsTrigType |= m_chkStableTri.Checked  ? VzClientSDK.VZ_LPRC_TRIG_ENABLE_STABLE : 0;
+            uBitsTrigType |= m_chkVirtualTri.Checked ? VzClientSDK.VZ_LPRC_TRIG_ENABLE_VLOOP : 0;
+            uBitsTrigType |= m_chkIO1.Checked        ? VzClientSDK.VZ_LPRC_TRIG_ENABLE_IO_IN1 : 0;
+            uBitsTrigType |= m_chkIO2.Checked        ? VzClientSDK.VZ_LPRC_TRIG_ENABLE_IO_IN2 : 0;
+            uBitsTrigType |= m_chkIO3.Checked        ? VzClientSDK.VZ_LPRC_TRIG_ENABLE_IO_IN3 : 0;
+            int nRet = VzClientSDK.VzLPRClient_SetPlateTrigType(m_hLPRClient, Convert.ToUInt32(uBitsTrigType));
+            bool bFuncRet = true;
+            if (nRet != 0)
+            {
+                MessageBox.Show("设置输出结果失败!");
+                bFuncRet = false;
+            }
+            return bFuncRet;            
+        }
+        //获取实时显示
+        private void getRealTimeResult()
+        {
+            VzClientSDK.VZ_LPRC_DRAWMODE drawMode = new VzClientSDK.VZ_LPRC_DRAWMODE();
+            int nRet = VzClientSDK.VzLPRClient_GetDrawMode(m_hLPRClient, ref drawMode);
+            m_chkVirtualAndReco.Checked = Convert.ToBoolean(drawMode.byDspAddRule);
+            m_chkResult.Checked         = Convert.ToBoolean(drawMode.byDspAddTarget);
+            m_chkPlatePos.Checked       = Convert.ToBoolean(drawMode.byDspAddTrajectory);
+        }
+        //设置实时显示
+        private bool setRealTimeResult()
+        {
+            VzClientSDK.VZ_LPRC_DRAWMODE drawMode = new VzClientSDK.VZ_LPRC_DRAWMODE();
+            drawMode.byDspAddRule       = Convert.ToByte(m_chkVirtualAndReco.Checked);
+            drawMode.byDspAddTarget     = Convert.ToByte(m_chkResult.Checked);
+            drawMode.byDspAddTrajectory = Convert.ToByte(m_chkPlatePos.Checked);
+            int nRet = VzClientSDK.VzLPRClient_SetDrawMode(m_hLPRClient, ref drawMode);
+            bool bFuncRet = true;
+            if (nRet != 0)
+            {
+                MessageBox.Show("设置实时显示失败!");
+                bFuncRet = false;
+            }
+            return bFuncRet;
+        }
+
+        private void m_btnOK_Click(object sender, EventArgs e)
+        {
+            bool bRecRet  = setPlateRecType();
+            bool bTrigRet = setTrigType();
+            bool bRealRet = setRealTimeResult();
+            if (bRecRet && bTrigRet && bRealRet)
+                MessageBox.Show("设置基本配置成功!");
+            this.Close();
+        }
+
+        private void BaseConfig_From_Load(object sender, EventArgs e)
+        {
+            getPlateRecType();
+            getTrigType();
+            getRealTimeResult();
+        }
+    }
+}

+ 374 - 0
parkMonitor/view/FormModbus/BaseConfig_From.designer.cs

@@ -0,0 +1,374 @@
+namespace VzClientSDKDemo
+{
+    partial class BaseConfig_From
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.m_chkResult = new System.Windows.Forms.CheckBox();
+            this.m_chkPlatePos = new System.Windows.Forms.CheckBox();
+            this.m_chkVirtualAndReco = new System.Windows.Forms.CheckBox();
+            this.m_chkIO1 = new System.Windows.Forms.CheckBox();
+            this.m_chkVirtualTri = new System.Windows.Forms.CheckBox();
+            this.m_chkStableTri = new System.Windows.Forms.CheckBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.m_chkIO2 = new System.Windows.Forms.CheckBox();
+            this.m_chkIO3 = new System.Windows.Forms.CheckBox();
+            this.m_chkArm = new System.Windows.Forms.CheckBox();
+            this.m_chkTablets = new System.Windows.Forms.CheckBox();
+            this.m_chkCoach = new System.Windows.Forms.CheckBox();
+            this.m_chkYellow = new System.Windows.Forms.CheckBox();
+            this.m_chkBlue = new System.Windows.Forms.CheckBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.m_chkBlack = new System.Windows.Forms.CheckBox();
+            this.m_chkEC = new System.Windows.Forms.CheckBox();
+            this.m_chkHK = new System.Windows.Forms.CheckBox();
+            this.m_chkTag = new System.Windows.Forms.CheckBox();
+            this.m_btnOK = new System.Windows.Forms.Button();
+            this.m_chkEnergy = new System.Windows.Forms.CheckBox();
+            this.m_chkAviation = new System.Windows.Forms.CheckBox();
+            this.m_chkNoPlate = new System.Windows.Forms.CheckBox();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.groupBox1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(16, 31);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(53, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "实时显示";
+            // 
+            // m_chkResult
+            // 
+            this.m_chkResult.AutoSize = true;
+            this.m_chkResult.Location = new System.Drawing.Point(81, 29);
+            this.m_chkResult.Name = "m_chkResult";
+            this.m_chkResult.Size = new System.Drawing.Size(72, 16);
+            this.m_chkResult.TabIndex = 1;
+            this.m_chkResult.Text = "实时结果";
+            this.m_chkResult.UseVisualStyleBackColor = true;
+            // 
+            // m_chkPlatePos
+            // 
+            this.m_chkPlatePos.AutoSize = true;
+            this.m_chkPlatePos.Location = new System.Drawing.Point(183, 29);
+            this.m_chkPlatePos.Name = "m_chkPlatePos";
+            this.m_chkPlatePos.Size = new System.Drawing.Size(72, 16);
+            this.m_chkPlatePos.TabIndex = 2;
+            this.m_chkPlatePos.Text = "车牌位置";
+            this.m_chkPlatePos.UseVisualStyleBackColor = true;
+            // 
+            // m_chkVirtualAndReco
+            // 
+            this.m_chkVirtualAndReco.AutoSize = true;
+            this.m_chkVirtualAndReco.Location = new System.Drawing.Point(279, 29);
+            this.m_chkVirtualAndReco.Name = "m_chkVirtualAndReco";
+            this.m_chkVirtualAndReco.Size = new System.Drawing.Size(132, 16);
+            this.m_chkVirtualAndReco.TabIndex = 3;
+            this.m_chkVirtualAndReco.Text = "虚拟线圈和识别区域";
+            this.m_chkVirtualAndReco.UseVisualStyleBackColor = true;
+            // 
+            // m_chkIO1
+            // 
+            this.m_chkIO1.AutoSize = true;
+            this.m_chkIO1.Location = new System.Drawing.Point(81, 100);
+            this.m_chkIO1.Name = "m_chkIO1";
+            this.m_chkIO1.Size = new System.Drawing.Size(90, 16);
+            this.m_chkIO1.TabIndex = 7;
+            this.m_chkIO1.Text = "IO输入1触发";
+            this.m_chkIO1.UseVisualStyleBackColor = true;
+            // 
+            // m_chkVirtualTri
+            // 
+            this.m_chkVirtualTri.AutoSize = true;
+            this.m_chkVirtualTri.Location = new System.Drawing.Point(183, 63);
+            this.m_chkVirtualTri.Name = "m_chkVirtualTri";
+            this.m_chkVirtualTri.Size = new System.Drawing.Size(96, 16);
+            this.m_chkVirtualTri.TabIndex = 6;
+            this.m_chkVirtualTri.Text = "虚拟线圈触发";
+            this.m_chkVirtualTri.UseVisualStyleBackColor = true;
+            // 
+            // m_chkStableTri
+            // 
+            this.m_chkStableTri.AutoSize = true;
+            this.m_chkStableTri.Location = new System.Drawing.Point(81, 63);
+            this.m_chkStableTri.Name = "m_chkStableTri";
+            this.m_chkStableTri.Size = new System.Drawing.Size(96, 16);
+            this.m_chkStableTri.TabIndex = 5;
+            this.m_chkStableTri.Text = "稳定识别触发";
+            this.m_chkStableTri.UseVisualStyleBackColor = true;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(16, 65);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(53, 12);
+            this.label2.TabIndex = 4;
+            this.label2.Text = "输出结果";
+            // 
+            // m_chkIO2
+            // 
+            this.m_chkIO2.AutoSize = true;
+            this.m_chkIO2.Location = new System.Drawing.Point(183, 100);
+            this.m_chkIO2.Name = "m_chkIO2";
+            this.m_chkIO2.Size = new System.Drawing.Size(90, 16);
+            this.m_chkIO2.TabIndex = 8;
+            this.m_chkIO2.Text = "IO输入2触发";
+            this.m_chkIO2.UseVisualStyleBackColor = true;
+            // 
+            // m_chkIO3
+            // 
+            this.m_chkIO3.AutoSize = true;
+            this.m_chkIO3.Location = new System.Drawing.Point(279, 100);
+            this.m_chkIO3.Name = "m_chkIO3";
+            this.m_chkIO3.Size = new System.Drawing.Size(90, 16);
+            this.m_chkIO3.TabIndex = 9;
+            this.m_chkIO3.Text = "IO输入3触发";
+            this.m_chkIO3.UseVisualStyleBackColor = true;
+            this.m_chkIO3.Visible = false;
+            // 
+            // m_chkArm
+            // 
+            this.m_chkArm.AutoSize = true;
+            this.m_chkArm.Location = new System.Drawing.Point(279, 167);
+            this.m_chkArm.Name = "m_chkArm";
+            this.m_chkArm.Size = new System.Drawing.Size(48, 16);
+            this.m_chkArm.TabIndex = 15;
+            this.m_chkArm.Text = "武警";
+            this.m_chkArm.UseVisualStyleBackColor = true;
+            // 
+            // m_chkTablets
+            // 
+            this.m_chkTablets.AutoSize = true;
+            this.m_chkTablets.Location = new System.Drawing.Point(183, 167);
+            this.m_chkTablets.Name = "m_chkTablets";
+            this.m_chkTablets.Size = new System.Drawing.Size(48, 16);
+            this.m_chkTablets.TabIndex = 14;
+            this.m_chkTablets.Text = "警牌";
+            this.m_chkTablets.UseVisualStyleBackColor = true;
+            // 
+            // m_chkCoach
+            // 
+            this.m_chkCoach.AutoSize = true;
+            this.m_chkCoach.Location = new System.Drawing.Point(81, 167);
+            this.m_chkCoach.Name = "m_chkCoach";
+            this.m_chkCoach.Size = new System.Drawing.Size(48, 16);
+            this.m_chkCoach.TabIndex = 13;
+            this.m_chkCoach.Text = "教练";
+            this.m_chkCoach.UseVisualStyleBackColor = true;
+            // 
+            // m_chkYellow
+            // 
+            this.m_chkYellow.AutoSize = true;
+            this.m_chkYellow.Location = new System.Drawing.Point(183, 130);
+            this.m_chkYellow.Name = "m_chkYellow";
+            this.m_chkYellow.Size = new System.Drawing.Size(48, 16);
+            this.m_chkYellow.TabIndex = 12;
+            this.m_chkYellow.Text = "黄牌";
+            this.m_chkYellow.UseVisualStyleBackColor = true;
+            // 
+            // m_chkBlue
+            // 
+            this.m_chkBlue.AutoSize = true;
+            this.m_chkBlue.Location = new System.Drawing.Point(81, 130);
+            this.m_chkBlue.Name = "m_chkBlue";
+            this.m_chkBlue.Size = new System.Drawing.Size(48, 16);
+            this.m_chkBlue.TabIndex = 11;
+            this.m_chkBlue.Text = "蓝牌";
+            this.m_chkBlue.UseVisualStyleBackColor = true;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(16, 132);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(53, 12);
+            this.label3.TabIndex = 10;
+            this.label3.Text = "识别类型";
+            // 
+            // m_chkBlack
+            // 
+            this.m_chkBlack.AutoSize = true;
+            this.m_chkBlack.Location = new System.Drawing.Point(279, 129);
+            this.m_chkBlack.Name = "m_chkBlack";
+            this.m_chkBlack.Size = new System.Drawing.Size(48, 16);
+            this.m_chkBlack.TabIndex = 16;
+            this.m_chkBlack.Text = "黑牌";
+            this.m_chkBlack.UseVisualStyleBackColor = true;
+            this.m_chkBlack.Visible = false;
+            // 
+            // m_chkEC
+            // 
+            this.m_chkEC.AutoSize = true;
+            this.m_chkEC.Location = new System.Drawing.Point(279, 205);
+            this.m_chkEC.Name = "m_chkEC";
+            this.m_chkEC.Size = new System.Drawing.Size(60, 16);
+            this.m_chkEC.TabIndex = 19;
+            this.m_chkEC.Text = "使领馆";
+            this.m_chkEC.UseVisualStyleBackColor = true;
+            // 
+            // m_chkHK
+            // 
+            this.m_chkHK.AutoSize = true;
+            this.m_chkHK.Location = new System.Drawing.Point(183, 205);
+            this.m_chkHK.Name = "m_chkHK";
+            this.m_chkHK.Size = new System.Drawing.Size(48, 16);
+            this.m_chkHK.TabIndex = 18;
+            this.m_chkHK.Text = "港澳";
+            this.m_chkHK.UseVisualStyleBackColor = true;
+            // 
+            // m_chkTag
+            // 
+            this.m_chkTag.AutoSize = true;
+            this.m_chkTag.Location = new System.Drawing.Point(81, 205);
+            this.m_chkTag.Name = "m_chkTag";
+            this.m_chkTag.Size = new System.Drawing.Size(48, 16);
+            this.m_chkTag.TabIndex = 17;
+            this.m_chkTag.Text = "军牌";
+            this.m_chkTag.UseVisualStyleBackColor = true;
+            // 
+            // m_btnOK
+            // 
+            this.m_btnOK.Location = new System.Drawing.Point(368, 295);
+            this.m_btnOK.Name = "m_btnOK";
+            this.m_btnOK.Size = new System.Drawing.Size(75, 23);
+            this.m_btnOK.TabIndex = 20;
+            this.m_btnOK.Text = "确定";
+            this.m_btnOK.UseVisualStyleBackColor = true;
+            this.m_btnOK.Click += new System.EventHandler(this.m_btnOK_Click);
+            // 
+            // m_chkEnergy
+            // 
+            this.m_chkEnergy.AutoSize = true;
+            this.m_chkEnergy.Location = new System.Drawing.Point(183, 237);
+            this.m_chkEnergy.Name = "m_chkEnergy";
+            this.m_chkEnergy.Size = new System.Drawing.Size(60, 16);
+            this.m_chkEnergy.TabIndex = 22;
+            this.m_chkEnergy.Text = "新能源";
+            this.m_chkEnergy.UseVisualStyleBackColor = true;
+            // 
+            // m_chkAviation
+            // 
+            this.m_chkAviation.AutoSize = true;
+            this.m_chkAviation.Location = new System.Drawing.Point(81, 237);
+            this.m_chkAviation.Name = "m_chkAviation";
+            this.m_chkAviation.Size = new System.Drawing.Size(48, 16);
+            this.m_chkAviation.TabIndex = 21;
+            this.m_chkAviation.Text = "民航";
+            this.m_chkAviation.UseVisualStyleBackColor = true;
+            // 
+            // m_chkNoPlate
+            // 
+            this.m_chkNoPlate.AutoSize = true;
+            this.m_chkNoPlate.Location = new System.Drawing.Point(279, 237);
+            this.m_chkNoPlate.Name = "m_chkNoPlate";
+            this.m_chkNoPlate.Size = new System.Drawing.Size(60, 16);
+            this.m_chkNoPlate.TabIndex = 23;
+            this.m_chkNoPlate.Text = "无车牌";
+            this.m_chkNoPlate.UseVisualStyleBackColor = true;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.label1);
+            this.groupBox1.Controls.Add(this.m_chkNoPlate);
+            this.groupBox1.Controls.Add(this.m_chkResult);
+            this.groupBox1.Controls.Add(this.m_chkEnergy);
+            this.groupBox1.Controls.Add(this.m_chkPlatePos);
+            this.groupBox1.Controls.Add(this.m_chkAviation);
+            this.groupBox1.Controls.Add(this.m_chkVirtualAndReco);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.m_chkEC);
+            this.groupBox1.Controls.Add(this.m_chkStableTri);
+            this.groupBox1.Controls.Add(this.m_chkHK);
+            this.groupBox1.Controls.Add(this.m_chkVirtualTri);
+            this.groupBox1.Controls.Add(this.m_chkTag);
+            this.groupBox1.Controls.Add(this.m_chkIO1);
+            this.groupBox1.Controls.Add(this.m_chkBlack);
+            this.groupBox1.Controls.Add(this.m_chkIO2);
+            this.groupBox1.Controls.Add(this.m_chkArm);
+            this.groupBox1.Controls.Add(this.m_chkIO3);
+            this.groupBox1.Controls.Add(this.m_chkTablets);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.m_chkCoach);
+            this.groupBox1.Controls.Add(this.m_chkBlue);
+            this.groupBox1.Controls.Add(this.m_chkYellow);
+            this.groupBox1.Location = new System.Drawing.Point(12, 12);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(431, 277);
+            this.groupBox1.TabIndex = 24;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "基本设置";
+            // 
+            // BaseConfig_From
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(466, 328);
+            this.Controls.Add(this.groupBox1);
+            this.Controls.Add(this.m_btnOK);
+            this.Name = "BaseConfig_From";
+            this.Text = "基本配置";
+            this.Load += new System.EventHandler(this.BaseConfig_From_Load);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.CheckBox m_chkResult;
+        private System.Windows.Forms.CheckBox m_chkPlatePos;
+        private System.Windows.Forms.CheckBox m_chkVirtualAndReco;
+        private System.Windows.Forms.CheckBox m_chkIO1;
+        private System.Windows.Forms.CheckBox m_chkVirtualTri;
+        private System.Windows.Forms.CheckBox m_chkStableTri;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.CheckBox m_chkIO2;
+        private System.Windows.Forms.CheckBox m_chkIO3;
+        private System.Windows.Forms.CheckBox m_chkArm;
+        private System.Windows.Forms.CheckBox m_chkTablets;
+        private System.Windows.Forms.CheckBox m_chkCoach;
+        private System.Windows.Forms.CheckBox m_chkYellow;
+        private System.Windows.Forms.CheckBox m_chkBlue;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.CheckBox m_chkBlack;
+        private System.Windows.Forms.CheckBox m_chkEC;
+        private System.Windows.Forms.CheckBox m_chkHK;
+        private System.Windows.Forms.CheckBox m_chkTag;
+        private System.Windows.Forms.Button m_btnOK;
+        private System.Windows.Forms.CheckBox m_chkEnergy;
+        private System.Windows.Forms.CheckBox m_chkAviation;
+        private System.Windows.Forms.CheckBox m_chkNoPlate;
+        private System.Windows.Forms.GroupBox groupBox1;
+    }
+}

+ 120 - 0
parkMonitor/view/FormModbus/BaseConfig_From.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

文件差异内容过多而无法显示
+ 1787 - 0
parkMonitor/view/FormModbus/FormModbus.Designer.cs


文件差异内容过多而无法显示
+ 1532 - 0
parkMonitor/view/FormModbus/FormModbus.cs


+ 126 - 0
parkMonitor/view/FormModbus/FormModbus.resx

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>25</value>
+  </metadata>
+</root>

+ 66 - 0
parkMonitor/view/FormModbus/Jsonhelper.cs

@@ -0,0 +1,66 @@
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.IO;
+
+namespace PLC_Communication
+{
+    /// <summary>
+    /// Json帮助类
+    /// </summary>
+    public class JsonHelper
+    {
+        /// <summary>
+        /// 将对象序列化为JSON格式
+        /// </summary>
+        /// <param name="o">对象</param>
+        /// <returns>json字符串</returns>
+        public static string SerializeObject(object o)
+        {
+            string json = JsonConvert.SerializeObject(o);
+            return json;
+        }
+
+        /// <summary>
+        /// 解析JSON字符串生成对象实体
+        /// </summary>
+        /// <typeparam name="T">对象类型</typeparam>
+        /// <param name="json">json字符串(eg.{"Adress":"0","Value":"125"})</param>
+        /// <returns>对象实体</returns>
+        public static T DeserializeJsonToObject<T>(string json) where T : class
+        {
+            JsonSerializer serializer = new JsonSerializer();
+            StringReader sr = new StringReader(json);
+            object o = serializer.Deserialize(new JsonTextReader(sr), typeof(T));
+            T t = o as T;
+            return t;
+        }
+
+        /// <summary>
+        /// 解析JSON数组生成对象实体集合
+        /// </summary>
+        /// <typeparam name="T">对象类型</typeparam>
+        /// <param name="json">json数组字符串(eg.[{"Adress":"0","Value":"125"}])</param>
+        /// <returns>对象实体集合</returns>
+        public static List<T> DeserializeJsonToList<T>(string json) where T : class
+        {
+            JsonSerializer serializer = new JsonSerializer();
+            StringReader sr = new StringReader(json);
+            object o = serializer.Deserialize(new JsonTextReader(sr), typeof(List<T>));
+            List<T> list = o as List<T>;
+            return list;
+        }
+
+        /// <summary>
+        /// 反序列化JSON到给定的匿名对象.
+        /// </summary>
+        /// <typeparam name="T">匿名对象类型</typeparam>
+        /// <param name="json">json字符串</param>
+        /// <param name="anonymousTypeObject">匿名对象</param>
+        /// <returns>匿名对象</returns>
+        public static T DeserializeAnonymousType<T>(string json, T anonymousTypeObject)
+        {
+            T t = JsonConvert.DeserializeAnonymousType(json, anonymousTypeObject);
+            return t;
+        }
+    }
+}

+ 62 - 0
parkMonitor/view/FormModbus/NetCfg_Form.cs

@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace VzClientSDKDemo
+{
+    public partial class NetCfg_Form : Form
+    {
+        private string m_strIP;
+        private uint  m_nSL	= 0;
+	    private uint  m_nSH	= 0;
+        private string m_strNetmask;
+        private string m_strGateway;
+
+        public NetCfg_Form()
+        {
+            InitializeComponent();
+        }
+
+        public void SetNetParam(string strIP, uint SL, uint SH, string netmask, string gateway)
+        {
+	        m_strIP = strIP;
+	        m_nSL	= SL;
+	        m_nSH	= SH;
+            m_strNetmask = netmask;
+            m_strGateway = gateway;
+        }
+
+        private void btnSave_Click(object sender, EventArgs e)
+        {
+            string strIP = txtIP.Text;
+
+            string strNetmask = txtMask.Text;
+
+            string strGateway = txtGateway.Text;
+
+            int ret = VzClientSDK.VzLPRClient_UpdateNetworkParam(m_nSH, m_nSL, strIP, strGateway, strNetmask);
+            if (ret == 2)
+            {
+                MessageBox.Show("设备IP跟网关不在同一网段,请重新输入!");
+            }
+            else if (ret == -1)
+            {
+                MessageBox.Show("修改网络参数失败,请重新输入!");
+            }
+
+            MessageBox.Show("修改网络参数成功");
+        }
+
+        private void NetCfg_Form_Load(object sender, EventArgs e)
+        {
+            txtIP.Text      = m_strIP;
+            txtMask.Text    = m_strNetmask;
+            txtGateway.Text = m_strGateway;
+        }
+    }
+}

+ 131 - 0
parkMonitor/view/FormModbus/NetCfg_Form.designer.cs

@@ -0,0 +1,131 @@
+namespace VzClientSDKDemo
+{
+    partial class NetCfg_Form
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.txtIP = new System.Windows.Forms.TextBox();
+            this.txtMask = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.txtGateway = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.btnSave = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(23, 29);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(41, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "IP地址";
+            // 
+            // txtIP
+            // 
+            this.txtIP.Location = new System.Drawing.Point(90, 26);
+            this.txtIP.Name = "txtIP";
+            this.txtIP.Size = new System.Drawing.Size(100, 21);
+            this.txtIP.TabIndex = 3;
+            this.txtIP.Text = "192.168.1.101";
+            // 
+            // txtMask
+            // 
+            this.txtMask.Location = new System.Drawing.Point(90, 53);
+            this.txtMask.Name = "txtMask";
+            this.txtMask.Size = new System.Drawing.Size(100, 21);
+            this.txtMask.TabIndex = 5;
+            this.txtMask.Text = "255.255.255.0";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(23, 56);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(53, 12);
+            this.label2.TabIndex = 4;
+            this.label2.Text = "子网掩码";
+            // 
+            // txtGateway
+            // 
+            this.txtGateway.Location = new System.Drawing.Point(90, 80);
+            this.txtGateway.Name = "txtGateway";
+            this.txtGateway.Size = new System.Drawing.Size(100, 21);
+            this.txtGateway.TabIndex = 7;
+            this.txtGateway.Text = "192.168.1.1";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(23, 83);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(53, 12);
+            this.label3.TabIndex = 6;
+            this.label3.Text = "默认网关";
+            // 
+            // btnSave
+            // 
+            this.btnSave.Location = new System.Drawing.Point(123, 118);
+            this.btnSave.Name = "btnSave";
+            this.btnSave.Size = new System.Drawing.Size(66, 23);
+            this.btnSave.TabIndex = 8;
+            this.btnSave.Text = "确定";
+            this.btnSave.UseVisualStyleBackColor = true;
+            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+            // 
+            // NetCfg_Form
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(257, 180);
+            this.Controls.Add(this.btnSave);
+            this.Controls.Add(this.txtGateway);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.txtMask);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.txtIP);
+            this.Controls.Add(this.label1);
+            this.Name = "NetCfg_Form";
+            this.Text = "网络参数配置";
+            this.Load += new System.EventHandler(this.NetCfg_Form_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox txtIP;
+        private System.Windows.Forms.TextBox txtMask;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox txtGateway;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Button btnSave;
+    }
+}

+ 120 - 0
parkMonitor/view/FormModbus/NetCfg_Form.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 350 - 0
parkMonitor/view/FormModbus/RVideoCfg_Form.cs

@@ -0,0 +1,350 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace VzClientSDKDemo
+{
+    public partial class RVideoCfg_Form : Form
+    {
+        public class ComboxItem
+        {
+            private string text;
+            private string values;
+
+            public string Text
+            {
+                get { return this.text; }
+                set { this.text = value; }
+            }
+
+            public string Values
+            {
+                get { return this.values; }
+                set { this.values = value; }
+            }
+
+            public ComboxItem(string _Text, string _Values)
+            {
+                Text = _Text;
+                Values = _Values;
+            }
+
+
+            public override string ToString()
+            {
+                return Text;
+            }
+        } 
+
+        private int m_hLPRClient = 0;
+        private int m_nMinDataRate;
+        private int m_nMaxDataRate;
+        private VzClientSDK.VZ_LPRC_R_VIDEO_PARAM m_video_param = new VzClientSDK.VZ_LPRC_R_VIDEO_PARAM();
+
+        public RVideoCfg_Form()
+        {
+            InitializeComponent();
+        }
+
+        public void SetLPRHandle(int hLPRClient)
+        {
+            m_hLPRClient = hLPRClient;
+        }
+
+        private void LoadVideoCfg()
+        {
+            VzClientSDK.VZ_LPRC_R_ENCODE_PARAM encode_param = new VzClientSDK.VZ_LPRC_R_ENCODE_PARAM();
+
+            VzClientSDK.VzLPRClient_RGet_Encode_Param(m_hLPRClient, 0, ref encode_param);
+            m_cmbStreamType.SelectedIndex = encode_param.default_stream;
+
+            LoadStreamParam(encode_param.default_stream);
+        }
+
+        private void LoadStreamParam(int stream_index)
+        {
+            int modeval = 0;
+
+            VzClientSDK.VZ_LPRC_R_ENCODE_PARAM encode_param = new VzClientSDK.VZ_LPRC_R_ENCODE_PARAM();
+            VzClientSDK.VzLPRClient_RGet_Encode_Param(m_hLPRClient, stream_index, ref encode_param);
+
+            bool sub_stream = false;
+
+            // 加载子码流参数
+            if (stream_index == 1)
+            {
+                sub_stream = true;
+            }
+
+            int index = 0;
+
+            VzClientSDK.VZ_LPRC_R_ENCODE_PARAM_PROPERTY param_property = new VzClientSDK.VZ_LPRC_R_ENCODE_PARAM_PROPERTY();
+            VzClientSDK.VzLPRClient_RGet_Encode_Param_Property(m_hLPRClient, ref param_property);
+
+            cmb_frame_size.Items.Clear();
+            int resolution_cur = encode_param.resolution;
+
+            m_nMinDataRate = param_property.data_rate_min;
+            m_nMaxDataRate = param_property.data_rate_max;
+
+            while (param_property.resolution[index].resolution_type > 0)
+            {
+                cmb_frame_size.Items.Add(new ComboxItem(param_property.resolution[index].resolution_content,param_property.resolution[index].resolution_type.ToString()));
+
+                if (resolution_cur == param_property.resolution[index].resolution_type)
+                {
+                    cmb_frame_size.SelectedIndex = index;
+                }
+
+                index++;
+
+                if (sub_stream && index >= 3)
+                {
+                    break;
+                }
+            }
+
+            if (encode_param.frame_rate >= 1 && encode_param.frame_rate <= 25)
+            {
+                cmb_frame_rate.SelectedIndex  = encode_param.frame_rate - 1;
+            }
+
+            if (encode_param.video_quality >= 0 && encode_param.video_quality <= 6)
+            {
+                cmb_img_quality.SelectedIndex = encode_param.video_quality;
+            }
+            else
+            {
+                cmb_img_quality.SelectedIndex = 3;
+            }
+
+            int rateval = encode_param.data_rate / 1000;
+            txt_rateval.Text = rateval.ToString();
+
+            //码流控制
+            modeval = encode_param.rate_type;
+            cmb_compress_mode.SelectedIndex  = modeval;
+
+            cmb_encode_type.SelectedIndex = 0;
+
+            txt_rateval.Enabled = (modeval == 0) ? true : false;
+            cmb_img_quality.Enabled = (modeval == 0) ? false : true;
+        }
+
+        private void LoadVideoSource( )
+        {
+            int brt = 0, cst = 0, sat = 0, hue = 0;
+            int ret = VzClientSDK.VzLPRClient_GetVideoPara(m_hLPRClient, ref brt, ref cst, ref sat, ref hue);
+            if (ret == 0)
+            {
+                tbar_bright.Value = brt;
+                tbar_contrast.Value = cst;
+                tbar_saturation.Value = sat;
+                tbar_definition.Value = hue;
+
+                lblBright.Text = brt.ToString();
+                lblContrast.Text = cst.ToString();
+                lblSaturation.Text = sat.ToString();
+                lblDefinition.Text = hue.ToString();
+            }
+
+            ret = VzClientSDK.VzLPRClient_RGet_Video_Param(m_hLPRClient, ref m_video_param);
+            if (ret == 0)
+            {
+                tbar_definition.Value = m_video_param.max_gain;
+            }
+
+            int flip = 0;
+            ret = VzClientSDK.VzLPRClient_GetFlip(m_hLPRClient, ref flip);
+            if (ret == 0)
+            {
+                cmb_img_pos.SelectedIndex = flip;
+            }
+            else
+            {
+                cmb_img_pos.SelectedIndex = 0;
+            }
+
+            int shutter = 0;
+            ret = VzClientSDK.VzLPRClient_GetShutter(m_hLPRClient, ref shutter);
+
+            if (shutter >= 1)
+            {
+                cmb_exposure_time.SelectedIndex = shutter - 1;
+            }
+            else
+            {
+                cmb_exposure_time.SelectedIndex = 0;
+            }
+        }
+
+        private void RVideoCfg_Form_Load(object sender, EventArgs e)
+        {
+            LoadVideoCfg();
+
+            LoadVideoSource();
+        }
+
+        private void btnSave_Click(object sender, EventArgs e)
+        {
+            int stream_type = m_cmbStreamType.SelectedIndex;
+
+            VzClientSDK.VZ_LPRC_R_ENCODE_PARAM encode_param = new VzClientSDK.VZ_LPRC_R_ENCODE_PARAM();
+            encode_param.default_stream = stream_type;
+
+            int frame_size = cmb_frame_size.SelectedIndex;
+
+            string strFrameType = ((ComboxItem)cmb_frame_size.Items[frame_size]).Values;
+            int frame_type = int.Parse(strFrameType);
+            encode_param.resolution = frame_type;
+
+            encode_param.frame_rate = cmb_frame_rate.SelectedIndex + 1;
+
+            encode_param.rate_type = cmb_compress_mode.SelectedIndex;
+
+            encode_param.video_quality = cmb_img_quality.SelectedIndex;
+
+
+            string sRateVal = txt_rateval.Text.ToString();
+            int nRate = int.Parse(sRateVal) * 1000;
+
+            if (nRate < m_nMinDataRate || nRate > m_nMaxDataRate)
+            {
+                int min_rate = m_nMinDataRate / 1000;
+                int max_rate = m_nMaxDataRate / 1000;
+                string msgInfo = "码流范围为" + min_rate + "-" + max_rate + ",请重新输入!";
+
+                MessageBox.Show(msgInfo);
+                return;
+            }
+
+            encode_param.data_rate = nRate;
+
+            int ret = VzClientSDK.VzLPRClient_RSet_Encode_Param(m_hLPRClient, stream_type, ref encode_param);
+            if (ret != 0)
+            {
+                MessageBox.Show("设置视频参数失败,请重试!");
+            }
+
+            MessageBox.Show("设置视频参数成功!");
+        }
+
+        private void btnRecovery_Click(object sender, EventArgs e)
+        {
+            int brt = 50;
+            int cst = 50;
+            int sat = 50;
+
+            tbar_bright.Value = brt;
+            tbar_contrast.Value = cst;
+            tbar_saturation.Value = sat;
+            tbar_definition.Value = 50;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+            lblDefinition.Text = "50";
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, 50);
+
+            int max_gain = 50;
+
+            m_video_param.max_gain = max_gain;
+            m_video_param.brightness = brt;
+            m_video_param.contrast = cst;
+            m_video_param.saturation = sat;
+            m_video_param.hue = 50;
+            VzClientSDK.VzLPRClient_RSet_Video_Param(m_hLPRClient, ref m_video_param);
+
+            VzClientSDK.VzLPRClient_SetShutter(m_hLPRClient, 3);
+            cmb_exposure_time.SelectedIndex = 2;
+
+            VzClientSDK.VzLPRClient_SetFlip(m_hLPRClient, 0);
+            cmb_img_pos.SelectedIndex = 0;
+        }
+
+        private void m_cmbStreamType_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int cur_sel = m_cmbStreamType.SelectedIndex;
+            LoadStreamParam(cur_sel);
+        }
+
+        private void cmb_img_pos_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int flip = cmb_img_pos.SelectedIndex;
+            int ret = VzClientSDK.VzLPRClient_SetFlip(m_hLPRClient, flip);
+        }
+
+        private void cmb_exposure_time_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int shutter = cmb_exposure_time.SelectedIndex;
+            int ret = VzClientSDK.VzLPRClient_SetShutter(m_hLPRClient, shutter + 1);
+        }
+
+        private void tbar_bright_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int hue = 50;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+        }
+
+        private void tbar_contrast_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int hue = 50;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+        }
+
+        private void tbar_saturation_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int hue = 50;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+        }
+
+        private void tbar_definition_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int max_gain = tbar_definition.Value;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+            lblDefinition.Text = max_gain.ToString();
+
+            m_video_param.brightness = brt;
+            m_video_param.contrast = cst;
+            m_video_param.saturation = sat;
+            m_video_param.max_gain = max_gain;
+            VzClientSDK.VzLPRClient_RSet_Video_Param(m_hLPRClient, ref m_video_param);
+        }
+    }
+}

+ 541 - 0
parkMonitor/view/FormModbus/RVideoCfg_Form.designer.cs

@@ -0,0 +1,541 @@
+namespace VzClientSDKDemo
+{
+    partial class RVideoCfg_Form
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.m_cmbStreamType = new System.Windows.Forms.ComboBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.cmb_img_quality = new System.Windows.Forms.ComboBox();
+            this.label11 = new System.Windows.Forms.Label();
+            this.btnSave = new System.Windows.Forms.Button();
+            this.txt_rateval = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
+            this.cmb_compress_mode = new System.Windows.Forms.ComboBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.cmb_encode_type = new System.Windows.Forms.ComboBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.cmb_frame_rate = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.cmb_frame_size = new System.Windows.Forms.ComboBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.tabPage2 = new System.Windows.Forms.TabPage();
+            this.btnRecovery = new System.Windows.Forms.Button();
+            this.cmb_img_pos = new System.Windows.Forms.ComboBox();
+            this.label16 = new System.Windows.Forms.Label();
+            this.cmb_exposure_time = new System.Windows.Forms.ComboBox();
+            this.label15 = new System.Windows.Forms.Label();
+            this.tbar_definition = new System.Windows.Forms.TrackBar();
+            this.label13 = new System.Windows.Forms.Label();
+            this.tbar_saturation = new System.Windows.Forms.TrackBar();
+            this.label12 = new System.Windows.Forms.Label();
+            this.tbar_contrast = new System.Windows.Forms.TrackBar();
+            this.label10 = new System.Windows.Forms.Label();
+            this.tbar_bright = new System.Windows.Forms.TrackBar();
+            this.label2 = new System.Windows.Forms.Label();
+            this.lblDefinition = new System.Windows.Forms.Label();
+            this.lblSaturation = new System.Windows.Forms.Label();
+            this.lblContrast = new System.Windows.Forms.Label();
+            this.lblBright = new System.Windows.Forms.Label();
+            this.tabControl1.SuspendLayout();
+            this.tabPage1.SuspendLayout();
+            this.tabPage2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_definition)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_saturation)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_contrast)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_bright)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabPage1);
+            this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Location = new System.Drawing.Point(12, 12);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(376, 379);
+            this.tabControl1.TabIndex = 1;
+            // 
+            // tabPage1
+            // 
+            this.tabPage1.Controls.Add(this.m_cmbStreamType);
+            this.tabPage1.Controls.Add(this.label5);
+            this.tabPage1.Controls.Add(this.cmb_img_quality);
+            this.tabPage1.Controls.Add(this.label11);
+            this.tabPage1.Controls.Add(this.btnSave);
+            this.tabPage1.Controls.Add(this.txt_rateval);
+            this.tabPage1.Controls.Add(this.label9);
+            this.tabPage1.Controls.Add(this.cmb_compress_mode);
+            this.tabPage1.Controls.Add(this.label8);
+            this.tabPage1.Controls.Add(this.cmb_encode_type);
+            this.tabPage1.Controls.Add(this.label4);
+            this.tabPage1.Controls.Add(this.cmb_frame_rate);
+            this.tabPage1.Controls.Add(this.label3);
+            this.tabPage1.Controls.Add(this.cmb_frame_size);
+            this.tabPage1.Controls.Add(this.label1);
+            this.tabPage1.Location = new System.Drawing.Point(4, 22);
+            this.tabPage1.Name = "tabPage1";
+            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage1.Size = new System.Drawing.Size(368, 353);
+            this.tabPage1.TabIndex = 0;
+            this.tabPage1.Text = "主码流";
+            this.tabPage1.UseVisualStyleBackColor = true;
+            // 
+            // m_cmbStreamType
+            // 
+            this.m_cmbStreamType.FormattingEnabled = true;
+            this.m_cmbStreamType.Items.AddRange(new object[] {
+            "主码流",
+            "子码流"});
+            this.m_cmbStreamType.Location = new System.Drawing.Point(79, 31);
+            this.m_cmbStreamType.Name = "m_cmbStreamType";
+            this.m_cmbStreamType.Size = new System.Drawing.Size(121, 20);
+            this.m_cmbStreamType.TabIndex = 14;
+            this.m_cmbStreamType.SelectedIndexChanged += new System.EventHandler(this.m_cmbStreamType_SelectedIndexChanged);
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(16, 35);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(29, 12);
+            this.label5.TabIndex = 13;
+            this.label5.Text = "码流";
+            // 
+            // cmb_img_quality
+            // 
+            this.cmb_img_quality.FormattingEnabled = true;
+            this.cmb_img_quality.Items.AddRange(new object[] {
+            "最流畅",
+            "较流畅",
+            "流畅",
+            "中等",
+            "清晰",
+            "较清晰",
+            "最清晰"});
+            this.cmb_img_quality.Location = new System.Drawing.Point(78, 188);
+            this.cmb_img_quality.Name = "cmb_img_quality";
+            this.cmb_img_quality.Size = new System.Drawing.Size(121, 20);
+            this.cmb_img_quality.TabIndex = 12;
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(14, 191);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(53, 12);
+            this.label11.TabIndex = 11;
+            this.label11.Text = "图像质量";
+            // 
+            // btnSave
+            // 
+            this.btnSave.Location = new System.Drawing.Point(133, 251);
+            this.btnSave.Name = "btnSave";
+            this.btnSave.Size = new System.Drawing.Size(64, 23);
+            this.btnSave.TabIndex = 10;
+            this.btnSave.Text = "确定";
+            this.btnSave.UseVisualStyleBackColor = true;
+            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+            // 
+            // txt_rateval
+            // 
+            this.txt_rateval.Location = new System.Drawing.Point(78, 217);
+            this.txt_rateval.Name = "txt_rateval";
+            this.txt_rateval.Size = new System.Drawing.Size(121, 21);
+            this.txt_rateval.TabIndex = 9;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(14, 218);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(53, 12);
+            this.label9.TabIndex = 8;
+            this.label9.Text = "码流上限";
+            // 
+            // cmb_compress_mode
+            // 
+            this.cmb_compress_mode.FormattingEnabled = true;
+            this.cmb_compress_mode.Items.AddRange(new object[] {
+            "定码流",
+            "变码流"});
+            this.cmb_compress_mode.Location = new System.Drawing.Point(78, 160);
+            this.cmb_compress_mode.Name = "cmb_compress_mode";
+            this.cmb_compress_mode.Size = new System.Drawing.Size(121, 20);
+            this.cmb_compress_mode.TabIndex = 7;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(14, 163);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(53, 12);
+            this.label8.TabIndex = 6;
+            this.label8.Text = "码流控制";
+            // 
+            // cmb_encode_type
+            // 
+            this.cmb_encode_type.FormattingEnabled = true;
+            this.cmb_encode_type.Items.AddRange(new object[] {
+            "H264"});
+            this.cmb_encode_type.Location = new System.Drawing.Point(79, 126);
+            this.cmb_encode_type.Name = "cmb_encode_type";
+            this.cmb_encode_type.Size = new System.Drawing.Size(121, 20);
+            this.cmb_encode_type.TabIndex = 5;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(15, 129);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(53, 12);
+            this.label4.TabIndex = 4;
+            this.label4.Text = "编码方式";
+            // 
+            // cmb_frame_rate
+            // 
+            this.cmb_frame_rate.FormattingEnabled = true;
+            this.cmb_frame_rate.Items.AddRange(new object[] {
+            "1",
+            "2",
+            "3",
+            "4",
+            "5",
+            "6",
+            "7",
+            "8",
+            "9",
+            "10",
+            "11",
+            "12",
+            "13",
+            "14",
+            "15",
+            "16",
+            "17",
+            "18",
+            "19",
+            "20",
+            "21",
+            "22",
+            "23",
+            "24",
+            "25"});
+            this.cmb_frame_rate.Location = new System.Drawing.Point(79, 93);
+            this.cmb_frame_rate.Name = "cmb_frame_rate";
+            this.cmb_frame_rate.Size = new System.Drawing.Size(121, 20);
+            this.cmb_frame_rate.TabIndex = 3;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(15, 96);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(41, 12);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "帧  率";
+            // 
+            // cmb_frame_size
+            // 
+            this.cmb_frame_size.FormattingEnabled = true;
+            this.cmb_frame_size.Items.AddRange(new object[] {
+            "352x288",
+            "704x576",
+            "1280x720",
+            "1920x1080"});
+            this.cmb_frame_size.Location = new System.Drawing.Point(79, 62);
+            this.cmb_frame_size.Name = "cmb_frame_size";
+            this.cmb_frame_size.Size = new System.Drawing.Size(121, 20);
+            this.cmb_frame_size.TabIndex = 1;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(15, 65);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(41, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "分辨率";
+            // 
+            // tabPage2
+            // 
+            this.tabPage2.Controls.Add(this.lblDefinition);
+            this.tabPage2.Controls.Add(this.lblSaturation);
+            this.tabPage2.Controls.Add(this.lblContrast);
+            this.tabPage2.Controls.Add(this.lblBright);
+            this.tabPage2.Controls.Add(this.btnRecovery);
+            this.tabPage2.Controls.Add(this.cmb_img_pos);
+            this.tabPage2.Controls.Add(this.label16);
+            this.tabPage2.Controls.Add(this.cmb_exposure_time);
+            this.tabPage2.Controls.Add(this.label15);
+            this.tabPage2.Controls.Add(this.tbar_definition);
+            this.tabPage2.Controls.Add(this.label13);
+            this.tabPage2.Controls.Add(this.tbar_saturation);
+            this.tabPage2.Controls.Add(this.label12);
+            this.tabPage2.Controls.Add(this.tbar_contrast);
+            this.tabPage2.Controls.Add(this.label10);
+            this.tabPage2.Controls.Add(this.tbar_bright);
+            this.tabPage2.Controls.Add(this.label2);
+            this.tabPage2.Location = new System.Drawing.Point(4, 22);
+            this.tabPage2.Name = "tabPage2";
+            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage2.Size = new System.Drawing.Size(368, 353);
+            this.tabPage2.TabIndex = 1;
+            this.tabPage2.Text = "视频源";
+            this.tabPage2.UseVisualStyleBackColor = true;
+            // 
+            // btnRecovery
+            // 
+            this.btnRecovery.Location = new System.Drawing.Point(216, 291);
+            this.btnRecovery.Name = "btnRecovery";
+            this.btnRecovery.Size = new System.Drawing.Size(75, 23);
+            this.btnRecovery.TabIndex = 14;
+            this.btnRecovery.Text = "恢复默认";
+            this.btnRecovery.UseVisualStyleBackColor = true;
+            this.btnRecovery.Click += new System.EventHandler(this.btnRecovery_Click);
+            // 
+            // cmb_img_pos
+            // 
+            this.cmb_img_pos.FormattingEnabled = true;
+            this.cmb_img_pos.Items.AddRange(new object[] {
+            "原始图像",
+            "上下翻转",
+            "左右翻转",
+            "中心翻转"});
+            this.cmb_img_pos.Location = new System.Drawing.Point(84, 237);
+            this.cmb_img_pos.Name = "cmb_img_pos";
+            this.cmb_img_pos.Size = new System.Drawing.Size(140, 20);
+            this.cmb_img_pos.TabIndex = 13;
+            this.cmb_img_pos.SelectedIndexChanged += new System.EventHandler(this.cmb_img_pos_SelectedIndexChanged);
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(17, 240);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(53, 12);
+            this.label16.TabIndex = 12;
+            this.label16.Text = "图像翻转";
+            // 
+            // cmb_exposure_time
+            // 
+            this.cmb_exposure_time.FormattingEnabled = true;
+            this.cmb_exposure_time.Items.AddRange(new object[] {
+            "0~1ms",
+            "0~2ms",
+            "0~3ms",
+            "0~4ms"});
+            this.cmb_exposure_time.Location = new System.Drawing.Point(84, 204);
+            this.cmb_exposure_time.Name = "cmb_exposure_time";
+            this.cmb_exposure_time.Size = new System.Drawing.Size(140, 20);
+            this.cmb_exposure_time.TabIndex = 11;
+            this.cmb_exposure_time.SelectedIndexChanged += new System.EventHandler(this.cmb_exposure_time_SelectedIndexChanged);
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(17, 207);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(53, 12);
+            this.label15.TabIndex = 10;
+            this.label15.Text = "曝光时间";
+            // 
+            // tbar_definition
+            // 
+            this.tbar_definition.AutoSize = false;
+            this.tbar_definition.Location = new System.Drawing.Point(83, 115);
+            this.tbar_definition.Maximum = 100;
+            this.tbar_definition.Name = "tbar_definition";
+            this.tbar_definition.Size = new System.Drawing.Size(220, 25);
+            this.tbar_definition.TabIndex = 7;
+            this.tbar_definition.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_definition.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_definition_MouseUp);
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(23, 119);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(53, 12);
+            this.label13.TabIndex = 6;
+            this.label13.Text = "最大增益";
+            // 
+            // tbar_saturation
+            // 
+            this.tbar_saturation.AutoSize = false;
+            this.tbar_saturation.Location = new System.Drawing.Point(83, 83);
+            this.tbar_saturation.Maximum = 100;
+            this.tbar_saturation.Name = "tbar_saturation";
+            this.tbar_saturation.Size = new System.Drawing.Size(220, 25);
+            this.tbar_saturation.TabIndex = 5;
+            this.tbar_saturation.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_saturation.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_saturation_MouseUp);
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(23, 87);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(41, 12);
+            this.label12.TabIndex = 4;
+            this.label12.Text = "饱和度";
+            // 
+            // tbar_contrast
+            // 
+            this.tbar_contrast.AutoSize = false;
+            this.tbar_contrast.Location = new System.Drawing.Point(84, 50);
+            this.tbar_contrast.Maximum = 100;
+            this.tbar_contrast.Name = "tbar_contrast";
+            this.tbar_contrast.Size = new System.Drawing.Size(219, 25);
+            this.tbar_contrast.TabIndex = 3;
+            this.tbar_contrast.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_contrast.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_contrast_MouseUp);
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(24, 54);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(41, 12);
+            this.label10.TabIndex = 2;
+            this.label10.Text = "对比度";
+            // 
+            // tbar_bright
+            // 
+            this.tbar_bright.AutoSize = false;
+            this.tbar_bright.Location = new System.Drawing.Point(83, 17);
+            this.tbar_bright.Maximum = 100;
+            this.tbar_bright.Name = "tbar_bright";
+            this.tbar_bright.Size = new System.Drawing.Size(220, 25);
+            this.tbar_bright.TabIndex = 1;
+            this.tbar_bright.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_bright.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_bright_MouseUp);
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(23, 21);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(29, 12);
+            this.label2.TabIndex = 0;
+            this.label2.Text = "亮度";
+            // 
+            // lblDefinition
+            // 
+            this.lblDefinition.AutoSize = true;
+            this.lblDefinition.Location = new System.Drawing.Point(309, 119);
+            this.lblDefinition.Name = "lblDefinition";
+            this.lblDefinition.Size = new System.Drawing.Size(0, 12);
+            this.lblDefinition.TabIndex = 26;
+            // 
+            // lblSaturation
+            // 
+            this.lblSaturation.AutoSize = true;
+            this.lblSaturation.Location = new System.Drawing.Point(309, 87);
+            this.lblSaturation.Name = "lblSaturation";
+            this.lblSaturation.Size = new System.Drawing.Size(0, 12);
+            this.lblSaturation.TabIndex = 25;
+            // 
+            // lblContrast
+            // 
+            this.lblContrast.AutoSize = true;
+            this.lblContrast.Location = new System.Drawing.Point(309, 54);
+            this.lblContrast.Name = "lblContrast";
+            this.lblContrast.Size = new System.Drawing.Size(0, 12);
+            this.lblContrast.TabIndex = 24;
+            // 
+            // lblBright
+            // 
+            this.lblBright.AutoSize = true;
+            this.lblBright.Location = new System.Drawing.Point(309, 21);
+            this.lblBright.Name = "lblBright";
+            this.lblBright.Size = new System.Drawing.Size(0, 12);
+            this.lblBright.TabIndex = 23;
+            // 
+            // RVideoCfg_Form
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(404, 416);
+            this.Controls.Add(this.tabControl1);
+            this.Name = "RVideoCfg_Form";
+            this.Text = "RVideoCfg_Form";
+            this.Load += new System.EventHandler(this.RVideoCfg_Form_Load);
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage1.ResumeLayout(false);
+            this.tabPage1.PerformLayout();
+            this.tabPage2.ResumeLayout(false);
+            this.tabPage2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_definition)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_saturation)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_contrast)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_bright)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TabPage tabPage1;
+        private System.Windows.Forms.ComboBox cmb_img_quality;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.Button btnSave;
+        private System.Windows.Forms.TextBox txt_rateval;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.ComboBox cmb_compress_mode;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.ComboBox cmb_encode_type;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.ComboBox cmb_frame_rate;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.ComboBox cmb_frame_size;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TabPage tabPage2;
+        private System.Windows.Forms.Button btnRecovery;
+        private System.Windows.Forms.ComboBox cmb_img_pos;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.ComboBox cmb_exposure_time;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.TrackBar tbar_definition;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.TrackBar tbar_saturation;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.TrackBar tbar_contrast;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.TrackBar tbar_bright;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.ComboBox m_cmbStreamType;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label lblDefinition;
+        private System.Windows.Forms.Label lblSaturation;
+        private System.Windows.Forms.Label lblContrast;
+        private System.Windows.Forms.Label lblBright;
+    }
+}

+ 120 - 0
parkMonitor/view/FormModbus/RVideoCfg_Form.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 719 - 0
parkMonitor/view/FormModbus/RuleCfg_Form.cs

@@ -0,0 +1,719 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using System.Threading;
+using System.IO;
+using System.Globalization;
+using System.Runtime.InteropServices;
+
+namespace VzClientSDKDemo
+{
+    public partial class RuleCfg_Form : Form
+    {
+        private int lpr_handle_ = 0;
+        private uint IMG_SIZE = 1920 * 1080;
+        private byte[] pic_data_ = new byte[1920*1080];
+        private IntPtr img_buf_ptr_;
+        private GCHandle img_object_;
+
+        private System.Timers.Timer draw_rule_timer_;
+        public static Mutex mutex_rule_ = new Mutex();
+
+        private const int LOOP_POINT_COUNT = 4;
+
+        private Graphics g_box_;
+        private Point[] loop_point_array_ = new Point[LOOP_POINT_COUNT];
+        private Pen pen_loop_ = new Pen(Color.LightCoral, 2);
+
+        private uint graph_width_ = 1280;
+        private uint graph_heigh_ = 720;
+
+        private const int BOUND_VALUE = 5;
+        private const int SELE_BOUND_VALUE = 8;
+        private const int CONTROL_BORDER = 2;
+
+        private VzClientSDK.VZ_LPRC_VIRTUAL_LOOPS loops_ = new VzClientSDK.VZ_LPRC_VIRTUAL_LOOPS();
+
+        private int active_pt_index_ = -1;
+
+        private double zoom_x_rate = 0.0;
+        private double zoom_y_rate = 0.0;
+
+        private bool mouse_down_ = false;
+        private Point pt_mouse_down_ = new Point();
+        private Point pt_prev_ = new Point();
+        private bool select_loop_ = false;
+
+        public void SetLPRHandle(int handle)
+        {
+            lpr_handle_ = handle;
+        }
+
+        public RuleCfg_Form()
+        {
+            InitializeComponent();
+        }
+
+        private void RuleCfg_Form_Load(object sender, EventArgs e)
+        {
+            // 开启获取实时解码数据
+            if (lpr_handle_ > 0)
+            {
+                VzClientSDK.VzLPRClient_StartRealPlayDecData(lpr_handle_);
+            }
+
+            img_object_     = GCHandle.Alloc(pic_data_, GCHandleType.Pinned);
+            img_buf_ptr_    = img_object_.AddrOfPinnedObject();
+
+            draw_rule_timer_ = new System.Timers.Timer(80);
+            draw_rule_timer_.Elapsed += drawTimer_Elapsed;     
+            draw_rule_timer_.AutoReset = true;               
+            draw_rule_timer_.Enabled = true;
+
+            g_box_ = picBoxVideo.CreateGraphics();
+
+            LoadRuleParam();
+        }
+
+        private void LoadRuleParam()
+        {
+            if (lpr_handle_ > 0)
+            {
+                // 加载虚拟线圈的规则
+                int ret = VzClientSDK.VzLPRClient_GetVirtualLoop(lpr_handle_, ref loops_);
+
+                if (loops_.uNumVirtualLoop > 0)
+                {
+                    LoadLoopParam();
+
+                    uint x = 0, y = 0;
+			        for( int i = 0; i < LOOP_POINT_COUNT; i++ )
+			        {
+                        x = loops_.struLoop[0].struVertex[i].X_1000 * graph_width_ / 1000;
+                        y = loops_.struLoop[0].struVertex[i].Y_1000 * graph_heigh_ / 1000;
+
+                        loop_point_array_[i] = new Point((int)x, (int)y);
+			        }
+
+                    zoom_x_rate = (double)picBoxVideo.Width / (double)graph_width_;
+                    zoom_y_rate = (double)picBoxVideo.Height / (double)graph_heigh_;
+                }
+                else
+                {
+                    EnableLoopParamCtrl(false);
+                }
+            }
+        }
+
+        private void drawTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
+        {
+            mutex_rule_.WaitOne();
+
+            int nBufSize = VzClientSDK.VzLPRClient_GetJpegStreamFromRealPlayDec(lpr_handle_, img_buf_ptr_, IMG_SIZE, 100);
+            if (nBufSize > 0)
+            {
+                // 显示图像到界面
+                MemoryStream ms = new MemoryStream(pic_data_);
+                Bitmap bitmap = new Bitmap(ms);
+
+                Graphics g = Graphics.FromImage(bitmap);
+
+                if ( loops_.uNumVirtualLoop == 1 )
+                {
+                    g.DrawPolygon(pen_loop_, loop_point_array_);
+
+                    if (graph_width_ != bitmap.Width || graph_heigh_ != bitmap.Height)
+                    {
+                        graph_width_ = (uint)bitmap.Width;
+                        graph_heigh_ = (uint)bitmap.Height;
+
+                        zoom_x_rate = (double)picBoxVideo.Width / (double)graph_width_;
+                        zoom_y_rate = (double)picBoxVideo.Height / (double)graph_heigh_;
+
+                        ReloadLoop( );
+                    }
+
+                    for( int i = 0; i < LOOP_POINT_COUNT; i++ )
+                    {
+                        if ( i == active_pt_index_ )
+                        {
+                            g.DrawRectangle(Pens.LightGreen, loop_point_array_[i].X - SELE_BOUND_VALUE, loop_point_array_[i].Y - SELE_BOUND_VALUE, SELE_BOUND_VALUE * 2, SELE_BOUND_VALUE * 2);
+                        }
+                        else
+                        {
+                            g.DrawRectangle(Pens.LightYellow, loop_point_array_[i].X - BOUND_VALUE, loop_point_array_[i].Y - BOUND_VALUE, BOUND_VALUE * 2, BOUND_VALUE * 2);
+                        }
+                    }
+                }
+
+                Rectangle rc_dest = new Rectangle(0, 0, picBoxVideo.Width, picBoxVideo.Height);
+                Rectangle rc_src = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
+                g_box_.DrawImage(bitmap, rc_dest, rc_src, GraphicsUnit.Pixel);
+            }
+
+            mutex_rule_.ReleaseMutex();
+        }
+
+        private void ReloadLoop( )
+        {
+            for (int i = 0; i < LOOP_POINT_COUNT; i++)
+            {
+                loop_point_array_[i].X = (int)(loops_.struLoop[0].struVertex[i].X_1000 * graph_width_ / 1000);
+                loop_point_array_[i].Y = (int)(loops_.struLoop[0].struVertex[i].Y_1000 * graph_heigh_ / 1000);
+            }
+        }
+
+        private void RuleCfg_Form_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            draw_rule_timer_.Enabled = false;
+            draw_rule_timer_.Stop();
+
+            VzClientSDK.VzLPRClient_StopRealPlayDecData(lpr_handle_);
+
+            if (img_object_.IsAllocated)
+            {
+                img_object_.Free();
+            }
+        }
+
+        private int Point2PointDist(Point pt_start, Point pt_end)
+        {
+            double dbDist = (pt_start.X - pt_end.X) * (pt_start.X - pt_end.X) + (pt_start.Y - pt_end.Y) * (pt_start.Y - pt_end.Y);
+	        int nDist = (int)Math.Sqrt(dbDist);
+
+	        return nDist;
+        }
+
+        private int GetPointIndex(Point pt, int max_dist)
+        {
+	        int index = -1;
+	        int dist = 0;
+        	
+	        for( int i = 0; i < LOOP_POINT_COUNT; i++ )
+	        {
+                dist = Point2PointDist(pt, loop_point_array_[i]);
+                if (dist <= max_dist)
+		        {
+                    max_dist = dist;
+                    index = i;
+		        }
+	        }
+
+            return index;
+        }
+
+        private Point PointToImgPoint(Point pt)
+        {
+            Point pt_img = new Point();
+
+            pt_img.X = GetImgX(pt.X);
+            pt_img.Y = GetImgY(pt.Y);
+
+            return pt_img;
+        }
+
+        private int GetImgX(int x)
+        {
+            int img_x = x;
+            if( zoom_x_rate > 0.01 )
+            {
+                img_x = (int)(x / zoom_x_rate);
+            }
+            
+            return img_x;
+        }
+
+        private int GetImgY(int y)
+        {
+            int img_y = y;
+
+            if ( zoom_y_rate > 0.01 )
+            {
+                img_y = (int)(y / zoom_y_rate);
+            }
+           
+            return img_y;
+        }
+
+
+        private void btnSave_Click(object sender, EventArgs e)
+        {
+            int nMinLPWidth = int.Parse(txtMinWidth.Text);
+            int nMaxLPWidth = int.Parse(txtMaxWidth.Text);
+            if (nMinLPWidth < 45 || nMaxLPWidth > 600 || nMinLPWidth >= nMaxLPWidth)
+            {
+                MessageBox.Show("车牌宽度限制填写不正确,请重新输入!");
+                return;
+            }
+
+	        if( lpr_handle_ > 0 )
+	        {
+                if (loops_.uNumVirtualLoop == 1)
+                {
+                    for (int i = 0; i < LOOP_POINT_COUNT; i++)
+                    {
+                        loops_.struLoop[0].struVertex[i].X_1000 = (uint)(loop_point_array_[i].X * 1000 / graph_width_);
+                        loops_.struLoop[0].struVertex[i].Y_1000 = (uint)(loop_point_array_[i].Y * 1000 / graph_heigh_);
+                    }
+
+                    loops_.struLoop[0].uMinLPWidth = uint.Parse(txtMinWidth.Text);
+                    loops_.struLoop[0].uMaxLPWidth = uint.Parse(txtMaxWidth.Text);
+                    loops_.struLoop[0].uTriggerTimeGap = uint.Parse(txtTimes.Text);
+                    loops_.struLoop[0].eCrossDir = (uint)(cmbDir.SelectedIndex);
+                    loops_.struLoop[0].byDraw = (chkDraw.Checked ? (byte)1 : (byte)0);
+                    loops_.struLoop[0].byEnable = (chkEnable.Checked ? (byte)1 : (byte)0);
+                }
+                else
+                {
+                    // 清空数据
+                    for (int i = 0; i < LOOP_POINT_COUNT; i++)
+                    {
+                        loops_.struLoop[0].struVertex[i].X_1000 = 0;
+                        loops_.struLoop[0].struVertex[i].Y_1000 = 0;
+                    }
+
+                    loops_.struLoop[0].strName = "";
+                    loops_.struLoop[0].uMinLPWidth = 0;
+                    loops_.struLoop[0].uMaxLPWidth = 0;
+                    loops_.struLoop[0].uTriggerTimeGap = 0;
+                    loops_.struLoop[0].eCrossDir = 0;
+                    loops_.struLoop[0].byDraw = 0;
+                    loops_.struLoop[0].byEnable = 0;
+                }
+
+                int ret = VzClientSDK.VzLPRClient_SetVirtualLoop(lpr_handle_, ref loops_);
+                if (ret == 0)
+                {
+                    MessageBox.Show("保存线圈参数成功!");
+                }
+                else
+                {
+                    MessageBox.Show("保存线圈参数失败!");
+                }
+	        }
+        }
+
+        private void picBoxVideo_MouseMove(object sender, MouseEventArgs e)
+        {
+            Point pt_mouse = new Point(e.X, e.Y);
+            Point pt_img = PointToImgPoint(pt_mouse);
+
+            int dis_x = 0, dis_y = 0;
+
+            if (mouse_down_)
+            {
+                if ( active_pt_index_ >= 0 && active_pt_index_ < LOOP_POINT_COUNT )
+                {
+                    Point ptNow = GetInBoundPoint(pt_img);
+                    if (!GetEditIsCross(active_pt_index_, ptNow))
+					{
+                        // 移动点
+                        loop_point_array_[active_pt_index_] = ptNow;
+					}
+                }
+                else
+                {
+                    // 移动整个图形
+                    if( select_loop_ )
+                    {
+                        // 获取当前位置与之前位置的坐标差
+                        dis_x = pt_img.X - pt_prev_.X;
+                        dis_y = pt_img.Y - pt_prev_.Y;
+
+                        // 如果图形上所有的点没有超过图形范围,则移动图形
+                        MoveBoundLimit(ref dis_x, ref dis_y);
+
+                        if (dis_x != 0 || dis_y != 0)
+                        {
+                            MoveAllPoints(dis_x, dis_y);
+
+                            // 保存之前的坐标
+                            pt_prev_.X += dis_x;
+                            pt_prev_.Y += dis_y;
+                        }
+                    }
+                }
+            }
+            else
+            {
+                active_pt_index_ = GetPointIndex(pt_img, 10);
+
+                PointIsInPolygen(pt_img);
+            }
+        }
+
+        private void MoveAllPoints(int dis_x, int dis_y)
+        {
+	       
+	        for( int i = 0; i < LOOP_POINT_COUNT; i++ )
+	        {
+                loop_point_array_[i].X += dis_x;
+                loop_point_array_[i].Y += dis_y;
+	        }
+        }
+
+        private void picBoxVideo_MouseDown(object sender, MouseEventArgs e)
+        {
+            pt_mouse_down_.X = e.X;
+            pt_mouse_down_.Y = e.Y;
+
+            Point pt_img = PointToImgPoint(pt_mouse_down_);
+
+            select_loop_ = PointIsInPolygen(pt_img);
+            if ( select_loop_ )
+            {
+                pt_prev_ = pt_img;
+            }
+
+            mouse_down_ = true;
+        }
+
+        private void picBoxVideo_MouseUp(object sender, MouseEventArgs e)
+        {
+            mouse_down_ = false;
+        }
+
+        bool PointIsInPolygen(Point pt)
+        {
+            Point pt0, pt1;
+	        int dist = 0;
+	        int counter = 0;
+
+	        bool result = false;
+	      
+	        for ( int i = 0; i < LOOP_POINT_COUNT - 1; i++ )
+	        {
+		        pt0 = loop_point_array_[i];
+                pt1 = loop_point_array_[i + 1];
+
+                if ((pt0.Y <= pt.Y && pt1.Y <= pt.Y) ||
+                        (pt0.Y > pt.Y && pt1.Y > pt.Y) ||
+                        (pt0.X < pt.X && pt1.X < pt.X) )
+                    {
+                        if( pt.Y == pt1.Y && (pt.X == pt1.X || (pt.Y == pt0.Y &&
+                            ((pt0.X <= pt.X && pt.X <= pt1.X) || (pt1.X <= pt.X && pt.X <= pt0.X)))) )
+                            return true;
+                        continue;
+                    }
+
+        	
+                dist = (pt.Y - pt0.Y)*(pt1.X - pt0.X) - (pt.X - pt0.X)*(pt1.Y - pt0.Y);
+                if( dist == 0 )
+                    return true;
+                if( pt1.Y < pt0.Y )
+                    dist = -dist;
+                
+                if (dist > 0)
+                {
+                    counter ++;
+                }
+                // counter += dist > 0;
+	        }
+
+	        result = (counter % 2) == 0 ? false : true;
+	        return result;
+        }
+
+        private void MoveBoundLimit(ref int nDisX, ref int nDisY)
+        {
+	        int nCurX = 0;
+	        int nCurY = 0;
+
+	        for( int i = 0; i < LOOP_POINT_COUNT; i++ )
+	        {
+		        nCurX = loop_point_array_[i].X + nDisX;
+		        nCurY = loop_point_array_[i].Y + nDisY;
+
+                if (nCurX > ((int)graph_width_ - CONTROL_BORDER))
+                {
+                    nCurX = ((int)graph_width_ - CONTROL_BORDER);
+		        }
+		        else if( nCurX < 0 ){
+			        nCurX = 0;
+		        }
+                nDisX = nCurX - loop_point_array_[i].X;
+
+                if (nCurY > ((int)graph_heigh_ - CONTROL_BORDER))
+                {
+                    nCurY = ((int)graph_heigh_ - CONTROL_BORDER);
+		        }
+		        else if( nCurY < 0 )
+                {
+			        nCurY = 0 ;
+		        }
+                nDisY = nCurY -loop_point_array_[i].Y;
+	        }
+        }
+
+        private bool GetEditIsCross( int nPtIndex, Point ptMouse )
+        {
+	        int nMaxIndex = LOOP_POINT_COUNT - 1;
+
+	        bool bCross = false;
+	        bool bCross1, bCross2;
+
+	        Point ptEdge1Start, ptEdge1End;
+	        Point ptEdge2Start, ptEdge2End;
+
+	        Point ptStart, ptEnd;
+
+	        // 移动起点
+	        if( nPtIndex == 0 )
+	        {
+		        ptStart = loop_point_array_[1];
+		        ptEnd = ptStart;
+
+		        // 第一条边
+		        ptEdge1Start = ptMouse;
+		        ptEdge1End   = loop_point_array_[1];
+
+                for (int i = 2; i < LOOP_POINT_COUNT; i++)
+		        {
+			        ptEnd = loop_point_array_[i];
+			        bCross = GetLineIsCross(ptEdge1Start, ptEdge1End, ptStart, ptEnd);
+
+			        if( bCross )
+			        {
+				        break;
+			        }
+
+			        ptStart = ptEnd;
+		        }
+	        } // 移动终点
+	        else if( nPtIndex == nMaxIndex )
+	        {
+		        ptStart = loop_point_array_[0];
+		        ptEnd = ptStart;
+
+		        // 第一条边
+		        ptEdge1Start = loop_point_array_[nMaxIndex - 1];
+		        ptEdge1End   = ptMouse;
+
+		        for( int i = 1; i < nMaxIndex; i++ )
+		        {
+			        ptEnd = loop_point_array_[i];
+			        bCross = GetLineIsCross(ptEdge1Start, ptEdge1End, ptStart, ptEnd);
+
+			        if( bCross )
+			        {
+				        break;
+			        }
+
+			        ptStart = ptEnd;
+		        }
+	        }
+	        else
+	        {
+		        ptStart = loop_point_array_[0];
+		        ptEnd = ptStart;
+
+		        // 第一条边
+		        ptEdge1Start = loop_point_array_[nPtIndex-1];
+		        ptEdge1End   = ptMouse;
+
+		        // 第二条边
+		        ptEdge2Start = ptMouse;
+		        ptEdge2End   = loop_point_array_[nPtIndex + 1];
+
+                for (int i = 1; i < LOOP_POINT_COUNT; i++)
+		        {
+                    ptEnd = loop_point_array_[i];
+
+			        if( (i == nPtIndex) || (i == (nPtIndex + 1)) )
+			        {
+				        ptStart = ptEnd;
+				        continue;
+			        }
+        			
+			        bCross1 = GetLineIsCross(ptEdge1Start, ptEdge1End, ptStart, ptEnd);
+			        bCross2 = GetLineIsCross(ptEdge2Start, ptEdge2End, ptStart, ptEnd);
+
+			        if( bCross1 || bCross2 )
+			        {
+				        bCross = true;
+				        break;
+			        }
+
+			        ptStart = ptEnd;
+		        }
+	        }
+
+	        return bCross;
+        }
+
+        private bool GetLineIsCross(Point ptMa, Point ptMb, Point ptNa, Point ptNb)
+        {
+	        double dbV1, dbV2, dbV3, dbV4;
+
+            dbV1 = (ptMb.X - ptMa.X) * (ptNb.Y - ptMa.Y) - (ptMb.Y - ptMa.Y) * (ptNb.X - ptMa.X);
+            dbV2 = (ptMb.X - ptMa.X) * (ptNa.Y - ptMa.Y) - (ptMb.Y - ptMa.Y) * (ptNa.X - ptMa.X);
+
+	        double dbResult1 = dbV1 * dbV2;
+	        if( dbResult1 >= 0 )
+	        {
+		        return false;
+	        }
+
+            dbV3 = (ptNb.X - ptNa.X) * (ptMb.Y - ptNa.Y) - (ptNb.Y - ptNa.Y) * (ptMb.X - ptNa.X);
+            dbV4 = (ptNb.X - ptNa.X) * (ptMa.Y - ptNa.Y) - (ptNb.Y - ptNa.Y) * (ptMa.X - ptNa.X);
+
+	        double dbResult2 = dbV3 * dbV4;
+	        if( dbResult2 >= 0 )
+	        {
+		        return false;
+	        }
+
+	        return true;
+        }
+
+        private Point GetInBoundPoint( Point pt )
+        {
+	        Point ptResult = pt;
+        	
+	        if( ptResult.X < 0 )
+	        {
+		        ptResult.X = 0;
+	        }
+
+	        if( ptResult.X > ((int)graph_width_ - CONTROL_BORDER) )
+	        {
+		        ptResult.X = (int)graph_width_ - CONTROL_BORDER;
+	        }
+
+	        if( ptResult.Y < 0 )
+	        {
+                ptResult.Y = 0;
+	        }
+
+            if (ptResult.Y > ((int)graph_heigh_ - CONTROL_BORDER))
+	        {
+                ptResult.Y = (int)graph_heigh_ - CONTROL_BORDER;
+	        }
+
+	        return ptResult;
+        }
+
+        private void EnableLoopParamCtrl(bool enable)
+        {
+            txtMinWidth.Enabled = enable;
+            txtMaxWidth.Enabled = enable;
+            txtTimes.Enabled = enable;
+            cmbDir.Enabled = enable;
+            chkDraw.Enabled = enable;
+            chkEnable.Enabled = enable;
+        }
+
+        // 删除线圈
+        private void btnDeleRule_Click(object sender, EventArgs e)
+        {
+            loops_.uNumVirtualLoop = 0;
+
+            for ( int i = 0; i < LOOP_POINT_COUNT; i++ )
+            {
+                loop_point_array_[i].X = 0;
+                loop_point_array_[i].Y = 0;
+            }
+
+            EnableLoopParamCtrl(false);
+        }
+
+        private void LoadLoopParam()
+        {
+            
+
+            string rule_name = loops_.struLoop[0].strName;
+            txtRuleName.Text = rule_name;
+
+            uint time_gap = loops_.struLoop[0].uTriggerTimeGap;
+            txtTimes.Text = time_gap.ToString();
+
+            if (loops_.struLoop[0].byDraw == 1)
+            {
+                chkDraw.Checked = true;
+            }
+
+            if (loops_.struLoop[0].byEnable == 1)
+            {
+                chkEnable.Checked = true;
+            }
+
+            uint min_lp_width = loops_.struLoop[0].uMinLPWidth;
+            uint max_lp_width = loops_.struLoop[0].uMaxLPWidth;
+
+            txtMinWidth.Text = min_lp_width.ToString();
+            txtMaxWidth.Text = max_lp_width.ToString();
+
+            uint cross_dir = loops_.struLoop[0].eCrossDir;
+            if (cross_dir >= 0 && cross_dir < 3)
+            {
+                cmbDir.SelectedIndex = (int)cross_dir;
+            }
+            else
+            {
+                cmbDir.SelectedIndex = 0;
+            }
+        }
+
+        // 添加线圈的功能
+        private void btnAddRule_Click(object sender, EventArgs e)
+        {
+            if (loops_.uNumVirtualLoop >= 1)
+            {
+                MessageBox.Show("只允许配置一个虚拟线圈!");
+                return;
+            }
+
+            int RULE_GRAPH_BORDER = 100;
+
+            int nWidth = (int)graph_width_;
+            int nHeight = (int)graph_heigh_;
+
+            int nMaxWidth = nWidth - RULE_GRAPH_BORDER;
+            int nMaxHeight = nHeight - RULE_GRAPH_BORDER;
+
+            Point pt1 = new Point(RULE_GRAPH_BORDER,RULE_GRAPH_BORDER + nMaxHeight / 2  );
+            Point pt2 = new Point(nWidth - RULE_GRAPH_BORDER, RULE_GRAPH_BORDER + nMaxHeight/2);
+            Point pt3 = new Point(nWidth - RULE_GRAPH_BORDER, nHeight - RULE_GRAPH_BORDER);
+            Point pt4 = new Point(RULE_GRAPH_BORDER, nMaxHeight);
+
+            loop_point_array_[0] = pt1;
+            loop_point_array_[1] = pt2;
+            loop_point_array_[2] = pt3;
+            loop_point_array_[3] = pt4;
+
+            loops_.uNumVirtualLoop = 1;
+
+            loops_.struLoop[0].strName = "电子线圈";
+            loops_.struLoop[0].eCrossDir = 0;
+            loops_.struLoop[0].uTriggerTimeGap = 10;
+            loops_.struLoop[0].byDraw = 1;
+            loops_.struLoop[0].byEnable = 1;
+            loops_.struLoop[0].uMinLPWidth = 45;
+            loops_.struLoop[0].uMaxLPWidth = 600;
+            loops_.uNumVirtualLoop = 1;
+
+            LoadLoopParam();
+
+            EnableLoopParamCtrl(true);
+        }
+
+        private void btnROI_Click(object sender, EventArgs e)
+        {
+            VzClientSDK.VZ_LPRC_ROI_EX struROI = new VzClientSDK.VZ_LPRC_ROI_EX();
+
+            int nRet = VzClientSDK.VzLPRClient_GetRegionOfInterestEx(lpr_handle_, ref struROI);
+            if (nRet == 0)
+            {
+
+            }
+
+        }
+           
+
+    }
+}

+ 315 - 0
parkMonitor/view/FormModbus/RuleCfg_Form.designer.cs

@@ -0,0 +1,315 @@
+namespace VzClientSDKDemo
+{
+    partial class RuleCfg_Form
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.picBoxVideo = new System.Windows.Forms.PictureBox();
+            this.btnAddRule = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.txtRuleName = new System.Windows.Forms.TextBox();
+            this.txtMinWidth = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.chkEnable = new System.Windows.Forms.CheckBox();
+            this.chkDraw = new System.Windows.Forms.CheckBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.txtMaxWidth = new System.Windows.Forms.TextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.txtTimes = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.cmbDir = new System.Windows.Forms.ComboBox();
+            this.btnSave = new System.Windows.Forms.Button();
+            this.btnDeleRule = new System.Windows.Forms.Button();
+            this.btnROI = new System.Windows.Forms.Button();
+            ((System.ComponentModel.ISupportInitialize)(this.picBoxVideo)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // picBoxVideo
+            // 
+            this.picBoxVideo.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.picBoxVideo.Location = new System.Drawing.Point(12, 38);
+            this.picBoxVideo.Name = "picBoxVideo";
+            this.picBoxVideo.Size = new System.Drawing.Size(793, 515);
+            this.picBoxVideo.TabIndex = 1;
+            this.picBoxVideo.TabStop = false;
+            this.picBoxVideo.MouseMove += new System.Windows.Forms.MouseEventHandler(this.picBoxVideo_MouseMove);
+            this.picBoxVideo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.picBoxVideo_MouseDown);
+            this.picBoxVideo.MouseUp += new System.Windows.Forms.MouseEventHandler(this.picBoxVideo_MouseUp);
+            // 
+            // btnAddRule
+            // 
+            this.btnAddRule.Location = new System.Drawing.Point(12, 9);
+            this.btnAddRule.Name = "btnAddRule";
+            this.btnAddRule.Size = new System.Drawing.Size(75, 23);
+            this.btnAddRule.TabIndex = 2;
+            this.btnAddRule.Text = "添加线圈";
+            this.btnAddRule.UseVisualStyleBackColor = true;
+            this.btnAddRule.Click += new System.EventHandler(this.btnAddRule_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(817, 49);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(53, 12);
+            this.label1.TabIndex = 3;
+            this.label1.Text = "规则名称";
+            // 
+            // txtRuleName
+            // 
+            this.txtRuleName.Enabled = false;
+            this.txtRuleName.Location = new System.Drawing.Point(881, 45);
+            this.txtRuleName.Name = "txtRuleName";
+            this.txtRuleName.Size = new System.Drawing.Size(120, 21);
+            this.txtRuleName.TabIndex = 4;
+            // 
+            // txtMinWidth
+            // 
+            this.txtMinWidth.Location = new System.Drawing.Point(900, 136);
+            this.txtMinWidth.Name = "txtMinWidth";
+            this.txtMinWidth.Size = new System.Drawing.Size(35, 21);
+            this.txtMinWidth.TabIndex = 6;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(817, 142);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(77, 12);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "车牌宽度限制";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Enabled = false;
+            this.label3.Location = new System.Drawing.Point(817, 83);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(59, 12);
+            this.label3.TabIndex = 7;
+            this.label3.Text = "是否检测 ";
+            // 
+            // chkEnable
+            // 
+            this.chkEnable.AutoSize = true;
+            this.chkEnable.Enabled = false;
+            this.chkEnable.Location = new System.Drawing.Point(881, 82);
+            this.chkEnable.Name = "chkEnable";
+            this.chkEnable.Size = new System.Drawing.Size(36, 16);
+            this.chkEnable.TabIndex = 8;
+            this.chkEnable.Text = "是";
+            this.chkEnable.UseVisualStyleBackColor = true;
+            // 
+            // chkDraw
+            // 
+            this.chkDraw.AutoSize = true;
+            this.chkDraw.Enabled = false;
+            this.chkDraw.Location = new System.Drawing.Point(881, 110);
+            this.chkDraw.Name = "chkDraw";
+            this.chkDraw.Size = new System.Drawing.Size(36, 16);
+            this.chkDraw.TabIndex = 10;
+            this.chkDraw.Text = "是";
+            this.chkDraw.UseVisualStyleBackColor = true;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Enabled = false;
+            this.label4.Location = new System.Drawing.Point(817, 111);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(53, 12);
+            this.label4.TabIndex = 9;
+            this.label4.Text = "是否绘制";
+            // 
+            // txtMaxWidth
+            // 
+            this.txtMaxWidth.Location = new System.Drawing.Point(958, 136);
+            this.txtMaxWidth.Name = "txtMaxWidth";
+            this.txtMaxWidth.Size = new System.Drawing.Size(35, 21);
+            this.txtMaxWidth.TabIndex = 11;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(941, 140);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(11, 12);
+            this.label5.TabIndex = 12;
+            this.label5.Text = "-";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(1003, 140);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(53, 12);
+            this.label6.TabIndex = 13;
+            this.label6.Text = "(45-600)";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(817, 173);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(125, 12);
+            this.label7.TabIndex = 14;
+            this.label7.Text = "相同车牌触发间隔时间";
+            // 
+            // txtTimes
+            // 
+            this.txtTimes.Location = new System.Drawing.Point(948, 168);
+            this.txtTimes.Name = "txtTimes";
+            this.txtTimes.Size = new System.Drawing.Size(35, 21);
+            this.txtTimes.TabIndex = 15;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(993, 173);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(65, 12);
+            this.label8.TabIndex = 16;
+            this.label8.Text = "秒 (0-255)";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(817, 207);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(77, 12);
+            this.label9.TabIndex = 17;
+            this.label9.Text = "车辆通过方向";
+            // 
+            // cmbDir
+            // 
+            this.cmbDir.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cmbDir.FormattingEnabled = true;
+            this.cmbDir.Items.AddRange(new object[] {
+            "双向",
+            "由上至下",
+            "从下至上"});
+            this.cmbDir.Location = new System.Drawing.Point(900, 204);
+            this.cmbDir.Name = "cmbDir";
+            this.cmbDir.Size = new System.Drawing.Size(80, 20);
+            this.cmbDir.TabIndex = 18;
+            // 
+            // btnSave
+            // 
+            this.btnSave.Location = new System.Drawing.Point(900, 238);
+            this.btnSave.Name = "btnSave";
+            this.btnSave.Size = new System.Drawing.Size(52, 23);
+            this.btnSave.TabIndex = 19;
+            this.btnSave.Text = "保存";
+            this.btnSave.UseVisualStyleBackColor = true;
+            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+            // 
+            // btnDeleRule
+            // 
+            this.btnDeleRule.Location = new System.Drawing.Point(101, 9);
+            this.btnDeleRule.Name = "btnDeleRule";
+            this.btnDeleRule.Size = new System.Drawing.Size(75, 23);
+            this.btnDeleRule.TabIndex = 20;
+            this.btnDeleRule.Text = "删除线圈";
+            this.btnDeleRule.UseVisualStyleBackColor = true;
+            this.btnDeleRule.Click += new System.EventHandler(this.btnDeleRule_Click);
+            // 
+            // btnROI
+            // 
+            this.btnROI.Location = new System.Drawing.Point(206, 9);
+            this.btnROI.Name = "btnROI";
+            this.btnROI.Size = new System.Drawing.Size(102, 23);
+            this.btnROI.TabIndex = 21;
+            this.btnROI.Text = "获取识别区域";
+            this.btnROI.UseVisualStyleBackColor = true;
+            this.btnROI.Click += new System.EventHandler(this.btnROI_Click);
+            // 
+            // RuleCfg_Form
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1066, 557);
+            this.Controls.Add(this.btnROI);
+            this.Controls.Add(this.btnDeleRule);
+            this.Controls.Add(this.btnSave);
+            this.Controls.Add(this.cmbDir);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.txtTimes);
+            this.Controls.Add(this.label7);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.txtMaxWidth);
+            this.Controls.Add(this.chkDraw);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.chkEnable);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.txtMinWidth);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.txtRuleName);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.btnAddRule);
+            this.Controls.Add(this.picBoxVideo);
+            this.MaximizeBox = false;
+            this.Name = "RuleCfg_Form";
+            this.Text = "规则配置";
+            this.Load += new System.EventHandler(this.RuleCfg_Form_Load);
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.RuleCfg_Form_FormClosed);
+            ((System.ComponentModel.ISupportInitialize)(this.picBoxVideo)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.PictureBox picBoxVideo;
+        private System.Windows.Forms.Button btnAddRule;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox txtRuleName;
+        private System.Windows.Forms.TextBox txtMinWidth;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.CheckBox chkEnable;
+        private System.Windows.Forms.CheckBox chkDraw;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.TextBox txtMaxWidth;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.TextBox txtTimes;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.ComboBox cmbDir;
+        private System.Windows.Forms.Button btnSave;
+        private System.Windows.Forms.Button btnDeleRule;
+        private System.Windows.Forms.Button btnROI;
+    }
+}

+ 120 - 0
parkMonitor/view/FormModbus/RuleCfg_Form.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 65 - 0
parkMonitor/view/FormModbus/StrToJson.cs

@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PLC_Communication
+{
+    /// <summary>
+    /// Json测试
+    /// </summary>
+    public class JsonTest 
+    {
+        public void Run()
+        {
+            PLC_Retured_value Retured_value = new PLC_Retured_value();
+            Retured_value.Adress = "";
+            Retured_value.Value = "";
+
+            //实体序列化和反序列化
+            string json1 = JsonHelper.SerializeObject(Retured_value);
+
+            PLC_Retured_value Retured_value_Read = JsonHelper.DeserializeJsonToObject<PLC_Retured_value>(json1);
+
+            //实体集合序列化和反序列化
+            List<PLC_Retured_value> Retured_v = new List<PLC_Retured_value>() { Retured_value };
+            string json2 = JsonHelper.SerializeObject(Retured_v);
+            //json: [{"ID":1,"Name":"陈晨","NickName":"石子儿"}]
+            List<PLC_Retured_value> Retured_v2 = JsonHelper.DeserializeJsonToList<PLC_Retured_value>(json2);
+        }
+
+    }
+    
+    /// <summary>
+    /// 信息实体
+    /// </summary>
+    public class PLC_Retured_value
+    {
+        public string Adress { get; set; }
+        public string Value { get; set; }
+       // public string NickName { get; set; }
+       // public Class Class { get; set; }
+    }
+
+    public class Lic_Retured_value
+    {
+        public string Licence_Num { get; set; }
+        public string Image_path { get; set; }
+
+        public string Time_income { get; set; }
+
+        // public string NickName { get; set; }
+        // public Class Class { get; set; }
+    }
+
+    /// <summary>
+    /// 数据实体
+    /// </summary>
+    public class Class
+    {
+        public string ID { get; set; }
+        public string Value { get; set; }
+    }
+}

+ 614 - 0
parkMonitor/view/FormModbus/VideoCfg_Form.cs

@@ -0,0 +1,614 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace VzClientSDKDemo
+{
+    public partial class VideoCfg_Form : Form
+    {
+        private int m_hLPRClient = 0;
+        private int m_board_type = 0;
+
+        public VideoCfg_Form()
+        {
+            InitializeComponent();
+        }
+
+        public void SetLPRHandle(int hLPRClient)
+        {
+            m_hLPRClient = hLPRClient;
+        }
+
+        private void LoadVideoSource( )
+        {
+            if(m_board_type == 2)
+            {
+                tbar_bright.SetRange(0, 255);
+                tbar_contrast.SetRange(0, 255);
+                tbar_saturation.SetRange(0, 255);
+                tbar_definition.SetRange(0, 255);
+
+                int brt = 0, cst = 0, sat = 0, hue = 0;
+                int ret = VzClientSDK.VzLPRClient_GetVideoPara(m_hLPRClient, ref brt, ref cst, ref sat, ref hue);
+                if (ret == 0)
+                {
+                    tbar_bright.Value = brt;
+                    tbar_contrast.Value = cst;
+                    tbar_saturation.Value = sat;
+                    tbar_definition.Value = hue;
+
+                    lblBright.Text = brt.ToString();
+                    lblContrast.Text = cst.ToString();
+                    lblSaturation.Text = sat.ToString();
+                    lblDefinition.Text = hue.ToString();
+                }
+
+                label14.Visible             = false;
+                cmb_video_standard.Visible  = false;
+
+                cmb_exposure_time.Items.Clear();
+                cmb_exposure_time.Items.Add("0~3ms");
+                cmb_exposure_time.Items.Add("0~2ms");
+                cmb_exposure_time.Items.Add("0~1ms");
+
+                int shutter = 0;
+                ret = VzClientSDK.VzLPRClient_GetShutter(m_hLPRClient, ref shutter);
+                if (ret == 0)
+                {
+                    if (shutter == 96)
+                    {
+                        cmb_exposure_time.SelectedIndex  = 0;
+                    }
+                    else if (shutter == 64)
+                    {
+                        cmb_exposure_time.SelectedIndex = 1;
+                    }
+                    else if (shutter == 32)
+                    {
+                        cmb_exposure_time.SelectedIndex = 2;
+                    }
+                }
+
+                int flip = 0;
+                ret = VzClientSDK.VzLPRClient_GetFlip(m_hLPRClient, ref flip);
+                if (ret == 0)
+                {
+                    cmb_img_pos.SelectedIndex = flip;
+                }
+               
+                int nMode = 0, nStrength = 0;
+                int nRet = VzClientSDK.VzLPRClient_GetDenoise(m_hLPRClient, ref nMode, ref nStrength);
+                if (nMode >= 0 && nStrength >= 0)
+                {
+                    m_cmbDeNoiseMode.SelectedIndex  = nMode;
+                    m_cmbDeNoiseLenth.SelectedIndex = nStrength;
+                }
+            }
+            else
+            {
+                int brt = 0, cst = 0, sat = 0, hue = 0;
+                int ret = VzClientSDK.VzLPRClient_GetVideoPara(m_hLPRClient, ref brt, ref cst, ref sat, ref hue);
+                if (ret == 0)
+                {
+                    tbar_bright.Value = brt;
+                    tbar_contrast.Value = cst;
+                    tbar_saturation.Value = sat;
+                    tbar_definition.Value = hue;
+
+                    lblBright.Text = brt.ToString();
+                    lblContrast.Text = cst.ToString();
+                    lblSaturation.Text = sat.ToString();
+                    lblDefinition.Text = hue.ToString();
+                }
+
+                int frequency = 0;
+                ret = VzClientSDK.VzLPRClient_GetFrequency(m_hLPRClient, ref frequency);
+                if (ret == 0)
+                {
+                    cmb_video_standard.SelectedIndex = frequency;
+                }
+
+                int shutter = 0;
+                ret = VzClientSDK.VzLPRClient_GetShutter(m_hLPRClient, ref shutter);
+                if (ret == 0)
+                {
+                    if (shutter == 2)
+                    {
+                        cmb_exposure_time.SelectedIndex = 0;
+                    }
+                    else if (shutter == 3)
+                    {
+                        cmb_exposure_time.SelectedIndex = 1;
+                    }
+                    else if (shutter == 4)
+                    {
+                        cmb_exposure_time.SelectedIndex = 2;
+                    }
+                }
+
+                int flip = 0;
+                ret = VzClientSDK.VzLPRClient_GetFlip(m_hLPRClient, ref flip);
+                if (ret == 0)
+                {
+                    cmb_img_pos.SelectedIndex = flip;
+                }
+            }
+        }
+
+        private void LoadVideoCfg()
+        {
+            string strRateval = "512";
+
+            if (m_hLPRClient > 0)
+            {
+                int nSizeVal = 0, nRateval = 0, nEncodeType = 0, modeval = 0, bitval = 0, ratelist = 0, levelval = 0;
+                int ret = -1; 
+
+                if (m_board_type == 2)
+                {
+                    cmb_frame_size.Items.Clear();
+                    cmb_frame_size.Items.Add("640x360");
+                    cmb_frame_size.Items.Add("720x576");
+                    cmb_frame_size.Items.Add("1280x720");
+                    cmb_frame_size.Items.Add("1920x1080");
+
+                    ret = VzClientSDK.VzLPRClient_GetVideoFrameSizeIndexEx(m_hLPRClient, ref nSizeVal);
+
+                    if (nSizeVal == 41943400)
+                    {
+                        cmb_frame_size.SelectedIndex = 0;
+                    }
+                    else if (nSizeVal == 47186496)
+                    {
+                        cmb_frame_size.SelectedIndex = 1;
+                    }
+                    else if (nSizeVal == 83886800)
+                    {
+                        cmb_frame_size.SelectedIndex = 2;
+                    }
+                    else if (nSizeVal == 125830200)
+                    {
+                        cmb_frame_size.SelectedIndex = 3;
+                    }
+                    else
+                    {
+                        cmb_frame_size.SelectedIndex = 0;
+                    }
+
+                    cmb_encode_type.SelectedIndex = 0;
+                    cmb_encode_type.Items.RemoveAt(1);
+                }
+                else
+                {
+                    ret = VzClientSDK.VzLPRClient_GetVideoEncodeType(m_hLPRClient, ref nEncodeType);
+                    if (ret == 0)
+                    {
+                        if (nEncodeType == 0)
+                        {
+                            cmb_encode_type.SelectedIndex = 0;
+                            cmb_compress_mode.Enabled = true;
+                        }
+                        else
+                        {
+                            cmb_encode_type.SelectedIndex = 1;
+                            cmb_compress_mode.Enabled = false;
+                        }
+                    }
+
+                    ret = VzClientSDK.VzLPRClient_GetVideoFrameSizeIndex(m_hLPRClient, ref nSizeVal);
+
+                    if (ret == 0)
+                    {
+                        if (nSizeVal == 0)
+                        {
+                            cmb_frame_size.SelectedIndex = 1;
+                        }
+                        else if (nSizeVal == 1)
+                        {
+                            cmb_frame_size.SelectedIndex = 0;
+                        }
+                        else
+                        {
+                            cmb_frame_size.SelectedIndex = nSizeVal;
+                        }
+                    }
+                }
+
+                ret = VzClientSDK.VzLPRClient_GetVideoFrameRate(m_hLPRClient, ref nRateval);
+                if (ret == 0 && nRateval > 0)
+                {
+                    cmb_frame_rate.SelectedIndex = nRateval - 1;
+                }
+
+                ret = VzClientSDK.VzLPRClient_GetVideoCompressMode(m_hLPRClient, ref modeval);
+                if (ret == 0)
+                {
+                    cmb_compress_mode.SelectedIndex = modeval;
+
+                    if (modeval == 0)
+                    {
+                        txt_rateval.Enabled = true;
+                    }
+                    else
+                    {
+                        txt_rateval.Enabled = false;
+                    }
+                }
+
+                ret = VzClientSDK.VzLPRClient_GetVideoCBR(m_hLPRClient, ref bitval, ref ratelist);
+                if (ret == 0)
+                {
+                    strRateval = bitval.ToString();
+                }
+
+                ret = VzClientSDK.VzLPRClient_GetVideoVBR(m_hLPRClient, ref levelval);
+                if (ret == 0)
+                {
+                    cmb_img_quality.SelectedIndex = levelval;
+                }
+            }
+
+            txt_rateval.Text = strRateval;
+        }
+
+        private void btnSave_Click(object sender, EventArgs e)
+        {
+            string sRateVal = txt_rateval.Text.ToString();
+            int nRate = Int32.Parse(sRateVal);
+
+            int ret = -1;
+
+            int nSizeVal = cmb_frame_size.SelectedIndex;
+
+            if (m_board_type == 2)
+            {
+                if (nRate < 512 || nRate > 5000)
+                {
+                    MessageBox.Show("码流范围为512-5000,请重新输入!");
+                    return;
+                }
+
+                switch (nSizeVal)
+                {
+                    case 0:
+                        nSizeVal = 41943400; break;
+                    case 1:
+                        nSizeVal = 47186496; break;
+                    case 2:
+                        nSizeVal = 83886800; break;
+                    case 3:
+                        nSizeVal = 125830200; break;
+                    default:
+                        break;
+                }
+
+                ret = VzClientSDK.VzLPRClient_SetVideoFrameSizeIndexEx(m_hLPRClient, nSizeVal);
+                if (ret != 0)
+                {
+                    MessageBox.Show("设置分辨率失败,请重试!");
+                    return;
+                }
+            }
+            else
+            {
+                if (nRate <= 99 || nRate > 5000)
+                {
+                    MessageBox.Show("码流范围为100-5000,请重新输入!");
+                    return;
+                }
+
+                if (nSizeVal == 0)
+                {
+                    nSizeVal = 1;
+                }
+                else if (nSizeVal == 1)
+                {
+                    nSizeVal = 0;
+                }
+
+
+                ret = VzClientSDK.VzLPRClient_SetVideoFrameSizeIndex(m_hLPRClient, nSizeVal);
+                if (ret != 0)
+                {
+                    MessageBox.Show("设置分辨率失败,请重试!");
+                    return;
+                }
+            }
+            
+            int nRateval = cmb_frame_rate.SelectedIndex + 1;
+            ret = VzClientSDK.VzLPRClient_SetVideoFrameRate(m_hLPRClient, nRateval);
+            if (ret != 0)
+            {
+                MessageBox.Show("设置帧率失败,请重试!");
+                return;
+            }
+
+            int nEncodeType = (cmb_encode_type.SelectedIndex == 0) ? 0 : 2;
+            ret = VzClientSDK.VzLPRClient_SetVideoEncodeType(m_hLPRClient, nEncodeType);
+            if (ret != 0)
+            {
+                MessageBox.Show("设置编码方式失败,请重试!");
+                return;
+            }
+
+            if (cmb_compress_mode.Enabled)
+            {
+                int modeval = cmb_compress_mode.SelectedIndex;
+                ret = VzClientSDK.VzLPRClient_SetVideoCompressMode(m_hLPRClient, modeval);
+                if (ret != 0)
+                {
+                    MessageBox.Show("设置码流控制失败,请重试!");
+                    return;
+                }
+            }
+
+            int level = cmb_img_quality.SelectedIndex;
+            ret = VzClientSDK.VzLPRClient_SetVideoVBR(m_hLPRClient, level);
+            if (ret != 0)
+            {
+                MessageBox.Show("设置图像质量失败,请重试!");
+                return;
+            }
+
+            if (txt_rateval.Enabled)
+            {
+                ret = VzClientSDK.VzLPRClient_SetVideoCBR(m_hLPRClient, nRate);
+                if (ret != 0)
+                {
+                    MessageBox.Show("设置码流上限失败,请重试!");
+                    return;
+                }
+            }
+
+            MessageBox.Show("设置成功!");
+        }
+
+        private async void VideoCfg_Form_Load(object sender, EventArgs e)
+        {
+            VzClientSDK.VzLPRClient_GetHwBoardType(m_hLPRClient, ref m_board_type);
+
+           // await Task.Factory.StartNew(async() => { await load01(); });
+            
+            LoadVideoCfg();
+            Application.DoEvents();
+            LoadVideoSource();
+            Application.DoEvents();
+        }
+        private  Task load01()
+        {
+           return Task.Factory.StartNew(()=> {  });
+        }
+       
+
+        private void cmb_encode_type_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int nCurSel = cmb_encode_type.SelectedIndex;
+            if (nCurSel == 0)
+            {
+                cmb_compress_mode.Enabled = true;
+            }
+            else
+            {
+                cmb_compress_mode.Enabled = false;
+            }
+        }
+
+        private void cmb_compress_mode_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (cmb_compress_mode.Enabled)
+            {
+                int nCurSel = cmb_compress_mode.SelectedIndex;
+                if (nCurSel == 0)
+                {
+                    txt_rateval.Enabled = true;
+                }
+                else
+                {
+                    txt_rateval.Enabled = false;
+                }
+            }
+            else
+            {
+                txt_rateval.Enabled = false;
+            }
+        }
+
+        private void btnRecovery_Click(object sender, EventArgs e)
+        {
+            if (m_board_type == 2)
+            {
+                int brt = 128;
+                tbar_bright.Value = brt;
+
+                int cst = 138;
+                tbar_contrast.Value = cst;
+
+                int sat = 128;
+                tbar_saturation.Value = sat;
+
+                int hue = 140;
+                tbar_definition.Value = hue;
+
+                VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+
+                VzClientSDK.VzLPRClient_SetShutter(m_hLPRClient, 96);
+                cmb_exposure_time.SelectedIndex = 0;
+
+                VzClientSDK.VzLPRClient_SetFlip(m_hLPRClient, 0);
+                cmb_img_pos.SelectedIndex = 0;
+
+                VzClientSDK.VzLPRClient_SetDenoise(m_hLPRClient, 3, 2);
+                m_cmbDeNoiseMode.SelectedIndex = 3;
+                m_cmbDeNoiseLenth.SelectedIndex = 2;
+
+                lblBright.Text = brt.ToString();
+                lblContrast.Text = cst.ToString();
+                lblSaturation.Text = sat.ToString();
+                lblDefinition.Text = hue.ToString();
+            }
+            else
+            {
+                int brt = 50;
+                tbar_bright.Value = brt;
+
+                int cst = 40;
+                tbar_contrast.Value = cst;
+
+                int sat = 30;
+                tbar_saturation.Value = sat;
+
+                int hue = 50;
+                tbar_definition.Value = hue;
+                VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+
+                VzClientSDK.VzLPRClient_SetFrequency(m_hLPRClient, 1);
+                cmb_video_standard.SelectedIndex = 1;
+
+                VzClientSDK.VzLPRClient_SetShutter(m_hLPRClient, 3);
+                cmb_exposure_time.SelectedIndex = 1;
+
+                VzClientSDK.VzLPRClient_SetFlip(m_hLPRClient, 0);
+                cmb_img_pos.SelectedIndex = 0;
+
+                lblBright.Text = brt.ToString();
+                lblContrast.Text = cst.ToString();
+                lblSaturation.Text = sat.ToString();
+                lblDefinition.Text = hue.ToString();
+            }
+        }
+
+        private void tbar_bright_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int hue = tbar_definition.Value;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+            lblDefinition.Text = hue.ToString();
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+        }
+
+        private void tbar_contrast_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int hue = tbar_definition.Value;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+            lblDefinition.Text = hue.ToString();
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+        }
+
+        private void tbar_saturation_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int hue = tbar_definition.Value;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+            lblDefinition.Text = hue.ToString();
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+        }
+
+        private void tbar_definition_MouseUp(object sender, MouseEventArgs e)
+        {
+            int brt = tbar_bright.Value;
+            int cst = tbar_contrast.Value;
+            int sat = tbar_saturation.Value;
+            int hue = tbar_definition.Value;
+
+            lblBright.Text = brt.ToString();
+            lblContrast.Text = cst.ToString();
+            lblSaturation.Text = sat.ToString();
+            lblDefinition.Text = hue.ToString();
+
+            VzClientSDK.VzLPRClient_SetVideoPara(m_hLPRClient, brt, cst, sat, hue);
+        }
+
+        private void cmb_video_standard_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int frequency = cmb_video_standard.SelectedIndex;
+            int ret = VzClientSDK.VzLPRClient_SetFrequency(m_hLPRClient, frequency);
+        }
+
+        private void cmb_exposure_time_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (m_board_type == 2)
+            {
+                int shutter = 0;
+                int curSel = cmb_exposure_time.SelectedIndex;
+                if (curSel == 0)
+                {
+                    shutter = 96;
+                }
+                else if (curSel == 1)
+                {
+                    shutter = 64;
+                }
+                else if (curSel == 2)
+                {
+                    shutter = 32;
+                }
+
+                int ret = VzClientSDK.VzLPRClient_SetShutter(m_hLPRClient, shutter);
+            }
+            else
+            {
+                int shutter = 0;
+                int curSel = cmb_exposure_time.SelectedIndex;
+                if (curSel == 0)
+                {
+                    shutter = 2;
+                }
+                else if (curSel == 1)
+                {
+                    shutter = 3;
+                }
+                else if (curSel == 2)
+                {
+                    shutter = 4;
+                }
+
+                int ret = VzClientSDK.VzLPRClient_SetShutter(m_hLPRClient, shutter);
+            }
+        }
+
+        private void cmb_img_pos_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int flip = cmb_img_pos.SelectedIndex;
+            int ret = VzClientSDK.VzLPRClient_SetFlip(m_hLPRClient, flip);
+        }
+
+        private void m_cmbDeNoiseMode_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int mode = m_cmbDeNoiseMode.SelectedIndex;
+            int strength = m_cmbDeNoiseLenth.SelectedIndex;
+            int ret = VzClientSDK.VzLPRClient_SetDenoise(m_hLPRClient, mode, strength);	
+        }
+
+        private void m_cmbDeNoiseLenth_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            int mode = m_cmbDeNoiseMode.SelectedIndex;
+            int strength = m_cmbDeNoiseLenth.SelectedIndex;
+            int ret = VzClientSDK.VzLPRClient_SetDenoise(m_hLPRClient, mode, strength);	
+        }
+    }
+}

+ 665 - 0
parkMonitor/view/FormModbus/VideoCfg_Form.designer.cs

@@ -0,0 +1,665 @@
+namespace VzClientSDKDemo
+{
+    partial class VideoCfg_Form
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.cmb_img_quality = new System.Windows.Forms.ComboBox();
+            this.label11 = new System.Windows.Forms.Label();
+            this.btnSave = new System.Windows.Forms.Button();
+            this.txt_rateval = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
+            this.cmb_compress_mode = new System.Windows.Forms.ComboBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.cmb_encode_type = new System.Windows.Forms.ComboBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.cmb_frame_rate = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.cmb_frame_size = new System.Windows.Forms.ComboBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.tabPage2 = new System.Windows.Forms.TabPage();
+            this.m_cmbDeNoiseLenth = new System.Windows.Forms.ComboBox();
+            this.label17 = new System.Windows.Forms.Label();
+            this.m_cmbDeNoiseMode = new System.Windows.Forms.ComboBox();
+            this.label18 = new System.Windows.Forms.Label();
+            this.btnRecovery = new System.Windows.Forms.Button();
+            this.cmb_img_pos = new System.Windows.Forms.ComboBox();
+            this.label16 = new System.Windows.Forms.Label();
+            this.cmb_exposure_time = new System.Windows.Forms.ComboBox();
+            this.label15 = new System.Windows.Forms.Label();
+            this.cmb_video_standard = new System.Windows.Forms.ComboBox();
+            this.label14 = new System.Windows.Forms.Label();
+            this.tbar_definition = new System.Windows.Forms.TrackBar();
+            this.label13 = new System.Windows.Forms.Label();
+            this.tbar_saturation = new System.Windows.Forms.TrackBar();
+            this.label12 = new System.Windows.Forms.Label();
+            this.tbar_contrast = new System.Windows.Forms.TrackBar();
+            this.label10 = new System.Windows.Forms.Label();
+            this.tbar_bright = new System.Windows.Forms.TrackBar();
+            this.label2 = new System.Windows.Forms.Label();
+            this.comboBox4 = new System.Windows.Forms.ComboBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.comboBox5 = new System.Windows.Forms.ComboBox();
+            this.label6 = new System.Windows.Forms.Label();
+            this.comboBox6 = new System.Windows.Forms.ComboBox();
+            this.label7 = new System.Windows.Forms.Label();
+            this.lblBright = new System.Windows.Forms.Label();
+            this.lblContrast = new System.Windows.Forms.Label();
+            this.lblSaturation = new System.Windows.Forms.Label();
+            this.lblDefinition = new System.Windows.Forms.Label();
+            this.tabControl1.SuspendLayout();
+            this.tabPage1.SuspendLayout();
+            this.tabPage2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_definition)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_saturation)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_contrast)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_bright)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabPage1);
+            this.tabControl1.Controls.Add(this.tabPage2);
+            this.tabControl1.Location = new System.Drawing.Point(12, 12);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(376, 379);
+            this.tabControl1.TabIndex = 0;
+            // 
+            // tabPage1
+            // 
+            this.tabPage1.Controls.Add(this.cmb_img_quality);
+            this.tabPage1.Controls.Add(this.label11);
+            this.tabPage1.Controls.Add(this.btnSave);
+            this.tabPage1.Controls.Add(this.txt_rateval);
+            this.tabPage1.Controls.Add(this.label9);
+            this.tabPage1.Controls.Add(this.cmb_compress_mode);
+            this.tabPage1.Controls.Add(this.label8);
+            this.tabPage1.Controls.Add(this.cmb_encode_type);
+            this.tabPage1.Controls.Add(this.label4);
+            this.tabPage1.Controls.Add(this.cmb_frame_rate);
+            this.tabPage1.Controls.Add(this.label3);
+            this.tabPage1.Controls.Add(this.cmb_frame_size);
+            this.tabPage1.Controls.Add(this.label1);
+            this.tabPage1.Location = new System.Drawing.Point(4, 22);
+            this.tabPage1.Name = "tabPage1";
+            this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage1.Size = new System.Drawing.Size(368, 353);
+            this.tabPage1.TabIndex = 0;
+            this.tabPage1.Text = "主码流";
+            this.tabPage1.UseVisualStyleBackColor = true;
+            // 
+            // cmb_img_quality
+            // 
+            this.cmb_img_quality.FormattingEnabled = true;
+            this.cmb_img_quality.Items.AddRange(new object[] {
+            "最流畅",
+            "较流畅",
+            "流畅",
+            "中等",
+            "清晰",
+            "较清晰",
+            "最清晰"});
+            this.cmb_img_quality.Location = new System.Drawing.Point(78, 143);
+            this.cmb_img_quality.Name = "cmb_img_quality";
+            this.cmb_img_quality.Size = new System.Drawing.Size(121, 20);
+            this.cmb_img_quality.TabIndex = 12;
+            // 
+            // label11
+            // 
+            this.label11.AutoSize = true;
+            this.label11.Location = new System.Drawing.Point(14, 146);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(53, 12);
+            this.label11.TabIndex = 11;
+            this.label11.Text = "图像质量";
+            // 
+            // btnSave
+            // 
+            this.btnSave.Location = new System.Drawing.Point(133, 206);
+            this.btnSave.Name = "btnSave";
+            this.btnSave.Size = new System.Drawing.Size(64, 23);
+            this.btnSave.TabIndex = 10;
+            this.btnSave.Text = "确定";
+            this.btnSave.UseVisualStyleBackColor = true;
+            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
+            // 
+            // txt_rateval
+            // 
+            this.txt_rateval.Location = new System.Drawing.Point(78, 172);
+            this.txt_rateval.Name = "txt_rateval";
+            this.txt_rateval.Size = new System.Drawing.Size(121, 21);
+            this.txt_rateval.TabIndex = 9;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(14, 173);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(53, 12);
+            this.label9.TabIndex = 8;
+            this.label9.Text = "码流上限";
+            // 
+            // cmb_compress_mode
+            // 
+            this.cmb_compress_mode.FormattingEnabled = true;
+            this.cmb_compress_mode.Items.AddRange(new object[] {
+            "定码流",
+            "变码流"});
+            this.cmb_compress_mode.Location = new System.Drawing.Point(78, 115);
+            this.cmb_compress_mode.Name = "cmb_compress_mode";
+            this.cmb_compress_mode.Size = new System.Drawing.Size(121, 20);
+            this.cmb_compress_mode.TabIndex = 7;
+            this.cmb_compress_mode.SelectedIndexChanged += new System.EventHandler(this.cmb_compress_mode_SelectedIndexChanged);
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(14, 118);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(53, 12);
+            this.label8.TabIndex = 6;
+            this.label8.Text = "码流控制";
+            // 
+            // cmb_encode_type
+            // 
+            this.cmb_encode_type.FormattingEnabled = true;
+            this.cmb_encode_type.Items.AddRange(new object[] {
+            "H264",
+            "JPEG"});
+            this.cmb_encode_type.Location = new System.Drawing.Point(79, 81);
+            this.cmb_encode_type.Name = "cmb_encode_type";
+            this.cmb_encode_type.Size = new System.Drawing.Size(121, 20);
+            this.cmb_encode_type.TabIndex = 5;
+            this.cmb_encode_type.SelectedIndexChanged += new System.EventHandler(this.cmb_encode_type_SelectedIndexChanged);
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(15, 84);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(53, 12);
+            this.label4.TabIndex = 4;
+            this.label4.Text = "编码方式";
+            // 
+            // cmb_frame_rate
+            // 
+            this.cmb_frame_rate.FormattingEnabled = true;
+            this.cmb_frame_rate.Items.AddRange(new object[] {
+            "1",
+            "2",
+            "3",
+            "4",
+            "5",
+            "6",
+            "7",
+            "8",
+            "9",
+            "10",
+            "11",
+            "12",
+            "13",
+            "14",
+            "15",
+            "16",
+            "17",
+            "18",
+            "19",
+            "20",
+            "21",
+            "22",
+            "23",
+            "24",
+            "25"});
+            this.cmb_frame_rate.Location = new System.Drawing.Point(79, 48);
+            this.cmb_frame_rate.Name = "cmb_frame_rate";
+            this.cmb_frame_rate.Size = new System.Drawing.Size(121, 20);
+            this.cmb_frame_rate.TabIndex = 3;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(15, 51);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(41, 12);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "帧  率";
+            // 
+            // cmb_frame_size
+            // 
+            this.cmb_frame_size.FormattingEnabled = true;
+            this.cmb_frame_size.Items.AddRange(new object[] {
+            "352x288",
+            "704x576",
+            "1280x720",
+            "1920x1080"});
+            this.cmb_frame_size.Location = new System.Drawing.Point(79, 17);
+            this.cmb_frame_size.Name = "cmb_frame_size";
+            this.cmb_frame_size.Size = new System.Drawing.Size(121, 20);
+            this.cmb_frame_size.TabIndex = 1;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(15, 20);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(41, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "分辨率";
+            // 
+            // tabPage2
+            // 
+            this.tabPage2.Controls.Add(this.lblDefinition);
+            this.tabPage2.Controls.Add(this.lblSaturation);
+            this.tabPage2.Controls.Add(this.lblContrast);
+            this.tabPage2.Controls.Add(this.lblBright);
+            this.tabPage2.Controls.Add(this.m_cmbDeNoiseLenth);
+            this.tabPage2.Controls.Add(this.label17);
+            this.tabPage2.Controls.Add(this.m_cmbDeNoiseMode);
+            this.tabPage2.Controls.Add(this.label18);
+            this.tabPage2.Controls.Add(this.btnRecovery);
+            this.tabPage2.Controls.Add(this.cmb_img_pos);
+            this.tabPage2.Controls.Add(this.label16);
+            this.tabPage2.Controls.Add(this.cmb_exposure_time);
+            this.tabPage2.Controls.Add(this.label15);
+            this.tabPage2.Controls.Add(this.cmb_video_standard);
+            this.tabPage2.Controls.Add(this.label14);
+            this.tabPage2.Controls.Add(this.tbar_definition);
+            this.tabPage2.Controls.Add(this.label13);
+            this.tabPage2.Controls.Add(this.tbar_saturation);
+            this.tabPage2.Controls.Add(this.label12);
+            this.tabPage2.Controls.Add(this.tbar_contrast);
+            this.tabPage2.Controls.Add(this.label10);
+            this.tabPage2.Controls.Add(this.tbar_bright);
+            this.tabPage2.Controls.Add(this.label2);
+            this.tabPage2.Location = new System.Drawing.Point(4, 22);
+            this.tabPage2.Name = "tabPage2";
+            this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage2.Size = new System.Drawing.Size(368, 353);
+            this.tabPage2.TabIndex = 1;
+            this.tabPage2.Text = "视频源";
+            this.tabPage2.UseVisualStyleBackColor = true;
+            // 
+            // m_cmbDeNoiseLenth
+            // 
+            this.m_cmbDeNoiseLenth.FormattingEnabled = true;
+            this.m_cmbDeNoiseLenth.Items.AddRange(new object[] {
+            "自动",
+            "低",
+            "中",
+            "高"});
+            this.m_cmbDeNoiseLenth.Location = new System.Drawing.Point(72, 301);
+            this.m_cmbDeNoiseLenth.Name = "m_cmbDeNoiseLenth";
+            this.m_cmbDeNoiseLenth.Size = new System.Drawing.Size(140, 20);
+            this.m_cmbDeNoiseLenth.TabIndex = 18;
+            this.m_cmbDeNoiseLenth.SelectedIndexChanged += new System.EventHandler(this.m_cmbDeNoiseLenth_SelectedIndexChanged);
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Location = new System.Drawing.Point(11, 304);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(53, 12);
+            this.label17.TabIndex = 17;
+            this.label17.Text = "降噪强度";
+            // 
+            // m_cmbDeNoiseMode
+            // 
+            this.m_cmbDeNoiseMode.FormattingEnabled = true;
+            this.m_cmbDeNoiseMode.Items.AddRange(new object[] {
+            "OFF",
+            "SNF",
+            "TNF",
+            "SNF+TNF"});
+            this.m_cmbDeNoiseMode.Location = new System.Drawing.Point(72, 268);
+            this.m_cmbDeNoiseMode.Name = "m_cmbDeNoiseMode";
+            this.m_cmbDeNoiseMode.Size = new System.Drawing.Size(140, 20);
+            this.m_cmbDeNoiseMode.TabIndex = 16;
+            this.m_cmbDeNoiseMode.SelectedIndexChanged += new System.EventHandler(this.m_cmbDeNoiseMode_SelectedIndexChanged);
+            // 
+            // label18
+            // 
+            this.label18.AutoSize = true;
+            this.label18.Location = new System.Drawing.Point(11, 271);
+            this.label18.Name = "label18";
+            this.label18.Size = new System.Drawing.Size(53, 12);
+            this.label18.TabIndex = 15;
+            this.label18.Text = "降噪模式";
+            // 
+            // btnRecovery
+            // 
+            this.btnRecovery.Location = new System.Drawing.Point(229, 327);
+            this.btnRecovery.Name = "btnRecovery";
+            this.btnRecovery.Size = new System.Drawing.Size(75, 23);
+            this.btnRecovery.TabIndex = 14;
+            this.btnRecovery.Text = "恢复默认";
+            this.btnRecovery.UseVisualStyleBackColor = true;
+            this.btnRecovery.Click += new System.EventHandler(this.btnRecovery_Click);
+            // 
+            // cmb_img_pos
+            // 
+            this.cmb_img_pos.FormattingEnabled = true;
+            this.cmb_img_pos.Items.AddRange(new object[] {
+            "原始图像",
+            "上下翻转",
+            "左右翻转",
+            "中心翻转"});
+            this.cmb_img_pos.Location = new System.Drawing.Point(72, 237);
+            this.cmb_img_pos.Name = "cmb_img_pos";
+            this.cmb_img_pos.Size = new System.Drawing.Size(140, 20);
+            this.cmb_img_pos.TabIndex = 13;
+            this.cmb_img_pos.SelectedIndexChanged += new System.EventHandler(this.cmb_img_pos_SelectedIndexChanged);
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Location = new System.Drawing.Point(11, 240);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(53, 12);
+            this.label16.TabIndex = 12;
+            this.label16.Text = "图像翻转";
+            // 
+            // cmb_exposure_time
+            // 
+            this.cmb_exposure_time.FormattingEnabled = true;
+            this.cmb_exposure_time.Items.AddRange(new object[] {
+            "0~8ms 停车场推荐",
+            "0~4ms",
+            "0~2ms 卡口推荐"});
+            this.cmb_exposure_time.Location = new System.Drawing.Point(72, 204);
+            this.cmb_exposure_time.Name = "cmb_exposure_time";
+            this.cmb_exposure_time.Size = new System.Drawing.Size(140, 20);
+            this.cmb_exposure_time.TabIndex = 11;
+            this.cmb_exposure_time.SelectedIndexChanged += new System.EventHandler(this.cmb_exposure_time_SelectedIndexChanged);
+            // 
+            // label15
+            // 
+            this.label15.AutoSize = true;
+            this.label15.Location = new System.Drawing.Point(11, 207);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(53, 12);
+            this.label15.TabIndex = 10;
+            this.label15.Text = "曝光时间";
+            // 
+            // cmb_video_standard
+            // 
+            this.cmb_video_standard.FormattingEnabled = true;
+            this.cmb_video_standard.Items.AddRange(new object[] {
+            "MaxOrZero",
+            "50Hz",
+            "60Hz"});
+            this.cmb_video_standard.Location = new System.Drawing.Point(72, 172);
+            this.cmb_video_standard.Name = "cmb_video_standard";
+            this.cmb_video_standard.Size = new System.Drawing.Size(140, 20);
+            this.cmb_video_standard.TabIndex = 9;
+            this.cmb_video_standard.SelectedIndexChanged += new System.EventHandler(this.cmb_video_standard_SelectedIndexChanged);
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Location = new System.Drawing.Point(11, 175);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(53, 12);
+            this.label14.TabIndex = 8;
+            this.label14.Text = "视频制式";
+            // 
+            // tbar_definition
+            // 
+            this.tbar_definition.AutoSize = false;
+            this.tbar_definition.Location = new System.Drawing.Point(71, 115);
+            this.tbar_definition.Maximum = 100;
+            this.tbar_definition.Name = "tbar_definition";
+            this.tbar_definition.Size = new System.Drawing.Size(220, 25);
+            this.tbar_definition.TabIndex = 7;
+            this.tbar_definition.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_definition.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_definition_MouseUp);
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Location = new System.Drawing.Point(23, 119);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(41, 12);
+            this.label13.TabIndex = 6;
+            this.label13.Text = "清淅度";
+            // 
+            // tbar_saturation
+            // 
+            this.tbar_saturation.AutoSize = false;
+            this.tbar_saturation.Location = new System.Drawing.Point(71, 83);
+            this.tbar_saturation.Maximum = 100;
+            this.tbar_saturation.Name = "tbar_saturation";
+            this.tbar_saturation.Size = new System.Drawing.Size(220, 25);
+            this.tbar_saturation.TabIndex = 5;
+            this.tbar_saturation.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_saturation.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_saturation_MouseUp);
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Location = new System.Drawing.Point(23, 87);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(41, 12);
+            this.label12.TabIndex = 4;
+            this.label12.Text = "饱和度";
+            // 
+            // tbar_contrast
+            // 
+            this.tbar_contrast.AutoSize = false;
+            this.tbar_contrast.Location = new System.Drawing.Point(72, 50);
+            this.tbar_contrast.Maximum = 100;
+            this.tbar_contrast.Name = "tbar_contrast";
+            this.tbar_contrast.Size = new System.Drawing.Size(219, 25);
+            this.tbar_contrast.TabIndex = 3;
+            this.tbar_contrast.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_contrast.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_contrast_MouseUp);
+            // 
+            // label10
+            // 
+            this.label10.AutoSize = true;
+            this.label10.Location = new System.Drawing.Point(24, 54);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(41, 12);
+            this.label10.TabIndex = 2;
+            this.label10.Text = "对比度";
+            // 
+            // tbar_bright
+            // 
+            this.tbar_bright.AutoSize = false;
+            this.tbar_bright.Location = new System.Drawing.Point(71, 17);
+            this.tbar_bright.Maximum = 100;
+            this.tbar_bright.Name = "tbar_bright";
+            this.tbar_bright.Size = new System.Drawing.Size(220, 25);
+            this.tbar_bright.TabIndex = 1;
+            this.tbar_bright.TickStyle = System.Windows.Forms.TickStyle.None;
+            this.tbar_bright.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tbar_bright_MouseUp);
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(23, 21);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(29, 12);
+            this.label2.TabIndex = 0;
+            this.label2.Text = "亮度";
+            // 
+            // comboBox4
+            // 
+            this.comboBox4.FormattingEnabled = true;
+            this.comboBox4.Location = new System.Drawing.Point(72, 81);
+            this.comboBox4.Name = "comboBox4";
+            this.comboBox4.Size = new System.Drawing.Size(121, 20);
+            this.comboBox4.TabIndex = 5;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(15, 84);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(41, 12);
+            this.label5.TabIndex = 4;
+            this.label5.Text = "分辨率";
+            // 
+            // comboBox5
+            // 
+            this.comboBox5.FormattingEnabled = true;
+            this.comboBox5.Location = new System.Drawing.Point(72, 48);
+            this.comboBox5.Name = "comboBox5";
+            this.comboBox5.Size = new System.Drawing.Size(121, 20);
+            this.comboBox5.TabIndex = 3;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(15, 51);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(41, 12);
+            this.label6.TabIndex = 2;
+            this.label6.Text = "分辨率";
+            // 
+            // comboBox6
+            // 
+            this.comboBox6.FormattingEnabled = true;
+            this.comboBox6.Location = new System.Drawing.Point(72, 17);
+            this.comboBox6.Name = "comboBox6";
+            this.comboBox6.Size = new System.Drawing.Size(121, 20);
+            this.comboBox6.TabIndex = 1;
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(15, 20);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(41, 12);
+            this.label7.TabIndex = 0;
+            this.label7.Text = "分辨率";
+            // 
+            // lblBright
+            // 
+            this.lblBright.AutoSize = true;
+            this.lblBright.Location = new System.Drawing.Point(298, 22);
+            this.lblBright.Name = "lblBright";
+            this.lblBright.Size = new System.Drawing.Size(0, 12);
+            this.lblBright.TabIndex = 19;
+            // 
+            // lblContrast
+            // 
+            this.lblContrast.AutoSize = true;
+            this.lblContrast.Location = new System.Drawing.Point(298, 55);
+            this.lblContrast.Name = "lblContrast";
+            this.lblContrast.Size = new System.Drawing.Size(0, 12);
+            this.lblContrast.TabIndex = 20;
+            // 
+            // lblSaturation
+            // 
+            this.lblSaturation.AutoSize = true;
+            this.lblSaturation.Location = new System.Drawing.Point(298, 88);
+            this.lblSaturation.Name = "lblSaturation";
+            this.lblSaturation.Size = new System.Drawing.Size(0, 12);
+            this.lblSaturation.TabIndex = 21;
+            // 
+            // lblDefinition
+            // 
+            this.lblDefinition.AutoSize = true;
+            this.lblDefinition.Location = new System.Drawing.Point(298, 120);
+            this.lblDefinition.Name = "lblDefinition";
+            this.lblDefinition.Size = new System.Drawing.Size(0, 12);
+            this.lblDefinition.TabIndex = 22;
+            // 
+            // VideoCfg_Form
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(400, 403);
+            this.Controls.Add(this.tabControl1);
+            this.Name = "VideoCfg_Form";
+            this.Text = "视频参数配置";
+            this.Load += new System.EventHandler(this.VideoCfg_Form_Load);
+            this.tabControl1.ResumeLayout(false);
+            this.tabPage1.ResumeLayout(false);
+            this.tabPage1.PerformLayout();
+            this.tabPage2.ResumeLayout(false);
+            this.tabPage2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_definition)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_saturation)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_contrast)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.tbar_bright)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TabControl tabControl1;
+        private System.Windows.Forms.TabPage tabPage1;
+        private System.Windows.Forms.TabPage tabPage2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.ComboBox cmb_frame_size;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TrackBar tbar_bright;
+        private System.Windows.Forms.ComboBox cmb_encode_type;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.ComboBox cmb_frame_rate;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.ComboBox cmb_compress_mode;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.ComboBox comboBox4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.ComboBox comboBox5;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.ComboBox comboBox6;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.TextBox txt_rateval;
+        private System.Windows.Forms.Button btnSave;
+        private System.Windows.Forms.TrackBar tbar_contrast;
+        private System.Windows.Forms.Label label10;
+        private System.Windows.Forms.ComboBox cmb_img_quality;
+        private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.TrackBar tbar_definition;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.TrackBar tbar_saturation;
+        private System.Windows.Forms.Label label12;
+        private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.ComboBox cmb_video_standard;
+        private System.Windows.Forms.ComboBox cmb_img_pos;
+        private System.Windows.Forms.Label label16;
+        private System.Windows.Forms.ComboBox cmb_exposure_time;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.Button btnRecovery;
+        private System.Windows.Forms.ComboBox m_cmbDeNoiseLenth;
+        private System.Windows.Forms.Label label17;
+        private System.Windows.Forms.ComboBox m_cmbDeNoiseMode;
+        private System.Windows.Forms.Label label18;
+        private System.Windows.Forms.Label lblDefinition;
+        private System.Windows.Forms.Label lblSaturation;
+        private System.Windows.Forms.Label lblContrast;
+        private System.Windows.Forms.Label lblBright;
+    }
+}

+ 120 - 0
parkMonitor/view/FormModbus/VideoCfg_Form.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 3 - 2
parkMonitor/view/menuBox/MenuBox.xaml.cs

@@ -8,6 +8,7 @@ using parkMonitor.view.startNumMachineWin;
 using parkMonitor.view.sysInfoWin;
 using parkMonitor.viewModel;
 using parkMonitor.viewModel.detail;
+using PLC_Communication;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
@@ -82,8 +83,8 @@ namespace parkMonitor.view.util {
 
 		/// <summary>菜单-启动号牌机</summary>
 		private void muRunNumMachine_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) {
-			//FormModbus form = new FormModbus();
-			//form.ShowDialog();
+			FormModbus form = new FormModbus();
+			form.ShowDialog();
 		}
 
 		///// <summary>菜单-启动机械手</summary>