Skip to content

Commit

Permalink
LoGeoRef40 - true north Z fixed
Browse files Browse the repository at this point in the history
Start Multilingual GUI -> Resoucre files created
  • Loading branch information
BexanderAlong committed Feb 9, 2024
1 parent 07b444f commit 7bde3da
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 13 deletions.
60 changes: 60 additions & 0 deletions IFCGeoRefCheckerGUI/IFCGeoRefCheckerGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,71 @@
</ItemGroup>

<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Update="Readme.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.pt.Designer.cs">
<DependentUpon>Resources.pt.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Properties\Resources.fr.Designer.cs">
<DependentUpon>Resources.fr.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Properties\Resources.es.Designer.cs">
<DependentUpon>Resources.es.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Properties\Resources.de.Designer.cs">
<DependentUpon>Resources.de.resx</DependentUpon>
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
</Compile>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.pt.resx">
<LastGenOutput>Resources.pt.Designer.cs</LastGenOutput>
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.fr.resx">
<LastGenOutput>Resources.fr.Designer.cs</LastGenOutput>
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.es.resx">
<LastGenOutput>Resources.es.Designer.cs</LastGenOutput>
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.de.resx">
<LastGenOutput>Resources.de.Designer.cs</LastGenOutput>
<Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<Import Project="..\IFCGeorefShared\IFCGeorefShared.projitems" Label="Shared" />

</Project>
3 changes: 2 additions & 1 deletion IFCGeoRefCheckerGUI/IfcCheckerService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Resources;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -10,7 +11,7 @@


namespace IFCGeoRefCheckerGUI
{
{
class IfcCheckerService
{
public GeoRefChecker CheckIFC(string filePath)
Expand Down
18 changes: 9 additions & 9 deletions IFCGeoRefCheckerGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</Grid.RowDefinitions>

<Grid Grid.Row="0" >
<GroupBox Header="Set working directory">
<GroupBox x:Name="SetWorkDirGroupBox" Header="Set working directory">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
Expand All @@ -41,8 +41,8 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Content="working directory" Grid.Row="0" Grid.Column="0"/>
<TextBox Grid.Row="1" Grid.ColumnSpan="2"
<Label x:Name="WorkingDirLabel" Content="working directory" Grid.Row="0" Grid.Column="0"/>
<TextBox x:Name="PathTextBox" Grid.Row="1" Grid.ColumnSpan="2"
Text="{Binding workingDirViewModel.WorkingDirPath, TargetNullValue='Please choose path!'}"
Margin="0,5,0,5" Padding="0,5,0,5" VerticalScrollBarVisibility="Auto"
VerticalContentAlignment="Center" />
Expand All @@ -52,7 +52,7 @@

<!-- Status View Model -->
<Grid Grid.Row="1">
<GroupBox Header="Input IFC Files">
<GroupBox x:Name="InputIFCGroupBox" Header="Input IFC Files">
<Grid Margin="5,5,5,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
Expand All @@ -61,12 +61,12 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Label Content="Status:"></Label>
<Label x:Name="StatusLabel" Content="Status:"></Label>
<Label Content="{Binding filePanelViewModel.FilePaths.Count, Mode=OneWay}" ContentStringFormat=" {0} file(s) loaded"/>
<Label Content="{Binding checkViewModel.NrOfChecks}" ContentStringFormat=" {0} file(s) checked"/>
</StackPanel>
<StackPanel Grid.Row="1">
<Label Content="Loaded IFC-Files"></Label>
<Label x:Name="LoadedIFCFilesLabel" Content="Loaded IFC-Files"></Label>
<ListBox MinHeight="175" ScrollViewer.VerticalScrollBarVisibility="Auto" MaxHeight="150"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ItemsSource="{Binding filePanelViewModel.FilePaths}"
SelectionMode="Single" SelectedItem="{Binding filePanelViewModel.SelectedPath}">
Expand All @@ -79,7 +79,7 @@

<!-- Check View Model -->
<Grid Grid.Row="2">
<GroupBox Header="Status report">
<GroupBox x:Name="StatusReportGroupBox" Header="Status report">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
Expand All @@ -105,7 +105,7 @@
<Label Content="{Binding checkViewModel.CheckerResults.level40Fulfilled, TargetNullValue='?'}" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"/>
<Label Content="{Binding checkViewModel.CheckerResults.level50Fulfilled, TargetNullValue='?'}" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"/>

<Button Content="Show protocoll" Grid.Column="3" Grid.Row="0" Command="{Binding checkViewModel.ShowLog}"></Button>
<Button x:Name="ShowProtocolBtn" Content="Show protocol" Grid.Column="3" Grid.Row="0" Command="{Binding checkViewModel.ShowLog}"></Button>

</Grid>
</GroupBox>
Expand All @@ -116,7 +116,7 @@
</Grid>

<Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
<GroupBox Header="Log output" Margin="0,5,0,5">
<GroupBox x:Name="LogOutputGroupBox" Header="Log output" Margin="0,5,0,5">
<RichTextBox x:Name="LogBox" Margin="0,5,0,5" IsReadOnly="True" VerticalScrollBarVisibility="Auto" TextChanged="LogBox_TextChanged"></RichTextBox>
</GroupBox>
</Grid>
Expand Down
21 changes: 21 additions & 0 deletions IFCGeoRefCheckerGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Xbim.Common;
using OSGeo.OGR;
using IFCGeorefShared;
using IFCGeorefShared.Levels;

namespace IFCGeoRefCheckerGUI
{
Expand All @@ -33,6 +34,21 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();

SetWorkinDirBtn.Content = Properties.Resources.SET_WORKING_DIRECTORY;
LoadFilesBtn.Content = Properties.Resources.LOAD_IFC_FILES;
CheckFileBtn.Content = Properties.Resources.CHECK_SELECTED_FILE;
SetWorkDirGroupBox.Header = Properties.Resources.SET_WORKING_DIRECTORY;
WorkingDirLabel.Content = Properties.Resources.WORKING_DIRECTORY_LABEL;
PathTextBox.Text = Properties.Resources.PATH_TEXTBOX;
InputIFCGroupBox.Header = Properties.Resources.INPUT_IFC_FILES;
StatusLabel.Content = Properties.Resources.STATUS_LABEL;
LoadedIFCFilesLabel.Content = Properties.Resources.LOADED_IFC_FILES;
StatusReportGroupBox.Header = Properties.Resources.STATUS_REPORT;
ShowProtocolBtn.Content = Properties.Resources.SHOW_PROTOCOL;
LogOutputGroupBox.Header = Properties.Resources.LOG_OUTPUT;


((MainWindowViewModel)DataContext).checkViewModel.NoFileSelected += NoFileSelectedMessageBox;
((MainWindowViewModel)DataContext).checkViewModel.NoWorkingDirSelected += NoWorkingDirSelectedMessageBox;
((MainWindowViewModel)DataContext).checkViewModel.FileNotYetChecked += NotYetCheckedMessageBox;
Expand Down Expand Up @@ -122,6 +138,11 @@ private void LogBox_TextChanged(object sender, TextChangedEventArgs e)
this.LogBox.ScrollToEnd();
}

private void CheckFileBtn_Click(object sender, RoutedEventArgs e)
{

}

/*private void Window_Loaded(object sender, RoutedEventArgs e)
{
var vm = ((MainWindowViewModel)DataContext);
Expand Down
16 changes: 15 additions & 1 deletion IFCGeoRefCheckerGUI/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

using System.Globalization;
using System.Resources;
using System.Windows.Forms;

namespace IFCGeoRefCheckerGUI.ViewModels
{
public class MainWindowViewModel : BaseViewModel
Expand Down Expand Up @@ -37,12 +42,21 @@ public string? SelectedPath {
}
}

//private static ResourceManager rm = new ResourceManager("IFCGeoRefCheckerGUI.Properties.Resources", Assembly.GetExecutingAssembly());
private static ResourceManager rm = new ResourceManager("IFCGeoRefCheckerGUI.Properties.Resources", typeof(MainWindowViewModel).Assembly);

public MainWindowViewModel() {


CultureInfo culture = new CultureInfo("de-DE");
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

workingDirViewModel = new WorkingDirViewModel(this.eventAggregator);
filePanelViewModel = new FilePanelViewModel(this.eventAggregator);
checkViewModel = new CheckViewModel(this.eventAggregator);

string? value = rm.GetString("LOAD_IFC_FILES");

this.eventSubscriptions = new List<Subscription>
{
eventAggregator.Subscribe<SelectedPathMessageObject>(spmo => this.SelectedPath = spmo.SelectedPath!)
Expand Down
8 changes: 6 additions & 2 deletions IFCGeorefShared/GeoRefChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public GeoRefChecker(IfcStore model) {

private void checkGeneralProps()
{
//Es werden immer Koordinaten als Warnung ausgegeben, die zur Georef genutzt werden (ab Level 30) -> Irritation beim Anwender (evtl. fachfremd)
//Vergleich zur jeweiligen Checkmethode notwendig -> keine Warnung, wenn Koordinaten in Checkmethode aufgerufen werden?

var allCartPoints = model.Instances.OfType<IIfcCartesianPoint>().ToList();
var allCartPointList2D = model.Instances.OfType<IIfcCartesianPointList2D>().ToList();
var allCartPointList3D = model.Instances.OfType<IIfcCartesianPointList3D>().ToList();
Expand Down Expand Up @@ -706,7 +709,8 @@ private string WriteResultLvl40()
sb.AppendLine($"Y: {lvl40.wcs.Location.Y}");
sb.AppendLine($"Z: {lvl40.wcs.Location.Z}");
sb.AppendLine();
sb.AppendLine($"True North is: {lvl40.trueNorth!.X} / {lvl40.trueNorth.Y} / {lvl40.trueNorth.Z}");
sb.AppendLine($"True North is: {lvl40.trueNorth!.X} / {lvl40.trueNorth.Y}");
//sb.AppendLine($"True North is: {lvl40.trueNorth!.X} / {lvl40.trueNorth.Y} / {lvl40.trueNorth.Z}"); //trueNorth.Z existiert nicht

sb.AppendLine();
sb.AppendLine("LoGeoRef40 is fulfilled ✓");
Expand Down Expand Up @@ -758,7 +762,7 @@ private string WriteResultLvl50()

foreach (var lvl50 in this.LoGeoRef50)
{
if (lvl50.MapConversion != null)
if (lvl50.MapConversion != null) //und Eastings > 0 und Northing > 0 ? -> in LoGeoRef Spezifikation nochmal Voraussetzungen prüfen
{
var targetCRS = lvl50.MapConversion.TargetCRS;
var eastings = lvl50.MapConversion.Eastings;
Expand Down

0 comments on commit 7bde3da

Please sign in to comment.