Commit 109e7b16 authored by 潘栩锋's avatar 潘栩锋 🚴

射线+激光AD模拟器整理

parent d762af99
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper"> <PackageReference Include="AutoMapper">
<Version>9.0.0</Version> <Version>10.1.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Newtonsoft.Json"> <PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version> <Version>12.0.3</Version>
......
using FLY.Thick.Base.Common; using FLY.Thick.Base.Server;
using FLY.Thick.Base.Server;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FLY.Simulation.Battery.RayLaser namespace FLY.Simulation.Battery.RayLaser
{ {
...@@ -40,7 +37,7 @@ namespace FLY.Simulation.Battery.RayLaser ...@@ -40,7 +37,7 @@ namespace FLY.Simulation.Battery.RayLaser
/// 托管左支架位置 mm /// 托管左支架位置 mm
/// </summary> /// </summary>
public int HoldPosLeft { get; set; } = 57; public int HoldPosLeft { get; set; } = 57;
/// <summary> /// <summary>
/// 托管左支架位置 mm /// 托管左支架位置 mm
/// </summary> /// </summary>
...@@ -111,13 +108,15 @@ namespace FLY.Simulation.Battery.RayLaser ...@@ -111,13 +108,15 @@ namespace FLY.Simulation.Battery.RayLaser
public CurveCollection curve_ray; public CurveCollection curve_ray;
public void Init() { public void Init()
{
curve_ray = new CurveCollection("curve_ray.json"); curve_ray = new CurveCollection("curve_ray.json");
curve_laser = new CurveCollection("curve_laser.json"); curve_laser = new CurveCollection("curve_laser.json");
Load(); Load();
} }
void Load() { void Load()
{
Load_DataInfo(HorizontalView, "HorizontalView.csv"); Load_DataInfo(HorizontalView, "HorizontalView.csv");
Load_DataInfo(SegmentView, "SegmentView.csv"); Load_DataInfo(SegmentView, "SegmentView.csv");
} }
...@@ -146,10 +145,12 @@ namespace FLY.Simulation.Battery.RayLaser ...@@ -146,10 +145,12 @@ namespace FLY.Simulation.Battery.RayLaser
} }
DateTime lastTime = DateTime.MinValue; DateTime lastTime = DateTime.MinValue;
public void OnPoll(DateTime now) { public void OnPoll(DateTime now)
{
if (lastTime == DateTime.MinValue) { if (lastTime == DateTime.MinValue)
{
lastTime = now; lastTime = now;
return; return;
} }
...@@ -158,16 +159,17 @@ namespace FLY.Simulation.Battery.RayLaser ...@@ -158,16 +159,17 @@ namespace FLY.Simulation.Battery.RayLaser
double ms = 1.0 * ts.Ticks / TimeSpan.TicksPerMillisecond; double ms = 1.0 * ts.Ticks / TimeSpan.TicksPerMillisecond;
double minute = ms / 1000 / 60; double minute = ms / 1000 / 60;
if (FilmVelocity != 0) { if (FilmVelocity != 0)
{
FilmPosition += minute * FilmVelocity; FilmPosition += minute * FilmVelocity;
} }
int index = (int)(FilmPosition*1000 % SegmentView.Count()); int index = (int)(FilmPosition * 1000 % SegmentView.Count());
IsVSignLight = SegmentView[index].IsLight; IsVSignLight = SegmentView[index].IsLight;
lastTime = now; lastTime = now;
} }
public enum PosType public enum PosType
{ {
/// <summary> /// <summary>
/// 空气 /// 空气
...@@ -196,25 +198,27 @@ namespace FLY.Simulation.Battery.RayLaser ...@@ -196,25 +198,27 @@ namespace FLY.Simulation.Battery.RayLaser
/// <param name="mm_v">相对于极片纵向位置mm</param> /// <param name="mm_v">相对于极片纵向位置mm</param>
/// <param name="posType">输出位置类型</param> /// <param name="posType">输出位置类型</param>
/// <returns></returns> /// <returns></returns>
public double GetValue(bool isRay, int mm, int mm_v, out PosType posType) { public double GetValue(bool isRay, int mm, int mm_v, out PosType posType)
{
if (mm >= (HoldPosLeft - HoldWidth / 2) && mm <= (HoldPosLeft + HoldWidth / 2)) if (mm >= (HoldPosLeft - HoldWidth / 2) && mm <= (HoldPosLeft + HoldWidth / 2))
{ {
posType = PosType.Hold; posType = PosType.Hold;
return 100000; return 100000;
} }
if (mm >= FilmBegin && mm < FilmBegin + HorizontalView.Count) { if (mm >= FilmBegin && mm < FilmBegin + HorizontalView.Count)
{
posType = PosType.Film; posType = PosType.Film;
var dataInfoH = HorizontalView[mm - FilmBegin]; var dataInfoH = HorizontalView[mm - FilmBegin];
while (mm_v<0) while (mm_v < 0)
{ {
mm_v += SegmentView.Count(); mm_v += SegmentView.Count();
} }
var dataInfoV = SegmentView[mm_v % SegmentView.Count()]; var dataInfoV = SegmentView[mm_v % SegmentView.Count()];
if ((dataInfoV.IsLight)|| (dataInfoH.IsLight)) if ((dataInfoV.IsLight) || (dataInfoH.IsLight))
{ {
return FoilValue; return FoilValue;
} }
...@@ -231,7 +235,8 @@ namespace FLY.Simulation.Battery.RayLaser ...@@ -231,7 +235,8 @@ namespace FLY.Simulation.Battery.RayLaser
return 100000; return 100000;
} }
if (isRay) { if (isRay)
{
if (mm >= (HoldPosRight + HoldWidth / 2) && mm <= (HoldPosRight + HoldWidth / 2 + SampleWidthRay)) if (mm >= (HoldPosRight + HoldWidth / 2) && mm <= (HoldPosRight + HoldWidth / 2 + SampleWidthRay))
{ {
posType = PosType.Sample; posType = PosType.Sample;
...@@ -247,7 +252,7 @@ namespace FLY.Simulation.Battery.RayLaser ...@@ -247,7 +252,7 @@ namespace FLY.Simulation.Battery.RayLaser
} }
} }
posType = PosType.Air; posType = PosType.Air;
return 0; return 0;
} }
......
...@@ -6,11 +6,11 @@ using System.Runtime.InteropServices; ...@@ -6,11 +6,11 @@ using System.Runtime.InteropServices;
// 控制。更改这些特性值可修改 // 控制。更改这些特性值可修改
// 与程序集关联的信息。 // 与程序集关联的信息。
[assembly: AssemblyTitle("FLY.Simulation.Battery.RayLaser")] [assembly: AssemblyTitle("FLY.Simulation.Battery.RayLaser")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("射线+激光 测厚仪 AD盒模拟器")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FLY.Simulation.Battery.RayLaser")] [assembly: AssemblyProduct("FLY.Simulation.Battery.RayLaser")]
[assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyCopyright("Copyright © 2021 flyauotmation")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper"> <PackageReference Include="AutoMapper">
<Version>9.0.0</Version> <Version>10.1.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="PropertyChanged.Fody"> <PackageReference Include="PropertyChanged.Fody">
<Version>3.3.1</Version> <Version>3.3.1</Version>
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper"> <PackageReference Include="AutoMapper">
<Version>9.0.0</Version> <Version>10.1.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Newtonsoft.Json"> <PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version> <Version>12.0.3</Version>
......
...@@ -40,6 +40,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation.Battery.RayL ...@@ -40,6 +40,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation.Battery.RayL
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLYAD7.Simulation.Battery.RayLaser", "FLYAD7.Simulation.Battery.RayLaser\FLYAD7.Simulation.Battery.RayLaser.csproj", "{DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLYAD7.Simulation.Battery.RayLaser", "FLYAD7.Simulation.Battery.RayLaser\FLYAD7.Simulation.Battery.RayLaser.csproj", "{DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation.Calender.GuRuiShiYe", "FLY.Simulation.Calender.GuRuiShiYe\FLY.Simulation.Calender.GuRuiShiYe.csproj", "{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FLY.Simulation.Calender.GuRuiShiYe.UI", "FLY.Simulation.Calender.GuRuiShiYe.UI\FLY.Simulation.Calender.GuRuiShiYe.UI.csproj", "{517847E4-5708-4ACE-BDF0-BB2C4495136D}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -214,6 +218,30 @@ Global ...@@ -214,6 +218,30 @@ Global
{DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}.Release|Mixed Platforms.Build.0 = Release|x86 {DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}.Release|Mixed Platforms.Build.0 = Release|x86
{DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}.Release|x86.ActiveCfg = Release|x86 {DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}.Release|x86.ActiveCfg = Release|x86
{DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}.Release|x86.Build.0 = Release|x86 {DFD5FDFA-6E8D-4901-8708-D7EF0269EE6A}.Release|x86.Build.0 = Release|x86
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Debug|x86.ActiveCfg = Debug|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Debug|x86.Build.0 = Debug|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Release|Any CPU.Build.0 = Release|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Release|x86.ActiveCfg = Release|Any CPU
{AEADFC07-59D9-40C4-BB31-47CFFDA6CC5C}.Release|x86.Build.0 = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Debug|x86.ActiveCfg = Debug|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Debug|x86.Build.0 = Debug|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|Any CPU.Build.0 = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|x86.ActiveCfg = Release|Any CPU
{517847E4-5708-4ACE-BDF0-BB2C4495136D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoMapper"> <PackageReference Include="AutoMapper">
<Version>9.0.0</Version> <Version>10.1.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="NLog"> <PackageReference Include="NLog">
<Version>4.6.8</Version> <Version>4.6.8</Version>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment