Commit e6a071a8 authored by 潘栩锋's avatar 潘栩锋 🚴

测试完成,吹膜扫描. 自动计算膜距离选择角度 完成

parent dafdd73a
......@@ -33,7 +33,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
public int LastBM { get; set; } = -1;
/// <summary>
/// 从BlowingScanService 接收过来的数据;
/// 缓冲区
......@@ -122,15 +122,19 @@ namespace FLY.Thick.BlowingScan.UI.Client
#region 自动
/// <summary>
/// 旋转架转动角度 查找范围 ±25°
/// 旋转架转动角度 查找范围 50°
/// </summary>
public int RAngleRange { get; set; } = 25;
public int RAngleRange { get; set; } = 90;
/// <summary>
/// 旋转架转动角度 查找范围 ±10m
/// 旋转架转动角度 查找范围 20m
/// </summary>
public int FilmLengthRange { get; set; } = 10;
public int FilmLengthRange { get; set; } = 20;
/// <summary>
/// 查找过程信息
/// </summary>
public string SearchMsg { get; private set; }
#endregion
BlowingAngleDetect mAngleDetect = new BlowingAngleDetect();
......@@ -149,7 +153,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
return (LastBM - (ScanInfoList.Count() - 1));
int markno = idx+ (LastBM - (ScanInfoList.Count() - 1));
int markno = idx + (LastBM - (ScanInfoList.Count() - 1));
return markno;
}
......@@ -162,7 +166,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
return -1;
return idx;
}
private void MarkNo_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
......@@ -177,7 +181,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
var flydata = mBufList[idx];
if (!scanInfo.HasCast)//解方程
ToThicks_SolveEquation(idx);
markdata.StartTime = scanInfo.StartTime;
markdata.ThicksDT = scanInfo.ThicksDT;
markdata.Thicks = scanInfo.thicks;
......@@ -225,7 +229,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
LastBM = lastbm;
mBufList = datas;
if (mBufList == null)
return;
return;
BufList2AngleInfo();
BufList2ScanInfoList();
......@@ -255,7 +259,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
//没有数据
}
}
int KeepInRange(int number, int begin, int end)
{
......@@ -277,7 +281,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
IsStep2Ing = false;
return;
}
GetSolveEquation(RAngle, FilmLength);
GetSolveEquation();
ClearAllResult();
MarkNo1.Refresh();
......@@ -289,7 +293,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
/// <summary>
/// 自动查找旋转角度
/// </summary>
public void StepAutoSearchRAngle()
public void StepAutoSearchRAngle()
{
IsStep2Ing = true;
if (mBufList == null)
......@@ -299,19 +303,338 @@ namespace FLY.Thick.BlowingScan.UI.Client
}
int idx1 = GetIdxFromRList(MarkNo1.Number);
int idx2 = GetIdxFromRList(MarkNo2.Number);
if (idx1 >= 0 && idx2>=0 && idx1!= idx2)
if (idx1 >= 0 && idx2 >= 0 && idx1 != idx2)
{
//TODO
double step = RAngleRange*2 / 10;
if(autoSearchRAngle(idx1, idx2, out double bestParam))
{
RAngle = bestParam;
GetSolveEquation();
ClearAllResult();
GetSolveEquation(RAngle, FilmLength);
ClearAllResult();
double r;
bool ret = TrySolveEquationAndGetR(idx1, idx2, out r);
MarkNo1.Refresh();
MarkNo2.Refresh();
}
}
IsStep2Ing = false;
}
bool autoSearchRAngle(int idx1, int idx2,out double bestRa)
{
ParamRs.Clear();
double minParam = RAngle - RAngleRange / 2;
double maxParam = RAngle + RAngleRange / 2;
if (minParam < 200)
minParam = 200;
if (maxParam > 360)
maxParam = 360;
double bestParam = RAngle;
double bestR;
searchMsgHeader = "";
GetSolveEquation(RAngle, FilmLength, idx1);
GetSolveEquation(RAngle, FilmLength, idx2);
TrySolveEquationAndGetR(idx1, idx2, out bestR);
searchMsgHeader = $"最佳旋转角度={bestParam:F1}°相关性={bestR:F5}";
while (true)
{
double step = (maxParam - minParam) / 8;
if (step < 0.1)
step = 0.1;
if (!SearchParam(minParam, maxParam, step, 0.05, out bestParam, out bestR,
(double par, out double r) =>
{
//GetSolveEquation(par, FilmLength, idx1);
//GetSolveEquation(par, FilmLength, idx2);
//获取角度信息
for (int i = 0; i < mBufList.Count(); i++)
{
GetSolveEquation(par, FilmLength, i);
}
return TrySolveEquationAndGetR(idx1, idx2, out r);
})
)
{
//异常停止
bestRa = bestParam;
return false;
}
searchMsgHeader = $"最佳旋转角度={bestParam:F1}°相关性={bestR:F5}";
if (step <= 0.1)
{
//查找完成
bestRa = bestParam;
return true;
}
minParam = bestParam - step * 2;
maxParam = bestParam + step * 2;
}
}
/// <summary>
/// 自动查找膜距离
/// </summary>
public void StepAutoSearchFilmLength()
{
IsStep2Ing = true;
if (mBufList == null)
{
IsStep2Ing = false;
return;
}
int idx1 = GetIdxFromRList(MarkNo1.Number);
int idx2 = GetIdxFromRList(MarkNo2.Number);
if (idx1 >= 0 && idx2 >= 0 && idx1 != idx2)
{
if(autoSearchFilmLength(idx1, idx2, out double bestParam))
{
FilmLength = bestParam;
GetSolveEquation();
ClearAllResult();
MarkNo1.Refresh();
MarkNo2.Refresh();
}
}
IsStep2Ing = false;
}
bool autoSearchFilmLength(int idx1, int idx2, out double bestFl)
{
ParamRs.Clear();
double minParam = FilmLength - FilmLengthRange / 2;
double maxParam = FilmLength + FilmLengthRange / 2;
if (minParam < 5)
minParam = 5;
if (maxParam > 50)
maxParam = 50;
double bestParam = FilmLength;
double bestR;
searchMsgHeader = "";
GetSolveEquation(RAngle, bestParam, idx1);
GetSolveEquation(RAngle, bestParam, idx2);
TrySolveEquationAndGetR(idx1, idx2, out bestR);
searchMsgHeader = $"最佳膜距离={bestParam:F1}m 相关性={bestR:F5}";
while (true)
{
double step = (maxParam - minParam) / 8;
if (step < 0.1)
step = 0.1;
if (!SearchParam(minParam, maxParam, step, 0.05, out bestParam, out bestR,
(double par, out double r) =>
{
//GetSolveEquation(RAngle,par, SearchIdx1);
//GetSolveEquation(RAngle,par, SearchIdx2);
//获取角度信息
for (int i = 0; i < mBufList.Count(); i++)
{
GetSolveEquation(RAngle, par, i);
}
return TrySolveEquationAndGetR(idx1, idx2, out r);
})
)
{
//异常停止
bestFl = bestParam;
return false;
}
searchMsgHeader = $"最佳膜距离={bestParam:F1}m 相关性={bestR:F5}";
if (step <= 0.1)
{
//查找完成
bestFl = bestParam;
return true;
}
minParam = bestParam - step * 2;
maxParam = bestParam + step * 2;
}
}
/// <summary>
/// 自动查找全部参数
/// </summary>
public void StepAutoSearchParams()
{
IsStep2Ing = true;
if (mBufList == null)
{
IsStep2Ing = false;
return;
}
int lastIdx = ScanInfoList.Count() - 1;
List<Range> sameDirScanInfoIdxs = new List<Range>();
//必须有个方向切换点
for (int i = 0; i < ScanInfoList.Count(); i++)
{
int idx = lastIdx - i;
var direction = ScanInfoList[idx].Direction;
if (direction != DIRECTION.FIX)
{
if (sameDirScanInfoIdxs.Count() == 0)
sameDirScanInfoIdxs.Add(new Range() { Begin = idx, End = idx });
else
{
Range range = sameDirScanInfoIdxs.Last();
int idxBegin = range.Begin;
if (ScanInfoList[idxBegin].Direction == direction)
{
range.Begin = idx;
}
else
{
//另一个方向
sameDirScanInfoIdxs.Add(new Range() { Begin = idx, End = idx });
}
}
}
}
if (sameDirScanInfoIdxs.Count < 3)
{
SearchMsg = "查找失败!!旋转次数<3";
goto _end;
}
int IdxOfSameDirRangeForSearchRAngle = -1;
int IdxOfSameDirRangeForSearchFilmLength = -1;
int minInfoCnt = SolveCnt * 2+2;
for (int i = 1; i < sameDirScanInfoIdxs.Count - 1; i++)
{
if (sameDirScanInfoIdxs[i].Width > minInfoCnt)
{
//合符要求
if (IdxOfSameDirRangeForSearchRAngle == -1)
{
IdxOfSameDirRangeForSearchRAngle = i;
}
else
{
IdxOfSameDirRangeForSearchFilmLength = i;
break;
}
}
}
if (IdxOfSameDirRangeForSearchFilmLength == -1)
{
SearchMsg = $"查找失败!!不能找到连续2次 在相同旋转内 扫描次数大于 {minInfoCnt}";
goto _end;
}
int idx1 = sameDirScanInfoIdxs[IdxOfSameDirRangeForSearchRAngle].Mid ;
int idx2 = sameDirScanInfoIdxs[IdxOfSameDirRangeForSearchRAngle].Mid + SolveCnt-1;
if (!autoSearchRAngle(idx1, idx2, out double bestRa))
{
SearchMsg = $"查找失败!!旋转角度查找失败";
goto _end;
}
RAngle = bestRa;
idx1 = sameDirScanInfoIdxs[IdxOfSameDirRangeForSearchRAngle].Mid + SolveCnt / 2;
idx2 = sameDirScanInfoIdxs[IdxOfSameDirRangeForSearchFilmLength].Mid + SolveCnt / 2;
if (!autoSearchFilmLength(idx1, idx2, out double bestFl))
{
SearchMsg = $"查找失败!!膜距离查找失败";
goto _end;
}
FilmLength = bestFl;
GetSolveEquation();
ClearAllResult();
MarkNo1.Refresh();
MarkNo2.Refresh();
MarkNo1.Number = GetMarkNoFromRList(idx2);
MarkNo2.Number = GetMarkNoFromRList(idx1);
_end:
IsStep2Ing = false;
}
public class ParamR
{
public double Param;
public double R;
public ParamR(double par, double r)
{
Param = par;
R = r;
}
public override string ToString()
{
return $"{Param:F2}:R={R:F5}";
}
}
/// <summary>
/// 旋转角度查找过程!!!
/// </summary>
public List<ParamR> ParamRs { get; set; } = new List<ParamR>();
delegate bool GetRHandler(double param, out double r);
string searchMsgHeader;
/// <summary>
/// 给定范围,步距,查找最大相关性时的旋转角度
/// 中间过程记录在RaRs
/// </summary>
/// <param name="minPar">参数最小值</param>
/// <param name="maxPar">参数最大值</param>
/// <param name="step">步距</param>
/// <param name="minStep">最小步距</param>
/// <param name="bestPar">最佳参数</param>
/// <param name="getR">更新参数解方程且获取相关性</param>
/// <returns>不能解方程返回 false</returns>
bool SearchParam(double minPar, double maxPar, double step, double minStep, out double bestPar, out double bestR, GetRHandler getR)
{
bestPar = 0;
bestR = -1;
List<ParamR> parList = new List<ParamR>();
for (double par = minPar; par <= maxPar; par += step)
{
var rar = ParamRs.Find(_rar => Math.Abs(_rar.Param - par) < minStep);
if (rar != null)
{
//已经测试过!!!!
parList.Add(rar);
continue;
}
double r;
bool ret = getR(par, out r);
if (ret)
{
parList.Add(new ParamR(par, r));
}
SearchMsg = searchMsgHeader + $"| 参数:{par:F1} 相关性={r:F5}";
}
if (parList.Count() == 0)
return false;
//找到最大值
{
double r = parList.Max(rar => rar.R);
bestR = r;
bestPar = parList.Find(_r => _r.R == r).Param;
}
//把列表插入到 RaRs
foreach (var rar in parList)
{
if (ParamRs.Find(_rar => _rar.Param == rar.Param) == null)
{
ParamRs.Add(rar);
}
}
ParamRs.Sort((rar1, rar2) => { return rar1.Param.CompareTo(rar2.Param); });
return true;
}
/// <summary>
/// 清除全部计算结果
/// </summary>
......@@ -380,9 +703,6 @@ namespace FLY.Thick.BlowingScan.UI.Client
}
/// <summary>
/// 转为 位置与厚度信息
/// </summary>
......@@ -489,59 +809,71 @@ namespace FLY.Thick.BlowingScan.UI.Client
/// <summary>
/// 第2步,修改 旋转角度,膜距离 执行, 耗时很短
/// </summary>
void GetSolveEquation(double rAngle,double filmLength)
void GetSolveEquation()
{
mAngleDetect.RAngle = rAngle;// RAngle;
//mAngleDetect.FilmLength = FilmLength;
//获取角度信息
for (int i = 0; i < mBufList.Count(); i++)
{
FlyData_BlowingScan f = mBufList[i];
ScanInfoCell scaninfocell = ScanInfoList[i];
scaninfocell.equationList.Clear();
GetSolveEquation(RAngle, FilmLength, i);
}
}
scaninfocell.State = ScanInfoCell.STATE.OK;
for (int j = 0; j < scaninfocell.frame.Count(); j++)
{
ScanPosCell scanpos = scaninfocell.frame[j];
/// <summary>
/// 只获取某次扫描的方程
/// </summary>
/// <param name="rAngle"></param>
/// <param name="filmLength"></param>
/// <param name="idx"></param>
void GetSolveEquation(double rAngle, double filmLength, int idx)
{
FlyData_BlowingScan f = mBufList[idx];
ScanInfoCell scaninfocell = ScanInfoList[idx];
BlowingAngleDetect.FilmInfo filminfo;
scaninfocell.equationList.Clear();
int ret = mAngleDetect.GetFilmInfo(
out filminfo,
scanpos.dt, f.FilmRange.Width, scanpos.pos, filmLength, f.Velocity);//FilmLength
scaninfocell.State = ScanInfoCell.STATE.OK;
//探头直径转为角度范围
double sensor_angle = 180.0 * Sensor / f.FilmRange.Width;
for (int j = 0; j < scaninfocell.frame.Count(); j++)
{
ScanPosCell scanpos = scaninfocell.frame[j];
if (ret == 0)
{
scanpos.angle1 = filminfo.angle1;
scanpos.angle2 = filminfo.angle2;
scanpos.direction = filminfo.direction;
//TODO
scanpos.rotateAngle = 180 * scanpos.pos / f.FilmRange.Width;
}
else
BlowingAngleDetect.FilmInfo filminfo;
mAngleDetect.RAngle = rAngle;
int ret = mAngleDetect.GetFilmInfo(
out filminfo,
scanpos.dt, f.FilmRange.Width, scanpos.pos, filmLength, f.Velocity);
//探头直径转为角度范围
double sensor_angle = 180.0 * Sensor / f.FilmRange.Width;
if (ret == 0)
{
scanpos.angle1 = filminfo.angle1;
scanpos.angle2 = filminfo.angle2;
scanpos.direction = filminfo.direction;
//TODO
scanpos.rotateAngle = 180 * scanpos.pos / f.FilmRange.Width;
}
else
{
scaninfocell.State = ScanInfoCell.STATE.Err_GetAngle;
break;
}
if (j == 0)
scaninfocell.Direction = scanpos.direction;
else
{
if (scaninfocell.Direction != scanpos.direction)
{
scaninfocell.State = ScanInfoCell.STATE.Err_GetAngle;
scaninfocell.Direction = DIRECTION.FIX;
scaninfocell.State = ScanInfoCell.STATE.Err_Solve;
break;
}
if (j == 0)
scaninfocell.Direction = scanpos.direction;
else
{
if (scaninfocell.Direction != scanpos.direction)
{
scaninfocell.Direction = DIRECTION.FIX;
scaninfocell.State = ScanInfoCell.STATE.Err_Solve;
break;
}
}
scaninfocell.AddEquation(j,sensor_angle);
}
}
scaninfocell.AddEquation(j, sensor_angle);
}
}
bool TrySolveEquationAndGetR(int scaninfo_idx0, int scaninfo_idx1,out double r)
......
......@@ -177,6 +177,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.ColumnSpan="2">
......@@ -341,7 +342,8 @@
<WindowsFormsHost Grid.Row="1">
<Chr:Chart x:Name="chart1" />
</WindowsFormsHost>
<Grid Grid.Row="2">
<TextBlock Grid.Row="2" Style="{StaticResource TextBlockStyle_FieldHeader2}" Text="{Binding SearchMsg}" />
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
......@@ -403,14 +405,7 @@
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader2}" Text="自相关性" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent2}" Text="{Binding R, StringFormat=\{0:F5\}}" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel x:Name="stackpanel_markno2" Orientation="Vertical" Grid.Column="1" >
......@@ -470,104 +465,107 @@
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader2}" Text="自相关性" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent2}" Text="{Binding R, StringFormat=\{0:F5\}}" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<GroupBox Header="调整" FontSize="20" Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" >
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader2}" Text="相关性" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent2}" Text="{Binding CurrR, StringFormat=\{0:F5\}}" />
<GroupBox Header="调整" FontSize="20" Grid.Row="1" Grid.Column="1" Grid.RowSpan="3" >
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader2}" Text="相关性" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent2}" Text="{Binding CurrR, StringFormat=\{0:F5\}}" />
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="解方程数" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding SolveCnt}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="次"/>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="解方程数" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding SolveCnt}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="次"/>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="平滑" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding Smooth}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="分区"/>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="平滑" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding Smooth}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="分区"/>
</StackPanel>
</StackPanel>
</StackPanel>
<!--<Button Click="button_solve_Click" >
<!--<Button Click="button_solve_Click" >
<Path Data="{StaticResource Geometry_check-circle}" />
</Button>-->
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="膜距离" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding FilmLength, StringFormat=\{0:F1\}}"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="m" FontSize="15" />
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="膜距离" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding FilmLength, StringFormat=\{0:F1\}}"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="m" FontSize="15" />
</StackPanel>
</StackPanel>
<Button Click="button_calFl_Click" >
<Path Data="{StaticResource Geometry_auto-fix}" />
</Button>
</StackPanel>
<Button Click="button_left_Click" >
<Path Data="{StaticResource Geometry_arrow-left}" />
</Button>
<Button Click="button_right_Click" >
<Path Data="{StaticResource Geometry_arrow-right}" />
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="旋转角度" />
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="旋转角度" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding RAngle}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="°" VerticalAlignment="Top" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding RAngle,StringFormat={}{0:F1}}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="°" VerticalAlignment="Top" />
</StackPanel>
</StackPanel>
<Button Click="button_calRa_Click" >
<Path Data="{StaticResource Geometry_auto-fix}" />
</Button>
</StackPanel>
<Button Click="button_collapse_Click" >
<Path Data="{StaticResource Geometry_arrow-collapse-horizontal}" />
</Button>
<Button Click="button_expand_Click" >
<Path Data="{StaticResource Geometry_arrow-expand-horizontal}" />
</Button>
</StackPanel>
<StackPanel Orientation="Vertical" >
<Button Style="{StaticResource ButtonStyle2}" Width="auto" Click="button_solve_Click" FontSize="30">
<StackPanel Orientation="Vertical" >
<Grid>
<TextBlock Text="更新参数"/>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="20" x:Name="grid_solveprogress" Visibility="{Binding IsRunning,Converter={StaticResource visbilityconv}}">
<ed:Arc Width="45" Height="45" Opacity="0.9"
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Style="{StaticResource ButtonStyle2}" Width="auto" Click="button_solve_Click" FontSize="30">
<Grid>
<TextBlock Text="更新参数"/>
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="10" x:Name="grid_solveprogress" Visibility="{Binding IsRunning,Converter={StaticResource visbilityconv}}">
<ed:Arc Width="40" Height="40" Opacity="0.9"
ArcThickness="4"
ArcThicknessUnit="Pixel"
StartAngle="0" EndAngle="360"
Fill="White" Stretch="None" Stroke="#FF988585" />
<ed:Arc Width="45" Height="45"
<ed:Arc Width="40" Height="40"
ArcThickness="4"
ArcThicknessUnit="Pixel"
StartAngle="0"
EndAngle="{Binding Progress}"
Fill="{StaticResource Color_theme_activity}" Stretch="None" Stroke="#FF988585" >
</ed:Arc>
</Grid>
</ed:Arc>
</Grid>
</Grid>
</Button>
<Button Grid.Column="1" Style="{StaticResource ButtonStyle2}" Width="auto" Click="button_calAuto_Click" FontSize="30">
<StackPanel>
<TextBlock Text="全自动"/>
<TextBlock Text="计算"/>
</StackPanel>
</Button>
</Grid>
</Button>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</ScrollViewer>
</GroupBox>
......
......@@ -1268,38 +1268,9 @@ namespace FLY.Thick.BlowingScan.UI.Client
}
}
private void button_left_Click(object sender, RoutedEventArgs e)
{
if (mAnaylze.FilmLength > 10)
{
mAnaylze.FilmLength -= 0.1;
}
}
private void button_right_Click(object sender, RoutedEventArgs e)
{
if (mAnaylze.FilmLength < 30)
{
mAnaylze.FilmLength += 0.1;
}
}
private void button_collapse_Click(object sender, RoutedEventArgs e)
{
if (mAnaylze.RAngle > 300)
{
mAnaylze.RAngle -= 1;
}
}
private void button_expand_Click(object sender, RoutedEventArgs e)
{
if (mAnaylze.RAngle < 358)
{
mAnaylze.RAngle += 1;
}
}
private void button_pre1_Click(object sender, RoutedEventArgs e)
......@@ -1385,6 +1356,45 @@ namespace FLY.Thick.BlowingScan.UI.Client
mAnaylze.MarkNo2.IsFocus = true;
mAnaylze.MarkNo1.IsFocus = false;
}
private void button_calRa_Click(object sender, RoutedEventArgs e)
{
if (IsRunning)
return;
if (mAnaylze.IsStep2Ing)
return;
//第2步,修改 旋转角度,膜距离 执行 解方程
Thread t = new Thread(mAnaylze.StepAutoSearchRAngle);
t.IsBackground = true;
t.Start();
}
private void button_calFl_Click(object sender, RoutedEventArgs e)
{
if (IsRunning)
return;
if (mAnaylze.IsStep2Ing)
return;
//第2步,修改 旋转角度,膜距离 执行 解方程
Thread t = new Thread(mAnaylze.StepAutoSearchFilmLength);
t.IsBackground = true;
t.Start();
}
private void button_calAuto_Click(object sender, RoutedEventArgs e)
{
if (IsRunning)
return;
if (mAnaylze.IsStep2Ing)
return;
//第2步,修改 旋转角度,膜距离 执行 解方程
Thread t = new Thread(mAnaylze.StepAutoSearchParams);
t.IsBackground = true;
t.Start();
}
}
......
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