Skip to content

Commit

Permalink
震度の凡例の表示条件を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
ingen084 committed Mar 20, 2024
1 parent ea9e44c commit 41ee2bb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/KyoshinEewViewer/Series/Earthquake/EarthquakeView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<TextBlock IsVisible="{Binding CurrentEvent.IsTest}" Foreground="{DynamicResource SubForegroundColor}" FontSize="125" Text="試験" FontWeight="Bold" />
</StackPanel>

<!-- 凡例表示 -->
<!-- 凡例表示
<Border Grid.Column="1" IsVisible="{Binding RemarksIntensities, Converter={x:Static ObjectConverters.IsNotNull}}" Background="{DynamicResource DockTitleBackgroundColor}" CornerRadius="4" Margin="5" ClipToBounds="True" HorizontalAlignment="Left" VerticalAlignment="Top">
<StackPanel>
<TextBlock Text="震度" FontSize="11" FontWeight="Bold" HorizontalAlignment="Center" />
Expand All @@ -223,7 +223,7 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Border>
</Border> -->

<!-- コメント表示 -->
<StackPanel Grid.Column="1" Margin="5" VerticalAlignment="Bottom" HorizontalAlignment="Right"
Expand Down
15 changes: 15 additions & 0 deletions src/KyoshinEewViewer/Series/KyoshinMonitor/KyoshinMonitorSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,32 @@ public KyoshinMonitorSeries(
.GroupBy(p => p.Key, p => p.Value).ToDictionary(p => p.Key, p => p.Max());
var warningAreaCodes = eews.SelectMany(e => e.WarningAreaCodes ?? []).Distinct().ToArray();
if (Config.Eew.FillForecastIntensity && intensityAreas.Count != 0)
{
ShowIntensityColorSample = true;
CustomColorMap = new()
{
{
LandLayerType.EarthquakeInformationSubdivisionArea,
intensityAreas.ToDictionary(p => p.Key, p => FixedObjectRenderer.IntensityPaintCache[p.Value].Background.Color)
},
};
}
else if (Config.Eew.FillWarningArea && warningAreaCodes.Any())
{
ShowIntensityColorSample = false;
CustomColorMap = new()
{
{
LandLayerType.EarthquakeInformationSubdivisionArea,
warningAreaCodes.ToDictionary(c => c, c => SKColors.Tomato)
},
};
}
else
{
ShowIntensityColorSample = false;
CustomColorMap = null;
}
UpateFocusPoint(e.time);
};
Expand Down Expand Up @@ -414,6 +423,12 @@ public bool ShowColorSample
get => _showColorSample;
set => this.RaiseAndSetIfChanged(ref _showColorSample, value);
}
private bool _showIntensityColorSample;
public bool ShowIntensityColorSample
{
get => _showIntensityColorSample;
set => this.RaiseAndSetIfChanged(ref _showIntensityColorSample, value);
}

public bool IsDebug { get; }
#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Grid IsVisible="{Binding CustomColorMap, Converter={x:Static ObjectConverters.IsNotNull}}" Grid.Row="1" Margin="15,0,0,0" Width="5" RowDefinitions=".5*,.5*,.5*,.5*,.5*,*,6.5*" HorizontalAlignment="Left">
<Grid IsVisible="{Binding ShowIntensityColorSample}" Grid.Row="1" Margin="15,0,0,0" Width="5" RowDefinitions=".5*,.5*,.5*,.5*,.5*,*,6.5*" HorizontalAlignment="Left">
<Rectangle Fill="{DynamicResource Int7Background}" />
<Rectangle Grid.Row="1" Fill="{DynamicResource Int6UpperBackground}" />
<Rectangle Grid.Row="2" Fill="{DynamicResource Int6LowerBackground}" />
Expand Down

0 comments on commit 41ee2bb

Please sign in to comment.