Преглед изворни кода

fix the line scan curve display bug(when the image resolution is not 4:3).

gsp пре 2 година
родитељ
комит
f963d66cae

+ 3 - 29
OTSCPP/OTSControl/OTSControl.vcxproj

@@ -239,7 +239,7 @@
     <IntDir>$(SolutionDir)\Obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
     <OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
     <IncludePath>$(SolutionDir)\OTSCPP\OTSControl;$(SolutionDir)OTSCPP\OTSData;$(SolutionDir)OTSCPP\Tools;$(SolutionDir)OTSCPP\OTSLog;$(IncludePath)</IncludePath>
-    <ReferencePath>$(SolutionDir)OTSCPP\OpenDll\OxfordApi60Dll;$(ReferencePath)</ReferencePath>
+    <ReferencePath>$(SolutionDir)OTSCPP\OpenDll\OxfordApi50Dll;$(ReferencePath)</ReferencePath>
     <LibraryPath>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_oxford50|x64'">
@@ -247,7 +247,7 @@
     <IntDir>$(SolutionDir)\Obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
     <OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
     <IncludePath>$(SolutionDir)\OTSCPP\OTSControl;$(SolutionDir)OTSCPP\OTSData;$(SolutionDir)OTSCPP\Tools;$(SolutionDir)OTSCPP\OTSLog;$(IncludePath)</IncludePath>
-    <ReferencePath>$(SolutionDir)OTSCPP\OpenDll\OxfordApi61Dll;$(ReferencePath)</ReferencePath>
+    <ReferencePath>$(SolutionDir)OTSCPP\OpenDll\OxfordApi61;$(ReferencePath)</ReferencePath>
     <LibraryPath>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_oxford60|x64'">
@@ -834,7 +834,7 @@
   </ItemGroup>
   <ItemGroup>
     <Reference Include="OINA.Extender">
-      <HintPath>..\OpenDll\OxfordApi61Dll\OINA.Extender.dll</HintPath>
+      <HintPath>..\OpenDll\OxfordApi50Dll\OINA.Extender.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
@@ -844,32 +844,6 @@
     <Reference Include="System.Xml" />
     <Reference Include="WindowsBase" />
   </ItemGroup>
-  <ItemGroup>
-    <Content Include="..\OpenDll\OxfordApi61Dll\apidsp_windows.dll">
-      <Link>apidsp_windows.dll</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="..\OpenDll\OxfordApi61Dll\apidsp_windows_x64.dll">
-      <Link>apidsp_windows_x64.dll</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="..\OpenDll\OxfordApi61Dll\hasp_net_windows.dll">
-      <Link>hasp_net_windows.dll</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="..\OpenDll\OxfordApi61Dll\hasp_windows_50590.dll">
-      <Link>hasp_windows_50590.dll</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="..\OpenDll\OxfordApi61Dll\hasp_windows_x64_50590.dll">
-      <Link>hasp_windows_x64_50590.dll</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="..\OpenDll\OxfordApi61Dll\OINA.SNSLicenseProvider.dll">
-      <Link>OINA.SNSLicenseProvider.dll</Link>
-      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>

+ 0 - 2
OTSCPP/OTSControl/Oxford/OxfordWrapper/OxfordControllerWrapper.cpp

@@ -2208,8 +2208,6 @@ IImageAcquisitionSettings^ OxfordControllerWrapper::GetImageAcqusitionSettings()
 		_imageAcqusitionSettings->ScanSettings->FrameCount = 1;
 
 		IImageSettings^ imageSettings = _imageAcqusitionSettings->ImageSettings;
-		//imageSettings->InputSources->ToList()->ForEach(i => imageSettings->EnableInputSource(i.Key, false));
-		//auto imageList = Enumerable::ToList(imageSettings->InputSources);
 
 		for each (KeyValuePair<OINA::Extender::Data::Image::ImageInputSources, bool>^ imputSource in imageSettings->InputSources)
 		{

+ 7 - 29
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.cs

@@ -206,21 +206,10 @@ namespace OTSMeasureApp
                 width = rectangle.Width;
                 height = rectangle.Height;
                 bitmap = new Bitmap(width, height);
-                //创建Graphics类对象
-              //var  graphics = Graphics.FromImage(bitmap);
-              //  //清空图片背景色
-              //  //graphics.Clear(Color.White);
-              //  Font font = new System.Drawing.Font("Arial", 9, FontStyle.Regular);
-
-              //  Brush brush2 = new SolidBrush(Color.SaddleBrown);
-              //  Brush brushPoint = new SolidBrush(Color.Red);
-
-              //  Pen mypenRed = new Pen(Color.Red, 1);
+     
                 Pen mypenYellow = new Pen(Color.Yellow, 0.001f);//点颜色
 
-                //画曲线
-                //if (drawflag == 1)
-                //{
+              
                     int len = buf.Length;
                     PointF[] CurvePointF = new PointF[len];//坐标点
                     float pointX = 0;
@@ -230,7 +219,7 @@ namespace OTSMeasureApp
                         pointX = (picBox.Width - rectangle.Width) / 2 + Convert.ToSingle(i * rate);
                         float imagei = (int)GrayLevel.Max - Convert.ToInt32(buf[i]);
                         float imagerate = (Convert.ToSingle(Convert.ToDouble(rectangle.Height) / 510));
-                        pointY = imagei * imagerate + (rectangle.Height) / 4;
+                        pointY = imagei * imagerate + (rectangle.Height) / 4+rectangle.Top;
                         if (pointY > ((rectangle.Height) * 3 / 4))
                         {
                             float ii = pointY;
@@ -241,7 +230,7 @@ namespace OTSMeasureApp
                     float Tension = 0.001f;
                     e.Graphics.DrawCurve(mypenYellow, CurvePointF, Tension);//画曲线
 
-                //}
+               
            
         }
         #endregion
@@ -1109,31 +1098,20 @@ namespace OTSMeasureApp
                         }
                         Point start = new Point(100, pointStart.Y);
                         Point end = new Point(500, pointEnd.Y);
-                        //int lens = curvebuf.Length;
-
-                        //if (lens <= 1)
-                        //{
-                        //    drawflag = 0;
-                        //    MessageBox.Show(table["message22"].ToString(), table["message23"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
-                        //}
-                        //else
-                        //{
-                            //drawflag = 1;
-                            //Y值
+                  
                             double rate = (double)picBox.Image.Height / (double)rectangle.Height;
                             int YSize = Convert.ToInt32((rate * (double)pointStart.Y));
                         //显示线扫描 黄色线的曲线数据
 
                        var Imagedata = new byte[m_iWidth];
                         GetYSize();
-                        //获取行数据
-                        //GetLineImage(YSize, m_iWidth, ref Imagedata);
+                        
                         GetLineImage(YSize, m_iWidth, ref Imagedata);
 
 
 
                             DrawCurve(Imagedata, e);
-                        //}
+                      
                         e.Graphics.DrawLine(new Pen(Color.Red), new Point(rectangle.X, rectangle.Y + (rectangle.Height) / 4), new Point(rectangle.X + rectangle.Width, rectangle.Y + (rectangle.Height) / 4));
                         e.Graphics.DrawLine(new Pen(Color.Red), new Point(rectangle.X, rectangle.Y + rectangle.Height * 3 / 4), new Point(rectangle.X + rectangle.Width, rectangle.Y + rectangle.Height * 3 / 4));
                         e.Graphics.DrawLine(new Pen(Color.Blue), new Point(rectangle.X, pointStart.Y), new Point(rectangle.X + rectangle.Width, pointEnd.Y));

+ 3 - 2
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -207,8 +207,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\OpenDll\Json\Newtonsoft.Json.dll</HintPath>
     </Reference>
-    <Reference Include="NLog">
-      <HintPath>..\Bin\x64\Debug\NLog.dll</HintPath>
+    <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\OpenDll\Nlog\NLog.dll</HintPath>
     </Reference>
     <Reference Include="office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>