Browse Source

修改界面文字,加速线扫采集的时间

zhangjiaxin 4 years ago
parent
commit
2e10e0992e

+ 18 - 0
DBManager/DBManager.csproj

@@ -34,6 +34,24 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.3.0\lib\net45\EntityFramework.dll</HintPath>

+ 163 - 63
DBManager/MeasureDB.cs

@@ -18,6 +18,15 @@ namespace DBManager
         public SQLiteConnection m_db;
         private MeasureFile m_measureFile; //测量文件
 
+
+        private List<byte[]> LineXraybyte = new List<byte[]>();
+        private List<string> LineXraystring = new List<string>();
+        private List<string> LineXray = new List<string>();
+
+        private List<byte[]> PoinXraybyte = new List<byte[]>();
+        private List<string> PoinXraystring = new List<string>();
+        private List<string> PoinXray = new List<string>();
+
         public MeasureDB(MeasureFile mf)
         {
             Init(mf);
@@ -48,8 +57,9 @@ namespace DBManager
             //{
             //    File.Delete(path);
             //}
-            
+
             m_db = new SQLiteConnection("data source =" + path);
+            //m_db = new SQLiteConnection("data source =" + @"D:\HOZ\数据库测试\MeasureDB.db");
             m_db.Open();
         }
 
@@ -262,73 +272,62 @@ namespace DBManager
         public bool InsertAPointXray(int PointsId, int XrayId, int X, int Y, long[] XrayData, Dictionary<string, double> listElement, int ImageID)
         {
             byte[] bArray = new byte[8000];
-
-            for (int i = 0; i < 2000; i++)
+            for (int a = 0; a < 2000; a++)
             {
-                byte[] temps = BitConverter.GetBytes(XrayData[i]);
-                bArray[i * 4] = temps[0];
-                bArray[i * 4 + 1] = temps[1];
-                bArray[i * 4 + 2] = temps[2];
-                bArray[i * 4 + 3] = temps[3];
+                byte[] temps = BitConverter.GetBytes(XrayData[a]);
+                bArray[a * 4] = temps[0];
+                bArray[a * 4 + 1] = temps[1];
+                bArray[a * 4 + 2] = temps[2];
+                bArray[a * 4 + 3] = temps[3];
             }
-
             //开启一个事务
-            using (SQLiteTransaction tr = m_db.BeginTransaction())
+            //using (SQLiteTransaction tr = m_db.BeginTransaction())
+            //{
+            //向能谱数据表插入数据
+            string sql = "INSERT INTO XrayData(ID, APID, ImageID, Type, X, Y, AreasID, ElementNum, XrayData) values ("
+                + XrayId.ToString() + ","
+                + PointsId.ToString() + ","
+                + ImageID.ToString() + ","
+                + 0.ToString() + ","
+                + X.ToString() + ","
+                + Y.ToString() + ","
+                + (-1).ToString() + ","
+                + listElement.Count.ToString() + ",:XrayData)";
+            PoinXraybyte.Add(bArray);
+            PoinXraystring.Add(sql);
+            //SQLiteCommand command = new SQLiteCommand(sql, m_db);
+            //command.Parameters.Add("XrayData", System.Data.DbType.Binary).Value = bArray;  // BLOB
+            //command.ExecuteNonQuery();
+            //向能谱元素表插入数据
+            int i = 1;
+            foreach (KeyValuePair<string, double> element in listElement)
             {
-                //向能谱数据表插入数据
-                string sql = "INSERT INTO XrayData(ID, APID, ImageID, Type, X, Y, AreasID, ElementNum, XrayData) values ("
-                    + XrayId.ToString() + ","
-                    + PointsId.ToString() + ","
-                    + ImageID.ToString() + ","
-                    + 0.ToString() + ","
-                    + X.ToString() + ","
-                    + Y.ToString() + ","
-                    + (-1).ToString() + ","
-                    + listElement.Count.ToString() + ",:XrayData)";
-
-                SQLiteCommand command = new SQLiteCommand(sql, m_db);
-                command.Parameters.Add("XrayData", System.Data.DbType.Binary).Value = bArray;  // BLOB
-                command.ExecuteNonQuery();
-
-                //向能谱元素表插入数据
-                int i = 1;
-                foreach (KeyValuePair<string, double> element in listElement)
-                {
-
-                    sql = "INSERT INTO Element(XayID, ElementNum, ElementID, Name, Percent) values ("
-                       + XrayId.ToString() + ","
-                       + listElement.Count.ToString() + ","
-                       + i.ToString() + ",'"
-                       + element.Key + "',"
-                       + element.Value.ToString() + ")";
-
-                    command = new SQLiteCommand(sql, m_db);
-                    command.ExecuteNonQuery();
-                    i++;
-                }
-
-                //向位置表插入数据
-
-               
-               
-
-                    sql = "INSERT INTO AreaPosition(XrayID, AID, SegNum, SegID, X, Y, Length) values ("
-                       + XrayId.ToString() + ","
-                       + PointsId.ToString() + ","
-                       + (-1).ToString() + ","
-                       + (-1).ToString() + ","
-                       + X.ToString() + ","
-                       + Y.ToString() + ","
-                       + (0).ToString() + ")";
-
-                    command = new SQLiteCommand(sql, m_db);
-                    command.ExecuteNonQuery();
-                  
-
-                tr.Commit();
-
-                Thread.Sleep(500);
+                sql = "INSERT INTO Element(XayID, ElementNum, ElementID, Name, Percent) values ("
+                   + XrayId.ToString() + ","
+                   + listElement.Count.ToString() + ","
+                   + i.ToString() + ",'"
+                   + element.Key + "',"
+                   + element.Value.ToString() + ")";
+                PoinXray.Add(sql);
+                //command = new SQLiteCommand(sql, m_db);
+                //command.ExecuteNonQuery();
+                i++;
             }
+            //向位置表插入数据
+            sql = "INSERT INTO AreaPosition(XrayID, AID, SegNum, SegID, X, Y, Length) values ("
+               + XrayId.ToString() + ","
+               + PointsId.ToString() + ","
+               + (-1).ToString() + ","
+               + (-1).ToString() + ","
+               + X.ToString() + ","
+               + Y.ToString() + ","
+               + (0).ToString() + ")";
+            PoinXray.Add(sql);
+            //command = new SQLiteCommand(sql, m_db);
+            //command.ExecuteNonQuery();
+            //tr.Commit();
+            Thread.Sleep(200);
+            //}
             return true;
         }
 
@@ -402,5 +401,106 @@ namespace DBManager
             }
             return true;
         }
+
+        public bool SaveToMemory(int PointsId, int XrayId, int AreaId, List<Segment> listSeg, long[] XrayData, Dictionary<string, double> listElement, int ImageID)
+        {
+            byte[] bArray = new byte[8000];
+            for (int a = 0; a < 2000; a++)
+            {
+                byte[] temps = BitConverter.GetBytes(XrayData[a]);
+                bArray[a * 4] = temps[0];
+                bArray[a * 4 + 1] = temps[1];
+                bArray[a * 4 + 2] = temps[2];
+                bArray[a * 4 + 3] = temps[3];
+            }
+            //向能谱数据表插入数据
+            string sql = "INSERT INTO XrayData(ID, APID, ImageID, Type, X, Y, AreasID, ElementNum, XrayData) values ("
+                + XrayId.ToString() + ","
+                + PointsId.ToString() + ","
+                + ImageID.ToString() + ","
+                + 1.ToString() + ","
+                + (-1).ToString() + ","
+                + (-1).ToString() + ","
+                + AreaId.ToString() + ","
+                + listElement.Count.ToString() + ",:XrayData)";
+            LineXraystring.Add(sql);
+            LineXraybyte.Add(bArray);
+            //向能谱元素表插入数据
+            int i = 1;
+            foreach (KeyValuePair<string, double> element in listElement)
+            {
+                sql = "INSERT INTO Element(XayID, ElementNum, ElementID, Name, Percent) values ("
+                   + XrayId.ToString() + ","
+                   + listElement.Count.ToString() + ","
+                   + i.ToString() + ",'"
+                   + element.Key + "',"
+                   + element.Value.ToString() + ")";
+                LineXray.Add(sql);
+                i++;
+            }
+            //向位置表插入数据
+            i = 1;
+            foreach (Segment seg in listSeg)
+            {
+                sql = "INSERT INTO AreaPosition(XrayID, AID, SegNum, SegID, X, Y, Length) values ("
+                   + XrayId.ToString() + ","
+                   + PointsId.ToString() + ","
+                   + listSeg.Count.ToString() + ","
+                   + i.ToString() + ","
+                   + seg.X.ToString() + ","
+                   + seg.Y.ToString() + ","
+                   + seg.Length.ToString() + ")";
+                LineXray.Add(sql);
+                i++;
+            }
+            return true;
+        }
+        public bool PointDataSubmitted()
+        {
+            using (SQLiteTransaction tr = m_db.BeginTransaction())
+            {
+                for (int i = 0; i < PoinXraystring.Count(); i++)
+                {
+                    SQLiteCommand command = new SQLiteCommand(LineXraystring[i], m_db);
+                    command.Parameters.Add("XrayData", System.Data.DbType.Binary).Value = PoinXraybyte[i];  // BLOB
+                    command.ExecuteNonQuery();
+                }
+                for (int i = 0; i < PoinXray.Count(); i++)
+                {
+                    SQLiteCommand command = new SQLiteCommand(PoinXray[i], m_db);
+                    command.ExecuteNonQuery();
+                }
+                tr.Commit();
+            }
+            PoinXraystring.Clear();
+            PoinXraybyte.Clear();
+            PoinXray.Clear();
+            return true;
+            
+        }
+        public bool LineDataSubmitted()
+        {
+            using (SQLiteTransaction tr = m_db.BeginTransaction())
+            {
+                for (int i = 0; i < LineXraystring.Count(); i++)
+                {
+                    SQLiteCommand command = new SQLiteCommand(LineXraystring[i], m_db);
+                    command.Parameters.Add("XrayData", System.Data.DbType.Binary).Value = LineXraybyte[i];  // BLOB
+                    command.ExecuteNonQuery();
+                }
+                for (int i = 0; i < LineXray.Count(); i++)
+                {
+                    SQLiteCommand command = new SQLiteCommand(LineXray[i], m_db);
+                    command.ExecuteNonQuery();
+                }
+                tr.Commit();
+            }
+            LineXraystring.Clear();
+            LineXraybyte.Clear();
+            LineXray.Clear();
+            return true;
+        }
     }
+
+    
 }

+ 18 - 0
ExtenderControl/HOZExtender.csproj

@@ -34,6 +34,24 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 18 - 0
FileManager/FileManager.csproj

@@ -34,6 +34,24 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 40 - 2
HOZ.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28307.1145
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31019.35
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitControl", "HOZProject\UnitControl.csproj", "{ABBA5E64-536B-4EA0-8305-490A48822C89}"
 EndProject
@@ -33,45 +33,83 @@ EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
+		Debug|x64 = Debug|x64
 		Release|Any CPU = Release|Any CPU
+		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Debug|x64.ActiveCfg = Debug|x64
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Debug|x64.Build.0 = Debug|x64
 		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Release|Any CPU.Build.0 = Release|Any CPU
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Release|x64.ActiveCfg = Release|x64
+		{ABBA5E64-536B-4EA0-8305-490A48822C89}.Release|x64.Build.0 = Release|x64
 		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Debug|x64.ActiveCfg = Debug|x64
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Debug|x64.Build.0 = Debug|x64
 		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Release|x64.ActiveCfg = Release|x64
+		{BF7F80B0-A6DA-4470-A331-4C96057FC7FA}.Release|x64.Build.0 = Release|x64
 		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Debug|x64.ActiveCfg = Debug|x64
+		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Debug|x64.Build.0 = Debug|x64
 		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Release|x64.ActiveCfg = Release|x64
+		{9A5851E4-73FD-48E1-876C-68BED40A0512}.Release|x64.Build.0 = Release|x64
 		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Debug|x64.ActiveCfg = Debug|x64
+		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Debug|x64.Build.0 = Debug|x64
 		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Release|x64.ActiveCfg = Release|x64
+		{14C99F54-B3C2-47CF-ADB3-E79FDD2D382F}.Release|x64.Build.0 = Release|x64
 		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Debug|x64.ActiveCfg = Debug|x64
+		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Debug|x64.Build.0 = Debug|x64
 		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Release|x64.ActiveCfg = Release|x64
+		{5674DD32-3A9F-4D74-B177-A693A75A0255}.Release|x64.Build.0 = Release|x64
 		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Debug|x64.ActiveCfg = Debug|x64
+		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Debug|x64.Build.0 = Debug|x64
 		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Release|x64.ActiveCfg = Release|x64
+		{12617585-8D9A-4AD4-B6C4-6894A48CEE9E}.Release|x64.Build.0 = Release|x64
 		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Debug|x64.ActiveCfg = Debug|x64
+		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Debug|x64.Build.0 = Debug|x64
 		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Release|Any CPU.Build.0 = Release|Any CPU
+		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Release|x64.ActiveCfg = Release|x64
+		{00319B6F-FAD0-46B5-B76B-7164DC5CA0D5}.Release|x64.Build.0 = Release|x64
 		{F5092F52-1FBD-4882-BB9C-399809D87779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{F5092F52-1FBD-4882-BB9C-399809D87779}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Debug|x64.ActiveCfg = Debug|x64
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Debug|x64.Build.0 = Debug|x64
 		{F5092F52-1FBD-4882-BB9C-399809D87779}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{F5092F52-1FBD-4882-BB9C-399809D87779}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Release|x64.ActiveCfg = Release|x64
+		{F5092F52-1FBD-4882-BB9C-399809D87779}.Release|x64.Build.0 = Release|x64
 		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Debug|x64.ActiveCfg = Debug|x64
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Debug|x64.Build.0 = Debug|x64
 		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Release|x64.ActiveCfg = Release|x64
+		{7566397D-632B-4939-8EB6-9AC620EE44F3}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 2 - 5
HOZProject/FormHOZMain.cs

@@ -938,9 +938,7 @@ namespace HOZProject
             {
              logwin.Left = this.Left-logwin.Width;
             logwin.Top = this.Top;
-
             }
-           
         }
 
         private void pbPause_Click(object sender, EventArgs e)
@@ -956,12 +954,11 @@ namespace HOZProject
                 {
                     MessageBox.Show("退出程序B");
                 }
-        }
+            }
             else
             {
                 MessageBox.Show("尚未保存文件");
             }
-
-}
+        }
     }
 }

+ 20 - 0
HOZProject/UnitControl.csproj

@@ -48,6 +48,26 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 1 - 1
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -531,7 +531,7 @@
             this.btnCutHoleFile.Name = "btnCutHoleFile";
             this.btnCutHoleFile.Size = new System.Drawing.Size(103, 25);
             this.btnCutHoleFile.TabIndex = 120;
-            this.btnCutHoleFile.Text = "读取测试点";
+            this.btnCutHoleFile.Text = "测试点选取";
             this.btnCutHoleFile.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
             this.btnCutHoleFile.UseVisualStyleBackColor = true;
             this.btnCutHoleFile.Click += new System.EventHandler(this.btnCutHoleFile_Click);

+ 18 - 0
MeasureData/MeasureData.csproj

@@ -31,6 +31,24 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="FileManager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 2 - 1
MeasureThread/Locate.cs

@@ -221,6 +221,7 @@ namespace MeasureThread
                 return false;
             }
             float curZ = iSEM.GetStageAtZ();
+            log.Info("当前Z轴位置为" + curZ.ToString());
             float targetZ;
             if (d == ZAxisDirection.up)
             {
@@ -231,7 +232,7 @@ namespace MeasureThread
                 targetZ = curZ - value;
             }
 
-            log.Info("将Z轴位置指定到:" + value.ToString(), true);
+            log.Info("将Z轴位置指定到:" + targetZ.ToString(), true);
             if (!iSEM.SetStageGotoZ(targetZ))
             {
                 log.Error("样品台Z轴移到位置失败", false);

+ 7 - 31
MeasureThread/Measure.cs

@@ -1607,16 +1607,11 @@ namespace MeasureThread
                 double dDwellTime = param.DwellTime;
                 int nImageType = param.ImageType;
                 double dScanSizes = param.ScanSize;
-
                 log.Info("dDwellTime=" + dDwellTime.ToString() + " nImageType=" + nImageType.ToString() + " dScanSizes=" + dScanSizes.ToString(), true);
                 iExtender.SetImageAcquistionSetting(dDwellTime, nImageType, dScanSizes);
-
                 string path = currHole.EDS_path;
                 string edsfn = path + "\\" + a_FieldImagePositionID.ToString() + "_" + ImageNameEDS;
                 log.Info("EDS_PATH=" + edsfn, true);
-
-
-
                 iExtender.GrabImage(edsfn, 0, 0, 0, 0, 0);//get the field eds image where the anylysis point locate.
                 arg.Picture_Information.Picture_FullPath = "";
                 arg.State = true;
@@ -1625,11 +1620,9 @@ namespace MeasureThread
                 arg.Message = "";
                 arg.Picture_Information.Picture_FullPath = edsfn;
                 SendMsg("EDSPic");
-
                 //送给客户,计算感兴趣的区域
                 List<System.Drawing.Point> listPoints = new List<System.Drawing.Point>();
                 List<System.Drawing.Point> LinesStartPoint = new List<System.Drawing.Point>();
-                
                 List<List<Segment>> Features = new List<List<Segment>>();
                 List<int> lines_height = new List<int>();
                 System.Drawing.Point area_pt = new System.Drawing.Point();
@@ -1655,8 +1648,6 @@ namespace MeasureThread
                         {
                             log.Error("插入分析视场失败", false);
                         }
-
-
                         iExtender.BeginMultipleAquisition();
                         Thread.Sleep(100);
                         //点采集
@@ -1665,7 +1656,6 @@ namespace MeasureThread
                         {
                             XrayData = new long[2000];
                             listElement = new Dictionary<string, double>();
-                          
                             if (iExtender.XrayPointCollecting(1000, pt.X, pt.Y , out XrayData, out listElement))
                             {
                                 string ele = "";
@@ -1681,14 +1671,12 @@ namespace MeasureThread
                                 Boolean ret = m_MeasDB.InsertAPointXray(currHole.HoleNo, m_nXrayId, pt.X, pt.Y, XrayData, listElement, a_FieldImagePositionID);
                                 Thread.Sleep(1000);
                             }
-
                         }
+                        m_MeasDB.PointDataSubmitted();
                         iExtender.EndMultipleAquisition();
                         break;
                     case 1://line mode
-
                         log.Info("线扫描", true);
-                        
                         state = 0;
                         ImagePro.EDS_Param_Lines(edsfn, a_FieldImagePositionID, Convert.ToInt32(MParam.SampleTypeNo()), MParam.Firm, out LinesStartPoint, out lines_height, out state);
                         string sp = "";
@@ -1697,26 +1685,22 @@ namespace MeasureThread
                             sp += "(" + p.X + "," + p.Y + ")";
                         }
                         log.Info("线返回数据,lines=" + LinesStartPoint.Count.ToString() + " " + sp+"每条线的长度为:"+ lines_height[0].ToString(), true);
-
                         if (state == 1)
                         {
                             //将线转换为segment数据
                             log.Info("将线转换为segment数据", true);
-
                             for (int i = 0; i < LinesStartPoint.Count; i++)
                             {
                                 int wholeHeight = lines_height[i];
                                 int singleHeight = 3;//每5高度形成一个单元
-
                                 for (int k = 0; k < wholeHeight; k += singleHeight)
                                 {
-
                                     List<Segment> feature = new List<Segment>();
                                     for (int j = 0; j <= singleHeight; j++)
                                     {
                                         Segment segment = new Segment();
                                         segment.X = LinesStartPoint[i].X;
-                                        segment.Y = LinesStartPoint[i].Y;
+                                        segment.Y = LinesStartPoint[i].Y+j+k;
                                         segment.Length = 1;
                                         feature.Add(segment);
                                     }
@@ -1730,17 +1714,15 @@ namespace MeasureThread
                             return false;
                         }
                         //线采集
-
                         m_nXrayId = 0;
                         iExtender.BeginMultipleAquisition();
-                        Thread.Sleep(100);
+                        //Thread.Sleep(100);
+                        log.Info(" Features.Coun的长度为"+ Features.Count.ToString());
                         for (int i = 0; i < Features.Count; i++)
                         {
                             List<Segment> listSeg = Features[i];
                             XrayData = new long[2000];
                             listElement = new Dictionary<string, double>();
-
-
                             //if (iExtender.XrayAreaCollectiong(5000, listSeg, out XrayData, out listElement))
                             if (iExtender.XrayPointCollecting(300, listSeg[0].X, listSeg[0].Y, out XrayData, out listElement))
                             {
@@ -1754,10 +1736,10 @@ namespace MeasureThread
                                 log.Info("线采集结束,写入数据库开始", true);
                                 //写入数据库
                                 m_nXrayId++;
-
                                 AreasNo++;
                                 //m_MeasDB.InsertAPointXray(currHole.HoleNo, m_nXrayId, listSeg[0].X, listSeg[0].Y, XrayData, listElement, a_FieldImagePositionID);
-                                m_MeasDB.InsertAAreaXay(currHole.HoleNo, m_nXrayId, AreasNo, listSeg, XrayData, listElement, a_FieldImagePositionID);
+                                //m_MeasDB.InsertAAreaXay(currHole.HoleNo, m_nXrayId, AreasNo, listSeg, XrayData, listElement, a_FieldImagePositionID);
+                                m_MeasDB.SaveToMemory(currHole.HoleNo, m_nXrayId, AreasNo, listSeg, XrayData, listElement, a_FieldImagePositionID);
                             }
                             else
                             {
@@ -1765,8 +1747,8 @@ namespace MeasureThread
                             }
 
                         }
+                        m_MeasDB.LineDataSubmitted();
                         iExtender.EndMultipleAquisition();
-
                         break;
                     case 2: //area mode
                             //面数据
@@ -1803,7 +1785,6 @@ namespace MeasureThread
                         {
                             XrayData = new long[2000];
                             listElement = new Dictionary<string, double>();
-
                             log.Info("AreaTime=15000", true);
                             if (iExtender.XrayAreaCollectiong(15000, feature, out XrayData, out listElement))
                             {
@@ -1816,7 +1797,6 @@ namespace MeasureThread
                                 log.Info("面采集结束,写入数据库开始", true);
                                 //写入数据库
                                 m_nXrayId++;
-
                                 AreasNo++;
                                 m_MeasDB.InsertAAreaXay(currHole.HoleNo, m_nXrayId, AreasNo, feature, XrayData, listElement, a_FieldImagePositionID);
                             }
@@ -1827,13 +1807,9 @@ namespace MeasureThread
                         }
                         iExtender.EndMultipleAquisition();
                         break;
-
                 }
-
                 //存储数据
                 //向分析点数据库更新
-
-
             }
             catch (Exception e)
             {

+ 18 - 0
MeasureThread/MeasureThread.csproj

@@ -35,6 +35,24 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="CookComputing.XmlRpcV2">
       <HintPath>.\CookComputing.XmlRpcV2.dll</HintPath>

+ 20 - 0
OxfordTest/OxfordTest.csproj

@@ -35,6 +35,26 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+    <Prefer32Bit>true</Prefer32Bit>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.3.0\lib\net45\EntityFramework.dll</HintPath>

+ 18 - 0
SmartSEMControl/SmartSEMControl.csproj

@@ -34,6 +34,24 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Interop.APILib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 18 - 0
WebManager/WebManager.csproj

@@ -34,6 +34,24 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <LangVersion>7.3</LangVersion>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>