16 Commits

12 changed files with 796 additions and 283 deletions
+2 -1
View File
@@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="spplus.MainWindow" WindowState="Maximized" x:Class="spplus.MainWindow" WindowState="Maximized" Icon="res/logo.ico"
Title="spplus"> Title="spplus">
<Border> <Border>
<Grid RowDefinitions="30,*"> <Grid RowDefinitions="30,*">
@@ -12,6 +12,7 @@
<!-- <MenuItem Click="MnuSettings_OnClick" x:Name="MnuSettings" Header="Einstellungen" /> --> <!-- <MenuItem Click="MnuSettings_OnClick" x:Name="MnuSettings" Header="Einstellungen" /> -->
<!-- <Separator /> --> <!-- <Separator /> -->
<MenuItem x:Name="MnuExpSettings" Header="Einstellungen exportieren" Click="MnuExpSettings_OnClick" /> <MenuItem x:Name="MnuExpSettings" Header="Einstellungen exportieren" Click="MnuExpSettings_OnClick" />
<MenuItem x:Name="MnuImpResult" Header="Berechnung importieren" Click="MnuImpResult_OnClick" />
<MenuItem x:Name="MnuExit" Header="Beenden" Click="MnuExit_OnClick"/> <MenuItem x:Name="MnuExit" Header="Beenden" Click="MnuExit_OnClick"/>
</MenuItem> </MenuItem>
<MenuItem Header="Hilfe"> <MenuItem Header="Hilfe">
+17
View File
@@ -442,4 +442,21 @@ public partial class MainWindow : Window
ExportUtility.ExportToCSV(file.Path.AbsolutePath); ExportUtility.ExportToCSV(file.Path.AbsolutePath);
} }
private async void MnuImpResult_OnClick(object? sender, RoutedEventArgs e)
{
// Hier importieren
var topLevel = GetTopLevel(this);
var file = await topLevel!.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{
Title = "CSV-Datei laden",
SuggestedFileType = new FilePickerFileType(".csv-Datei")
{
Patterns = new[] { "*.csv" }
}
});
if (file == null) return;
}
} }
+1 -1
View File
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" SizeToContent="WidthAndHeight" mc:Ignorable="d" SizeToContent="WidthAndHeight" Icon="res/logo.ico"
x:Class="spplus.MessageBox" WindowStartupLocation="CenterScreen" x:Class="spplus.MessageBox" WindowStartupLocation="CenterScreen"
Title="MessageBox"> Title="MessageBox">
<StackPanel> <StackPanel>
+4
View File
@@ -2,6 +2,8 @@
Plattformunabhängiger (Windows, Linux, Mac), interaktiver Sportkursplaner für Oberstufen auf Basis einer Sportkurswahl durch SuS. Plattformunabhängiger (Windows, Linux, Mac), interaktiver Sportkursplaner für Oberstufen auf Basis einer Sportkurswahl durch SuS.
![spplus-Hauptbildschirm](img/spplus_planung.png)
## Features ## Features
* \+ Import von CSV-Dateien mit Kurswahl * \+ Import von CSV-Dateien mit Kurswahl
* \+ Wahlansicht * \+ Wahlansicht
@@ -21,3 +23,5 @@ Plattformunabhängiger (Windows, Linux, Mac), interaktiver Sportkursplaner für
* Suche `spplus` bzw. `spplus.exe` und führe aus * Suche `spplus` bzw. `spplus.exe` und führe aus
* Linux/MacOS evl.: `chmod +x spplus` * Linux/MacOS evl.: `chmod +x spplus`
![spplus-Sportkursübersicht](img/spplus_sport.png)
+717 -280
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

+41
View File
@@ -47,4 +47,45 @@ public static class import
return result; return result;
} }
public static List<Student> ImportResultFromFile(string path)
{
var dict = new Dictionary<string, (string Name, List<string> Courses)>();
foreach (var line in File.ReadLines(path).Skip(1)) // Header überspringen
{
if (string.IsNullOrWhiteSpace(line))
continue;
var parts = line.Split(',');
if (parts.Length < 3)
continue;
string nameWithId = parts[0].Trim();
string course = parts[2].Replace("(2)", "").Replace("(3)", "").Replace("(4)", "").Trim();
int open = nameWithId.LastIndexOf('(');
int close = nameWithId.LastIndexOf(')');
if (open < 0 || close < 0 || close <= open)
continue;
string name = nameWithId[..open].Trim();
string id = nameWithId[(open + 1)..close].Trim();
if (!dict.ContainsKey(id))
dict[id] = (name, new List<string>());
dict[id].Courses.Add(course);
}
var result = new List<Student>();
foreach (var (id, data) in dict)
{
var student = new Student(id, data.Name, data.Courses);
result.Add(student);
}
return result;
}
} }
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

+13
View File
@@ -5,6 +5,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>res/logo.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -19,4 +20,16 @@
</PackageReference> </PackageReference>
<PackageReference Include="Lucide.Avalonia" Version="0.1.35"/> <PackageReference Include="Lucide.Avalonia" Version="0.1.35"/>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Remove="res\logo.ico"/>
<AvaloniaResource Include="res\logo.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AvaloniaResource>
<None Remove="res\logo.png"/>
<AvaloniaResource Include="res\logo.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AvaloniaResource>
</ItemGroup>
</Project> </Project>
+1 -1
View File
@@ -85,7 +85,7 @@ public class Settings
public List<Student> Students { get; set; } = []; public List<Student> Students { get; set; } = [];
public List<Sport> Sports { get; set; } = []; public List<Sport> Sports { get; set; } = [];
public int NumCoursesPerSemester { get; set; } = 10; public int NumCoursesPerSemester { get; set; } = 10; // Exact Amount of courses, not a maximum
public Settings() public Settings()
{ {