duyong 4 роки тому
батько
коміт
cc6c6dc5fc
50 змінених файлів з 5258 додано та 171 видалено
  1. 47 0
      CarMeterMonitor/App.config
  2. 143 0
      CarMeterMonitor/CarMeterMonitor.csproj
  3. 40 0
      CarMeterMonitor/Form1.Designer.cs
  4. 20 0
      CarMeterMonitor/Form1.cs
  5. 22 0
      CarMeterMonitor/Program.cs
  6. 36 0
      CarMeterMonitor/Properties/AssemblyInfo.cs
  7. 71 0
      CarMeterMonitor/Properties/Resources.Designer.cs
  8. 117 0
      CarMeterMonitor/Properties/Resources.resx
  9. 30 0
      CarMeterMonitor/Properties/Settings.Designer.cs
  10. 7 0
      CarMeterMonitor/Properties/Settings.settings
  11. 56 0
      CarMeterMonitor/fromContect.Designer.cs
  12. 1045 0
      CarMeterMonitor/fromContect.cs
  13. 123 0
      CarMeterMonitor/fromContect.resx
  14. 6 3
      CarMeterSystem/App.config
  15. 10 0
      CarMeterSystem/CarMeterSystem.csproj
  16. 58 1
      CarMeterSystem/Form1.cs
  17. 4 0
      CarMeterSystem/Program.cs
  18. 61 0
      CarMeterSystem/frmMain.cs
  19. 85 63
      CarMeterSystem/frmOneYardToEnd.cs
  20. 56 0
      CarMeterSystem/fromContect.Designer.cs
  21. 1044 0
      CarMeterSystem/fromContect.cs
  22. 123 0
      CarMeterSystem/fromContect.resx
  23. 4 0
      Common/Common.csproj
  24. 26 0
      Common/DbOption/work/MeterWorkCarActualService.cs
  25. 133 0
      Common/cacheCls/DownloadTools.cs
  26. 160 0
      Common/cacheCls/GlobalVariable.cs
  27. 64 0
      Common/cacheCls/ReleaseFile.cs
  28. 125 0
      Common/cacheCls/ReleaseList.cs
  29. 133 0
      FantasyCorrector/DownloadTools.cs
  30. 178 0
      FantasyCorrector/FantasyCorrector.csproj
  31. 23 0
      FantasyCorrector/GlobalVariable.cs
  32. 20 0
      FantasyCorrector/Program.cs
  33. 36 0
      FantasyCorrector/Properties/AssemblyInfo.cs
  34. 63 0
      FantasyCorrector/Properties/Resources.Designer.cs
  35. 117 0
      FantasyCorrector/Properties/Resources.resx
  36. 26 0
      FantasyCorrector/Properties/Settings.Designer.cs
  37. 7 0
      FantasyCorrector/Properties/Settings.settings
  38. 64 0
      FantasyCorrector/ReleaseFile.cs
  39. 125 0
      FantasyCorrector/ReleaseList.cs
  40. BIN
      FantasyCorrector/SystemLog.ico
  41. 174 0
      FantasyCorrector/UpdaterForm.cs
  42. 258 0
      FantasyCorrector/UpdaterForm.designer.cs
  43. 148 0
      FantasyCorrector/UpdaterForm.resx
  44. 3 0
      FantasyCorrector/app.config
  45. 4 4
      FrmStandAloneMetering/FrmStandAloneMetering.Designer.cs
  46. 1 1
      FrmStandAloneMetering/FrmStandAloneMetering.resx
  47. 92 0
      HnstMeteringSystem.sln
  48. 24 91
      MeterSceneLibrary/JISCO/InnerCarJISCO.cs
  49. 8 8
      MeterSceneLibrary/JISCO/OuterCarJISCO.cs
  50. 38 0
      MeterSceneLibrary/JISCO/private/SaveMethod.cs

+ 47 - 0
CarMeterMonitor/App.config

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+  <appSettings>
+    <!--<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />-->
+    <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
+    <add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />
+    <!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
+    <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
+    <!--<add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>-->
+    <!--实时库地址-->
+    <add key="icoredbTcp" value="tarantool://guest@10.99.200.86:2101" />
+    <!--SFTP或者vsftp服务端连接及地址-->
+    <add key="fip" value="192.168.185.238" />
+    <add key="fport" value="22" />
+    <add key="fuid" value="jgjlftp" />
+    <add key="fpwd" value="xxzx2021" />
+    <!-- /jldate/ftppicture/ -->
+    <add key="fpath" value="https://jgwzjl.jiugang.com/icore.icp.web/pass/file/upload/" />
+    <!--0使用sftp,1使用vsftp-->
+    <add key="ftpType" value="1" />
+    <!--图片压缩-->
+    <add key="imgWidth" value="1200" />
+    <add key="imgHeight" value="1200" />
+    <!--毛皮差值验证(单位kg)-->
+    <add key="differenceWgt" value="400" />
+    <!--进入测试界面还是正式界面 0测试,1正式,2一码到底测试,3判稳测试工具-->
+    <add key="productType" value="0" />
+    <!--联达比较重量-->
+    <add key="lianDaWgt" value="200" />
+    <!--联达计量点编号-->
+    <add key="lianDaPointNo" value="00019" />
+
+    <!--期限皮使用方式配置:车号-物料-路线(1),车号-物料-称点(2),车号-物料(3)-->
+    <add key="TareControlType" value="3" />
+
+    <!--厂内外车配置:001004003(内部),001004002(外部)-->
+    <add key="carTypeNo" value="001004002" />
+
+    <!--厂内外车配置:001004003(内部),001004002(外部)-->
+    <add key="carTypeName" value="外部" />
+
+    <add key="ClientSettingsProvider.ServiceUri" value="" />
+  </appSettings>
+</configuration>

+ 143 - 0
CarMeterMonitor/CarMeterMonitor.csproj

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{1D59985C-5276-485C-A041-F733F0868BB4}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>CarMeterMonitor</RootNamespace>
+    <AssemblyName>CarMeterMonitor</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\Output\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="CoreFS.CA06Lite, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\output\CoreFS.CA06Lite.dll</HintPath>
+    </Reference>
+    <Reference Include="iCore.Rtdb, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\output\iCore.Rtdb.dll</HintPath>
+    </Reference>
+    <Reference Include="Infragistics2.Excel.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\output\Infragistics2.Excel.v9.2.dll</HintPath>
+    </Reference>
+    <Reference Include="Infragistics2.Win.UltraWinDataSource.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\output\Infragistics2.Win.UltraWinDataSource.v9.2.dll</HintPath>
+    </Reference>
+    <Reference Include="Infragistics2.Win.UltraWinEditors.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\output\Infragistics2.Win.UltraWinEditors.v9.2.dll</HintPath>
+    </Reference>
+    <Reference Include="Infragistics2.Win.UltraWinGrid.v9.2, Version=9.2.20092.1003, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\output\Infragistics2.Win.UltraWinGrid.v9.2.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="fromContect.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="fromContect.Designer.cs">
+      <DependentUpon>fromContect.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="fromContect.resx">
+      <DependentUpon>fromContect.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\CarMeterSystem\CarMeterSystem.csproj">
+      <Project>{7d262392-c0a3-465d-bd99-ec384d4be321}</Project>
+      <Name>CarMeterSystem</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Common\Common.csproj">
+      <Project>{24b72a4a-3a4a-486b-9bcf-4a4b965c0ec6}</Project>
+      <Name>Common</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeterConditionLibrary\MeterConditionLibrary.csproj">
+      <Project>{e34ea556-df5b-4c10-9280-23b38259e6bc}</Project>
+      <Name>MeterConditionLibrary</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeterModelLibrary\MeterModelLibrary.csproj">
+      <Project>{d239be9e-348d-4ac8-abe5-8e7e4a69e047}</Project>
+      <Name>MeterModelLibrary</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeterModuleLibrary\MeterModuleLibrary.csproj">
+      <Project>{937e0dfa-3387-41e7-8718-ce2660b846dd}</Project>
+      <Name>MeterModuleLibrary</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeterPlugInLibrary\MeterPlugInLibrary.csproj">
+      <Project>{a90f4f23-9077-46ca-ba60-eb21df346b27}</Project>
+      <Name>MeterPlugInLibrary</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MeterSceneLibrary\MeterSceneLibrary.csproj">
+      <Project>{c70eb531-65e2-416a-b85e-946a8d4acaed}</Project>
+      <Name>MeterSceneLibrary</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 40 - 0
CarMeterMonitor/Form1.Designer.cs

@@ -0,0 +1,40 @@
+namespace CarMeterMonitor
+{
+  partial class Form1
+  {
+    /// <summary>
+    /// 必需的设计器变量。
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// 清理所有正在使用的资源。
+    /// </summary>
+    /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+    protected override void Dispose(bool disposing)
+    {
+      if (disposing && (components != null))
+      {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows 窗体设计器生成的代码
+
+    /// <summary>
+    /// 设计器支持所需的方法 - 不要修改
+    /// 使用代码编辑器修改此方法的内容。
+    /// </summary>
+    private void InitializeComponent()
+    {
+      this.components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.ClientSize = new System.Drawing.Size(800, 450);
+      this.Text = "Form1";
+    }
+
+    #endregion
+  }
+}
+

+ 20 - 0
CarMeterMonitor/Form1.cs

@@ -0,0 +1,20 @@
+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 CarMeterMonitor
+{
+  public partial class Form1 : Form
+  {
+    public Form1()
+    {
+      InitializeComponent();
+    }
+  }
+}

+ 22 - 0
CarMeterMonitor/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace CarMeterMonitor
+{
+  static class Program
+  {
+    /// <summary>
+    /// 应用程序的主入口点。
+    /// </summary>
+    [STAThread]
+    static void Main()
+    {
+      Application.EnableVisualStyles();
+      Application.SetCompatibleTextRenderingDefault(false);
+      Application.Run(new fromContect());
+    }
+  }
+}

+ 36 - 0
CarMeterMonitor/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("CarMeterMonitor")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CarMeterMonitor")]
+[assembly: AssemblyCopyright("Copyright ©  2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("1d59985c-5276-485c-a041-f733f0868bb4")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 71 - 0
CarMeterMonitor/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CarMeterMonitor.Properties
+{
+
+
+  /// <summary>
+  ///   强类型资源类,用于查找本地化字符串等。
+  /// </summary>
+  // 此类是由 StronglyTypedResourceBuilder
+  // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+  // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+  // (以 /str 作为命令选项),或重新生成 VS 项目。
+  [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+  [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+  internal class Resources
+  {
+
+    private static global::System.Resources.ResourceManager resourceMan;
+
+    private static global::System.Globalization.CultureInfo resourceCulture;
+
+    [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+    internal Resources()
+    {
+    }
+
+    /// <summary>
+    ///   返回此类使用的缓存 ResourceManager 实例。
+    /// </summary>
+    [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+    internal static global::System.Resources.ResourceManager ResourceManager
+    {
+      get
+      {
+        if ((resourceMan == null))
+        {
+          global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CarMeterMonitor.Properties.Resources", typeof(Resources).Assembly);
+          resourceMan = temp;
+        }
+        return resourceMan;
+      }
+    }
+
+    /// <summary>
+    ///   覆盖当前线程的 CurrentUICulture 属性
+    ///   使用此强类型的资源类的资源查找。
+    /// </summary>
+    [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+    internal static global::System.Globalization.CultureInfo Culture
+    {
+      get
+      {
+        return resourceCulture;
+      }
+      set
+      {
+        resourceCulture = value;
+      }
+    }
+  }
+}

+ 117 - 0
CarMeterMonitor/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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>

+ 30 - 0
CarMeterMonitor/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace CarMeterMonitor.Properties
+{
+
+
+  [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+  [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+  internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+  {
+
+    private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+    public static Settings Default
+    {
+      get
+      {
+        return defaultInstance;
+      }
+    }
+  }
+}

+ 7 - 0
CarMeterMonitor/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 56 - 0
CarMeterMonitor/fromContect.Designer.cs

@@ -0,0 +1,56 @@
+
+namespace CarMeterMonitor
+{
+    partial class fromContect
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            this.timer1 = new System.Windows.Forms.Timer(this.components);
+            this.SuspendLayout();
+            // 
+            // timer1
+            // 
+            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+            // 
+            // fromContect
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Name = "fromContect";
+            this.Text = "fromContect";
+            this.Load += new System.EventHandler(this.fromContect_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Timer timer1;
+    }
+}

+ 1045 - 0
CarMeterMonitor/fromContect.cs

@@ -0,0 +1,1045 @@
+using CarMeterSystem.OptionCls;
+using CarMeterSystem;
+using com.hnshituo.core.webapp.vo;
+using Common;
+using iCore.Rtdb.RtdbTable;
+using MeterConditionLibrary;
+using MeterModelLibrary;
+using MeterModuleLibrary.uc;
+using MeterPlugInLibrary;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace CarMeterMonitor
+{
+    public partial class fromContect : Form
+    {
+        public fromContect()
+        {
+            InitializeComponent();
+        }
+
+        private Log l = Log.GetInstance();
+        private Print printClass = new Print();//打印
+
+        //内存表
+        private MemoryTableDataSocket MemoClass = new MemoryTableDataSocket("");
+
+        //实时表数据采集
+        private DataCollectionControl collection = new DataCollectionControl();
+
+        //图片控制器含图片压缩及上传curl
+        private ImageCurlControl imageCurlControl = new ImageCurlControl();
+
+        //与监控界面对接的表
+        private MeterWorkMonitorService meterWorkMonitor = new MeterWorkMonitorService();
+
+        //零点报警表
+        private meterworkzeroalarmservice zeroAlarmService = new meterworkzeroalarmservice();
+
+        //车号修正
+        private CarNoModfiy modfiy = new CarNoModfiy();
+
+        /// <summary>
+        /// 这个是保存前一次采集中的车号信息
+        /// </summary>
+        private string preCarNo = "";
+
+        //验证对射
+        private validParkStatus valid = new validParkStatus();
+
+        //语音播报
+        private VoicePlay vicPlayClass = new VoicePlay();
+
+        //扫码枪
+        private SweepCode sweepCodeClass = new SweepCode();
+
+        private LED_Control led_controler = null;
+
+        //监控表操作
+        private MeterMonitorWeightService monitorWeightService = new MeterMonitorWeightService();
+
+        //历史皮操作
+        private MeterBaseHisTareDataService hisTareDataService = new MeterBaseHisTareDataService();
+
+        /// <summary>
+        /// 欢迎界面
+        /// </summary>
+        private frmWelcome_Jisco frmWelcome = new frmWelcome_Jisco();//欢迎
+
+        private int startCar = 0;
+
+        private int startWeight = 0;
+
+        private DateTime startTime;
+
+        private DateTime endTime;
+
+        /// <summary>
+        /// 基础数据载入
+        /// </summary>
+        private BaseDbCls bd = new BaseDbCls();
+
+        //扫码修正车号标识
+        private bool codeFlag = false;
+
+        private List<ucBusinessType> lu = new List<ucBusinessType>();
+
+        private bool isVoiceDownCar = false;//车上人员请下车播放一次
+        private bool isShowFrmWelcome = false; //是否显示欢迎界面
+
+        private bool isOpened = false;//是否已经打开了扫码计量界面
+
+        private void fromContect_Load(object sender, EventArgs e)
+        {
+            //*
+            try
+            {
+                //this.Hide();
+
+                LoginCls lg = new LoginCls();
+                timer1.Start();
+
+                //2021年6月21日 杨秀东添加
+                if (isShowFrmWelcome)
+                {
+                    frmWelcome.Show();
+                    frmWelcome.Visible = true;
+                }
+
+                if (lg.LoginIn())
+                {
+                    if (bd.setBaseDb() && bd.getBaseDb())
+                    {
+                        if (!string.IsNullOrEmpty(PbCache.sportInfo.ledIp))
+                        {
+                            led_controler = new LED_Control(PbCache.sportInfo.ledIp);
+                        }
+
+                        //调用该方法时已赋值 test git 测试git推送代码123;456
+                        RESTfulResult<List<MeterWorkMonitor>> rm = meterWorkMonitor.doQueryOneWf(new MeterWorkMonitor { validFlag = "1", pointNo = PbCache.sportInfo.baseSpotNo });
+                        if (!rm.Succeed)
+                        {
+                            l.WriteLog(1, "载入监控表数据异常");
+                            return;
+                        }
+                        else if (rm.Data != null && rm.Data.Count > 0)
+                        {
+                            if (string.IsNullOrEmpty(PbCache.collect_no))
+                            {
+                                PbCache.collect_no = rm.Data[0].collectionCode;
+                                MemoClass = new MemoryTableDataSocket(PbCache.collect_no);
+                            }
+                        }
+                        else
+                        {
+                            l.WriteLog(1, "为配置监控数据");
+                            return;
+                        }
+                        //若未校秤的话,也不允许计量
+
+                        //载入界面业务按钮
+                        if (PbCache.businessType != null && PbCache.businessType.Count > 0)
+                        {
+                            foreach (ComBaseInfo info in PbCache.businessType)
+                            {
+                                ucBusinessType uc = new ucBusinessType();
+                                switch (info.baseCode)
+                                {
+                                    case "001006003":
+                                        uc.setControl(info.baseName, info.memo, info.baseCode);
+                                        break;
+
+                                    case "001006001":
+                                    case "001006002":
+                                        uc.setControl(info.baseName, info.memo, info.baseCode);
+                                        break;
+
+                                    default:
+                                        uc.setControl(info.baseName, info.memo, info.baseCode);
+                                        break;
+                                }
+
+                                uc.Dock = DockStyle.Top;
+                                //uc.setControl("","","",);
+                                uc.ucEvent += new EventHandler(ucEvents);
+                                lu.Add(uc);
+                                //panel7.Controls.Add(uc);
+                            }
+                        }
+
+                        //开启基础进程
+                        l.WriteLog(0, "系统登录成功");
+
+                        collection.EventDataCollectionArgs += new EventDataCollection(EventData);//数据采集及扫码信息
+                        collection.Start(PbCache.sportInfo.baseSpotNo, PbCache.sportInfo.baseSpotName);
+
+                        imageCurlControl.Start(); //图片上传线程
+                        sweepCodeClass.StartThreadSweep(); //扫码线程
+                    }
+                    else
+                    {
+                        l.WriteLog(0, "系统登录失败");
+                    }
+                }
+                else
+                {
+                    l.WriteLog(0, "按IP地址找不到计量点信息,系统登录失败");
+                }
+            }
+            catch (Exception ex)
+            {
+                l.WriteLog(0, "系统加载失败:" + ex.Message);
+            }
+            //*/
+        }
+
+        /// <summary>
+        /// 直接打开扫码计量界面
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void timer1_Tick(object sender, EventArgs e)
+        {
+            if (!isOpened && PbCache.collect?.weight > 500)
+            {
+                isOpened = true;
+                PbCache.bussinessTypeName = "";
+                PbCache.bussinessTypeCode = "";
+                //frmOneYardToEnd fcc = new frmOneYardToEnd();
+                //fcc.ShowDialog();
+            }
+        }
+
+        #region
+        //*
+
+        /// <summary>
+        /// 委托的方式调用控件的点击事件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        public void ucEvents(object sender, EventArgs e)
+        {
+            Control control = (Control)sender;
+            ucBusinessType um = control.Parent.Parent as ucBusinessType;
+
+            try
+            {
+                switch (control.Name)
+                {
+                    case "btnContext":
+                    case "btnPurchase":
+                        {
+                            PbCache.bussinessTypeName = um._bussiness == null ? "" : um._bussiness;
+                            PbCache.bussinessTypeCode = um._code;
+
+                            switch (um._code)
+                            {
+                                case "001006003":
+                                    frmInternalTransport frm = new frmInternalTransport();
+                                    frm.ShowDialog();
+                                    break;
+                                /*
+                                case "001006001":
+                                case "001006002":
+                                    frmCarSalePurchase frmCar = new frmCarSalePurchase();
+                                    frmCar.ShowDialog();
+                                    break;
+                                //*/
+                                default:
+                                    frmCarSalePurchase frmCar = new frmCarSalePurchase();
+                                    frmCar.ShowDialog();
+                                    break;
+                            }
+                        };
+                        break;
+
+                    default: break;
+                }
+            }
+            catch (Exception ex)
+            {
+                //MessageBox.Show("操作异常:" + ex.Message);
+            }
+        }
+
+        //*/
+        #endregion
+
+        #region
+
+        private void setThisVis(bool visb)
+        {
+            if (this.InvokeRequired)
+            {
+                Action<bool> action = new Action<bool>(setThisVis);
+                Invoke(action, new object[] { visb });
+            }
+            else
+            {
+                if (this.Visible != visb)
+                {
+                    this.Visible = visb;
+                }
+            }
+        }
+
+        #endregion
+
+        #region
+
+        private void setWelecomeVis(bool visb)
+        {
+            if (!isShowFrmWelcome) return;//2021年6月21日 杨秀东添加
+
+            if (frmWelcome.InvokeRequired)
+            {
+                Action<bool> action = new Action<bool>(setWelecomeVis);
+                Invoke(action, new object[] { visb });
+            }
+            else
+            {
+                if (frmWelcome.Visible != visb)
+                {
+                    frmWelcome.Visible = visb;
+                    frmWelcome.setLogin();
+                }
+            }
+            //*/
+        }
+
+        #endregion
+
+        private int iCount = 0, iHodeTime = 0;
+        private bool flagCarMonit = false;//车号修正
+        private bool bEditCar = false; //手动修正车号
+        private bool isOpenMeter = false; //是否已打开计量界面,若已经打开则这里关于超量程及红外的语音将停止播报
+        private string firstCode = "";//上次扫码的信息
+
+        private string ledTxt = "";
+        private bool isLedWrite = false;//是否写入一次LED
+
+        private string sPreNo = ""; //记录重量曲线变化
+        private int preWgt = 0;//前一次重量,用于重量曲线
+        private string sCarNo = "";
+
+        private int iCountPark = 0;
+        private string editCarNo = "";
+
+        /// <summary>
+        /// 数据采集
+        /// </summary>
+        /// <param name="o"></param>
+        /// <param name="e"></param>
+        private void EventData(object o, DataCollectionArgs e)
+        {
+            //这里每隔0.5秒执行一次
+            try
+            {
+                #region 扫码信息
+                sweepCodeClass.StrState = e.weightStatus + ""; //重量状态信息;当StrState= 0时,获取扫码信息,StrState= 2时将扫码信息置位“”空;其他状态不处理
+
+                if (string.IsNullOrEmpty(sweepCodeClass.StrCode))
+                {
+                    codeFlag = false;
+                    if (string.IsNullOrEmpty(PbCache.strCode))
+                    {
+                        firstCode = "";
+                        PbCache.strCode = "";
+                        l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
+                    }
+                }
+                else
+                {
+                    ////日期2021年12月22日:重复扫码,取前面12位
+                    //if (sweepCodeClass.StrCode.Length > 15)
+                    //{
+                    //    // todo: 加入车号截取逻辑
+                    //    sweepCodeClass.StrCode = sweepCodeClass.StrCode.Substring(0,12);
+                    //}
+                    //if (firstCode != sweepCodeClass.StrCode || string.IsNullOrEmpty(PbCache.strCode))
+                    //{
+                    //    l.WriteLog(12, "主线程扫码值赋值;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode前值为:" + PbCache.strCode);
+                    //    PbCache.strCode = sweepCodeClass.StrCode;
+                    //    firstCode = PbCache.strCode;
+                    //}
+                    l.WriteLog(12, "测试扫码值" + PbCache.strCode);
+                    PbCache.collect.carno = sweepCodeClass.StrCode;
+                    codeFlag = true;
+                }
+
+                #endregion 扫码信息
+
+                #region 秤上无车10分钟获取一次基础数据
+                if (iCount < 1200)
+                {
+                    iCount++;
+                }
+                else
+                {
+                    try
+                    {
+                        //秤上没有车时,每隔10分钟获取一次基础数据
+                        if (e.weight < 500)
+                        {
+                            if (bd.setBaseDb())
+                            {
+                                l.WriteLog(0, "十分钟获取基础数据成功");
+                            }
+                            else
+                            {
+                                l.WriteLog(0, "十分钟获取基础数据失败");
+                            }
+                            iCount = 0;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        l.WriteLog(0, "十分钟获取基础数据失败:" + ex.Message);
+                        iCount = 0;
+                    }
+                }
+                #endregion
+
+                #region 每10秒写入一次当前时间
+                if (iCount % 20 == 0)
+                {
+                    //更新在线时间
+                    RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, lastTime = DateTime.Now });
+                    if (!rms.Succeed)
+                    {
+                        l.WriteLog(0, "frmMain.EventData异常:写入时间异常");
+                    }
+                }
+                #endregion
+
+                #region
+                //一旦界面锁定则不采集数据
+                if (!PbCache.isLockFrm)
+                {
+                    PbCache.collect.pointid = PbCache.sportInfo.baseSpotNo;
+                    PbCache.collect.weight = e.weight;
+                    PbCache.collect.weightStatus = e.weightStatus;
+                    PbCache.collect.parkStatus = e.parkStatus;
+                    PbCache.collect.datetime = e.datetime;
+                    PbCache.collect.licType = e.licType;
+                }
+                //*/
+
+                // 更新监控表
+                doLive();
+
+                //重量大于500的情况下
+                if (e.weight > 500)
+                {
+                    if (startWeight == 0)
+                    {
+                        startTime = DateTime.Now;
+                        startWeight = 1;
+                    }
+                    if (startCar == 0 && e.vdioCarNos != "")
+                    {
+                        WriteText(0, "当前采集车号:" + e.vdioCarNos);
+                        startCar = 1;
+                    }
+
+                    if (startWeight == 1 && PbCache.collect.weightStatus == 0)
+                    {
+                        endTime = DateTime.Now;
+                        startWeight = 2;
+                        TimeSpan secondSpan = new TimeSpan(endTime.Ticks - startTime.Ticks);
+                        WriteText(1, "开始时间:" + startTime.ToString("yyyy-MM-dd HH:mm:ss:fff") + ",结束时间:" + endTime.ToString("yyyy-MM-dd HH:mm:ss:fff") + ",时间差:" + secondSpan.TotalSeconds + "秒" + ",重量:" + e.weight);
+                    }
+
+                    if (PbCache.dtStartTime == null)
+                        PbCache.dtStartTime = DateTime.Now;
+                    isLedWrite = true;
+
+                    #region 车上人员请下车
+                    try
+                    {
+                        //界面未锁定的情况下,有车号,如果重量稳定了,停车线验证通过,未超量程的情况下,则按钮可用
+                        if (PbCache.collect != null && !string.IsNullOrEmpty(PbCache.collect.carno) && PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_park_status && PbCache.collect.weight < PbCache.range.upperRange)
+                        {
+                            if (!isVoiceDownCar)
+                            {
+                                isVoiceDownCar = true;
+                                vicPlayClass.GetVoicePlay("车上人员请下车", PbCache.collect.carno);
+                            }
+                        }
+                    }
+                    catch { }
+                    #endregion
+
+                    setWelecomeVis(false);
+
+                    //每隔1秒刷一次计量实时监控表数据值
+                    if (iCount % 2 == 0)
+                    {
+                        //调用该方法时已赋值
+                        RESTfulResult<List<MeterWorkMonitor>> rm = meterWorkMonitor.doQueryOneWf(new MeterWorkMonitor { validFlag = "1", pointNo = PbCache.sportInfo.baseSpotNo });
+                        if (!rm.Succeed)
+                        {
+                            l.WriteLog(0, "frmMain.EventData异常419:" + rm.ResultMessage);
+                        }
+                        else
+                        {
+                            if (rm.Data != null && rm.Data.Count > 0)
+                            {
+                                PbCache.monitor = rm.Data[0];
+
+                                if (string.IsNullOrEmpty(PbCache.collect_no))
+                                {
+                                    PbCache.collect_no = rm.Data[0].collectionCode;
+                                }
+
+                                if (ledTxt != rm.Data[0].ledWriter && rm.Data[0].ledWriter != "")
+                                {
+                                    //调用LED信息写入******************************
+                                    ledTxt = rm.Data[0].ledWriter;
+                                }
+
+                                if (string.IsNullOrEmpty(ledTxt))
+                                {
+                                    ledTxt = "欢迎使用酒钢汽车衡智能计量系统!";
+                                }
+                            }
+                        }
+
+                        #region 2021-03-29
+                        #region 摄像头当前采集的车号与上次采集的不一样且当前未勾选不验证,且当前车号未进行手动修正的情况下
+                        if (preCarNo != e.carno && PbCache.monitor != null && PbCache.monitor.validCarno != "0" && !bEditCar)
+                        {
+                            flagCarMonit = false;
+                        }
+                        preCarNo = e.carno;
+                        #endregion
+
+                        if (!flagCarMonit)
+                        {
+                            sCarNo = e.carno;
+                        }
+
+                        //*
+                        //有车号,且重量稳定的情况下,只修正一次车号
+                        if (!string.IsNullOrEmpty(e.carno) && e.weightStatus == 0 && !flagCarMonit && PbCache.monitor != null && PbCache.monitor.carMonitor == "1" && PbCache.monitor.carMonitorLvl > 0)
+                        {
+                            flagCarMonit = true;
+                            string methods = "";
+                            for (int i = 0; i <= PbCache.monitor.carMonitorLvl; i++)
+                            {
+                                methods += "CarNoTrustCorrect" + i + ",";
+                            }
+                            editCarNo = modfiy.CarNoCorrect(e.carno, methods.Substring(0, methods.Length - 1));
+                            sCarNo = editCarNo;
+                            //mwUpdate
+                        }
+
+                        //勾选了不验证车号的情况
+                        if (PbCache.monitor.validCarno == "0")
+                        {
+                            flagCarMonit = true;
+                        }
+                        #endregion
+
+                        #region 每隔1秒写入一次重量曲线
+                        try
+                        {
+                            if (preWgt != e.weight)
+                            {
+                                preWgt = e.weight;
+                                sPreNo = PbCache.sportInfo.baseSpotNo + DateTime.Now.ToString("yyyyMMddHHmmssfff");
+
+                                monitorWeightService.doAddWf(new MeterMonitorWeight
+                                {
+                                    weightNo = sPreNo,
+                                    baseSpotNo = PbCache.sportInfo.baseSpotNo,
+                                    baseSpotName = PbCache.sportInfo.baseSpotName,
+                                    collectWeight = e.weight + "",
+                                    collectStartTime = PbCache.dtStartTime.Value,
+                                    collectEndTime = DateTime.Now,
+                                    spotTypeNo = "001002001",
+                                    spotTypeName = "汽车衡",
+                                    actualFirstNo = PbCache.actualFirstNo
+                                });
+                            }
+                            else
+                            {
+                                if (!string.IsNullOrEmpty(sPreNo))
+                                {
+                                    monitorWeightService.doUpdateWf(new MeterMonitorWeight
+                                    {
+                                        weightNo = sPreNo,
+                                        collectEndTime = DateTime.Now
+                                    });
+                                }
+                            }
+                        }
+                        catch { }
+                        #endregion
+
+                        #region 停留超时
+                        iHodeTime++;
+                        MeterWorkMonitor mwUpdate = new MeterWorkMonitor();
+                        mwUpdate.pointNo = PbCache.sportInfo.baseSpotNo;
+                        mwUpdate.editCar = editCarNo;
+
+                        if (PbCache.holdTime != null && PbCache.holdTime.Count > 0)
+                        {
+                            if (PbCache.holdTime[0].retentionTime != null)
+                            {
+                                if (PbCache.holdTime[0].retentionTime.Value < iHodeTime)
+                                {
+                                    PbCache.isOvertimeAlarm = true; //是否超时报警
+                                    mwUpdate.stopOverTime = "1"; //写入一次停留超时
+                                    //mwUpdate.isHelp = "1";//派位
+                                    //mwUpdate.isTakeOver = "1";
+                                    iHodeTime = 99999;//不再增长避免超出
+                                }
+                            }
+                        }
+                        #endregion
+
+                        #region RFID识别车号信息
+                        mwUpdate.rfidCar = "";
+                        mwUpdate.photoCar = e.vdioCarNos;
+                        //mwUpdate.photoCar = PbCache.collect.carno;
+                        if (!string.IsNullOrEmpty(e.RfidNos))
+                        {
+                            string sqls = @"SELECT RFID_ID id,CAR_NO text FROM METER_BASE_RFID_INFO where RFID_CODE = '" + e.RfidNos + "'";
+
+                            PbModelDbService<List<PbModelDb>> pbp = new PbModelDbService<List<PbModelDb>>();
+                            RESTfulResult<List<PbModelDb>> rmT = pbp.executeSqlDataWf(sqls);
+                            if (rmT.Data == null || rmT.Data.Count == 0)
+                            { }
+                            else
+                            {
+                                mwUpdate.rfidCar = rmT.Data[0].text;
+                                sCarNo = rmT.Data[0].text;
+                            }
+                        }
+                        #endregion
+
+                        #region 计量员修改的车号信息
+                        if (PbCache.monitor != null && !string.IsNullOrEmpty(PbCache.monitor.setCar))
+                        {
+                            sCarNo = PbCache.monitor.setCar;
+                            bEditCar = true;
+                            flagCarMonit = true;
+                            codeFlag = false;
+                            sweepCodeClass.StrCode = "";
+                        }
+                        #endregion
+
+                        #region 重量信息
+                        if (!PbCache.isLockFrm)
+                        {
+                            mwUpdate.wgt = e.weight;
+                        }
+                        else
+                        {
+                            mwUpdate.wgt = Convert.ToInt32(PbCache.lockWgt);
+                        }
+                        #endregion
+
+                        #region 写入一次监控表,将重量/车号停留超时等信息写入
+                        mwUpdate.msgInfo = PbCache.ResultMessage;
+                        mwUpdate.weightStatus = PbCache.collect.weightStatus;
+                        //另外初始化一次监控数据
+                        RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(mwUpdate);
+                        if (!rms.Succeed)
+                        {
+                            l.WriteLog(0, "frmMain.EventData异常583:写入信息异常");
+                        }
+                        #endregion
+
+                        //验证对射
+                        valid.ValidMethod();
+
+                        if (!isOpenMeter)
+                        {
+                            //if (PbCache.range != null && PbCache.range.upperRange < e.weight)
+                            if (PbCache.range != null && PbCache.range.upperRange < e.weight)
+                            {
+                                //超量程
+                                vicPlayClass.GetVoicePlay("已超量程", e.carno);
+                                //return;
+                            }
+                            else if (e.weightStatus == 0)
+                            {
+                                if (!PbCache.monitorResult.valid_park_status)
+                                {
+                                    iCountPark++;
+                                    if (iCountPark > 9)
+                                    {
+                                        //重量稳定,且对射验证不合格
+                                        vicPlayClass.GetVoicePlay("您的车辆未停到位", e.carno);
+                                        //return;
+                                        iCountPark = 0; //2021年7月27日5s播一次,然后重新在播
+                                    }
+                                }
+                                else
+                                {
+                                    iCountPark = 0;
+                                }
+                            }
+                        }
+
+                        if (!lu[0].bcEnable)
+                        {
+                            foreach (ucBusinessType uc in lu)
+                            {
+                                uc.setControlEnable(true);
+                            }
+                        }
+                        if (sweepCodeClass.StrCode == "" && !codeFlag)
+                        {
+                            PbCache.collect.carno = sCarNo;
+                        }
+                    }
+
+                    //写入LED信息
+                    if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
+                    {
+                        PbCache.OldLedInfo = PbCache.ledInfo;
+                        if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
+                        {
+                            //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                        }
+                    }
+                }
+                else
+                {
+                    startCar = 0;
+                    startWeight = 0;
+                    if (e.weight > 10 && e.weight < 500)
+                    {
+                        //重量小于500,大于10
+                        MeterWorkMonitor mwUpdate = new MeterWorkMonitor();
+                        mwUpdate.pointNo = PbCache.sportInfo.baseSpotNo;
+                        mwUpdate.wgt = e.weight;
+                        RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(mwUpdate);
+                    }
+                    if (e.weight > 0 && e.weight < 200)
+                    {
+                        doOperateLive();
+                    }
+                    if (e.weight == 0)
+                    {
+                        PbCache.isZeroAlarm = false;
+                    }
+                    isOpened = false; //下次上秤直接打开主界面
+                    editCarNo = "";
+                    firstCode = ""; //历史的扫码枪的值
+                    preCarNo = "";
+                    sCarNo = "";
+                    sPreNo = "";
+                    preWgt = 0;
+
+                    PbCache.isOvertimeAlarm = false; //是否超时报警
+                    PbCache.strCode = "";
+                    PbCache.ResultMessage = "";
+                    bEditCar = false;
+                    isVoiceDownCar = false;
+                    flagCarMonit = false;
+                    iHodeTime = 0;
+
+                    isOpenMeter = false;
+                    PbCache.isLockFrm = false;
+                    PbCache.dtStartTime = null;
+                    PbCache.voiceOver = true;
+                    if (PbCache.collect != null && !string.IsNullOrEmpty(PbCache.collect.carno))
+                    {
+                        PbCache.collect.carno = "";
+                    }
+
+                    setWelecomeVis(true);
+                    if (lu[0].bcEnable)
+                    {
+                        foreach (ucBusinessType uc in lu)
+                        {
+                            uc.setControlEnable(false);
+                        }
+                    }
+                    //LED写入
+                    if (isLedWrite)
+                    {
+                        if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
+                        {
+                            PbCache.ledInfo = "欢迎使用九钢汽车衡智能计量系统";
+                        }
+                        else
+                        {
+                            PbCache.ledInfo = PbCache.monitor == null ? "" : PbCache.monitor.ledWriter;
+                        }
+
+                        //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+
+                        isLedWrite = false;
+
+                        //*
+                        //另外初始化一次监控数据
+                        RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(new MeterWorkMonitor
+                        {
+                            pointNo = PbCache.sportInfo.baseSpotNo,
+                            validWgt = "1",
+                            validCarno = "1",
+                            validTareTime = "1",
+                            validMatTime = "1",
+                            validTimeInterval = "1",
+                            validParkStatus = "1",
+                            validExceedWgt = "1",
+                            validPredictionDiff = "1",
+                            validLianda = "1",
+                            validMatClick = "1",
+                            setCar = "",
+                            rfidCar = "",
+                            photoCar = "",
+                            scanCar = "",
+                            editCar = "",
+                            carErr = "0",
+                            wgtErr = "0",
+                            stopOverTime = "0",
+                            msgInfo = "",
+                            ledWriter = "",
+                            isOverWgt = "",
+                            isHelp = "0",
+                            wgt = 0
+                        });
+                        if (!rms.Succeed)
+                        {
+                            l.WriteLog(0, "frmMain.EventData异常754:写入信息异常");
+                            isLedWrite = true;
+                        }
+                        //*/
+                    }
+                }
+
+                #endregion
+            }
+            catch (Exception ex)
+            {
+                l.WriteLog(0, "frmMain.EventData异常:" + ex.Message);
+            }
+        }
+
+        private delegate void ShowBtnTare(bool flag);//定义委托  期限皮重按钮
+
+
+        /// <summary>
+        /// 操作Live表的数据:零点报警
+        /// </summary>
+        private void doOperateLive()
+        {
+            if (PbCache.collect_no == null)
+            {
+                return;
+            }
+            List<LiveData> ll = MemoClass.getWarnInfo(PbCache.collect_no);
+            if (ll != null)
+            {
+                foreach (LiveData lv in ll)
+                {
+                    switch (lv.Tagname.Replace(PbCache.collect_no, ""))
+                    {
+                        case "StaticStatus"://车辆检测	"0、东西方向激光均无报警;否则报警
+
+                            break;
+                        case "SwitchLight"://PLC红绿灯控制模式状态	"PLC有三种控制模式:1、自动、2、远控;3、检修
+
+                            break;
+                        case "LightWest"://红绿灯:1、为绿灯;2、为红灯;"
+
+                            break;
+                        case "ZeroWeightStatus": //0、其它,1、零点报警,红绿灯变红,
+                            if (((lv.Value ?? "0") + "").Equals("1"))
+                            {
+                                doInsertZeroAlarm();
+                                PbCache.isZeroAlarm = true;
+                            }
+                            else
+                            {
+                                PbCache.isZeroAlarm = false;
+                            }
+                            break;
+                    }
+                }
+            }
+        }
+
+
+        /// <summary>
+        /// 操作Live表的数据:零点报警
+        /// </summary>
+        private void doLive()
+        {
+            if (PbCache.collect_no == null)
+            {
+                return;
+            }
+            List<LiveData> ll = MemoClass.getWarnInfo(PbCache.collect_no);
+            MeterWorkMonitor mwm = new MeterWorkMonitor();
+            mwm.pointNo = PbCache.sportInfo.baseSpotNo;
+            mwm.redGreenLightState = "0";
+            if (ll != null)
+            {
+                foreach (LiveData lv in ll)
+                {
+                    switch (lv.Tagname.Replace(PbCache.collect_no, ""))
+                    {
+                        case "PowerStatus":
+                            mwm.powerState = lv.Value.ToString();
+                            break;
+                        case "PlcWatchDog":
+                            if (int.Parse(lv.Value.ToString()) >= 0 && int.Parse(lv.Value.ToString()) <= 0)
+                            {
+                                mwm.plcState = 0.ToString();
+                            }
+                            break;
+                        case "InfraredWest":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.leftInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.leftInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "InfraredEast":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.rightInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.rightInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "AmplifierState":
+                            mwm.amplifierState = lv.Value.ToString();
+                            break;
+                        case "LampState":
+                            mwm.lampState = lv.Value.ToString();
+                            break;
+                        case "InfraredLeft":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.frontInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.frontInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "InfraredRight":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.rearInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.rearInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "RfidState":
+                            mwm.rfidState = lv.Value.ToString();
+                            break;
+                    }
+                }
+            }
+            RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(mwm);
+        }
+
+
+        /// <summary>
+        /// 新增零点报警的数据
+        /// </summary>
+        private void doInsertZeroAlarm()
+        {
+            if (!PbCache.isZeroAlarm)
+            {
+                PbCache.isZeroAlarm = true;
+                MeterWorkZeroAlarm workZeroAlarm = new MeterWorkZeroAlarm();
+                workZeroAlarm.zeroWeight = PbCache.collect.weight;
+                workZeroAlarm.spotTypeNo = PbCache.sportInfo.spotTypeNo;
+                workZeroAlarm.spotTypeName = PbCache.sportInfo.spotTypeName;
+                workZeroAlarm.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+                workZeroAlarm.baseSpotName = PbCache.sportInfo.baseSpotName;
+                workZeroAlarm.scalePointNo = PbCache.collect_no;
+                workZeroAlarm.createManNo = PbCache.sportInfo.baseSpotNo;
+                workZeroAlarm.createManName = PbCache.sportInfo.baseSpotName;
+                RESTfulResult<String> rms = zeroAlarmService.doInsertZeroAlarm(workZeroAlarm);
+                if (rms.Succeed)
+                {
+                    l.WriteLog(20, "新增成功:" + workZeroAlarm.baseSpotName + ":" + workZeroAlarm.zeroWeight);
+                }
+                else
+                {
+                    l.WriteLog(20, "操作失败:" + workZeroAlarm.baseSpotName + ":" + workZeroAlarm.zeroWeight + rms.Data + rms.Message);
+                }
+            }
+        }
+
+        /// <summary>
+        /// 关闭程序
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            collection.Stop();
+            imageCurlControl.Stop();
+            sweepCodeClass.CloseThread();
+            timer1.Stop();
+            timer1.Dispose();
+        }
+
+        public void WriteText(int iType, string str)
+        {
+            try
+            {
+                string strLogName = "";
+                switch (iType)
+                {
+                    case 0:
+                        strLogName = "车号采集_";
+                        break;
+                    case 1:
+                        strLogName = "判稳时间_";
+                        break;
+                }
+
+                string m_szRunPath;
+                m_szRunPath = System.Environment.CurrentDirectory;
+                if (System.IO.Directory.Exists(m_szRunPath + "\\log") == false)
+                {
+                    System.IO.Directory.CreateDirectory(m_szRunPath + "\\log");
+                }
+                string strDate = System.DateTime.Now.ToString("yyyyMMdd");
+                string strPathFile = m_szRunPath + "\\log\\" + strDate;
+                if (!Directory.Exists(strPathFile))//如果不存在就创建file文件夹
+                {
+                    Directory.CreateDirectory(strPathFile);
+                }
+                System.IO.TextWriter tw = new System.IO.StreamWriter(strPathFile + "\\" + strLogName + strDate + ".log", true);
+
+                tw.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
+                tw.WriteLine(str);
+                tw.WriteLine("\r\n");
+
+                tw.Close();
+            }
+            catch (Exception ex)
+            {
+
+            }
+        }
+    }
+}

+ 123 - 0
CarMeterMonitor/fromContect.resx

@@ -0,0 +1,123 @@
+<?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="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 6 - 3
CarMeterSystem/App.config

@@ -6,10 +6,10 @@
 	<appSettings>
 		<!--<add key="ServiceUrl" value="http://127.0.0.1:9004/v1" />-->
     <!--<add key="ServiceUrl" value="http://10.104.4.105:9004/v1" />-->
-    <add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />
+    <!--<add key="ServiceUrl" value="http://10.104.0.1:9004/v1" />-->
 		<!--<add key="ServiceUrl" value="http://192.168.107.60:8888/icore.icp.winform/pass/jlcar"/>-->
     <!--<add key="ServiceUrl" value="http://192.168.185.29/icore.icp.winform/pass/jlcar"/>-->
-    <!--<add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>-->
+    <add key="ServiceUrl" value="http://jgwzjl.jiugang.com/icore.icp.web/pass/systemBase/v1"/>
     <!--实时库地址-->
 		<add key="icoredbTcp" value="tarantool://guest@10.99.200.86:2101" />
 		<!--SFTP或者vsftp服务端连接及地址-->
@@ -26,7 +26,7 @@
 		<add key="imgHeight" value="1200" />
 		<!--毛皮差值验证(单位kg)-->
 		<add key="differenceWgt" value="400" />
-		<!--进入测试界面还是正式界面 0测试,1正式,2一码到底测试-->
+		<!--进入测试界面还是正式界面 0测试,1正式,2一码到底测试,3判稳测试工具-->
 		<add key="productType" value="0" />
 		<!--联达比较重量-->
 		<add key="lianDaWgt" value="200" />
@@ -43,6 +43,9 @@
     <add key="carTypeName" value="外部" />
 
 		<add key="ClientSettingsProvider.ServiceUri" value="" />
+
+    <!--厂内外车配置:001004003(内部),001004002(外部)-->
+    <add key="carAdd" value="1" />
 	</appSettings>
 	<system.web>
 		<membership defaultProvider="ClientAuthenticationMembershipProvider">

+ 10 - 0
CarMeterSystem/CarMeterSystem.csproj

@@ -23,6 +23,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
+    <Prefer32Bit>true</Prefer32Bit>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -98,6 +99,12 @@
     <Compile Include="frmWelcome_Jisco.Designer.cs">
       <DependentUpon>frmWelcome_Jisco.cs</DependentUpon>
     </Compile>
+    <Compile Include="fromContect.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="fromContect.Designer.cs">
+      <DependentUpon>fromContect.cs</DependentUpon>
+    </Compile>
     <Compile Include="Interface\HttpHelper.cs" />
     <Compile Include="Interface\JGLimsInterface.cs" />
     <Compile Include="Interface\JGLimsMsg.cs" />
@@ -174,6 +181,9 @@
     <EmbeddedResource Include="frmWelcome.resx">
       <DependentUpon>frmWelcome.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="fromContect.resx">
+      <DependentUpon>fromContect.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>

+ 58 - 1
CarMeterSystem/Form1.cs

@@ -9,7 +9,9 @@ using MeterPlugInLibrary;
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Diagnostics;
 using System.Drawing;
+using System.IO;
 using System.Linq;
 using System.Windows.Forms;
 
@@ -61,7 +63,6 @@ namespace CarMeterSystem
 
         //查询当前是否校秤
         private bool bRelation = true;
-
         /// <summary>
         /// 欢迎界面
         /// </summary>
@@ -96,6 +97,7 @@ namespace CarMeterSystem
                 //frmMatMsgInfo frmMatMsgInfo = new frmMatMsgInfo();
                 //frmMatMsgInfo.Show();
 
+
                 timer1.Start();
                 //2021年6月21日 杨秀东添加
                 if (isShowFrmWelcome)
@@ -108,6 +110,10 @@ namespace CarMeterSystem
 
                 if (lg.LoginIn())
                 {
+                    if (SystemUpdate(false))
+                    {
+                        return;
+                    }
                     // 加载并验证基本配置
                     if (bd.setBaseDb() && bd.getBaseDb())
                     {
@@ -1344,5 +1350,56 @@ namespace CarMeterSystem
             timer1.Stop();
             timer1.Dispose();
         }
+        private bool SystemUpdate(bool isMessage)
+        {
+            ReleaseList releaseList = new ReleaseList(Application.StartupPath + @"\" + GlobalVariable.Instance.ReleaseFileName);
+            DownloadTools dt = new DownloadTools();
+            try
+            {
+                bool isDownload = dt.IsDownloadFile(GlobalVariable.Instance.LocalPath, GlobalVariable.Instance.ReleaseURL, GlobalVariable.Instance.ReleaseFileName);
+                if (!isDownload)
+                {
+                    if (isMessage) MessageBox.Show("无法连接到远程主机!", Application.ProductName);
+                    return false;
+                }
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show(e.Message);
+            }
+
+            bool flag = this.CheckUpdate(releaseList);
+
+            if (flag)
+            {
+                MessageBox.Show("有新版本,现在更新");
+                string t = dt.DownloadFile(Application.StartupPath, GlobalVariable.Instance.ReleaseURL, GlobalVariable.Instance.ApplicationUpdater);
+                this.Close();
+                Application.Exit();
+                GC.Collect();
+                Process.Start(Application.StartupPath + @"\" + GlobalVariable.Instance.ApplicationUpdater);
+                return true;
+            }
+            else
+            {
+                if (isMessage) MessageBox.Show("你的系统已经是最新版本,不需要更新!", Application.ProductName);
+                return false;
+            }
+        }
+
+        private bool CheckUpdate(ReleaseList localRelease)
+        {
+            try
+            {
+                string fileNameAll = Application.StartupPath + "\\" + GlobalVariable.Instance.LocalPath + "\\" + GlobalVariable.Instance.ReleaseFileName;
+                ReleaseList remoteRelease = new ReleaseList(fileNameAll);
+                return (((localRelease != null) && (remoteRelease != null)) && localRelease.ReleaseDate.CompareTo(remoteRelease.ReleaseDate) < 0);
+            }
+            catch (Exception exception)
+            {
+                MessageBox.Show(exception.Message);
+            }
+            return false;
+        }
     }
 }

+ 4 - 0
CarMeterSystem/Program.cs

@@ -26,6 +26,10 @@ namespace CarMeterSystem
                     {
                         Application.Run(new Form1());//
                     }
+                    else if (AppConfigCache.productType == "3")
+                    {
+                        Application.Run(new fromContect());//
+                    }
                     else 
                     {
                         Application.Run(new frmMain());//

+ 61 - 0
CarMeterSystem/frmMain.cs

@@ -9,6 +9,7 @@ using MeterPlugInLibrary;
 using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Diagnostics;
 using System.Drawing;
 using System.Linq;
 using System.Windows.Forms;
@@ -104,6 +105,10 @@ namespace CarMeterSystem
                
                 if (lg.LoginIn())
                 {
+                    if (SystemUpdate(false))
+                    {
+                        return;
+                    }
                     if (bd.setBaseDb() && bd.getBaseDb())
                     {
                         if (!string.IsNullOrEmpty(PbCache.sportInfo.ledIp))
@@ -580,6 +585,10 @@ namespace CarMeterSystem
                         #region RFID识别车号信息
                         mwUpdate.rfidCar = "";
                         mwUpdate.photoCar = e.vdioCarNos;
+                        if (codeFlag)
+                        {
+                            mwUpdate.scanCar = PbCache.collect.carno;
+                        }
                         //mwUpdate.photoCar = PbCache.collect.carno;
                         if (!string.IsNullOrEmpty(e.RfidNos))
                         {
@@ -967,5 +976,57 @@ namespace CarMeterSystem
             timer1.Stop();
             timer1.Dispose();
         }
+
+        private bool SystemUpdate(bool isMessage)
+        {
+            ReleaseList releaseList = new ReleaseList(Application.StartupPath + @"\" + GlobalVariable.Instance.ReleaseFileName);
+            DownloadTools dt = new DownloadTools();
+            try
+            {
+                bool isDownload = dt.IsDownloadFile(GlobalVariable.Instance.LocalPath, GlobalVariable.Instance.ReleaseURL, GlobalVariable.Instance.ReleaseFileName);
+                if (!isDownload)
+                {
+                    if (isMessage) MessageBox.Show("无法连接到远程主机!", Application.ProductName);
+                    return false;
+                }
+            }
+            catch (Exception e)
+            {
+                MessageBox.Show(e.Message);
+            }
+
+            bool flag = this.CheckUpdate(releaseList);
+
+            if (flag)
+            {
+                MessageBox.Show("有新版本,现在更新");
+                string t = dt.DownloadFile(Application.StartupPath, GlobalVariable.Instance.ReleaseURL, GlobalVariable.Instance.ApplicationUpdater);
+                this.Close();
+                Application.Exit();
+                GC.Collect();
+                Process.Start(Application.StartupPath + @"\" + GlobalVariable.Instance.ApplicationUpdater);
+                return true;
+            }
+            else
+            {
+                if (isMessage) MessageBox.Show("你的系统已经是最新版本,不需要更新!", Application.ProductName);
+                return false;
+            }
+        }
+
+        private bool CheckUpdate(ReleaseList localRelease)
+        {
+            try
+            {
+                string fileNameAll = Application.StartupPath + "\\" + GlobalVariable.Instance.LocalPath + "\\" + GlobalVariable.Instance.ReleaseFileName;
+                ReleaseList remoteRelease = new ReleaseList(fileNameAll);
+                return (((localRelease != null) && (remoteRelease != null)) && localRelease.ReleaseDate.CompareTo(remoteRelease.ReleaseDate) < 0);
+            }
+            catch (Exception exception)
+            {
+                MessageBox.Show(exception.Message);
+            }
+            return false;
+        }
     }
 }

+ 85 - 63
CarMeterSystem/frmOneYardToEnd.cs

@@ -217,7 +217,7 @@ namespace CarMeterSystem
                 {
                     PbCache.isLockFrm = false;
                     btnSave.Enabled = true;
-                    setMsg("秤体存在零点,禁止进行计量操作!请点[语音求助],联系司秤工处理!");
+                    setMsg("秤体存在零点,禁止进行计量操作!请点[语音求助],联系计量大厅处理!");
                     return;
                 }
 
@@ -239,12 +239,15 @@ namespace CarMeterSystem
                 {
                     //是否在黑名单内
                     MeterBaseCarBlacelistService bService = new MeterBaseCarBlacelistService();
-                    RESTfulResult<List<MeterBaseCarBlacelist>> rmB = bService.doQueryWf(new MeterBaseCarBlacelist { carNo = PbCache.lockCarNo, valueFlag = "0" });
+                    RESTfulResult<List<MeterBaseCarBlacelist>> rmB = bService.doQueryWf(new MeterBaseCarBlacelist { carNo = PbCache.lockCarNo, valueFlag = "1" });
                     if (rmB.Succeed)
                     {
                         if (rmB.Data != null && rmB.Data.Count > 0)
                         {
+                            PbCache.voiceType = 22;
+                            readVoicd();
                             PbCache.ResultMessage = string.Format("车辆[{0}在黑名单内,不能计量", PbCache.lockCarNo);
+                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, string.Format("车辆[{0}在黑名单内,不能计量", PbCache.lockCarNo));
                             lg.WriteLog(3, string.Format("车辆[{0}在黑名单内,不能计量", PbCache.lockCarNo));
 
                             PbCache.isLockFrm = false;
@@ -318,7 +321,7 @@ namespace CarMeterSystem
                             strMsg = strRm.ResultMessage;
                             if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                             {
-                                led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                             }
                         }
                         catch (Exception exp)
@@ -329,7 +332,7 @@ namespace CarMeterSystem
                             setMsg(PbCache.ResultMessage);
                             if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
                             {
-                                led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                                led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
                             }
                             //break;
                             return;
@@ -338,16 +341,20 @@ namespace CarMeterSystem
                     else
                     {
                         //拿到车辆
-                        RESTfulResult<List<MeterBaseCar>> resCarLists = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.lockCarNo });
-                        RESTfulResult<List<MeterBaseSpecialUnit>> sunitList = meterBaseSpecialUnitService.doQueryCarList(new MeterBaseSpecialUnit { unitNo = resCarLists.Data[0].usetDepartmentNo });
-
-                        if (sunitList.Data == null || sunitList.Data.Count != 1)
+                        RESTfulResult<List<MeterBaseCar>> resCarLists = carService.doQueryCarList(new MeterBaseCar { carNo = PbCache.lockCarNo,carTypeNo = "001004003" });
+                        if (resCarLists.Data == null || resCarLists.Data.Count == 0)
                         { }
                         else
                         {
-                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "请通过APP确认本次重量,重量为" + Math.Round((PbCache.lockWgt / 1000), 2) + "T");
-                        }
+                            RESTfulResult<List<MeterBaseSpecialUnit>> sunitList = meterBaseSpecialUnitService.doQueryCarList(new MeterBaseSpecialUnit { unitNo = resCarLists.Data[0].usetDepartmentNo });
 
+                            if (sunitList.Data == null || sunitList.Data.Count != 1)
+                            { }
+                            else
+                            {
+                                led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "请通过APP确认本次重量,重量为" + Math.Round((PbCache.lockWgt / 1000), 2) + "T");
+                            }
+                        }
                         // 把车号加上-
                         string tempCarNo = PbCache.lockCarNo;
                         RESTfulResult<List<MeterBaseCar>> resCarList = carService.doQueryCarList(new MeterBaseCar { carNo = tempCarNo });
@@ -460,7 +467,7 @@ namespace CarMeterSystem
 
                                     if (strRm.Data.result) //说明:标识当前跑了一个场景成功了;场景完成后则返回,不再进行下一个场景的执行操作;
                                     {
-                                        PbCache.ResultMessage = strRm.Data.resultInfo; //语音提示文件
+                                        PbCache.ResultMessage = strRm.Data.resultInfo; 
                                         setMsg(PbCache.ResultMessage);
                                         Monitor(strRm.Data);
                                         if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
@@ -502,40 +509,40 @@ namespace CarMeterSystem
 
                                 }
                             }
-                            else
-                            {
-                                if (string.IsNullOrEmpty(tempCarNo))
-                                {
-                                    PbCache.ResultMessage += "车号为空,请联系处理";
-                                    PbCache.monitorResultMessage = "车号为空,请联系处理";
-                                    vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.lockCarNo);
-                                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
-                                }
-                                else
-                                {
-                                    PbCache.ResultMessage += "车号未注册,请联系处理";
-                                    PbCache.monitorResultMessage = "车号未注册,请联系处理";
-                                    vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.lockCarNo);
-                                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
-                                }
-                                PbCache.isLockFrm = false;
-                                btnSave.Enabled = true;
-
-                                setMsg(PbCache.ResultMessage);
-                                rtInfo rt = new rtInfo();
-                                rt.isWarn = true;
-                                rt.WarnContent = "carErr";
-                                Monitor(rt);
-                                if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
-                                {
-                                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
-                                }
-                                if (!string.IsNullOrEmpty(tempCarNo))
-                                {
-                                    carService.addCar(new MeterBaseCar { carNo = tempCarNo, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
-                                }
-                                return;
-                            }
+                            //else
+                            //{
+                            //    if (string.IsNullOrEmpty(tempCarNo))
+                            //    {
+                            //        PbCache.ResultMessage += "车号未识别,请联系处理";
+                            //        PbCache.monitorResultMessage = "车号未识别,请联系处理";
+                            //        vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.lockCarNo);
+                            //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
+                            //    }
+                            //    else
+                            //    {
+                            //        PbCache.ResultMessage += "车号未注册,请联系处理";
+                            //        PbCache.monitorResultMessage = "车号未注册,请联系处理";
+                            //        vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.lockCarNo);
+                            //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
+                            //    }
+                            //    PbCache.isLockFrm = false;
+                            //    btnSave.Enabled = true;
+
+                            //    setMsg(PbCache.ResultMessage);
+                            //    rtInfo rt = new rtInfo();
+                            //    rt.isWarn = true;
+                            //    rt.WarnContent = "carErr";
+                            //    Monitor(rt);
+                            //    if (!string.IsNullOrEmpty(PbCache.LEDResultMessage))
+                            //    {
+                            //        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, PbCache.LEDResultMessage);
+                            //    }
+                            //    if (!string.IsNullOrEmpty(tempCarNo))
+                            //    {
+                            //        carService.addCar(new MeterBaseCar { carNo = tempCarNo, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
+                            //    }
+                            //    return;
+                            //}
                         }
                         #endregion
                     }
@@ -853,8 +860,8 @@ namespace CarMeterSystem
                             if (!string.IsNullOrEmpty(PbCache.monitor.isOverWgt) && PbCache.monitor.isTakeOver == "2" && !isOverSound) //&& !PbCache.isLockFrm)
                             {
                                 ucWeightCarTJXJG1.setWgtBackColor(true);//称重完成后,显示颜色;
-                                txtMsgInfo.Text = "称重完成";
-                                vicPlayClass.GetVoicePlay("称重完成", PbCache.collect.carno);
+                                txtMsgInfo.Text = "计量完成";
+                                vicPlayClass.GetVoicePlay("计量完成,请离开秤台", PbCache.collect.carno);
                                 isOverSound = true;
                                 Print1(PbCache.monitor.isOverWgt);
                                 return;
@@ -865,11 +872,11 @@ namespace CarMeterSystem
                                 btnSave.Visible = false;
                                 bRelation = true;
                                 lg.WriteLog(14, "车号:" + PbCache.collect.carno + ";远程计量完成后,保存按钮隐藏!");
-                                if (!txtMsgInfo.Text.Contains("称重完成") && PbCache.monitor.isTakeOver == "2")
+                                if (!txtMsgInfo.Text.Contains("计量完成") && PbCache.monitor.isTakeOver == "2")
                                 {
                                     txtMsgInfo.Text = "正在远程计量,请等待处理!!";
                                 }
-                                if (!txtMsgInfo.Text.Contains("称重完成") && !string.IsNullOrEmpty(PbCache.monitor.isOverWgt))
+                                if (!txtMsgInfo.Text.Contains("计量完成") && !string.IsNullOrEmpty(PbCache.monitor.isOverWgt))
                                 {
                                     txtMsgInfo.Text = "本次计量称重已经完成,车辆请下秤!!";
                                 }
@@ -948,7 +955,7 @@ namespace CarMeterSystem
                         }
                     }
                     if (PbCache.collect.weightStatus == 0 && !PbCache.monitorResult.valid_park_status)
-                    {6
+                    {
                         //重量稳定,且对射验证不合格
                         if (!isPlayCalibVoice)
                         {
@@ -963,7 +970,7 @@ namespace CarMeterSystem
                         if (!isPlayOvertimeVoice && !PbCache.isLockFrm)
                         {
                             vicPlayClass.GetVoicePlay("停留超时", PbCache.collect.carno);
-                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
+                            led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "停留超时");
                             //txtMsgInfo.Text = "您的车辆已停留超过三分钟,遇到操作问题请点击【语音求助】联系司秤工处理或继续进行自助计量!";
                             isPlayOvertimeVoice = true;
                             return;
@@ -973,10 +980,13 @@ namespace CarMeterSystem
                     #region 模拟APP
                     if (!string.IsNullOrEmpty(PbCache.collect.carno))
                     {
-                        string sqls = "UPDATE METER_BASE_APP_TEST SET CAR_NO= '"+ PbCache.collect.carno + "' where ID = 1";
+                        if (ConfigurationManager.AppSettings["carAdd"].ToString().Trim() == "1")
+                        {
+                            string sqls = "UPDATE METER_BASE_APP_TEST SET CAR_NO= '" + PbCache.collect.carno + "' where ID = 1";
 
-                        PbModelDbService<List<PbModelDb>> pbp = new PbModelDbService<List<PbModelDb>>();
-                        RESTfulResult<List<PbModelDb>> rmT = pbp.executeSqlDataWf(sqls);
+                            PbModelDbService<List<PbModelDb>> pbp = new PbModelDbService<List<PbModelDb>>();
+                            RESTfulResult<List<PbModelDb>> rmT = pbp.executeSqlDataWf(sqls);
+                        }
                     }
                     #endregion
 
@@ -1139,28 +1149,32 @@ namespace CarMeterSystem
                                     else if (PbCache.isPre)
                                     {
                                         ucCarMeterInfoJisco1.setFormControlValue(PbCache.mwPreFirst);
+                                        bRailwayActual = false;
                                     }
                                 }
                                 else
                                 {
+                                    string ledinfo = "";
                                     if (string.IsNullOrEmpty(PbCache.collect.carno))
                                     {
-                                        txtMsgInfo.Text  = "车号为空,请联系处理";
-                                        PbCache.monitorResultMessage = "车号为空,请联系处理";
-                                        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号为空,请联系处理");
+                                        txtMsgInfo.Text = "车号未识别,请联系处理";
+                                        PbCache.monitorResultMessage = "车号未识别,请联系处理";
+                                        PbCache.ResultMessage = "车号未识别,请联系处理";
+                                        ledinfo = "车号未识别,请联系处理";
                                         vicPlayClass.GetVoicePlay("车号为空,请联系处理", PbCache.lockCarNo);
                                     }
                                     else
                                     {
-                                        txtMsgInfo.Text  = "车号未注册,请联系处理";
+                                        txtMsgInfo.Text = "车号未注册,请联系处理";
                                         PbCache.monitorResultMessage = "车号未注册,请联系处理";
-                                        led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, "车号未注册,请联系处理");
+                                        PbCache.ResultMessage = "车号未注册,请联系处理";
+                                        ledinfo = "车号未注册,请联系处理";
                                         vicPlayClass.GetVoicePlay("车号未注册,请联系处理", PbCache.lockCarNo);
                                     }
 
                                     PbCache.isLockFrm = false;
                                     btnSave.Enabled = true;
-                                
+
                                     rtInfo rt = new rtInfo();
                                     rt.isWarn = true;
                                     rt.WarnContent = "carErr";
@@ -1170,6 +1184,8 @@ namespace CarMeterSystem
                                     {
                                         carService.addCar(new MeterBaseCar { carNo = PbCache.collect.carno, carTypeNo = AppConfigCache.carTypeNo, carTypeName = AppConfigCache.carTypeName });
                                     }
+                                    led_controler.setStaticLineMsg(PbCache.sportInfo.ledIp, ledinfo);
+                                    bRailwayActual = false;
                                     return;
                                 }
                             }
@@ -1217,7 +1233,7 @@ namespace CarMeterSystem
                     #region 界面未锁定的情况下,如果,有车号,重量稳定了,停车线验证通过,完成了扫码验证
 
                     //没有远程接管,且已查过一次数据,且界面未锁定的情况下,如果,有车号,重量稳定了,停车线验证通过,完成了扫码验证的情况下,则按钮可用
-                    if (PbCache.monitor != null && PbCache.monitor.isTakeOver == "0" && !bRailwayActual
+                    if (PbCache.monitor != null && PbCache.monitor.isTakeOver == "0" && !bRailwayActual && !string.IsNullOrEmpty(PbCache.collect.carno)
                         && PbCache.collect.weightStatus == 0 && ucWeightT1.isGreenWgt)
                     {
                         if (!PbCache.isLockFrm)
@@ -1256,12 +1272,12 @@ namespace CarMeterSystem
                         {
                             if (PbCache.monitor.isTakeOver == "1")
                             {
-                                lblog = "正在进行派位,不允许进行自助计量,请点击【语音求助】,联系司秤工处理!";
+                                lblog = "正在进行派位,不允许进行自助计量,请点击【语音求助】,联系计量大厅处理!";
                                 DoShowlbLog(lblog);
                             }
                             if (PbCache.monitor.isTakeOver == "2")
                             {
-                                lblog = "正在进行远程计量,请等待司秤工处理!";
+                                lblog = "正在进行远程计量,请等待计量大厅处理!";
                                 DoShowlbLog(lblog);
                             }
                         }
@@ -2124,6 +2140,12 @@ namespace CarMeterSystem
                 case 21:
                     voiceContent = "计量失败,未选择称重类型";//未选择称重类型,请选择后开始计量
                     break;
+                case 22:
+                    voiceContent = "车辆在黑名单中";//未选择称重类型,请选择后开始计量
+                    break;
+                case 23:
+                    voiceContent = "毛重接近历史皮重";//未选择称重类型,请选择后开始计量
+                    break;
             }
 
 

+ 56 - 0
CarMeterSystem/fromContect.Designer.cs

@@ -0,0 +1,56 @@
+
+namespace CarMeterSystem
+{
+    partial class fromContect
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            this.timer1 = new System.Windows.Forms.Timer(this.components);
+            this.SuspendLayout();
+            // 
+            // timer1
+            // 
+            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+            // 
+            // fromContect
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(800, 450);
+            this.Name = "fromContect";
+            this.Text = "fromContect";
+            this.Load += new System.EventHandler(this.fromContect_Load);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Timer timer1;
+    }
+}

+ 1044 - 0
CarMeterSystem/fromContect.cs

@@ -0,0 +1,1044 @@
+using CarMeterSystem.OptionCls;
+using com.hnshituo.core.webapp.vo;
+using Common;
+using iCore.Rtdb.RtdbTable;
+using MeterConditionLibrary;
+using MeterModelLibrary;
+using MeterModuleLibrary.uc;
+using MeterPlugInLibrary;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace CarMeterSystem
+{
+    public partial class fromContect : Form
+    {
+        public fromContect()
+        {
+            InitializeComponent();
+        }
+
+        private Log l = Log.GetInstance();
+        private Print printClass = new Print();//打印
+
+        //内存表
+        private MemoryTableDataSocket MemoClass = new MemoryTableDataSocket("");
+
+        //实时表数据采集
+        private DataCollectionControl collection = new DataCollectionControl();
+
+        //图片控制器含图片压缩及上传curl
+        private ImageCurlControl imageCurlControl = new ImageCurlControl();
+
+        //与监控界面对接的表
+        private MeterWorkMonitorService meterWorkMonitor = new MeterWorkMonitorService();
+
+        //零点报警表
+        private meterworkzeroalarmservice zeroAlarmService = new meterworkzeroalarmservice();
+
+        //车号修正
+        private CarNoModfiy modfiy = new CarNoModfiy();
+
+        /// <summary>
+        /// 这个是保存前一次采集中的车号信息
+        /// </summary>
+        private string preCarNo = "";
+
+        //验证对射
+        private validParkStatus valid = new validParkStatus();
+
+        //语音播报
+        private VoicePlay vicPlayClass = new VoicePlay();
+
+        //扫码枪
+        private SweepCode sweepCodeClass = new SweepCode();
+
+        private LED_Control led_controler = null;
+
+        //监控表操作
+        private MeterMonitorWeightService monitorWeightService = new MeterMonitorWeightService();
+
+        //历史皮操作
+        private MeterBaseHisTareDataService hisTareDataService = new MeterBaseHisTareDataService();
+
+        /// <summary>
+        /// 欢迎界面
+        /// </summary>
+        private frmWelcome_Jisco frmWelcome = new frmWelcome_Jisco();//欢迎
+
+        private int startCar = 0;
+
+        private int startWeight = 0;
+
+        private DateTime startTime;
+
+        private DateTime endTime;
+
+        /// <summary>
+        /// 基础数据载入
+        /// </summary>
+        private BaseDbCls bd = new BaseDbCls();
+
+        //扫码修正车号标识
+        private bool codeFlag = false;
+
+        private List<ucBusinessType> lu = new List<ucBusinessType>();
+
+        private bool isVoiceDownCar = false;//车上人员请下车播放一次
+        private bool isShowFrmWelcome = false; //是否显示欢迎界面
+
+        private bool isOpened = false;//是否已经打开了扫码计量界面
+        
+        private void fromContect_Load(object sender, EventArgs e)
+        {
+            //*
+            try
+            {
+                //this.Hide();
+
+                LoginCls lg = new LoginCls();
+                timer1.Start();
+
+                //2021年6月21日 杨秀东添加
+                if (isShowFrmWelcome)
+                {
+                    frmWelcome.Show();
+                    frmWelcome.Visible = true;
+                }
+
+                if (lg.LoginIn())
+                {
+                    if (bd.setBaseDb() && bd.getBaseDb())
+                    {
+                        if (!string.IsNullOrEmpty(PbCache.sportInfo.ledIp))
+                        {
+                            led_controler = new LED_Control(PbCache.sportInfo.ledIp);
+                        }
+
+                        //调用该方法时已赋值 test git 测试git推送代码123;456
+                        RESTfulResult<List<MeterWorkMonitor>> rm = meterWorkMonitor.doQueryOneWf(new MeterWorkMonitor { validFlag = "1", pointNo = PbCache.sportInfo.baseSpotNo });
+                        if (!rm.Succeed)
+                        {
+                            l.WriteLog(1, "载入监控表数据异常");
+                            return;
+                        }
+                        else if (rm.Data != null && rm.Data.Count > 0)
+                        {
+                            if (string.IsNullOrEmpty(PbCache.collect_no))
+                            {
+                                PbCache.collect_no = rm.Data[0].collectionCode;
+                                MemoClass = new MemoryTableDataSocket(PbCache.collect_no);
+                            }
+                        }
+                        else
+                        {
+                            l.WriteLog(1, "为配置监控数据");
+                            return;
+                        }
+                        //若未校秤的话,也不允许计量
+
+                        //载入界面业务按钮
+                        if (PbCache.businessType != null && PbCache.businessType.Count > 0)
+                        {
+                            foreach (ComBaseInfo info in PbCache.businessType)
+                            {
+                                ucBusinessType uc = new ucBusinessType();
+                                switch (info.baseCode)
+                                {
+                                    case "001006003":
+                                        uc.setControl(info.baseName, info.memo, info.baseCode);
+                                        break;
+
+                                    case "001006001":
+                                    case "001006002":
+                                        uc.setControl(info.baseName, info.memo, info.baseCode);
+                                        break;
+
+                                    default:
+                                        uc.setControl(info.baseName, info.memo, info.baseCode);
+                                        break;
+                                }
+
+                                uc.Dock = DockStyle.Top;
+                                //uc.setControl("","","",);
+                                uc.ucEvent += new EventHandler(ucEvents);
+                                lu.Add(uc);
+                                //panel7.Controls.Add(uc);
+                            }
+                        }
+
+                        //开启基础进程
+                        l.WriteLog(0, "系统登录成功");
+
+                        collection.EventDataCollectionArgs += new EventDataCollection(EventData);//数据采集及扫码信息
+                        collection.Start(PbCache.sportInfo.baseSpotNo, PbCache.sportInfo.baseSpotName);
+
+                        imageCurlControl.Start(); //图片上传线程
+                        sweepCodeClass.StartThreadSweep(); //扫码线程
+                    }
+                    else
+                    {
+                        l.WriteLog(0, "系统登录失败");
+                    }
+                }
+                else
+                {
+                    l.WriteLog(0, "按IP地址找不到计量点信息,系统登录失败");
+                }
+            }
+            catch (Exception ex)
+            {
+                l.WriteLog(0, "系统加载失败:" + ex.Message);
+            }
+            //*/
+        }
+
+        /// <summary>
+        /// 直接打开扫码计量界面
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void timer1_Tick(object sender, EventArgs e)
+        {
+            if (!isOpened && PbCache.collect?.weight > 500)
+            {
+                isOpened = true;
+                PbCache.bussinessTypeName = "";
+                PbCache.bussinessTypeCode = "";
+                //frmOneYardToEnd fcc = new frmOneYardToEnd();
+                //fcc.ShowDialog();
+            }
+        }
+
+        #region
+        //*
+
+        /// <summary>
+        /// 委托的方式调用控件的点击事件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        public void ucEvents(object sender, EventArgs e)
+        {
+            Control control = (Control)sender;
+            ucBusinessType um = control.Parent.Parent as ucBusinessType;
+
+            try
+            {
+                switch (control.Name)
+                {
+                    case "btnContext":
+                    case "btnPurchase":
+                        {
+                            PbCache.bussinessTypeName = um._bussiness == null ? "" : um._bussiness;
+                            PbCache.bussinessTypeCode = um._code;
+
+                            switch (um._code)
+                            {
+                                case "001006003":
+                                    frmInternalTransport frm = new frmInternalTransport();
+                                    frm.ShowDialog();
+                                    break;
+                                /*
+                                case "001006001":
+                                case "001006002":
+                                    frmCarSalePurchase frmCar = new frmCarSalePurchase();
+                                    frmCar.ShowDialog();
+                                    break;
+                                //*/
+                                default:
+                                    frmCarSalePurchase frmCar = new frmCarSalePurchase();
+                                    frmCar.ShowDialog();
+                                    break;
+                            }
+                        };
+                        break;
+
+                    default: break;
+                }
+            }
+            catch (Exception ex)
+            {
+                //MessageBox.Show("操作异常:" + ex.Message);
+            }
+        }
+
+        //*/
+        #endregion
+
+        #region
+
+        private void setThisVis(bool visb)
+        {
+            if (this.InvokeRequired)
+            {
+                Action<bool> action = new Action<bool>(setThisVis);
+                Invoke(action, new object[] { visb });
+            }
+            else
+            {
+                if (this.Visible != visb)
+                {
+                    this.Visible = visb;
+                }
+            }
+        }
+
+        #endregion
+
+        #region
+
+        private void setWelecomeVis(bool visb)
+        {
+            if (!isShowFrmWelcome) return;//2021年6月21日 杨秀东添加
+
+            if (frmWelcome.InvokeRequired)
+            {
+                Action<bool> action = new Action<bool>(setWelecomeVis);
+                Invoke(action, new object[] { visb });
+            }
+            else
+            {
+                if (frmWelcome.Visible != visb)
+                {
+                    frmWelcome.Visible = visb;
+                    frmWelcome.setLogin();
+                }
+            }
+            //*/
+        }
+
+        #endregion
+
+        private int iCount = 0, iHodeTime = 0;
+        private bool flagCarMonit = false;//车号修正
+        private bool bEditCar = false; //手动修正车号
+        private bool isOpenMeter = false; //是否已打开计量界面,若已经打开则这里关于超量程及红外的语音将停止播报
+        private string firstCode = "";//上次扫码的信息
+
+        private string ledTxt = "";
+        private bool isLedWrite = false;//是否写入一次LED
+
+        private string sPreNo = ""; //记录重量曲线变化
+        private int preWgt = 0;//前一次重量,用于重量曲线
+        private string sCarNo = "";
+
+        private int iCountPark = 0;
+        private string editCarNo = "";
+
+        /// <summary>
+        /// 数据采集
+        /// </summary>
+        /// <param name="o"></param>
+        /// <param name="e"></param>
+        private void EventData(object o, DataCollectionArgs e)
+        {
+            //这里每隔0.5秒执行一次
+            try
+            {
+                #region 扫码信息
+                sweepCodeClass.StrState = e.weightStatus + ""; //重量状态信息;当StrState= 0时,获取扫码信息,StrState= 2时将扫码信息置位“”空;其他状态不处理
+
+                if (string.IsNullOrEmpty(sweepCodeClass.StrCode))
+                {
+                    codeFlag = false;
+                    if (string.IsNullOrEmpty(PbCache.strCode))
+                    {
+                        firstCode = "";
+                        PbCache.strCode = "";
+                        l.WriteLog(12, "主线程扫码值为空时清空;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode值为:" + PbCache.strCode);
+                    }
+                }
+                else
+                {
+                    ////日期2021年12月22日:重复扫码,取前面12位
+                    //if (sweepCodeClass.StrCode.Length > 15)
+                    //{
+                    //    // todo: 加入车号截取逻辑
+                    //    sweepCodeClass.StrCode = sweepCodeClass.StrCode.Substring(0,12);
+                    //}
+                    //if (firstCode != sweepCodeClass.StrCode || string.IsNullOrEmpty(PbCache.strCode))
+                    //{
+                    //    l.WriteLog(12, "主线程扫码值赋值;sweepCodeClass.StrCode值为" + sweepCodeClass.StrCode + " ;PbCache.strCode前值为:" + PbCache.strCode);
+                    //    PbCache.strCode = sweepCodeClass.StrCode;
+                    //    firstCode = PbCache.strCode;
+                    //}
+                    l.WriteLog(12, "测试扫码值" + PbCache.strCode);
+                    PbCache.collect.carno = sweepCodeClass.StrCode;
+                    codeFlag = true;
+                }
+
+                #endregion 扫码信息
+
+                #region 秤上无车10分钟获取一次基础数据
+                if (iCount < 1200)
+                {
+                    iCount++;
+                }
+                else
+                {
+                    try
+                    {
+                        //秤上没有车时,每隔10分钟获取一次基础数据
+                        if (e.weight < 500)
+                        {
+                            if (bd.setBaseDb())
+                            {
+                                l.WriteLog(0, "十分钟获取基础数据成功");
+                            }
+                            else
+                            {
+                                l.WriteLog(0, "十分钟获取基础数据失败");
+                            }
+                            iCount = 0;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        l.WriteLog(0, "十分钟获取基础数据失败:" + ex.Message);
+                        iCount = 0;
+                    }
+                }
+                #endregion
+
+                #region 每10秒写入一次当前时间
+                if (iCount % 20 == 0)
+                {
+                    //更新在线时间
+                    RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(new MeterWorkMonitor { pointNo = PbCache.sportInfo.baseSpotNo, lastTime = DateTime.Now });
+                    if (!rms.Succeed)
+                    {
+                        l.WriteLog(0, "frmMain.EventData异常:写入时间异常");
+                    }
+                }
+                #endregion
+
+                #region
+                //一旦界面锁定则不采集数据
+                if (!PbCache.isLockFrm)
+                {
+                    PbCache.collect.pointid = PbCache.sportInfo.baseSpotNo;
+                    PbCache.collect.weight = e.weight;
+                    PbCache.collect.weightStatus = e.weightStatus;
+                    PbCache.collect.parkStatus = e.parkStatus;
+                    PbCache.collect.datetime = e.datetime;
+                    PbCache.collect.licType = e.licType;
+                }
+                //*/
+
+                // 更新监控表
+                doLive();
+
+                //重量大于500的情况下
+                if (e.weight > 500)
+                {
+                    if (startWeight == 0)
+                    {
+                        startTime = DateTime.Now;
+                        startWeight = 1;
+                    }
+                    if (startCar == 0 && e.vdioCarNos != "")
+                    {
+                        WriteText(0, "当前采集车号:" + e.vdioCarNos);
+                        startCar = 1;
+                    }
+
+                    if (startWeight == 1 && PbCache.collect.weightStatus == 0)
+                    {
+                        endTime = DateTime.Now;
+                        startWeight = 2;
+                        TimeSpan secondSpan = new TimeSpan(endTime.Ticks - startTime.Ticks);
+                        WriteText(1,"开始时间:"+ startTime.ToString("yyyy-MM-dd HH:mm:ss:fff") +",结束时间:"+ endTime.ToString("yyyy-MM-dd HH:mm:ss:fff") + ",时间差:"+ secondSpan.TotalSeconds +"秒" + ",重量:" + e.weight);
+                    }
+
+                    if (PbCache.dtStartTime == null)
+                        PbCache.dtStartTime = DateTime.Now;
+                    isLedWrite = true;
+
+                    #region 车上人员请下车
+                    try
+                    {
+                        //界面未锁定的情况下,有车号,如果重量稳定了,停车线验证通过,未超量程的情况下,则按钮可用
+                        if (PbCache.collect != null && !string.IsNullOrEmpty(PbCache.collect.carno) && PbCache.collect.weightStatus == 0 && PbCache.monitorResult.valid_park_status && PbCache.collect.weight < PbCache.range.upperRange)
+                        {
+                            if (!isVoiceDownCar)
+                            {
+                                isVoiceDownCar = true;
+                                vicPlayClass.GetVoicePlay("车上人员请下车", PbCache.collect.carno);
+                            }
+                        }
+                    }
+                    catch { }
+                    #endregion
+
+                    setWelecomeVis(false);
+
+                    //每隔1秒刷一次计量实时监控表数据值
+                    if (iCount % 2 == 0)
+                    {
+                        //调用该方法时已赋值
+                        RESTfulResult<List<MeterWorkMonitor>> rm = meterWorkMonitor.doQueryOneWf(new MeterWorkMonitor { validFlag = "1", pointNo = PbCache.sportInfo.baseSpotNo });
+                        if (!rm.Succeed)
+                        {
+                            l.WriteLog(0, "frmMain.EventData异常419:" + rm.ResultMessage);
+                        }
+                        else
+                        {
+                            if (rm.Data != null && rm.Data.Count > 0)
+                            {
+                                PbCache.monitor = rm.Data[0];
+
+                                if (string.IsNullOrEmpty(PbCache.collect_no))
+                                {
+                                    PbCache.collect_no = rm.Data[0].collectionCode;
+                                }
+
+                                if (ledTxt != rm.Data[0].ledWriter && rm.Data[0].ledWriter != "")
+                                {
+                                    //调用LED信息写入******************************
+                                    ledTxt = rm.Data[0].ledWriter;
+                                }
+
+                                if (string.IsNullOrEmpty(ledTxt))
+                                {
+                                    ledTxt = "欢迎使用酒钢汽车衡智能计量系统!";
+                                }
+                            }
+                        }
+
+                        #region 2021-03-29
+                        #region 摄像头当前采集的车号与上次采集的不一样且当前未勾选不验证,且当前车号未进行手动修正的情况下
+                        if (preCarNo != e.carno && PbCache.monitor != null && PbCache.monitor.validCarno != "0" && !bEditCar)
+                        {
+                            flagCarMonit = false;
+                        }
+                        preCarNo = e.carno;
+                        #endregion
+
+                        if (!flagCarMonit)
+                        {
+                            sCarNo = e.carno;
+                        }
+
+                        //*
+                        //有车号,且重量稳定的情况下,只修正一次车号
+                        if (!string.IsNullOrEmpty(e.carno) && e.weightStatus == 0 && !flagCarMonit && PbCache.monitor != null && PbCache.monitor.carMonitor == "1" && PbCache.monitor.carMonitorLvl > 0)
+                        {
+                            flagCarMonit = true;
+                            string methods = "";
+                            for (int i = 0; i <= PbCache.monitor.carMonitorLvl; i++)
+                            {
+                                methods += "CarNoTrustCorrect" + i + ",";
+                            }
+                            editCarNo = modfiy.CarNoCorrect(e.carno, methods.Substring(0, methods.Length - 1));
+                            sCarNo = editCarNo;
+                            //mwUpdate
+                        }
+
+                        //勾选了不验证车号的情况
+                        if (PbCache.monitor.validCarno == "0")
+                        {
+                            flagCarMonit = true;
+                        }
+                        #endregion
+
+                        #region 每隔1秒写入一次重量曲线
+                        try
+                        {
+                            if (preWgt != e.weight)
+                            {
+                                preWgt = e.weight;
+                                sPreNo = PbCache.sportInfo.baseSpotNo + DateTime.Now.ToString("yyyyMMddHHmmssfff");
+
+                                monitorWeightService.doAddWf(new MeterMonitorWeight
+                                {
+                                    weightNo = sPreNo,
+                                    baseSpotNo = PbCache.sportInfo.baseSpotNo,
+                                    baseSpotName = PbCache.sportInfo.baseSpotName,
+                                    collectWeight = e.weight + "",
+                                    collectStartTime = PbCache.dtStartTime.Value,
+                                    collectEndTime = DateTime.Now,
+                                    spotTypeNo = "001002001",
+                                    spotTypeName = "汽车衡",
+                                    actualFirstNo = PbCache.actualFirstNo
+                                });
+                            }
+                            else
+                            {
+                                if (!string.IsNullOrEmpty(sPreNo))
+                                {
+                                    monitorWeightService.doUpdateWf(new MeterMonitorWeight
+                                    {
+                                        weightNo = sPreNo,
+                                        collectEndTime = DateTime.Now
+                                    });
+                                }
+                            }
+                        }
+                        catch { }
+                        #endregion
+
+                        #region 停留超时
+                        iHodeTime++;
+                        MeterWorkMonitor mwUpdate = new MeterWorkMonitor();
+                        mwUpdate.pointNo = PbCache.sportInfo.baseSpotNo;
+                        mwUpdate.editCar = editCarNo;
+
+                        if (PbCache.holdTime != null && PbCache.holdTime.Count > 0)
+                        {
+                            if (PbCache.holdTime[0].retentionTime != null)
+                            {
+                                if (PbCache.holdTime[0].retentionTime.Value < iHodeTime)
+                                {
+                                    PbCache.isOvertimeAlarm = true; //是否超时报警
+                                    mwUpdate.stopOverTime = "1"; //写入一次停留超时
+                                    //mwUpdate.isHelp = "1";//派位
+                                    //mwUpdate.isTakeOver = "1";
+                                    iHodeTime = 99999;//不再增长避免超出
+                                }
+                            }
+                        }
+                        #endregion
+
+                        #region RFID识别车号信息
+                        mwUpdate.rfidCar = "";
+                        mwUpdate.photoCar = e.vdioCarNos;
+                        //mwUpdate.photoCar = PbCache.collect.carno;
+                        if (!string.IsNullOrEmpty(e.RfidNos))
+                        {
+                            string sqls = @"SELECT RFID_ID id,CAR_NO text FROM METER_BASE_RFID_INFO where RFID_CODE = '" + e.RfidNos + "'";
+
+                            PbModelDbService<List<PbModelDb>> pbp = new PbModelDbService<List<PbModelDb>>();
+                            RESTfulResult<List<PbModelDb>> rmT = pbp.executeSqlDataWf(sqls);
+                            if (rmT.Data == null || rmT.Data.Count == 0)
+                            { }
+                            else
+                            {
+                                mwUpdate.rfidCar = rmT.Data[0].text;
+                                sCarNo = rmT.Data[0].text;
+                            }
+                        }
+                        #endregion
+
+                        #region 计量员修改的车号信息
+                        if (PbCache.monitor != null && !string.IsNullOrEmpty(PbCache.monitor.setCar))
+                        {
+                            sCarNo = PbCache.monitor.setCar;
+                            bEditCar = true;
+                            flagCarMonit = true;
+                            codeFlag = false;
+                            sweepCodeClass.StrCode = "";
+                        }
+                        #endregion
+
+                        #region 重量信息
+                        if (!PbCache.isLockFrm)
+                        {
+                            mwUpdate.wgt = e.weight;
+                        }
+                        else
+                        {
+                            mwUpdate.wgt = Convert.ToInt32(PbCache.lockWgt);
+                        }
+                        #endregion
+
+                        #region 写入一次监控表,将重量/车号停留超时等信息写入
+                        mwUpdate.msgInfo = PbCache.ResultMessage;
+                        mwUpdate.weightStatus = PbCache.collect.weightStatus;
+                        //另外初始化一次监控数据
+                        RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(mwUpdate);
+                        if (!rms.Succeed)
+                        {
+                            l.WriteLog(0, "frmMain.EventData异常583:写入信息异常");
+                        }
+                        #endregion
+
+                        //验证对射
+                        valid.ValidMethod();
+
+                        if (!isOpenMeter)
+                        {
+                            //if (PbCache.range != null && PbCache.range.upperRange < e.weight)
+                            if (PbCache.range != null && PbCache.range.upperRange < e.weight)
+                            {
+                                //超量程
+                                vicPlayClass.GetVoicePlay("已超量程", e.carno);
+                                //return;
+                            }
+                            else if (e.weightStatus == 0)
+                            {
+                                if (!PbCache.monitorResult.valid_park_status)
+                                {
+                                    iCountPark++;
+                                    if (iCountPark > 9)
+                                    {
+                                        //重量稳定,且对射验证不合格
+                                        vicPlayClass.GetVoicePlay("您的车辆未停到位", e.carno);
+                                        //return;
+                                        iCountPark = 0; //2021年7月27日5s播一次,然后重新在播
+                                    }
+                                }
+                                else
+                                {
+                                    iCountPark = 0;
+                                }
+                            }
+                        }
+
+                        if (!lu[0].bcEnable)
+                        {
+                            foreach (ucBusinessType uc in lu)
+                            {
+                                uc.setControlEnable(true);
+                            }
+                        }
+                        if (sweepCodeClass.StrCode == "" && !codeFlag)
+                        {
+                            PbCache.collect.carno = sCarNo;
+                        }
+                    }
+
+                    //写入LED信息
+                    if (PbCache.sportInfo != null && PbCache.ledInfo != PbCache.OldLedInfo)
+                    {
+                        PbCache.OldLedInfo = PbCache.ledInfo;
+                        if (PbCache.monitor != null && PbCache.monitor.ledKeep == "0")
+                        {
+                            //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+                        }
+                    }
+                }
+                else
+                {
+                    startCar = 0;
+                    startWeight = 0;
+                    if (e.weight > 10 && e.weight < 500)
+                    {
+                        //重量小于500,大于10
+                        MeterWorkMonitor mwUpdate = new MeterWorkMonitor();
+                        mwUpdate.pointNo = PbCache.sportInfo.baseSpotNo;
+                        mwUpdate.wgt = e.weight;
+                        RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(mwUpdate);
+                    }
+                    if (e.weight > 0 && e.weight < 200)
+                    {
+                        doOperateLive();
+                    }
+                    if (e.weight == 0)
+                    {
+                        PbCache.isZeroAlarm = false;
+                    }
+                    isOpened = false; //下次上秤直接打开主界面
+                    editCarNo = "";
+                    firstCode = ""; //历史的扫码枪的值
+                    preCarNo = "";
+                    sCarNo = "";
+                    sPreNo = "";
+                    preWgt = 0;
+
+                    PbCache.isOvertimeAlarm = false; //是否超时报警
+                    PbCache.strCode = "";
+                    PbCache.ResultMessage = "";
+                    bEditCar = false;
+                    isVoiceDownCar = false;
+                    flagCarMonit = false;
+                    iHodeTime = 0;
+
+                    isOpenMeter = false;
+                    PbCache.isLockFrm = false;
+                    PbCache.dtStartTime = null;
+                    PbCache.voiceOver = true;
+                    if (PbCache.collect != null && !string.IsNullOrEmpty(PbCache.collect.carno))
+                    {
+                        PbCache.collect.carno = "";
+                    }
+
+                    setWelecomeVis(true);
+                    if (lu[0].bcEnable)
+                    {
+                        foreach (ucBusinessType uc in lu)
+                        {
+                            uc.setControlEnable(false);
+                        }
+                    }
+                    //LED写入
+                    if (isLedWrite)
+                    {
+                        if (PbCache.monitor == null || string.IsNullOrEmpty(PbCache.monitor.ledWriter))
+                        {
+                            PbCache.ledInfo = "欢迎使用九钢汽车衡智能计量系统";
+                        }
+                        else
+                        {
+                            PbCache.ledInfo = PbCache.monitor == null ? "" : PbCache.monitor.ledWriter;
+                        }
+
+                        //led_controler.setOneLineMsg(PbCache.sportInfo.ledIp, PbCache.ledInfo);
+
+                        isLedWrite = false;
+
+                        //*
+                        //另外初始化一次监控数据
+                        RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(new MeterWorkMonitor
+                        {
+                            pointNo = PbCache.sportInfo.baseSpotNo,
+                            validWgt = "1",
+                            validCarno = "1",
+                            validTareTime = "1",
+                            validMatTime = "1",
+                            validTimeInterval = "1",
+                            validParkStatus = "1",
+                            validExceedWgt = "1",
+                            validPredictionDiff = "1",
+                            validLianda = "1",
+                            validMatClick = "1",
+                            setCar = "",
+                            rfidCar = "",
+                            photoCar = "",
+                            scanCar = "",
+                            editCar = "",
+                            carErr = "0",
+                            wgtErr = "0",
+                            stopOverTime = "0",
+                            msgInfo = "",
+                            ledWriter = "",
+                            isOverWgt = "",
+                            isHelp = "0",
+                            wgt = 0
+                        });
+                        if (!rms.Succeed)
+                        {
+                            l.WriteLog(0, "frmMain.EventData异常754:写入信息异常");
+                            isLedWrite = true;
+                        }
+                        //*/
+                    }
+                }
+
+                #endregion
+            }
+            catch (Exception ex)
+            {
+                l.WriteLog(0, "frmMain.EventData异常:" + ex.Message);
+            }
+        }
+
+        private delegate void ShowBtnTare(bool flag);//定义委托  期限皮重按钮
+
+
+        /// <summary>
+        /// 操作Live表的数据:零点报警
+        /// </summary>
+        private void doOperateLive()
+        {
+            if (PbCache.collect_no == null)
+            {
+                return;
+            }
+            List<LiveData> ll = MemoClass.getWarnInfo(PbCache.collect_no);
+            if (ll != null)
+            {
+                foreach (LiveData lv in ll)
+                {
+                    switch (lv.Tagname.Replace(PbCache.collect_no, ""))
+                    {
+                        case "StaticStatus"://车辆检测	"0、东西方向激光均无报警;否则报警
+
+                            break;
+                        case "SwitchLight"://PLC红绿灯控制模式状态	"PLC有三种控制模式:1、自动、2、远控;3、检修
+
+                            break;
+                        case "LightWest"://红绿灯:1、为绿灯;2、为红灯;"
+
+                            break;
+                        case "ZeroWeightStatus": //0、其它,1、零点报警,红绿灯变红,
+                            if (((lv.Value ?? "0") + "").Equals("1"))
+                            {
+                                doInsertZeroAlarm();
+                                PbCache.isZeroAlarm = true;
+                            }
+                            else
+                            {
+                                PbCache.isZeroAlarm = false;
+                            }
+                            break;
+                    }
+                }
+            }
+        }
+
+
+        /// <summary>
+        /// 操作Live表的数据:零点报警
+        /// </summary>
+        private void doLive()
+        {
+            if (PbCache.collect_no == null)
+            {
+                return;
+            }
+            List<LiveData> ll = MemoClass.getWarnInfo(PbCache.collect_no);
+            MeterWorkMonitor mwm = new MeterWorkMonitor();
+            mwm.pointNo = PbCache.sportInfo.baseSpotNo;
+            mwm.redGreenLightState = "0";
+            if (ll != null)
+            {
+                foreach (LiveData lv in ll)
+                {
+                    switch (lv.Tagname.Replace(PbCache.collect_no, ""))
+                    {
+                        case "PowerStatus":
+                            mwm.powerState = lv.Value.ToString();
+                            break;
+                        case "PlcWatchDog":
+                            if (int.Parse(lv.Value.ToString()) >= 0 && int.Parse(lv.Value.ToString()) <= 0)
+                            {
+                                mwm.plcState = 0.ToString();
+                            }
+                            break;
+                        case "InfraredWest":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.leftInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.leftInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "InfraredEast":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.rightInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.rightInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "AmplifierState":
+                            mwm.amplifierState = lv.Value.ToString();
+                            break;
+                        case "LampState":
+                            mwm.lampState = lv.Value.ToString();
+                            break;
+                        case "InfraredLeft":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.frontInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.frontInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "InfraredRight":
+                            if (lv.Value.ToString() == "2")
+                            {
+                                mwm.rearInfraredRayState = "0";
+                            }
+                            else
+                            {
+                                mwm.rearInfraredRayState = lv.Value.ToString();
+                            }
+                            break;
+                        case "RfidState":
+                            mwm.rfidState = lv.Value.ToString();
+                            break;
+                    }
+                }
+            }
+            RESTfulResult<string> rms = meterWorkMonitor.doUpdateWf(mwm);
+        }
+
+
+        /// <summary>
+        /// 新增零点报警的数据
+        /// </summary>
+        private void doInsertZeroAlarm()
+        {
+            if (!PbCache.isZeroAlarm)
+            {
+                PbCache.isZeroAlarm = true;
+                MeterWorkZeroAlarm workZeroAlarm = new MeterWorkZeroAlarm();
+                workZeroAlarm.zeroWeight = PbCache.collect.weight;
+                workZeroAlarm.spotTypeNo = PbCache.sportInfo.spotTypeNo;
+                workZeroAlarm.spotTypeName = PbCache.sportInfo.spotTypeName;
+                workZeroAlarm.baseSpotNo = PbCache.sportInfo.baseSpotNo;
+                workZeroAlarm.baseSpotName = PbCache.sportInfo.baseSpotName;
+                workZeroAlarm.scalePointNo = PbCache.collect_no;
+                workZeroAlarm.createManNo = PbCache.sportInfo.baseSpotNo;
+                workZeroAlarm.createManName = PbCache.sportInfo.baseSpotName;
+                RESTfulResult<String> rms = zeroAlarmService.doInsertZeroAlarm(workZeroAlarm);
+                if (rms.Succeed)
+                {
+                    l.WriteLog(20, "新增成功:" + workZeroAlarm.baseSpotName + ":" + workZeroAlarm.zeroWeight);
+                }
+                else
+                {
+                    l.WriteLog(20, "操作失败:" + workZeroAlarm.baseSpotName + ":" + workZeroAlarm.zeroWeight + rms.Data + rms.Message);
+                }
+            }
+        }
+
+        /// <summary>
+        /// 关闭程序
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            collection.Stop();
+            imageCurlControl.Stop();
+            sweepCodeClass.CloseThread();
+            timer1.Stop();
+            timer1.Dispose();
+        }
+
+        public void WriteText(int iType, string str)
+        {
+            try
+            {
+                string strLogName = "";
+                switch (iType)
+                {
+                    case 0:
+                        strLogName = "车号采集_";
+                        break;
+                    case 1:
+                        strLogName = "判稳时间_";
+                        break;
+                }
+
+                string m_szRunPath;
+                m_szRunPath = System.Environment.CurrentDirectory;
+                if (System.IO.Directory.Exists(m_szRunPath + "\\log") == false)
+                {
+                    System.IO.Directory.CreateDirectory(m_szRunPath + "\\log");
+                }
+                string strDate = System.DateTime.Now.ToString("yyyyMMdd");
+                string strPathFile = m_szRunPath + "\\log\\" + strDate;
+                if (!Directory.Exists(strPathFile))//如果不存在就创建file文件夹
+                {
+                    Directory.CreateDirectory(strPathFile);
+                }
+                System.IO.TextWriter tw = new System.IO.StreamWriter(strPathFile + "\\" + strLogName + strDate + ".log", true);
+
+                tw.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
+                tw.WriteLine(str);
+                tw.WriteLine("\r\n");
+
+                tw.Close();
+            }
+            catch (Exception ex)
+            {
+
+            }
+        }
+    }
+}

+ 123 - 0
CarMeterSystem/fromContect.resx

@@ -0,0 +1,123 @@
+<?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="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 4 - 0
Common/Common.csproj

@@ -81,6 +81,10 @@
   <ItemGroup>
     <Compile Include="cacheCls\AppConfigCache.cs" />
     <Compile Include="cacheCls\CraneScaleCache.cs" />
+    <Compile Include="cacheCls\DownloadTools.cs" />
+    <Compile Include="cacheCls\GlobalVariable.cs" />
+    <Compile Include="cacheCls\ReleaseFile.cs" />
+    <Compile Include="cacheCls\ReleaseList.cs" />
     <Compile Include="control\GridHelper.cs" />
     <Compile Include="database\ComBoxHelper.cs" />
     <Compile Include="database\MemoryTableDataSocket_Belt.cs" />

+ 26 - 0
Common/DbOption/work/MeterWorkCarActualService.cs

@@ -166,6 +166,32 @@ namespace Common
             return rm;
         }
 
+        /// <summary>
+        /// 多毛一皮结净
+        /// </summary>
+        /// <param name="secondDb">MeterWorkCarActualFirst</param>
+        /// <param name="netDb">MeterWorkCarActual</param>
+        /// <param name="saveTare">0 不保存历史皮,1保存历史皮</param>
+        /// <returns></returns>
+        public RESTfulResult<string> doNetAddMuchGross(List<MeterWorkCarActualFirst> actualFirst, MeterWorkCarActualFirst actualFirst1, MeterMonitorNote note)
+        {
+            DbHelper db = new DbHelper();
+            PbSomeModel<List<MeterWorkCarActualFirst>, MeterWorkCarActualFirst, PreTrackScale, MeterMonitorNote> pbSomeModel = new PbSomeModel<List<MeterWorkCarActualFirst>, MeterWorkCarActualFirst, PreTrackScale, MeterMonitorNote>();
+            pbSomeModel.one = actualFirst;
+            pbSomeModel.two = actualFirst1;
+            pbSomeModel.four = note;
+
+            if (actualFirst1 != null && string.IsNullOrEmpty(actualFirst1.createManNo))
+            {
+                actualFirst1.createManNo = actualFirst1.baseSpotNo;
+                actualFirst1.createManName = actualFirst1.baseSpotName;
+            }
+
+            //RESTfulResult<string> rm = db.doOption<string>("meterworkcaractualfirsts", "doAddNetInnerWf", new object[] { secondDb, netDb, saveTare }, 1);
+            RESTfulResult<string> rm = db.doOption<string>("meterworkcaractualfirsts", "doNetAddMuchGross", new object[] { pbSomeModel }, 1);
+            return rm;
+        }
+
         /// <summary>
         /// 错误结净
         /// </summary>

+ 133 - 0
Common/cacheCls/DownloadTools.cs

@@ -0,0 +1,133 @@
+using System;
+using System.IO;
+using System.Net;
+
+namespace Common
+{
+
+  public class DownloadTools
+  {
+    public string DownloadFile(string SavePath, string DownloadUrl, string FileName)
+    {
+      if (!Directory.Exists(SavePath))
+      {
+        Directory.CreateDirectory(SavePath);
+      }
+      string path = SavePath + "\\" + FileName;
+      string requestUriString = DownloadUrl + "/" + FileName;
+      try
+      {
+        WebResponse response = WebRequest.Create(requestUriString).GetResponse();
+        if (response.ContentLength > 0)
+        {
+          try
+          {
+            long contentLength = response.ContentLength;
+            try
+            {
+              Stream responseStream = response.GetResponseStream();
+              StreamReader reader = new StreamReader(responseStream);
+              byte[] buffer = new byte[contentLength];
+              int count = buffer.Length;
+              int offset = 0;
+              while (contentLength > 0)
+              {
+                int num4 = responseStream.Read(buffer, offset, count);
+                if (num4 == 0)
+                {
+                  break;
+                }
+                offset += num4;
+                count -= num4;
+                float num5 = ((float)offset) / 1024f;
+                float num6 = ((float)buffer.Length) / 1024f;
+                Convert.ToInt32((float)((num5 / num6) * 100f));
+              }
+              FileStream stream2 = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
+              stream2.Write(buffer, 0, buffer.Length);
+              responseStream.Close();
+              reader.Close();
+              stream2.Close();
+              return FileName;
+            }
+            catch
+            {
+              return null;
+            }
+          }
+          catch
+          {
+            return null;
+          }
+        }
+      }
+      catch
+      {
+        return null;
+      }
+      return null;
+    }
+
+    public bool IsDownloadFile(string SavePath, string DownloadUrl, string FileName)
+    {
+      if (!Directory.Exists(SavePath))
+      {
+        Directory.CreateDirectory(SavePath);
+      }
+      string path = SavePath + "\\" + FileName;
+      string requestUriString = DownloadUrl + "/" + FileName;
+      try
+      {
+        WebResponse response = WebRequest.Create(requestUriString).GetResponse();
+        if (response.ContentLength > 0)
+        {
+          try
+          {
+            long contentLength = response.ContentLength;
+            try
+            {
+              Stream responseStream = response.GetResponseStream();
+              StreamReader reader = new StreamReader(responseStream);
+              byte[] buffer = new byte[contentLength];
+              int count = buffer.Length;
+              int offset = 0;
+              while (contentLength > 0)
+              {
+                int num4 = responseStream.Read(buffer, offset, count);
+                if (num4 == 0)
+                {
+                  break;
+                }
+                offset += num4;
+                count -= num4;
+                float num5 = ((float)offset) / 1024f;
+                float num6 = ((float)buffer.Length) / 1024f;
+                Convert.ToInt32((float)((num5 / num6) * 100f));
+              }
+              FileStream stream2 = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
+              stream2.SetLength(0);
+              stream2.Write(buffer, 0, buffer.Length);
+              responseStream.Close();
+              reader.Close();
+              stream2.Close();
+              return true;
+            }
+            catch (Exception e)
+            {
+              throw new Exception( e.Message);
+            }
+          }
+          catch (Exception e)
+          {
+            throw new Exception(e.Message);
+          }
+        }
+      }
+      catch (Exception e)
+      {
+        throw new Exception(e.Message);
+      }
+      return false;
+    }
+  }
+}

+ 160 - 0
Common/cacheCls/GlobalVariable.cs

@@ -0,0 +1,160 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace Common
+{
+ public  class GlobalVariable
+  {
+    public GlobalVariable()
+    {
+      
+    }
+    public static readonly GlobalVariable Instance = new GlobalVariable();
+    /// <summary>
+    /// 主界面最小化时隐藏
+    /// </summary>
+    public  bool HideMainFormOnMinimizedTag = false;
+    
+    public  string MyToken{  get; set; }
+    /// <summary>
+    /// 当前用户id
+    /// </summary>
+    public  string CurrentUserId { get; set; }
+    /// <summary>
+    /// 当前用户Name
+    /// </summary>
+    public  string CurrentUserName { get; set; }
+    public string successString = "suceess";
+    /// <summary>
+    /// 系统名称
+    /// </summary>
+    
+    public string SystemName = "酒钢智能计量系统客户端";
+    public string InitPassword = "init";
+    public  string ServerIp = "10.1.213.213";
+
+    /// <summary>
+    /// 更新程序名称
+    /// </summary>
+    public string ApplicationStart = "CarMeterSystem.exe";
+    public string ReleaseFileName = "ReleaseList.xml";
+    public string ReleaseURL = "http://10.129.1.210/pikaServices/ZNZD";
+    public string LocalPath = "FantasyUpdate";
+    public string ApplicationUpdater = "FantasyCorrector.exe";
+    public  List<string> Authorities { get; set; }
+
+    
+    public  void WriteLocalConfigFile()
+    {
+      XmlDocument doc = new XmlDocument();
+      CheckPathExist();
+      if (!File.Exists(LocalConfigFile)) CreateLocalConfigFile();
+      doc.Load(LocalConfigFile);
+
+      XmlNode nodeLoginUsers = doc.SelectSingleNode("/WlsConfig/HistoryInfo/LoginUsers");
+      XmlNode x = FindXmlNodeInList(nodeLoginUsers, "User", GlobalVariable.Instance.CurrentUserId);
+      if (x == null)
+      {
+        XmlElement xe = doc.CreateElement("Item");
+        xe.SetAttribute("User", GlobalVariable.Instance.CurrentUserId);
+        xe.SetAttribute("Name", GlobalVariable.Instance.CurrentUserName);
+        nodeLoginUsers.AppendChild(xe);
+      }
+
+      XmlNode nodeLastLoginUser = doc.SelectSingleNode("/WlsConfig/HistoryInfo/LastLoginUser");
+      nodeLastLoginUser.Attributes["User"].Value = GlobalVariable.Instance.CurrentUserId;
+      nodeLastLoginUser.Attributes["Name"].Value = GlobalVariable.Instance.CurrentUserName;
+
+      doc.Save(LocalConfigFile);
+    }
+    public  string GetLastLoginUser(string attName)
+    {
+      if (!File.Exists(LocalConfigFile)) return string.Empty;
+      XmlDocument doc = new XmlDocument();
+      doc.Load(LocalConfigFile);
+      XmlNode nodeLastLoginUser = doc.SelectSingleNode("/WlsConfig/HistoryInfo/LastLoginUser");
+      return nodeLastLoginUser.Attributes[attName].Value;
+    }
+    public  XmlNodeList GetLoginUsers()
+    {
+      if (!File.Exists(GlobalVariable.Instance.LocalConfigFile)) return null;
+      XmlDocument doc = new XmlDocument();
+      doc.Load(GlobalVariable.Instance.LocalConfigFile);
+      XmlNode nodeLoginUsers = doc.SelectSingleNode("/WlsConfig/HistoryInfo/LoginUsers");
+      return nodeLoginUsers.ChildNodes;
+    }
+    private  void CheckPathExist()
+    {
+      if (!Directory.Exists(LocalConfigFilePath))
+        Directory.CreateDirectory(LocalConfigFilePath);
+      DirectoryInfo dir = new DirectoryInfo(LocalConfigFilePath);
+    }
+    private  string LocalConfigFilePath
+    {
+      get
+      {
+        return string.Format("{0}\\{1}", SystemPath, LocalConfigFileShortPath);
+      }
+    }
+    /// <summary>
+    /// 本地配置文件
+    /// </summary>
+    private  string LocalConfigFileShortPath = "LocalConfigFilePath";
+
+
+    /// <summary>
+    /// 用户配置文件保存路径
+    /// </summary>
+    public  string SystemPath { get; set; }
+    public string Path= System.Environment.CurrentDirectory;
+    private  string LocalConfigFile
+    {
+      get
+      {
+        return string.Format("{0}\\{1}", LocalConfigFilePath, "LocalConfigFile.xml");
+      }
+    }
+    public string TableConfigFile
+    {
+      get
+      {
+        return string.Format("{0}\\{1}", LocalConfigFilePath, "TableConfigFile.xml");
+      }
+    }
+    private   XmlNode FindXmlNodeInList(XmlNode nodeList, string attributeName, string attributeValue)
+    {
+      if (nodeList == null || nodeList.ChildNodes.Count == 0) return null;
+      foreach (XmlNode x in nodeList.ChildNodes)
+      {
+        if (x.Attributes[attributeName] != null && x.Attributes[attributeName].Value.ToUpper() == attributeValue.ToUpper())
+          return x;
+      }
+      return null;
+    }
+    private  void CreateLocalConfigFile()
+    {
+      XmlTextWriter writer = new XmlTextWriter(LocalConfigFile, Encoding.UTF8);
+      writer.Formatting = Formatting.Indented;
+      writer.WriteStartDocument();
+      writer.WriteStartElement("WlsConfig");
+
+      writer.WriteStartElement("HistoryInfo");
+      writer.WriteStartElement("LoginUsers");
+      writer.WriteEndElement();
+      writer.WriteStartElement("LastLoginUser");
+      writer.WriteAttributeString("User", GlobalVariable.Instance.CurrentUserId);
+      writer.WriteAttributeString("Name", GlobalVariable.Instance.CurrentUserName);
+      writer.WriteEndElement();
+      writer.WriteEndElement();
+
+      writer.WriteEndElement();
+      writer.WriteEndDocument();
+      writer.Flush();
+      writer.Close();
+    }
+  }
+}

+ 64 - 0
Common/cacheCls/ReleaseFile.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Common
+{
+  using System;
+
+  public class ReleaseFile
+  {
+    private string _FileName = "";
+    private string _ReleaseDate = "";
+    private string _Size = "";
+    private string _Version = "";
+
+    public string FileName
+    {
+      get
+      {
+        return this._FileName;
+      }
+      set
+      {
+        this._FileName = value;
+      }
+    }
+
+    public string ReleaseDate
+    {
+      get
+      {
+        return this._ReleaseDate;
+      }
+      set
+      {
+        this._ReleaseDate = value;
+      }
+    }
+
+    public string Size
+    {
+      get
+      {
+        return this._Size;
+      }
+      set
+      {
+        this._Size = value;
+      }
+    }
+
+    public string Version
+    {
+      get
+      {
+        return this._Version;
+      }
+      set
+      {
+        this._Version = value;
+      }
+    }
+  }
+}

+ 125 - 0
Common/cacheCls/ReleaseList.cs

@@ -0,0 +1,125 @@
+using System;
+using System.Collections;
+using System.Xml;
+
+namespace Common
+{
+
+  public class ReleaseList : XmlDocument
+  {
+    private string _Description = "";
+    private string _ReleaseDate = "";
+    private IList _ReleaseFiles;
+    private string _ReleaseVersion = "";
+    private string _ReleaseReason = "";
+
+    public ReleaseList(string FileNameAll)
+    {
+      this.Init(FileNameAll);
+    }
+
+    public XmlNode FindNode(string xPath)
+    {
+      return base.SelectSingleNode(xPath);
+    }
+
+    public XmlNodeList GetNodeList(string xPath)
+    {
+      return base.SelectSingleNode(xPath).ChildNodes;
+    }
+
+    public string GetNodeValue(string xPath)
+    {
+      return base.SelectSingleNode(xPath).InnerText;
+    }
+
+    private void Init(string FileNameAll)
+    {
+      try
+      {
+        this.Load(FileNameAll);
+        this._Description = this.GetNodeValue("AutoUpdater/Description");
+        this._ReleaseDate = this.GetNodeValue("AutoUpdater/ReleaseDate");
+        this._ReleaseVersion = this.GetNodeValue("AutoUpdater/ReleaseVersion");
+        this._ReleaseReason = this.GetNodeValue("AutoUpdater/ReleaseReason");
+        this._ReleaseFiles = new ArrayList();
+        foreach (XmlNode node in this.GetNodeList("AutoUpdater/Releases"))
+        {
+          ReleaseFile file = new ReleaseFile();
+          file.FileName = node.Attributes["FileName"].Value.Trim();
+          file.Version = node.Attributes["Version"].Value.Trim();
+          file.ReleaseDate = node.Attributes["ReleaseDate"].Value.Trim();
+          file.Size = node.Attributes["Size"].Value.Trim();
+          this._ReleaseFiles.Add(file);
+        }
+      }
+      catch
+      {
+      }
+    }
+
+
+    public string Description
+    {
+      get
+      {
+        return this._Description;
+      }
+      set
+      {
+        this._Description = value;
+      }
+    }
+
+
+    public string ReleaseDate
+    {
+      get
+      {
+        return this._ReleaseDate;
+      }
+      set
+      {
+        this._ReleaseDate = value;
+      }
+    }
+
+    public IList ReleaseFiles
+    {
+      get
+      {
+        return this._ReleaseFiles;
+      }
+      set
+      {
+        this._ReleaseFiles = value;
+      }
+    }
+
+
+    public string ReleaseVersion
+    {
+      get
+      {
+        return this._ReleaseVersion;
+      }
+      set
+      {
+        this._ReleaseVersion = value;
+      }
+    }
+    public string ReleaseReason
+    {
+      get
+      {
+        return this._ReleaseReason;
+      }
+      set
+      {
+        this._ReleaseReason = value;
+      }
+    }
+
+
+  }
+}

+ 133 - 0
FantasyCorrector/DownloadTools.cs

@@ -0,0 +1,133 @@
+using System;
+using System.IO;
+using System.Net;
+
+namespace FantasySolution.FantasyCorrector
+{
+
+  public class DownloadTools
+  {
+    //11111333
+    public string DownloadFile(string SavePath, string DownloadUrl, string FileName)
+    {
+      if (!Directory.Exists(SavePath))
+      {
+        Directory.CreateDirectory(SavePath);
+      }
+      string path = SavePath + "\\" + FileName;
+      string requestUriString = DownloadUrl + "/" + FileName;
+      try
+      {
+        WebResponse response = WebRequest.Create(requestUriString).GetResponse();
+        if (response.ContentLength > 0)
+        {
+          try
+          {
+            long contentLength = response.ContentLength;
+            try
+            {
+              Stream responseStream = response.GetResponseStream();
+              StreamReader reader = new StreamReader(responseStream);
+              byte[] buffer = new byte[contentLength];
+              int count = buffer.Length;
+              int offset = 0;
+              while (contentLength > 0)
+              {
+                int num4 = responseStream.Read(buffer, offset, count);
+                if (num4 == 0)
+                {
+                  break;
+                }
+                offset += num4;
+                count -= num4;
+                float num5 = ((float)offset) / 1024f;
+                float num6 = ((float)buffer.Length) / 1024f;
+                Convert.ToInt32((float)((num5 / num6) * 100f));
+              }
+              FileStream stream2 = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
+              stream2.Write(buffer, 0, buffer.Length);
+              responseStream.Close();
+              reader.Close();
+              stream2.Close();
+              return FileName;
+            }
+            catch
+            {
+              return null;
+            }
+          }
+          catch
+          {
+            return null;
+          }
+        }
+      }
+      catch
+      {
+        return null;
+      }
+      return null;
+    }
+
+    public bool IsDownloadFile(string SavePath, string DownloadUrl, string FileName)
+    {
+      if (!Directory.Exists(SavePath))
+      {
+        Directory.CreateDirectory(SavePath);
+      }
+      string path = SavePath + "\\" + FileName;
+      string requestUriString = DownloadUrl + "/" + FileName;
+      try
+      {
+        WebResponse response = WebRequest.Create(requestUriString).GetResponse();
+        if (response.ContentLength > 0)
+        {
+          try
+          {
+            long contentLength = response.ContentLength;
+            try
+            {
+              Stream responseStream = response.GetResponseStream();
+              StreamReader reader = new StreamReader(responseStream);
+              byte[] buffer = new byte[contentLength];
+              int count = buffer.Length;
+              int offset = 0;
+              while (contentLength > 0)
+              {
+                int num4 = responseStream.Read(buffer, offset, count);
+                if (num4 == 0)
+                {
+                  break;
+                }
+                offset += num4;
+                count -= num4;
+                float num5 = ((float)offset) / 1024f;
+                float num6 = ((float)buffer.Length) / 1024f;
+                Convert.ToInt32((float)((num5 / num6) * 100f));
+              }
+              FileStream stream2 = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
+              stream2.Write(buffer, 0, buffer.Length);
+              responseStream.Close();
+              reader.Close();
+              stream2.Close();
+              return true;
+            }
+            catch
+            {
+              return false;
+            }
+          }
+          catch
+          {
+            return false;
+          }
+        }
+      }
+      catch
+      {
+        return false;
+      }
+      return false;
+    }
+  }
+}

+ 178 - 0
FantasyCorrector/FantasyCorrector.csproj

@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>FantasyCorrector</RootNamespace>
+    <AssemblyName>FantasyCorrector</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SccProjectName>SAK</SccProjectName>
+    <SccLocalPath>SAK</SccLocalPath>
+    <SccAuxPath>SAK</SccAuxPath>
+    <SccProvider>SAK</SccProvider>
+    <ApplicationIcon>SystemLog.ico</ApplicationIcon>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <UpgradeBackupLocation />
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\output\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\FantasyCorrector.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\FantasyCorrector.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DownloadTools.cs" />
+    <Compile Include="GlobalVariable.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="UpdaterForm.resx">
+      <DependentUpon>UpdaterForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
+    </Compile>
+    <None Include="app.config" />
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+    <Compile Include="ReleaseFile.cs" />
+    <Compile Include="ReleaseList.cs" />
+    <Compile Include="UpdaterForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="UpdaterForm.designer.cs">
+      <DependentUpon>UpdaterForm.cs</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="SystemLog.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 23 - 0
FantasyCorrector/GlobalVariable.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FantasySolution.FantasyCorrector
+{
+  public class GlobalVariable
+  {
+    public GlobalVariable()
+    {
+
+    }
+    public static readonly GlobalVariable Instance = new GlobalVariable();
+    /// <summary>
+    /// ¸üгÌÐòÃû³Æ11
+    /// </summary>
+    public string ApplicationStart = "CarMeterSystem.exe";
+    public string ReleaseFileName = "ReleaseList.xml";
+    public string ReleaseURL = "http://10.129.1.210/pikaServices/ZNZD";
+    public string LocalPath = "FantasyUpdate";
+    public string ApplicationUpdater = "FantasyCorrector.exe";
+  }
+}

+ 20 - 0
FantasyCorrector/Program.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace FantasySolution.FantasyCorrector
+{
+  static class Program
+  {
+    /// <summary>
+    /// The main entry point for the application.
+    /// </summary>
+    [STAThread]
+    static void Main()
+    {
+      Application.EnableVisualStyles();
+      Application.SetCompatibleTextRenderingDefault(false);
+      Application.Run(new UpdaterForm());
+    }
+  }
+}

+ 36 - 0
FantasyCorrector/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("pika")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("酒泉钢铁公司")]
+[assembly: AssemblyProduct("酒钢信息管理系统")]
+[assembly: AssemblyCopyright("Copyright ©  2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8107834e-5268-43fa-b47f-b29c0fa1434d")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 63 - 0
FantasyCorrector/Properties/Resources.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace FantasyCorrector.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FantasyCorrector.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性
+        ///   重写当前线程的 CurrentUICulture 属性。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
FantasyCorrector/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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>

+ 26 - 0
FantasyCorrector/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace FantasyCorrector.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
FantasyCorrector/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 64 - 0
FantasyCorrector/ReleaseFile.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace FantasySolution.FantasyCorrector
+{
+  using System;
+
+  public class ReleaseFile
+  {
+    private string _FileName = "";
+    private string _ReleaseDate = "";
+    private string _Size = "";
+    private string _Version = "";
+
+    public string FileName
+    {
+      get
+      {
+        return this._FileName;
+      }
+      set
+      {
+        this._FileName = value;
+      }
+    }
+
+    public string ReleaseDate
+    {
+      get
+      {
+        return this._ReleaseDate;
+      }
+      set
+      {
+        this._ReleaseDate = value;
+      }
+    }
+
+    public string Size
+    {
+      get
+      {
+        return this._Size;
+      }
+      set
+      {
+        this._Size = value;
+      }
+    }
+
+    public string Version
+    {
+      get
+      {
+        return this._Version;
+      }
+      set
+      {
+        this._Version = value;
+      }
+    }
+  }
+}

+ 125 - 0
FantasyCorrector/ReleaseList.cs

@@ -0,0 +1,125 @@
+using System;
+using System.Collections;
+using System.Xml;
+
+namespace FantasySolution.FantasyCorrector
+{
+
+  public class ReleaseList : XmlDocument
+  {
+    private string _Description = "";
+    private string _ReleaseDate = "";
+    private IList _ReleaseFiles;
+    private string _ReleaseVersion = "";
+    private string _ReleaseReason = "";
+
+    public ReleaseList(string FileNameAll)
+    {
+      this.Init(FileNameAll);
+    }
+
+    public XmlNode FindNode(string xPath)
+    {
+      return base.SelectSingleNode(xPath);
+    }
+
+    public XmlNodeList GetNodeList(string xPath)
+    {
+      return base.SelectSingleNode(xPath).ChildNodes;
+    }
+
+    public string GetNodeValue(string xPath)
+    {
+      return base.SelectSingleNode(xPath).InnerText;
+    }
+
+    private void Init(string FileNameAll)
+    {
+      try
+      {
+        this.Load(FileNameAll);
+        this._Description = this.GetNodeValue("AutoUpdater/Description");
+        this._ReleaseDate = this.GetNodeValue("AutoUpdater/ReleaseDate");
+        this._ReleaseVersion = this.GetNodeValue("AutoUpdater/ReleaseVersion");
+        this._ReleaseReason = this.GetNodeValue("AutoUpdater/ReleaseReason");
+        this._ReleaseFiles = new ArrayList();
+        foreach (XmlNode node in this.GetNodeList("AutoUpdater/Releases"))
+        {
+          ReleaseFile file = new ReleaseFile();
+          file.FileName = node.Attributes["FileName"].Value.Trim();
+          file.Version = node.Attributes["Version"].Value.Trim();
+          file.ReleaseDate = node.Attributes["ReleaseDate"].Value.Trim();
+          file.Size = node.Attributes["Size"].Value.Trim();
+          this._ReleaseFiles.Add(file);
+        }
+      }
+      catch
+      {
+      }
+    }
+
+
+    public string Description
+    {
+      get
+      {
+        return this._Description;
+      }
+      set
+      {
+        this._Description = value;
+      }
+    }
+
+
+    public string ReleaseDate
+    {
+      get
+      {
+        return this._ReleaseDate;
+      }
+      set
+      {
+        this._ReleaseDate = value;
+      }
+    }
+
+    public IList ReleaseFiles
+    {
+      get
+      {
+        return this._ReleaseFiles;
+      }
+      set
+      {
+        this._ReleaseFiles = value;
+      }
+    }
+
+
+    public string ReleaseVersion
+    {
+      get
+      {
+        return this._ReleaseVersion;
+      }
+      set
+      {
+        this._ReleaseVersion = value;
+      }
+    }
+    public string ReleaseReason
+    {
+      get
+      {
+        return this._ReleaseReason;
+      }
+      set
+      {
+        this._ReleaseReason = value;
+      }
+    }
+
+
+  }
+}

BIN
FantasyCorrector/SystemLog.ico


+ 174 - 0
FantasyCorrector/UpdaterForm.cs

@@ -0,0 +1,174 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Collections;
+using System.IO;
+using System.Diagnostics;
+
+namespace FantasySolution.FantasyCorrector
+{
+  public partial class UpdaterForm : Form
+  {
+    private IList UpdateLists;
+    private ReleaseList LocalRelease = null;
+    private ReleaseList RemoteRelease = null;
+    private bool newRelaes = false;
+
+    public UpdaterForm()
+    {
+      InitializeComponent();
+    }
+
+    private void UpdaterForm_Load(object sender, EventArgs e)
+    {
+      this.LocalRelease = new ReleaseList(Application.StartupPath + @"\" + GlobalVariable.Instance.ReleaseFileName);
+      DownloadTools dt = new DownloadTools();
+
+      textBox1.Text = this.LocalRelease.ReleaseVersion;
+      textBox2.Text = this.LocalRelease.ReleaseDate;
+
+      bool flg = dt.IsDownloadFile(GlobalVariable.Instance.LocalPath, GlobalVariable.Instance.ReleaseURL, GlobalVariable.Instance.ReleaseFileName);
+      if (flg)
+      {
+        newRelaes = this.CheckUpdate();
+        textBox3.Text = this.RemoteRelease.ReleaseVersion;
+        textBox4.Text = this.RemoteRelease.ReleaseDate;
+        textBox5.Text = this.RemoteRelease.ReleaseReason;
+      }
+      else
+      {
+        textBox3.Text = "未知";
+        textBox4.Text = "未知";
+        textBox5.Text = "未知";
+      }
+    }
+
+    private bool CheckUpdate()
+    {
+      try
+      {
+        string fileNameAll = Application.StartupPath + "\\" + GlobalVariable.Instance.LocalPath + "\\" + GlobalVariable.Instance.ReleaseFileName;
+        this.RemoteRelease = new ReleaseList(fileNameAll);
+        if (this.LocalRelease==null||((this.LocalRelease != null) && (this.RemoteRelease != null)) && !this.LocalRelease.ReleaseDate.Equals(this.RemoteRelease.ReleaseDate))
+        {
+          return true;
+        }
+      }
+      catch (Exception exception)
+      {
+        MessageBox.Show(exception.Message);
+      }
+      return false;
+    }
+
+    private void CloseButtonOnClick(object sender, EventArgs e)
+    {
+      this.Close();
+    }
+
+    private void UpdateButtonOnClick(object sender, EventArgs e)
+    {
+      if (this.newRelaes)
+      {
+        this.Init();
+        if (this.StartDownload())
+        {
+          DialogResult result = MessageBox.Show("新版本更新完成,是否现在启动新程序?", Application.ProductName, MessageBoxButtons.YesNo);
+          if (result == DialogResult.Yes)
+          {
+            this.Close();
+            Application.Exit();
+            GC.Collect();
+            Process.Start(Application.StartupPath + @"\" + GlobalVariable.Instance.ApplicationStart);
+          }
+        }
+      }
+      else
+      {
+        MessageBox.Show("没有新版本,或者远程服务器无法连接!");
+      }
+    }
+
+    public void Init()
+    {
+      this.textStatusLabel.Visible = true;
+      this.progressBar.Visible = true;
+      this.progressBar.Value = 0;
+      this.statusStrip1.Update();
+
+      IDictionary dictionary = new Hashtable();
+      foreach (ReleaseFile file1 in this.LocalRelease.ReleaseFiles)
+      {
+        dictionary.Add(file1.FileName, file1);
+      }
+      this.UpdateLists = new ArrayList();
+      foreach (ReleaseFile file2 in this.RemoteRelease.ReleaseFiles)
+      {
+        if (file2.FileName.Equals(GlobalVariable.Instance.ApplicationUpdater)) continue;
+
+        ReleaseFile file3 = dictionary[file2.FileName] as ReleaseFile;
+        if (file3 != null)
+        {
+          if (!file3.ReleaseDate.Equals(file2.ReleaseDate))
+          {
+            this.UpdateLists.Add(file2);
+          }
+          continue;
+        }
+        this.UpdateLists.Add(file2);
+      }
+    }
+
+    private bool StartDownload()
+    {
+      string path = Application.StartupPath + @"\" + GlobalVariable.Instance.LocalPath;
+      if (!Directory.Exists(path))
+      {
+        Directory.CreateDirectory(path);
+      }
+      IList list = new ArrayList();
+      bool flag = true;
+      this.progressBar.Maximum = 20 * this.UpdateLists.Count;
+      int num = 20;
+      foreach (ReleaseFile file in this.UpdateLists)
+      {
+        if (file == null)
+        {
+          continue;
+        }
+        string text3 = new DownloadTools().DownloadFile(path, GlobalVariable.Instance.ReleaseURL, file.FileName);
+        if (text3 != null)
+        {
+          list.Add(text3);
+          this.progressBar.Value += num;
+          continue;
+        }
+        flag = false;
+        break;
+      }
+      if (flag)
+      {
+        foreach (string text4 in list)
+        {
+          string sourceFileName = path + @"\" + text4;
+          string destFileName = Application.StartupPath + @"\" + text4;
+          if (text4.IndexOf(".exe.xml") >= 0)
+          {
+            destFileName = Application.StartupPath + @"\" + text4.Replace(".exe.xml",".exe.config");
+          }
+          File.Copy(sourceFileName, destFileName, true);
+          File.Delete(sourceFileName);
+        }
+        string filename = Application.StartupPath + @"\" + GlobalVariable.Instance.ReleaseFileName;
+        this.RemoteRelease.Save(filename);
+        this.progressBar.Value = 20 * this.UpdateLists.Count;
+        return true;
+      }
+      return false;
+    }
+  }
+}

+ 258 - 0
FantasyCorrector/UpdaterForm.designer.cs

@@ -0,0 +1,258 @@
+namespace FantasySolution.FantasyCorrector
+{
+  partial class UpdaterForm
+  {
+    /// <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()
+    {
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdaterForm));
+      this.updateButton = new System.Windows.Forms.Button();
+      this.closeButton = new System.Windows.Forms.Button();
+      this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+      this.textStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
+      this.progressBar = new System.Windows.Forms.ToolStripProgressBar();
+      this.groupBox1 = new System.Windows.Forms.GroupBox();
+      this.textBox2 = new System.Windows.Forms.TextBox();
+      this.textBox1 = new System.Windows.Forms.TextBox();
+      this.label2 = new System.Windows.Forms.Label();
+      this.label1 = new System.Windows.Forms.Label();
+      this.groupBox2 = new System.Windows.Forms.GroupBox();
+      this.textBox4 = new System.Windows.Forms.TextBox();
+      this.textBox3 = new System.Windows.Forms.TextBox();
+      this.label4 = new System.Windows.Forms.Label();
+      this.label3 = new System.Windows.Forms.Label();
+      this.textBox5 = new System.Windows.Forms.TextBox();
+      this.label5 = new System.Windows.Forms.Label();
+      this.statusStrip1.SuspendLayout();
+      this.groupBox1.SuspendLayout();
+      this.groupBox2.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // updateButton
+      // 
+      this.updateButton.Location = new System.Drawing.Point(309, 187);
+      this.updateButton.Name = "updateButton";
+      this.updateButton.Size = new System.Drawing.Size(75, 23);
+      this.updateButton.TabIndex = 0;
+      this.updateButton.Text = "更新";
+      this.updateButton.UseVisualStyleBackColor = true;
+      this.updateButton.Click += new System.EventHandler(this.UpdateButtonOnClick);
+      // 
+      // closeButton
+      // 
+      this.closeButton.Location = new System.Drawing.Point(417, 187);
+      this.closeButton.Name = "closeButton";
+      this.closeButton.Size = new System.Drawing.Size(75, 23);
+      this.closeButton.TabIndex = 1;
+      this.closeButton.Text = "退出";
+      this.closeButton.UseVisualStyleBackColor = true;
+      this.closeButton.Click += new System.EventHandler(this.CloseButtonOnClick);
+      // 
+      // statusStrip1
+      // 
+      this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.textStatusLabel,
+            this.progressBar});
+      this.statusStrip1.Location = new System.Drawing.Point(0, 226);
+      this.statusStrip1.Name = "statusStrip1";
+      this.statusStrip1.Size = new System.Drawing.Size(501, 22);
+      this.statusStrip1.TabIndex = 2;
+      this.statusStrip1.Text = "statusStrip1";
+      // 
+      // textStatusLabel
+      // 
+      this.textStatusLabel.Name = "textStatusLabel";
+      this.textStatusLabel.Size = new System.Drawing.Size(56, 17);
+      this.textStatusLabel.Text = "更新进度";
+      this.textStatusLabel.Visible = false;
+      // 
+      // progressBar
+      // 
+      this.progressBar.AutoSize = false;
+      this.progressBar.Name = "progressBar";
+      this.progressBar.Size = new System.Drawing.Size(200, 16);
+      this.progressBar.Visible = false;
+      // 
+      // groupBox1
+      // 
+      this.groupBox1.Controls.Add(this.textBox2);
+      this.groupBox1.Controls.Add(this.textBox1);
+      this.groupBox1.Controls.Add(this.label2);
+      this.groupBox1.Controls.Add(this.label1);
+      this.groupBox1.Location = new System.Drawing.Point(12, 12);
+      this.groupBox1.Name = "groupBox1";
+      this.groupBox1.Size = new System.Drawing.Size(229, 117);
+      this.groupBox1.TabIndex = 3;
+      this.groupBox1.TabStop = false;
+      this.groupBox1.Text = "当前使用版本";
+      // 
+      // textBox2
+      // 
+      this.textBox2.Location = new System.Drawing.Point(75, 74);
+      this.textBox2.Name = "textBox2";
+      this.textBox2.ReadOnly = true;
+      this.textBox2.Size = new System.Drawing.Size(138, 21);
+      this.textBox2.TabIndex = 3;
+      // 
+      // textBox1
+      // 
+      this.textBox1.Location = new System.Drawing.Point(75, 37);
+      this.textBox1.Name = "textBox1";
+      this.textBox1.ReadOnly = true;
+      this.textBox1.Size = new System.Drawing.Size(138, 21);
+      this.textBox1.TabIndex = 2;
+      // 
+      // label2
+      // 
+      this.label2.AutoSize = true;
+      this.label2.Location = new System.Drawing.Point(16, 78);
+      this.label2.Name = "label2";
+      this.label2.Size = new System.Drawing.Size(53, 12);
+      this.label2.TabIndex = 1;
+      this.label2.Text = "发布日期";
+      // 
+      // label1
+      // 
+      this.label1.AutoSize = true;
+      this.label1.Location = new System.Drawing.Point(28, 41);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(41, 12);
+      this.label1.TabIndex = 0;
+      this.label1.Text = "版本号";
+      // 
+      // groupBox2
+      // 
+      this.groupBox2.Controls.Add(this.textBox4);
+      this.groupBox2.Controls.Add(this.textBox3);
+      this.groupBox2.Controls.Add(this.label4);
+      this.groupBox2.Controls.Add(this.label3);
+      this.groupBox2.Location = new System.Drawing.Point(263, 12);
+      this.groupBox2.Name = "groupBox2";
+      this.groupBox2.Size = new System.Drawing.Size(229, 117);
+      this.groupBox2.TabIndex = 4;
+      this.groupBox2.TabStop = false;
+      this.groupBox2.Text = "最新发布版本";
+      // 
+      // textBox4
+      // 
+      this.textBox4.Location = new System.Drawing.Point(75, 74);
+      this.textBox4.Name = "textBox4";
+      this.textBox4.ReadOnly = true;
+      this.textBox4.Size = new System.Drawing.Size(138, 21);
+      this.textBox4.TabIndex = 3;
+      // 
+      // textBox3
+      // 
+      this.textBox3.Location = new System.Drawing.Point(75, 37);
+      this.textBox3.Name = "textBox3";
+      this.textBox3.ReadOnly = true;
+      this.textBox3.Size = new System.Drawing.Size(138, 21);
+      this.textBox3.TabIndex = 2;
+      // 
+      // label4
+      // 
+      this.label4.AutoSize = true;
+      this.label4.Location = new System.Drawing.Point(16, 78);
+      this.label4.Name = "label4";
+      this.label4.Size = new System.Drawing.Size(53, 12);
+      this.label4.TabIndex = 1;
+      this.label4.Text = "发布日期";
+      // 
+      // label3
+      // 
+      this.label3.AutoSize = true;
+      this.label3.Location = new System.Drawing.Point(28, 41);
+      this.label3.Name = "label3";
+      this.label3.Size = new System.Drawing.Size(41, 12);
+      this.label3.TabIndex = 0;
+      this.label3.Text = "版本号";
+      // 
+      // textBox5
+      // 
+      this.textBox5.Location = new System.Drawing.Point(87, 144);
+      this.textBox5.Name = "textBox5";
+      this.textBox5.ReadOnly = true;
+      this.textBox5.Size = new System.Drawing.Size(405, 21);
+      this.textBox5.TabIndex = 6;
+      // 
+      // label5
+      // 
+      this.label5.AutoSize = true;
+      this.label5.Location = new System.Drawing.Point(28, 148);
+      this.label5.Name = "label5";
+      this.label5.Size = new System.Drawing.Size(53, 12);
+      this.label5.TabIndex = 5;
+      this.label5.Text = "发布说明";
+      // 
+      // UpdaterForm
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.ClientSize = new System.Drawing.Size(501, 248);
+      this.Controls.Add(this.textBox5);
+      this.Controls.Add(this.label5);
+      this.Controls.Add(this.groupBox2);
+      this.Controls.Add(this.groupBox1);
+      this.Controls.Add(this.statusStrip1);
+      this.Controls.Add(this.closeButton);
+      this.Controls.Add(this.updateButton);
+      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+      this.Name = "UpdaterForm";
+      this.Text = "系统更新";
+      this.Load += new System.EventHandler(this.UpdaterForm_Load);
+      this.statusStrip1.ResumeLayout(false);
+      this.statusStrip1.PerformLayout();
+      this.groupBox1.ResumeLayout(false);
+      this.groupBox1.PerformLayout();
+      this.groupBox2.ResumeLayout(false);
+      this.groupBox2.PerformLayout();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.Button updateButton;
+    private System.Windows.Forms.Button closeButton;
+    private System.Windows.Forms.StatusStrip statusStrip1;
+    private System.Windows.Forms.ToolStripStatusLabel textStatusLabel;
+    private System.Windows.Forms.ToolStripProgressBar progressBar;
+    private System.Windows.Forms.GroupBox groupBox1;
+    private System.Windows.Forms.GroupBox groupBox2;
+    private System.Windows.Forms.TextBox textBox2;
+    private System.Windows.Forms.TextBox textBox1;
+    private System.Windows.Forms.Label label2;
+    private System.Windows.Forms.Label label1;
+    private System.Windows.Forms.TextBox textBox4;
+    private System.Windows.Forms.TextBox textBox3;
+    private System.Windows.Forms.Label label4;
+    private System.Windows.Forms.Label label3;
+    private System.Windows.Forms.TextBox textBox5;
+    private System.Windows.Forms.Label label5;
+  }
+}
+

+ 148 - 0
FantasyCorrector/UpdaterForm.resx

@@ -0,0 +1,148 @@
+<?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>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAAAAAAD//wAA//8AAP//AAD//wAA
+        //8AAP//AAAAAAAAAAAAAP//AAD//wAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAA//8AAP//AAD//wAA
+        //8AAP//AAD//wAAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAAAAAAAP//AAD//wAAAAAAAP//AAD//wAA
+        AAAAAAAAAAD//wAA//8AAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAP//AAD//wAA//8AAP//AAAAAAAA//8AAP//AAAAAAAA
+        //8AAP//AAAAAAAA//8AAP//AAD//wAAAAAAAAAAAAD//wAA//8AAP//AAD//wAAAAAAAP//AAD//wAA
+        AAAAAP//AAD//wAAAAAAAP//AAD//wAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAD//wAA//8AAP//AAAAAAAA
+        //8AAP//AAAAAAAA//8AAP//AAAAAAAA//8AAP//AAAAAAAAAAAAAP//AAD//wAA//8AAP//AAD//wAA
+        AAAAAP//AAD//wAAAAAAAP//AAD//wAAAAAAAP//AAD//wAAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAA//8AAP//AAAAAAAA
+        AAAAAAAAAAAAAAAA//8AAP//AAAAAAAA//8AAP//AAD//wAA//8AAP//AAAAAAAAAAAAAP//AAD//wAA
+        AAAAAAAAAAAAAAAAAAAAAP//AAD//wAAAAAAAP//AAD//wAA//8AAP//AAD//wAAAAAAAAAAAAD//wAA
+        //8AAAAAAAAAAAAAAAAAAAAAAAD//wAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        //8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAgP8AAICBAACcgQAAnJkAAJ/5AACEkQAAhJEAAP//AAAEkwAABJMAAD/zAAA8gwAAPIMAADz/
+        AAAA/wAAAP8AAA==
+</value>
+  </data>
+</root>

+ 3 - 0
FantasyCorrector/app.config

@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>

+ 4 - 4
FrmStandAloneMetering/FrmStandAloneMetering.Designer.cs

@@ -1207,7 +1207,7 @@ namespace FrmStandAloneMetering
             this.ultraTabPageControl2.Controls.Add(this.ultraGridTare);
             this.ultraTabPageControl2.Location = new System.Drawing.Point(-10000, -10000);
             this.ultraTabPageControl2.Name = "ultraTabPageControl2";
-            this.ultraTabPageControl2.Size = new System.Drawing.Size(1365, 355);
+            this.ultraTabPageControl2.Size = new System.Drawing.Size(1365, 487);
             // 
             // ultraGridTare
             // 
@@ -1602,7 +1602,7 @@ namespace FrmStandAloneMetering
             this.ultraGridTare.Font = new System.Drawing.Font("宋体", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ultraGridTare.Location = new System.Drawing.Point(0, 0);
             this.ultraGridTare.Name = "ultraGridTare";
-            this.ultraGridTare.Size = new System.Drawing.Size(1365, 355);
+            this.ultraGridTare.Size = new System.Drawing.Size(1365, 487);
             this.ultraGridTare.TabIndex = 11;
             // 
             // dataSetTare
@@ -2164,8 +2164,8 @@ namespace FrmStandAloneMetering
             this.tableLayoutPanelButton.Name = "tableLayoutPanelButton";
             this.tableLayoutPanelButton.RowCount = 1;
             this.tableLayoutPanelButton.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
-            this.tableLayoutPanelButton.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 194F));
-            this.tableLayoutPanelButton.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 194F));
+            this.tableLayoutPanelButton.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 62F));
+            this.tableLayoutPanelButton.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 62F));
             this.tableLayoutPanelButton.Size = new System.Drawing.Size(1355, 62);
             this.tableLayoutPanelButton.TabIndex = 2;
             // 

+ 1 - 1
FrmStandAloneMetering/FrmStandAloneMetering.resx

@@ -118,7 +118,7 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <metadata name="dataSetGross.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>257, 20</value>
+    <value>218, 21</value>
   </metadata>
   <metadata name="dataSetTare.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>387, 23</value>

+ 92 - 0
HnstMeteringSystem.sln

@@ -38,84 +38,176 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrmStandAloneMetering", "Fr
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrainVideoDataDispose", "TrainVideoDataDispose\TrainVideoDataDispose.csproj", "{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FantasyCorrector", "FantasyCorrector\FantasyCorrector.csproj", "{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarMeterMonitor", "CarMeterMonitor\CarMeterMonitor.csproj", "{1D59985C-5276-485C-A041-F733F0868BB4}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		Debug|x86 = Debug|x86
 		Release|Any CPU = Release|Any CPU
+		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Debug|x86.Build.0 = Debug|Any CPU
 		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Release|Any CPU.Build.0 = Release|Any CPU
+		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Release|x86.ActiveCfg = Release|Any CPU
+		{937E0DFA-3387-41E7-8718-CE2660B846DD}.Release|x86.Build.0 = Release|Any CPU
 		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Debug|x86.Build.0 = Debug|Any CPU
 		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Release|x86.ActiveCfg = Release|Any CPU
+		{D239BE9E-348D-4AC8-ABE5-8E7E4A69E047}.Release|x86.Build.0 = Release|Any CPU
 		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Debug|x86.Build.0 = Debug|Any CPU
 		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Release|x86.ActiveCfg = Release|Any CPU
+		{E34EA556-DF5B-4C10-9280-23B38259E6BC}.Release|x86.Build.0 = Release|Any CPU
 		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Debug|x86.Build.0 = Debug|Any CPU
 		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Release|x86.ActiveCfg = Release|Any CPU
+		{7D262392-C0A3-465D-BD99-EC384D4BE321}.Release|x86.Build.0 = Release|Any CPU
 		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Debug|x86.Build.0 = Debug|Any CPU
 		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Release|x86.ActiveCfg = Release|Any CPU
+		{C70EB531-65E2-416A-B85E-946A8D4ACAED}.Release|x86.Build.0 = Release|Any CPU
 		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Debug|x86.Build.0 = Debug|Any CPU
 		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Release|x86.ActiveCfg = Release|Any CPU
+		{24B72A4A-3A4A-486B-9BCF-4A4B965C0EC6}.Release|x86.Build.0 = Release|Any CPU
 		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Debug|x86.Build.0 = Debug|Any CPU
 		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Release|Any CPU.Build.0 = Release|Any CPU
+		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Release|x86.ActiveCfg = Release|Any CPU
+		{571E4FD7-A37A-4EEE-A882-926AC4A32F70}.Release|x86.Build.0 = Release|Any CPU
 		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Debug|x86.Build.0 = Debug|Any CPU
 		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Release|x86.ActiveCfg = Release|Any CPU
+		{A90F4F23-9077-46CA-BA60-EB21DF346B27}.Release|x86.Build.0 = Release|Any CPU
 		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Debug|x86.Build.0 = Debug|Any CPU
 		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Release|x86.ActiveCfg = Release|Any CPU
+		{AE0022AE-4299-42F1-8A83-7F1D3A4E1FDF}.Release|x86.Build.0 = Release|Any CPU
 		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Debug|x86.Build.0 = Debug|Any CPU
 		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Release|x86.ActiveCfg = Release|Any CPU
+		{284ED035-2607-4AFE-ADCF-A032FFADAFF5}.Release|x86.Build.0 = Release|Any CPU
 		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Debug|x86.Build.0 = Debug|Any CPU
 		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Release|x86.ActiveCfg = Release|Any CPU
+		{23FDD9D6-CC43-4BE6-A049-3089D19EA4AA}.Release|x86.Build.0 = Release|Any CPU
 		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Debug|x86.Build.0 = Debug|Any CPU
 		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Release|Any CPU.Build.0 = Release|Any CPU
+		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Release|x86.ActiveCfg = Release|Any CPU
+		{0369CF08-EE2B-4142-AA61-8E9D2AD61E57}.Release|x86.Build.0 = Release|Any CPU
 		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Debug|x86.Build.0 = Debug|Any CPU
 		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Release|x86.ActiveCfg = Release|Any CPU
+		{4ED045B9-CEB0-422A-B78D-04B191B4C51A}.Release|x86.Build.0 = Release|Any CPU
 		{E2557F35-66B1-488A-8524-CCA6DBBD75BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E2557F35-66B1-488A-8524-CCA6DBBD75BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E2557F35-66B1-488A-8524-CCA6DBBD75BD}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{E2557F35-66B1-488A-8524-CCA6DBBD75BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E2557F35-66B1-488A-8524-CCA6DBBD75BD}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E2557F35-66B1-488A-8524-CCA6DBBD75BD}.Release|x86.ActiveCfg = Release|Any CPU
 		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Debug|x86.Build.0 = Debug|Any CPU
 		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Release|Any CPU.Build.0 = Release|Any CPU
+		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Release|x86.ActiveCfg = Release|Any CPU
+		{97DE8014-5BF8-48F0-BC15-43773C70E1ED}.Release|x86.Build.0 = Release|Any CPU
 		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Debug|x86.Build.0 = Debug|Any CPU
 		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Release|x86.ActiveCfg = Release|Any CPU
+		{223597D5-577B-49D6-A66A-C1A173DAFE5D}.Release|x86.Build.0 = Release|Any CPU
 		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Debug|x86.Build.0 = Debug|Any CPU
 		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Release|x86.ActiveCfg = Release|Any CPU
+		{DCEA1EFE-23FC-45D5-B4DB-692C0ADDC0C6}.Release|x86.Build.0 = Release|Any CPU
 		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Debug|x86.Build.0 = Debug|Any CPU
 		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Release|x86.ActiveCfg = Release|Any CPU
+		{72DC9D1F-AF25-4572-9D7B-4E305ED3298D}.Release|x86.Build.0 = Release|Any CPU
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Debug|x86.ActiveCfg = Debug|x86
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Debug|x86.Build.0 = Debug|x86
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Release|Any CPU.Build.0 = Release|Any CPU
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Release|x86.ActiveCfg = Release|x86
+		{21A4FE60-CE1F-43D5-A3E2-39176F9D8135}.Release|x86.Build.0 = Release|x86
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Debug|x86.Build.0 = Debug|Any CPU
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Release|x86.ActiveCfg = Release|Any CPU
+		{1D59985C-5276-485C-A041-F733F0868BB4}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 24 - 91
MeterSceneLibrary/JISCO/InnerCarJISCO.cs

@@ -106,6 +106,7 @@ namespace MeterSceneLibrary
                     PbCache.voiceType = 21;
                     PbCache.monitorResultMessage = "未选择称重类型,请选择后开始计量";
                     PbCache.LEDResultMessage = "未选择称重类型,请选择后开始计量";
+                    PbCache.ResultMessage = "未选择称重类型,请选择后开始计量";
                 }
                 // 存在一条预处理数据
                 else if (list == null || list.Count == 1)
@@ -123,8 +124,9 @@ namespace MeterSceneLibrary
                         {}
                         else
                         {
-                            rt = saveMethod.doError(string.Format("当前重量{0}吨,请确认重量", PbCache.lockWgt));
-                            PbCache.LEDResultMessage = string.Format("当前重量{0}吨,请确认重量", PbCache.lockWgt);
+                            rt = saveMethod.doError("");
+                            rt.resultInfo = string.Format("车号{0},当前毛重{1}吨,请确认重量", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                            PbCache.LEDResultMessage = string.Format("车号{0},当前毛重{1}吨,请确认重量", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                             PbCache.voiceType = 12;
                             return rt;
                         }
@@ -206,7 +208,7 @@ namespace MeterSceneLibrary
                                         {
                                             PbCache.ResultMessage = "重量类型为毛重,在皮重误差内";
                                         }
-                                        PbCache.voiceType = 14;
+                                        PbCache.voiceType = 23;
                                         rt = saveMethod.doError(PbCache.ResultMessage);
                                         rt.isWarn = true;
                                         rt.WarnContent = "validWgt";
@@ -306,11 +308,11 @@ namespace MeterSceneLibrary
                                                                     mwaf.weightType = "0";
                                                                     // 只保存一次计量数据
                                                                     rt = saveMethod.doAddFirst(rmScale.Data[0], mwaf);
-                                                                    rt.resultInfo += ",期限皮不存在或者已过期,请留存期限皮";
+                                                                    rt.resultInfo += ",期限皮无效,请留存期限皮";
                                                                     PbCache.voiceType = 15;
-                                                                    PbCache.ResultMessage = "计量成功,期限皮不存在或者已过期,请留存期限皮";
-                                                                    PbCache.monitorResultMessage = "计量成功,期限皮不存在或者已过期,请留存期限皮";
-                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成,期限皮不存在或已过期请留存期限皮", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                                                    PbCache.ResultMessage = "计量成功,期限皮无效,请留存期限皮";
+                                                                    PbCache.monitorResultMessage = "计量成功,期限皮无效,请留存期限皮";
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,计量完成,期限皮无效", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                                                 }
                                                                 else
                                                                 {
@@ -326,7 +328,7 @@ namespace MeterSceneLibrary
                                                                     rt.resultInfo += ",期限皮结净";
                                                                     PbCache.voiceType = 16; 
                                                                     PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,计量完成期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
                                                                 }
                                                             }
                                                         }
@@ -449,7 +451,7 @@ namespace MeterSceneLibrary
                                                                     rt.resultInfo += ",期限皮结净";
                                                                     PbCache.voiceType = 16;
                                                                     PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,计量完成期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
                                                                 }
                                                             }
                                                         }
@@ -620,7 +622,7 @@ namespace MeterSceneLibrary
                                                                     mwaf.weightType = "0";
                                                                     PbCache.voiceType = 16;
                                                                     PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,计量完成期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
                                                                     rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
                                                                     rt.resultInfo += ",期限皮结净";
                                                                 }
@@ -762,7 +764,7 @@ namespace MeterSceneLibrary
                                                                     mwaf.weightType = "0";
                                                                     PbCache.voiceType = 16;
                                                                     PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,计量完成期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
+                                                                    PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
                                                                     rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
                                                                     rt.resultInfo += ",期限皮结净";
                                                                 }
@@ -980,7 +982,7 @@ namespace MeterSceneLibrary
                                                                             mwaf.weightType = "0";
                                                                             PbCache.voiceType = 16;
                                                                             PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                            PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,计量完成期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
+                                                                            PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
                                                                             rt = saveMethod.doNetTermTare(scales.Data[0], mwaf);
                                                                             rt.resultInfo += ",期限皮结净";
                                                                         }
@@ -1122,7 +1124,7 @@ namespace MeterSceneLibrary
                                                                             mwaf.weightType = "0";
                                                                             PbCache.voiceType = 16;
                                                                             PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                            PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,计量完成期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
+                                                                            PbCache.LEDResultMessage = string.Format("车号{0},毛重{1}吨,净重{2}吨,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(PbCache.lockWgt - termTareData.Data.meterWeight.Value) / 1000), 2));
                                                                             rt = saveMethod.doNetTermTare(scales.Data[0], mwaf);
                                                                             rt.resultInfo += ",期限皮结净";
                                                                         }
@@ -1479,7 +1481,7 @@ namespace MeterSceneLibrary
                                             {
                                                 PbCache.ResultMessage = "重量类型为毛重,在皮重误差内";
                                             }
-                                            PbCache.voiceType = 14;
+                                            PbCache.voiceType = 23;
                                             rt = saveMethod.doError(PbCache.ResultMessage);
                                         }
                                     }
@@ -1553,7 +1555,7 @@ namespace MeterSceneLibrary
                                             mwaf.weightType = "1";
                                             PbCache.voiceType = 1;
                                             rt = saveMethod.doAddFirst(null, mwaf);
-                                            PbCache.LEDResultMessage = string.Format("车号{0},重{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
+                                            PbCache.LEDResultMessage = string.Format("车号{0},重{1}吨,计量完成", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
                                         }
                                         else
                                         {
@@ -1927,7 +1929,7 @@ namespace MeterSceneLibrary
                                             {
                                                 PbCache.ResultMessage = "重量类型为皮重且不在皮重误差内";
                                             }
-                                            PbCache.voiceType = 13;
+                                            PbCache.voiceType = 23;
                                             rt = saveMethod.doError(PbCache.ResultMessage);
                                             rt.isWarn = true;
                                             rt.WarnContent = "validWgt";
@@ -1944,6 +1946,7 @@ namespace MeterSceneLibrary
                                         //PbCache.monitorResultMessage = "之前存在多个未结净的毛重";
 
                                         int countTerm = 0;
+                                        List<MeterWorkCarActualFirst> meterWorkCarActualFirsts = new List<MeterWorkCarActualFirst>(); 
 
                                         foreach (var item in firstList)
                                         {
@@ -1982,43 +1985,7 @@ namespace MeterSceneLibrary
                                                                 RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
                                                                 if (termTareData.Succeed)
                                                                 {
-                                                                    // 正常结净
-                                                                    //给一次数据匹配委托
-                                                                    EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
-                                                                    mwaf = entityBase3.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
-                                                                    mwaf.isPreScale = "1";
-                                                                    mwaf.weightType = "0";
-
-                                                                    rt = saveMethod.doTermTareNet(scales.Data[0], item, mwaf);
-                                                                    //if (termTareData.Data == null)
-                                                                    //{
-                                                                    // 正常结净
-                                                                    //给一次数据匹配委托
-                                                                    //EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
-                                                                    //mwaf = entityBase3.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
-                                                                    //mwaf.isPreScale = "1";
-                                                                    //mwaf.weightType = "0";
-
-                                                                    //rt = saveMethod.doTermTareNet(rmScale.Data[0], mwaf, firstList[0]);
-                                                                    //rt.resultInfo += ",留存期限皮成功";
-                                                                    //PbCache.ResultMessage = "计量成功,留存期限皮成功";
-                                                                    //PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,留存期限皮成功", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                                                                    //}
-                                                                    //else
-                                                                    //{
-                                                                    //    // 存在使用期限皮重权限,并使用期限皮重结净
-                                                                    //    List<string> l = new List<string>();
-                                                                    //    l.Add("create");
-                                                                    //    //给一次数据匹配委托
-                                                                    //    EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
-                                                                    //    mwaf = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
-                                                                    //    mwaf.isPreScale = "1";
-                                                                    //    mwaf.weightType = "0";
-                                                                    //    rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
-                                                                    //    rt.resultInfo += ",期限皮结净";
-                                                                    //    PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                    //    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                                                                    //}
+                                                                    meterWorkCarActualFirsts.Add(item);
                                                                 }
                                                             }
                                                         }
@@ -2113,43 +2080,7 @@ namespace MeterSceneLibrary
                                                                 RESTfulResult<MeterBaseTermTareData> termTareData = meterBaseTermTareDataService.doQueryPageWf(new MeterBaseTermTareData { carNo = PbCache.lockCarNo, valueFlag = "0" });
                                                                 if (termTareData.Succeed)
                                                                 {
-                                                                    // 正常结净
-                                                                    //给一次数据匹配委托
-                                                                    EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
-                                                                    mwaf = entityBase3.format<MeterWorkCarActualFirst>(scales.Data[0], mwaf);
-                                                                    mwaf.isPreScale = "1";
-                                                                    mwaf.weightType = "0";
-
-                                                                    rt = saveMethod.doTermTareNet(scales.Data[0], item, mwaf);
-                                                                    //if (termTareData.Data == null)
-                                                                    //{
-                                                                    // 正常结净
-                                                                    //给一次数据匹配委托
-                                                                    //EntityBase<PreTrackScale> entityBase3 = new EntityBase<PreTrackScale>();
-                                                                    //mwaf = entityBase3.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
-                                                                    //mwaf.isPreScale = "1";
-                                                                    //mwaf.weightType = "0";
-
-                                                                    //rt = saveMethod.doTermTareNet(rmScale.Data[0], mwaf, firstList[0]);
-                                                                    //rt.resultInfo += ",留存期限皮成功";
-                                                                    //PbCache.ResultMessage = "计量成功,留存期限皮成功";
-                                                                    //PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,留存期限皮成功", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                                                                    //}
-                                                                    //else
-                                                                    //{
-                                                                    //    // 存在使用期限皮重权限,并使用期限皮重结净
-                                                                    //    List<string> l = new List<string>();
-                                                                    //    l.Add("create");
-                                                                    //    //给一次数据匹配委托
-                                                                    //    EntityBase<PreTrackScale> entityBase1 = new EntityBase<PreTrackScale>();
-                                                                    //    mwaf = entityBase1.format<MeterWorkCarActualFirst>(rmScale.Data[0], mwaf);
-                                                                    //    mwaf.isPreScale = "1";
-                                                                    //    mwaf.weightType = "0";
-                                                                    //    rt = saveMethod.doNetTermTare(rmScale.Data[0], mwaf);
-                                                                    //    rt.resultInfo += ",期限皮结净";
-                                                                    //    PbCache.ResultMessage = "计量完成,期限皮结净";
-                                                                    //    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,计量完成,期限皮结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2));
-                                                                    //}
+                                                                    meterWorkCarActualFirsts.Add(item);
                                                                 }
                                                             }
                                                         }
@@ -2165,8 +2096,9 @@ namespace MeterSceneLibrary
 
                                         if (countTerm == 0)
                                         {
+                                            rt = saveMethod.doNetAddMuchGross(meterWorkCarActualFirsts,mwaf);
                                             rt.result = true;
-                                            rt.resultInfo = "计量完成";
+                                            rt.resultInfo = "计量完成,留存期限皮成功";
                                             PbCache.voiceType = 9;
                                             PbCache.ResultMessage = "计量成功,留存期限皮成功";
                                             PbCache.monitorResultMessage = string.Format("计量成功,留存期限皮成功");
@@ -2188,6 +2120,7 @@ namespace MeterSceneLibrary
                                         }
                                         else
                                         {
+                                            rt = saveMethod.doNetAddMuchGross(meterWorkCarActualFirsts, mwaf);
                                             rt.result = true;
                                             PbCache.voiceType = 11;
                                             rt.resultInfo += ",存在多个毛重未结净";

+ 8 - 8
MeterSceneLibrary/JISCO/OuterCarJISCO.cs

@@ -336,7 +336,7 @@ namespace MeterSceneLibrary
                                             rt = saveMethod.doAddNetNewHZHX(listPreScale[0], newActualFirst, mwaf);
                                             rt.resultInfo += ",混装业务"; 
                                             PbCache.voiceType = 1; 
-                                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成混装业务", PbCache.lockCarNo, Math.Round(PbCache.lockWgt / 1000, 2), Math.Round((PbCache.lockWgt - double.Parse(lastMeterWorkCarActual.grossWeight.ToString()) / 1000), 2));
+                                            PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round(PbCache.lockWgt / 1000, 2), Math.Round((PbCache.lockWgt - double.Parse(lastMeterWorkCarActual.grossWeight.ToString()) / 1000), 2));
                                         }
                                         else
                                         {
@@ -505,7 +505,7 @@ namespace MeterSceneLibrary
                                     rt.WarnContent = "validIsPre";
                                     rt.resultInfo += ",无委托结净";
                                     PbCache.voiceType = 1;
-                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成无委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                    PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,无委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     PbCache.monitorResultMessage = string.Format("计量完成,车号{0}无委托结净", PbCache.lockCarNo, listPreScale.Count);
 
                                 }
@@ -548,14 +548,14 @@ namespace MeterSceneLibrary
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     else if (listPreScale[0].matterNo == listPreScale[1].matterNo && (listPreScale[0].receivingUintNo == listPreScale[1].forwardingUnitNo || listPreScale[0].forwardingUnitNo == listPreScale[1].receivingUintNo))
                                     {
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     /*
                                      * 委托关系满足混装逻辑
@@ -578,7 +578,7 @@ namespace MeterSceneLibrary
                                         //mwaf.isPreScale = "1";
                                         PbCache.voiceType = 1;
                                         rt = saveMethod.doNetHZHX(listPreScale[1], mwca, mwaf);
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                         rt.resultInfo += ",混装业务";
                                     }
                                     // 不满足以上逻辑
@@ -728,14 +728,14 @@ namespace MeterSceneLibrary
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     else if (listPreScale[0].matterNo == listPreScale[1].matterNo && (listPreScale[0].receivingUintNo == listPreScale[1].forwardingUnitNo || listPreScale[0].forwardingUnitNo == listPreScale[1].receivingUintNo))
                                     {
                                         // 正常结净并生成两条净重数据
                                         rt = saveMethod.doNetAddTwo(listPreScale, rmX.Data[0], mwaf);
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,双委托结净", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     /*
                                      * 委托关系满足混装混卸逻辑
@@ -770,7 +770,7 @@ namespace MeterSceneLibrary
                                         rt = saveMethod.doNetHZHX(pts, mwca, mwaf);
                                         rt.resultInfo += ",混装业务";
                                         PbCache.voiceType = 1;
-                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,计量完成混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
+                                        PbCache.LEDResultMessage = string.Format("车号{0},重量{1}吨,净重{2}吨,混装业务", PbCache.lockCarNo, Math.Round((PbCache.lockWgt / 1000), 2), Math.Round((Math.Abs(rmX.Data[0].meterWeight.Value - PbCache.lockWgt) / 1000), 2));
                                     }
                                     // 不满足以上逻辑
                                     else

+ 38 - 0
MeterSceneLibrary/JISCO/private/SaveMethod.cs

@@ -931,6 +931,44 @@ namespace MeterSceneLibrary.JISCO
             }
             return rt;
         }
+        /// <summary>
+        /// 多毛一皮
+        /// </summary>
+        /// <param name="scale"></param>
+        /// <param name="actualFirst"></param>
+        /// <param name="actualFirst1"></param>
+        /// <returns></returns>
+        public rtInfo doNetAddMuchGross(List<MeterWorkCarActualFirst> actualFirst, MeterWorkCarActualFirst actualFirst1)
+        {
+            //操作日志
+            MeterMonitorNote monitorNote = new MeterMonitorNote();
+            monitorNote.baseSpotNo = actualFirst1.baseSpotNo;
+            monitorNote.baseSpotName = actualFirst1.baseSpotName;
+            monitorNote.operationContent = string.Format("保存期限皮重");
+            monitorNote.operationTime = actualFirst1.createTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
+            monitorNote.carNo = actualFirst1.carNo;
+            monitorNote.meterNoteSource = "0";
+
+            //期限皮重数据保存
+            MeterWorkCarActualService actualService = new MeterWorkCarActualService();
+            RESTfulResult<string> rmI = actualService.doNetAddMuchGross(actualFirst, actualFirst1, monitorNote);
+
+            if (rmI.Succeed)
+            {
+                rt.result = true;
+                rt.resultInfo = "计量完成";
+                PbCache.actualFirstNo = rmI.Data;
+                PbCache.strQRCode = rmI.Message;
+                PbCache.isTareWeight = true;//皮重
+            }
+            else
+            {
+                rt.result = false;
+                rt.isError = true;
+                rt.resultInfo = "称重数据保存失败";
+            }
+            return rt;
+        }
 
         /// <summary>
         /// 多毛一重