Commit f19b1f91 by liulongfei

1. 手动裁切映射bug修复

2. 是否显示中轴线修复
parent ae343c4d
...@@ -27,6 +27,6 @@ namespace VIZ.H2V.Domain ...@@ -27,6 +27,6 @@ namespace VIZ.H2V.Domain
/// <summary> /// <summary>
/// 3D鼠标映射配置 /// 3D鼠标映射配置
/// </summary> /// </summary>
public static List<Navigation3DMapping> Navigation3DMapping { get; set; } public static Navigation3DMappingDomainModel Navigation3DMapping { get; private set; } = new Navigation3DMappingDomainModel();
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VIZ.Framework.Core;
namespace VIZ.H2V.Domain
{
/// <summary>
/// 3D鼠标映射领域模型
/// </summary>
public class Navigation3DMappingDomainModel : ModelBase
{
#region Name -- 映射名称
private string name;
/// <summary>
/// 映射名称
/// </summary>
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
#endregion
#region Mappings -- 映射集合
private List<Navigation3DMapping> mappings;
/// <summary>
/// 映射集合
/// </summary>
public List<Navigation3DMapping> Mappings
{
get { return mappings; }
set { mappings = value; this.RaisePropertyChanged(nameof(Mappings)); }
}
#endregion
#region Multiple -- 倍率
private double multiple;
/// <summary>
/// 倍率
/// </summary>
public double Multiple
{
get { return multiple; }
set { multiple = value; this.RaisePropertyChanged(nameof(Multiple)); }
}
#endregion
}
}
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
<Compile Include="Model\Algorithm\AlgorithmProcessModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmProcessModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmBorderScenceModel.cs" />
<Compile Include="Model\Algorithm\AlgorithmStrategyModel.cs" /> <Compile Include="Model\Algorithm\AlgorithmStrategyModel.cs" />
<Compile Include="Model\Navigation3D\Navigation3DMappingDomainModel.cs" />
<Compile Include="Model\Navigation3D\Navigation3DMappingGroupModel.cs" /> <Compile Include="Model\Navigation3D\Navigation3DMappingGroupModel.cs" />
<Compile Include="Model\NDI\NDIStreamInfoModel.cs" /> <Compile Include="Model\NDI\NDIStreamInfoModel.cs" />
<Compile Include="Model\NDI\NDIStreamDelayInfoModel.cs" /> <Compile Include="Model\NDI\NDIStreamDelayInfoModel.cs" />
......
...@@ -60,7 +60,7 @@ namespace VIZ.H2V.Module ...@@ -60,7 +60,7 @@ namespace VIZ.H2V.Module
/// <returns>映射值</returns> /// <returns>映射值</returns>
public int GetMappingValue() public int GetMappingValue()
{ {
List<Navigation3DMapping> mappingList = ApplicationDomainEx.Navigation3DMapping; List<Navigation3DMapping> mappingList = ApplicationDomainEx.Navigation3DMapping.Mappings;
if (mappingList == null) if (mappingList == null)
return 1; return 1;
...@@ -77,14 +77,14 @@ namespace VIZ.H2V.Module ...@@ -77,14 +77,14 @@ namespace VIZ.H2V.Module
if (value >= last.MaxValue) if (value >= last.MaxValue)
{ {
return last.MappingValue * symbol; return (int)(last.MappingValue * symbol * ApplicationDomainEx.Navigation3DMapping.Multiple);
} }
Navigation3DMapping mapping = mappingList.FirstOrDefault(p => value >= p.MinValue && value < p.MaxValue); Navigation3DMapping mapping = mappingList.FirstOrDefault(p => value >= p.MinValue && value < p.MaxValue);
if (mapping == null) if (mapping == null)
return 0; return 0;
return mapping.MappingValue * symbol; return (int)(mapping.MappingValue * symbol * ApplicationDomainEx.Navigation3DMapping.Multiple);
} }
/// <summary> /// <summary>
......
...@@ -228,6 +228,14 @@ ...@@ -228,6 +228,14 @@
<CheckBox Style="{StaticResource CheckBox_IsShowCenterAxis}" Width="32" Height="32" Margin="0,0,10,0" <CheckBox Style="{StaticResource CheckBox_IsShowCenterAxis}" Width="32" Height="32" Margin="0,0,10,0"
ToolTip="手动模式显示中轴线" ToolTip="手动模式显示中轴线"
IsChecked="{Binding Path=AlgorithmConfig.IsShowCenterAxis,Mode=TwoWay}"> IsChecked="{Binding Path=AlgorithmConfig.IsShowCenterAxis,Mode=TwoWay}">
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="Checked">
<behaviors:InvokeCommandAction Command="{Binding SaveAlgorithmConfigCommand}" />
</behaviors:EventTrigger>
<behaviors:EventTrigger EventName="Unchecked">
<behaviors:InvokeCommandAction Command="{Binding SaveAlgorithmConfigCommand}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
</CheckBox> </CheckBox>
<!-- 启用面积百分比校准 --> <!-- 启用面积百分比校准 -->
......
...@@ -419,5 +419,22 @@ namespace VIZ.H2V.Module ...@@ -419,5 +419,22 @@ namespace VIZ.H2V.Module
} }
#endregion #endregion
#region SaveAlgorithmConfigCommand -- 保存算法配置命令
/// <summary>
/// 保存算法配置命令
/// </summary>
public VCommand SaveAlgorithmConfigCommand { get; set; }
/// <summary>
/// 保存算法配置
/// </summary>
private void SaveAlgorithmConfig()
{
this.AlgorithmControllerDic[this.StrategyType].SaveConfig(this.AlgorithmConfig);
}
#endregion
} }
} }
...@@ -123,15 +123,6 @@ namespace VIZ.H2V.Module ...@@ -123,15 +123,6 @@ namespace VIZ.H2V.Module
/// </summary> /// </summary>
private IManualController ManualController; private IManualController ManualController;
#if DEBUG
/// <summary>
/// 录制控制器
/// </summary>
private IRecordingController ReecordingController;
#endif
// ====================================================================================== // ======================================================================================
// === Property === // === Property ===
// ====================================================================================== // ======================================================================================
......
...@@ -69,6 +69,7 @@ namespace VIZ.H2V.Module ...@@ -69,6 +69,7 @@ namespace VIZ.H2V.Module
this.IsBorderShowChangedCommand = new VCommand(this.IsBorderShowChanged); this.IsBorderShowChangedCommand = new VCommand(this.IsBorderShowChanged);
this.IsBorderEnabledChangedCommand = new VCommand(this.IsBorderEnabledChanged); this.IsBorderEnabledChangedCommand = new VCommand(this.IsBorderEnabledChanged);
this.IsAreaCorrectionEnabledChangedCommand = new VCommand(this.IsAreaCorrectionEnabledChanged); this.IsAreaCorrectionEnabledChangedCommand = new VCommand(this.IsAreaCorrectionEnabledChanged);
this.SaveAlgorithmConfigCommand = new VCommand(this.SaveAlgorithmConfig);
} }
/// <summary> /// <summary>
......
...@@ -51,13 +51,16 @@ namespace VIZ.H2V.Module ...@@ -51,13 +51,16 @@ namespace VIZ.H2V.Module
config.ManualNavigation3DMappingName = kv.Key; config.ManualNavigation3DMappingName = kv.Key;
ApplicationDomainEx.Navigation3DMapping = kv.Value; ApplicationDomainEx.Navigation3DMapping.Name = kv.Key;
ApplicationDomainEx.Navigation3DMapping.Mappings = kv.Value;
ApplicationDomainEx.LiteDbContext.SystemConfig.Update(config); ApplicationDomainEx.LiteDbContext.SystemConfig.Update(config);
return true; return true;
} }
ApplicationDomainEx.Navigation3DMapping = ApplicationDomainEx.CsvContext.Navigation3DMappingDic[config.ManualNavigation3DMappingName]; ApplicationDomainEx.Navigation3DMapping.Name = config.ManualNavigation3DMappingName;
ApplicationDomainEx.Navigation3DMapping.Multiple = config.ManualNavigation3DMappingMultiple;
ApplicationDomainEx.Navigation3DMapping.Mappings = ApplicationDomainEx.CsvContext.Navigation3DMappingDic[config.ManualNavigation3DMappingName];
return true; return true;
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition> <RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="60"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- 剪切框颜色 --> <!-- 剪切框颜色 -->
...@@ -113,9 +114,19 @@ ...@@ -113,9 +114,19 @@
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
</Grid> </Grid>
<!-- 手动裁切框移动倍率 -->
<Grid Grid.Row="6">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="手动裁切框移动倍率" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="2"></TextBlock>
<fcommon:NumberBox Grid.Column="1" MinValue="0.1" MaxValue="5" Interval="0.1" Height="40"
Value="{Binding Path=Navigation3DMappingMultiple,Mode=TwoWay}"></fcommon:NumberBox>
</Grid>
<!-- 手动裁切框移动 --> <!-- 手动裁切框移动 -->
<TextBlock Text="手动裁切框移动" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="6"></TextBlock> <TextBlock Text="手动裁切框移动平滑系数" Foreground="White" FontSize="18" VerticalAlignment="Center" Grid.Row="7"></TextBlock>
<Grid Grid.Row="7"> <Grid Grid.Row="8">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition> <RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition> <RowDefinition Height="*"></RowDefinition>
......
...@@ -160,6 +160,20 @@ namespace VIZ.H2V.Module ...@@ -160,6 +160,20 @@ namespace VIZ.H2V.Module
#endregion #endregion
#region Navigation3DMappingMultiple -- 3D鼠标倍率
private double navigation3DMappingMultiple;
/// <summary>
/// 3D鼠标倍率
/// </summary>
public double Navigation3DMappingMultiple
{
get { return navigation3DMappingMultiple; }
set { navigation3DMappingMultiple = value; this.RaisePropertyChanged(nameof(Navigation3DMappingMultiple)); }
}
#endregion
// ====================================================================================== // ======================================================================================
// === Commond === // === Commond ===
// ====================================================================================== // ======================================================================================
...@@ -211,6 +225,8 @@ namespace VIZ.H2V.Module ...@@ -211,6 +225,8 @@ namespace VIZ.H2V.Module
this.Navigation3DMappingGroupModelItems = items; this.Navigation3DMappingGroupModelItems = items;
this.SelectedNavigation3DMappingGroupModel = items.FirstOrDefault(p => p.Name == this.SystemConfig.ManualNavigation3DMappingName); this.SelectedNavigation3DMappingGroupModel = items.FirstOrDefault(p => p.Name == this.SystemConfig.ManualNavigation3DMappingName);
this.Navigation3DMappingMultiple = this.SystemConfig.ManualNavigation3DMappingMultiple;
} }
#endregion #endregion
...@@ -249,6 +265,9 @@ namespace VIZ.H2V.Module ...@@ -249,6 +265,9 @@ namespace VIZ.H2V.Module
if (this.SelectedNavigation3DMappingGroupModel.Name != this.SystemConfig.ManualNavigation3DMappingName) if (this.SelectedNavigation3DMappingGroupModel.Name != this.SystemConfig.ManualNavigation3DMappingName)
return true; return true;
if (this.Navigation3DMappingMultiple != this.SystemConfig.ManualNavigation3DMappingMultiple)
return true;
return false; return false;
} }
...@@ -267,6 +286,7 @@ namespace VIZ.H2V.Module ...@@ -267,6 +286,7 @@ namespace VIZ.H2V.Module
this.SystemConfig.ClipCenterAxisColor = this.ClipCenterAxisColor.ToString(); this.SystemConfig.ClipCenterAxisColor = this.ClipCenterAxisColor.ToString();
this.SystemConfig.ManualSmoothCoeff = this.ManualSmoothCoeff; this.SystemConfig.ManualSmoothCoeff = this.ManualSmoothCoeff;
this.SystemConfig.ManualNavigation3DMappingName = this.SelectedNavigation3DMappingGroupModel.Name; this.SystemConfig.ManualNavigation3DMappingName = this.SelectedNavigation3DMappingGroupModel.Name;
this.SystemConfig.ManualNavigation3DMappingMultiple = this.Navigation3DMappingMultiple;
ApplicationDomainEx.LiteDbContext.SystemConfig.Update(this.SystemConfig); ApplicationDomainEx.LiteDbContext.SystemConfig.Update(this.SystemConfig);
...@@ -276,7 +296,9 @@ namespace VIZ.H2V.Module ...@@ -276,7 +296,9 @@ namespace VIZ.H2V.Module
p.LoadStyle(); p.LoadStyle();
p.LoadClipBoxSmooth(this.ManualSmoothCoeff); p.LoadClipBoxSmooth(this.ManualSmoothCoeff);
}); });
ApplicationDomainEx.Navigation3DMapping = this.SelectedNavigation3DMappingGroupModel.Mappings; ApplicationDomainEx.Navigation3DMapping.Name = this.SelectedNavigation3DMappingGroupModel.Name;
ApplicationDomainEx.Navigation3DMapping.Multiple = this.Navigation3DMappingMultiple;
ApplicationDomainEx.Navigation3DMapping.Mappings = this.SelectedNavigation3DMappingGroupModel.Mappings;
// 返回 // 返回
return true; return true;
......
...@@ -59,5 +59,10 @@ namespace VIZ.H2V.Storage ...@@ -59,5 +59,10 @@ namespace VIZ.H2V.Storage
/// 手动裁切配置文件在 config/navigation_3d_mapping/ 文件夹下 /// 手动裁切配置文件在 config/navigation_3d_mapping/ 文件夹下
/// </remarks> /// </remarks>
public string ManualNavigation3DMappingName { get; set; } public string ManualNavigation3DMappingName { get; set; }
/// <summary>
/// 手动裁切映射值倍率
/// </summary>
public double ManualNavigation3DMappingMultiple { get; set; } = 1d;
} }
} }
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
1,100,9999,10 1,100,9999,15
\ No newline at end of file \ No newline at end of file
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
1,100,300,1 1,100,200,2
2,300,600,3 2,200,300,3
3,600,900,5 3,300,400,4
4,900,1200,10 4,400,500,5
5,1200,1500,15 5,500,600,6
6,1500,1800,20 6,600,700,7
7,1800,2100,30 7,700,800,8
\ No newline at end of file 8,800,900,9
9,900,1000,10
10,1000,1100,11
11,1100,1200,13
12,1200,1300,15
13,1300,1400,17
14,1400,1500,19
15,1500,2200,25
16,2200,9999,30
\ No newline at end of file
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
1,100,300,5 1,100,200,2
2,300,600,10 2,200,300,3
3,600,900,20 3,300,400,4
4,900,1200,30 4,400,500,5
5,1200,1500,40 5,500,600,6
6,1500,1800,50 6,600,700,7
7,1800,2100,60 7,700,800,8
\ No newline at end of file 8,800,900,9
9,900,1000,10
10,1000,1100,15
11,1100,1200,20
12,1200,1300,25
13,1300,1400,30
14,1400,1500,35
15,1500,2200,40
16,2200,9999,45
\ No newline at end of file
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
ID,MinValue,MaxValue,MappingValue ID,MinValue,MaxValue,MappingValue
1,100,300,1 1,100,200,2
2,300,600,2 2,200,300,3
3,600,900,3 3,300,400,4
4,900,1200,5 4,400,500,5
5,1200,1500,8 5,500,600,6
6,1500,1800,13 6,600,700,7
7,1800,2100,20 7,700,800,8
\ No newline at end of file 8,800,900,9
9,900,1000,10
10,1000,1100,11
11,1100,1200,12
12,1200,1300,13
13,1300,1400,15
14,1400,1500,17
15,1500,2200,20
16,2200,9999,25
\ No newline at end of file
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