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

现场调整360旋转

parent 4b895549
......@@ -172,16 +172,8 @@
<TextBlock Text="状态" />
</Border>
<WrapPanel Orientation="Horizontal" Grid.Column="1" >
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="On信号" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="No." Margin="0,5"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding LastLimitNo, Mode=OneWay}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="On信号到当前时间" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="复位信号到当前时间" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding PastTime, Converter={StaticResource timespanconv}, Mode=OneWay}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="min" />
......@@ -193,6 +185,7 @@
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding RenZiJiaPeriod, Converter={StaticResource timespanconv}, Mode=OneWay}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="min/R" />
</StackPanel>
</StackPanel>
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="旋转次数" />
......@@ -234,7 +227,7 @@
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="旋转角度" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding Angle, Mode=OneWay, StringFormat={}{0:F1}}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding Angle, Mode=OneWay, StringFormat={}{0:F0}}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="°" VerticalAlignment="Top"/>
</StackPanel>
</StackPanel>
......@@ -245,6 +238,7 @@
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="m/min" />
</StackPanel>
</StackPanel>
</WrapPanel >
</Grid>
......@@ -323,9 +317,22 @@
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="脉冲" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" DataContext="{Binding bDetect}">
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="全局位置" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding GlobalPos, Mode=OneWay}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="脉冲" />
</StackPanel>
</StackPanel>
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="全局速度" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent}" Text="{Binding Speed, Mode=OneWay}" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="脉冲/s" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</WrapPanel>
</Grid>
......@@ -536,7 +543,20 @@
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding ActPosOfR}" IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="理论旋转1圈总脉冲" FontSize="15"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding ActPosOfOrgSign}" IsReadOnly="True">
<DataGridTextColumn.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="理论复位信号总脉冲" FontSize="15"/>
</StackPanel>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
......
......@@ -83,7 +83,7 @@ namespace FLY.Thick.Blowing360.UI
/// <summary>
/// 复位信号列表
/// </summary>
public ObservableCollection<OrgSignData> OrgSignList { get; } = new ObservableCollection<OrgSignData>();
public ObservableCollection<OrgSignData2> OrgSignList { get; } = new ObservableCollection<OrgSignData2>();
#endregion
#region Command
......@@ -225,7 +225,54 @@ namespace FLY.Thick.Blowing360.UI
for (int i = 0; i < reponse.Count(); i++)
{
int idx = reponse.Count() - 1 - i;
OrgSignList.Add(reponse[idx]);
OrgSignData2 orgSign = new OrgSignData2()
{
Time = reponse[idx].Time,
On = reponse[idx].On,
GlobalPos = reponse[idx].GlobalPos,
Speed = reponse[idx].Speed
};
//向前找 ActPosOfR
int pre_idx = idx;
while (true) {
pre_idx--;
if (pre_idx < 0)
break;
if (reponse[pre_idx].On == orgSign.On)
{
int pos = Math.Abs(orgSign.GlobalPos - reponse[pre_idx].GlobalPos);
if (pos > 4000)
{
//成功找到
orgSign.ActPosOfR = pos;
}
break;
}
}
//向前找 ActPosOfOrgSign
pre_idx = idx;
while (true)
{
pre_idx--;
if (pre_idx < 0)
break;
if (reponse[pre_idx].On != orgSign.On)
{
int pos = Math.Abs(orgSign.GlobalPos - reponse[pre_idx].GlobalPos);
if (pos < 4000)
{
//成功找到
orgSign.ActPosOfOrgSign = pos;
}
break;
}
}
OrgSignList.Add(orgSign);
}
}
......@@ -312,7 +359,44 @@ namespace FLY.Thick.Blowing360.UI
return true;
}
}
/// <summary>
/// 复位信号
/// </summary>
public class OrgSignData2 : INotifyPropertyChanged
{
/// <summary>
/// 时间
/// </summary>
public DateTime Time { get; set; }
/// <summary>
/// on? off?
/// </summary>
public bool On { get; set; }
/// <summary>
/// 全局脉冲
/// </summary>
public int GlobalPos { get; set; }
/// <summary>
/// 脉冲/s
/// </summary>
public int Speed { get; set; }
/// <summary>
/// 实际 人字架 旋转1周总脉冲数;
/// 与上一个On相同,的GlobalPos差值,且 偏差大于4000
/// </summary>
public int ActPosOfR { get; set; }
/// <summary>
/// 实际 复位信号 脉冲数
/// 与上一个On不相同,的GlobalPos差值,且 偏差小于4000
/// </summary>
public int ActPosOfOrgSign { get; set; }
public event PropertyChangedEventHandler PropertyChanged;
}
......
......@@ -87,6 +87,16 @@ namespace FLY.Thick.Blowing360.Client
/// 复位信号列表更新时间
/// </summary>
public DateTime OrgSignListUpdateTime { get; set; }
/// <summary>
///旋转架脉冲
/// </summary>
public int GlobalPos { get; set; }
/// <summary>
/// 旋转架脉冲速度
/// </summary>
public int Speed { get; set; }
#endregion
#endregion
......
......@@ -41,7 +41,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Client\BlowingDetectServiceClient.cs" />
<Compile Include="Client\BlowingDetect360EncoderServiceClient.cs" />
<Compile Include="IService\IBlowingDetect360Encoder.cs" />
<Compile Include="IService\IBlowingDetectEncoder.cs" />
<Compile Include="IService\IBlowingDetectInServer.cs" />
......
......@@ -79,6 +79,15 @@ namespace FLY.Thick.Blowing360.IService
/// 复位信号列表更新时间
/// </summary>
DateTime OrgSignListUpdateTime { get; }
/// <summary>
///旋转架脉冲
/// </summary>
int GlobalPos { get; }
/// <summary>
/// 旋转架脉冲速度
/// </summary>
int Speed { get; }
#endregion
void Apply();
......
......@@ -102,6 +102,15 @@ namespace FLY.Thick.Blowing360.Server
/// 缓冲区最新数据时间
/// </summary>
public DateTime BufLastTime { get; private set; }
/// <summary>
///旋转架脉冲
/// </summary>
public int GlobalPos { get; private set; }
/// <summary>
/// 旋转架脉冲速度
/// </summary>
public int Speed { get; private set; }
#endregion
......@@ -183,10 +192,12 @@ namespace FLY.Thick.Blowing360.Server
Clear();
PropertyChanged += new PropertyChangedEventHandler(RenZiJiaAndFilmPositionDetect_PropertyChanged);
Load();
CheckParamErr();
PropertyChanged += new PropertyChangedEventHandler(RenZiJiaAndFilmPositionDetect_PropertyChanged);
}
double getAngle(int pos) {
......@@ -226,6 +237,7 @@ namespace FLY.Thick.Blowing360.Server
(e.PropertyName == nameof(PosOfOrgSign))
)
{
TouchFilmInfoChanged_lastLimit(2);
}
}
......@@ -330,6 +342,9 @@ namespace FLY.Thick.Blowing360.Server
}
}
mPosList.RAdd(new PosData() { Time = now, Speed = speed, GlobalPos = globalPos });
GlobalPos = globalPos;
Speed = speed;
if (speed > 0)
Direction = DIRECTION.FORWARD;
else if (speed < 0)
......@@ -1077,10 +1092,11 @@ namespace FLY.Thick.Blowing360.Server
{
string json = File.ReadAllText(file_path);
var jsonDb = JsonConvert.DeserializeObject<BlowingDetect360EncoderJsonDb>(json);
BlowingDetect360EncoderJsonDb.Mapper.Map(jsonDb, this);
//BlowingDetect360EncoderJsonDb.Mapper.Map(jsonDb, this);
jsonDb.Map(this);
return true;
}
catch
catch(Exception e)
{
//异常,没有json 解码失败
......@@ -1189,17 +1205,21 @@ namespace FLY.Thick.Blowing360.Server
public static Mapper Mapper { get; } = new AutoMapper.Mapper(new MapperConfiguration(c => {
c.CreateMap<BlowingDetect360Encoder, BlowingDetect360EncoderJsonDb>().ReverseMap();
}));
public void Map(BlowingDetect360Encoder dest) {
dest.PosOfR = PosOfR;
dest.PosOfOrgSign = PosOfOrgSign;
dest.FilmLength = FilmLength;
dest.RollPerimeter = RollPerimeter;
}
/// <summary>
/// 人字架 旋转1周总脉冲数
/// </summary>
public int PosOfR { get; set; } = 50000;
public int PosOfR { get; set; } = 100000;
/// <summary>
/// 原点信号脉冲数
/// 复位信号总脉冲数
/// </summary>
public int PosOfOrgSign { get; set; } = 100;
public int PosOfOrgSign { get; set; } = 300;
/// <summary>
/// 人字架到测厚仪膜长 单位m
/// </summary>
......
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