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

修复 环型图改回 外厚内薄

parent 783da53b
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
</Style> </Style>
</iconPacks:PackIconMaterial.Style> </iconPacks:PackIconMaterial.Style>
</iconPacks:PackIconMaterial> </iconPacks:PackIconMaterial>
<TextBlock FontSize="18" FontWeight="Bold" FontFamily="YouYuan" TextAlignment="Right" VerticalAlignment="Bottom" Foreground="#FF3B3B3B" > <TextBlock FontSize="15" FontWeight="Bold" FontFamily="YouYuan" TextAlignment="Right" VerticalAlignment="Bottom" Foreground="#FF3B3B3B" >
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">
<Setter Property="Text" Value="逆时针"/> <Setter Property="Text" Value="逆时针"/>
......
...@@ -471,6 +471,8 @@ new PropertyChangedCallback(delegate (DependencyObject d, DependencyPropertyChan ...@@ -471,6 +471,8 @@ new PropertyChangedCallback(delegate (DependencyObject d, DependencyPropertyChan
else { else {
stroke = brush_alarm; stroke = brush_alarm;
} }
//-公差线 //-公差线
r = target_r + toleranceThickness * i; r = target_r + toleranceThickness * i;
Ellipse ellipse_alarm1 = new Ellipse() Ellipse ellipse_alarm1 = new Ellipse()
...@@ -546,11 +548,20 @@ new PropertyChangedCallback(delegate (DependencyObject d, DependencyPropertyChan ...@@ -546,11 +548,20 @@ new PropertyChangedCallback(delegate (DependencyObject d, DependencyPropertyChan
percent = 0.01; percent = 0.01;
double toleranceThickness = GraphThickness / (2 * YRangePercent); double toleranceThickness = GraphThickness / (2 * YRangePercent);
double target_r = InnerRingThickness + GraphThickness * 0.5; double target_r = InnerRingThickness + GraphThickness * 0.5;
////Value 外小 内大
////负公差
//Draw_Marker(new Polar() { Degrees = startAngle, Radius = target_r + toleranceThickness }, $"{(-100 * percent):F0}%");
////正公差
//Draw_Marker(new Polar() { Degrees = startAngle, Radius = target_r - toleranceThickness }, $"{(+100 * percent):F0}%");
//Value 外大 内小
//负公差 //负公差
Draw_Marker(new Polar() { Degrees = startAngle, Radius = target_r + toleranceThickness }, $"{(-100 * percent):F0}%"); Draw_Marker(new Polar() { Degrees = startAngle, Radius = target_r - toleranceThickness }, $"{(-100 * percent):F0}%");
//正公差 //正公差
Draw_Marker(new Polar() { Degrees = startAngle, Radius = target_r - toleranceThickness }, $"{(+100 * percent):F0}%"); Draw_Marker(new Polar() { Degrees = startAngle, Radius = target_r + toleranceThickness }, $"{(+100 * percent):F0}%");
} }
void Draw_Marker(Polar polar, string s) void Draw_Marker(Polar polar, string s)
{ {
...@@ -664,16 +675,23 @@ new PropertyChangedCallback(delegate (DependencyObject d, DependencyPropertyChan ...@@ -664,16 +675,23 @@ new PropertyChangedCallback(delegate (DependencyObject d, DependencyPropertyChan
arc.Fill = AreaColors[0]; arc.Fill = AreaColors[0];
} }
//扇型的厚度
arc.ArcThickness = Math.Abs(r); arc.ArcThickness = Math.Abs(r);
if (r < 0)
{ //扇型最外圆直径
arc.Width = (target_r - r) * 2;
} //Value 外小 内大
//if (r < 0)
// arc.Width = (target_r - r) * 2;
//else
// arc.Width = target_r * 2;
//Value 外大 内小
if (r > 0)
arc.Width = (target_r + r) * 2;
else else
{
arc.Width = target_r * 2; arc.Width = target_r * 2;
}
arc.Height = arc.Width; arc.Height = arc.Width;
arc.Margin = new Thickness(Radius - arc.Width / 2); arc.Margin = new Thickness(Radius - arc.Width / 2);
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<uimodule:PolarChart x:Name="graph" Grid.Row="1" Grid.ColumnSpan="3" /> <uimodule:PolarChart x:Name="graph" Grid.Row="1" Grid.ColumnSpan="3" />
<TextBlock Grid.Row="1" Grid.ColumnSpan="3" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" Foreground="{StaticResource Color_theme_noact}"> <TextBlock Grid.Row="1" Grid.ColumnSpan="3" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="5" Foreground="{StaticResource Color_theme_noact}">
备注:外薄内厚 备注:外厚内薄
</TextBlock> </TextBlock>
<Button Style="{StaticResource ButtonStyle_icon}" Margin="0,0,0,-20" <Button Style="{StaticResource ButtonStyle_icon}" Margin="0,0,0,-20"
Click="Button_info_click" > Click="Button_info_click" >
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</Style> </Style>
</iconPacks:PackIconMaterial.Style> </iconPacks:PackIconMaterial.Style>
</iconPacks:PackIconMaterial> </iconPacks:PackIconMaterial>
<TextBlock FontSize="18" FontWeight="Bold" FontFamily="YouYuan" TextAlignment="Right" VerticalAlignment="Bottom" Foreground="#FF3B3B3B" > <TextBlock FontSize="15" FontWeight="Bold" FontFamily="YouYuan" TextAlignment="Right" VerticalAlignment="Bottom" Foreground="#FF3B3B3B" >
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">
<Setter Property="Text" Value="逆时针"/> <Setter Property="Text" Value="逆时针"/>
......
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