From 8a812b7eaca02299215c4416afc1b8ccff9ae135 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 10:40:56 +0000 Subject: [PATCH] Initial commit --- .gitignore | 42 ++ README.md | 1 + SpaceShuttle.csv | 9 + SpaceShuttle.sln | 25 + SpaceShuttle.sln.DotSettings | 113 +++++ SpaceShuttle/Program.cs | 67 +++ SpaceShuttle/SpaceShuttle.cs | 15 + SpaceShuttle/SpaceShuttle.csproj | 22 + SpaceShuttle/SpaceShuttleName.cs | 15 + SpaceShuttle/SpaceShuttleStart.cs | 17 + SpaceShuttle/Tools/CsvImport.cs | 328 +++++++++++++ SpaceShuttle/Tools/CsvImportBase.cs | 448 ++++++++++++++++++ .../Tools/CsvImportFormatAttribute.cs | 25 + SpaceShuttleName.csv | 7 + SpaceShuttleStart.csv | 136 ++++++ 15 files changed, 1270 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 SpaceShuttle.csv create mode 100644 SpaceShuttle.sln create mode 100644 SpaceShuttle.sln.DotSettings create mode 100644 SpaceShuttle/Program.cs create mode 100644 SpaceShuttle/SpaceShuttle.cs create mode 100644 SpaceShuttle/SpaceShuttle.csproj create mode 100644 SpaceShuttle/SpaceShuttleName.cs create mode 100644 SpaceShuttle/SpaceShuttleStart.cs create mode 100644 SpaceShuttle/Tools/CsvImport.cs create mode 100644 SpaceShuttle/Tools/CsvImportBase.cs create mode 100644 SpaceShuttle/Tools/CsvImportFormatAttribute.cs create mode 100644 SpaceShuttleName.csv create mode 100644 SpaceShuttleStart.csv diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc7b141 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. + +# Compiled output +/dist +/tmp +/out-tsc +/bazel-out + +# Node +/node_modules +npm-debug.log +yarn-error.log + +# IDEs and editors +.idea/ +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# Visual Studio Code +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# Miscellaneous +/.angular/cache +.sass-cache/ +/connect.lock +/coverage +/libpeerconnection.log +testem.log +/typings + +# System files +.DS_Store +Thumbs.db diff --git a/README.md b/README.md new file mode 100644 index 0000000..6bacd8e --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +"# 09-SpaceShuttle" diff --git a/SpaceShuttle.csv b/SpaceShuttle.csv new file mode 100644 index 0000000..cbf802b --- /dev/null +++ b/SpaceShuttle.csv @@ -0,0 +1,9 @@ +Name;OVNo;Remark +Independence;OV-100;Ehemals Explorer, ist ein originalgetreuer Nachbau der Raumgleiter. Er steht im Johnson Space Center +Pathfinder;OV-098;Ein nicht flugfähiges Handlingmodell aus Stahl. Es wurde zum Erproben und Einüben der Abläufe am Boden eingesetzt. +Enterprise;OV-101;Ein flug-, jedoch nicht raumflugtauglicher Prototyp, der für Gleitversuche und für Flugversuche auf dem Rücken des Shuttle Carrier Aircrafts eingesetzt wurde +Columbia;OV-102;erster raumflugfähiger Orbiter, am 1. Februar 2003 beim Wiedereintritt durch defekte Hitzeschutzverkleidung zerstört. Alle 7 Besatzungsmitglieder kamen dabei ums Leben. +Challenger;OV-099;am 28. Januar 1986 kurz nach dem Start durch einen Defekt an einem Feststoffbooster zerstört. Alle 7 Besatzungsmitglieder kamen dabei ums Leben. +Discovery;OV-103;letzte Landung am 9. März 2011, Exponat im Steven F. Udvar-Hazy Center seit dem 19. April 2012 +Atlantis;OV-104;letzte Landung am 21. Juli 2011, Exponat im Kennedy Space Center +Endeavour;OV-105;letzte Landung am 1. Juni 2011, Ersatzorbiter für Challenger, Exponat im California Science Center \ No newline at end of file diff --git a/SpaceShuttle.sln b/SpaceShuttle.sln new file mode 100644 index 0000000..05f6de5 --- /dev/null +++ b/SpaceShuttle.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32210.238 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpaceShuttle", "SpaceShuttle\SpaceShuttle.csproj", "{1D17AEAC-E387-4027-BA7C-3E327453E528}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1D17AEAC-E387-4027-BA7C-3E327453E528}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1D17AEAC-E387-4027-BA7C-3E327453E528}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1D17AEAC-E387-4027-BA7C-3E327453E528}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1D17AEAC-E387-4027-BA7C-3E327453E528}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8E039742-FC97-46AF-9602-39FD513A6A88} + EndGlobalSection +EndGlobal diff --git a/SpaceShuttle.sln.DotSettings b/SpaceShuttle.sln.DotSettings new file mode 100644 index 0000000..340a79b --- /dev/null +++ b/SpaceShuttle.sln.DotSettings @@ -0,0 +1,113 @@ + + + ExplicitlyExcluded + ExplicitlyExcluded + 39FD3420-6140-4A24-82D3-2E9FB14B096E/d:ClientApp/d:dist + 972C43C8-8BF9-41FA-BA3C-299AC44A6938/d:Migrations + BD772F21-D4E2-4577-9AF3-FBE59BB72C03/d:Migrations + D2B2F798-28FC-4515-966F-B92C3D11D3F2/d:ClientApp/d:dist + + clipper.cs + package-lock.json + + SUGGESTION + SUGGESTION + + True + True + 1 + + True + True + True + True + True + True + True + True + True + True + True + False + True + + 250 + 20000 + 250 + True + True + + CRUD + CNC + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + + False + True + True + + DO_NOTHING + LIVE_MONITOR + LIVE_MONITOR + DO_NOTHING + LIVE_MONITOR + LIVE_MONITOR + LIVE_MONITOR + LIVE_MONITOR + LIVE_MONITOR + LIVE_MONITOR + LIVE_MONITOR + LIVE_MONITOR + DO_NOTHING + LIVE_MONITOR + + True + True + True + True + True + + True + True + True + True + True \ No newline at end of file diff --git a/SpaceShuttle/Program.cs b/SpaceShuttle/Program.cs new file mode 100644 index 0000000..43cf470 --- /dev/null +++ b/SpaceShuttle/Program.cs @@ -0,0 +1,67 @@ +/*-------------------------------------------------------------- +* HTBLA-Leonding / Class: 1xHIF +*-------------------------------------------------------------- +* Musterlösung-HA +*-------------------------------------------------------------- +* Description: SpaceShuttle +*-------------------------------------------------------------- +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; + +using SpaceShuttle; +using SpaceShuttle.Tools; + +Console.WriteLine("Space-Shuttle"); +Console.WriteLine("====================="); + +string fileNameShuttle = "SpaceShuttle.csv"; +string fileNameShuttleName = "SpaceShuttleName.csv"; +string fileNameShuttleStart = "SpaceShuttleStart.csv"; + +var shuttle = new CsvImport() +{ + DateFormat = "dd.MM.yyyy", + TimeFormat = "H:m" +}.Read(fileNameShuttle); + +var shuttleName = new CsvImport().Read(fileNameShuttleName); + +var shuttleStart = new CsvImport() +{ + DateFormat = "dd.MM.yyyy", + TimeFormat = "H:m" +}.Read(fileNameShuttleStart); + +#region Task1 + +//ToDo: Task1 + +#endregion + +#region Task2 + +//ToDo: Task2 + +#endregion + +#region Task3 - join + +//ToDo: Task3 + +#endregion + +#region Task4 - join-join + +//ToDo: Task4 + +#endregion + +#region Task5 - join-group + +//ToDo: Task5 + +#endregion diff --git a/SpaceShuttle/SpaceShuttle.cs b/SpaceShuttle/SpaceShuttle.cs new file mode 100644 index 0000000..4622899 --- /dev/null +++ b/SpaceShuttle/SpaceShuttle.cs @@ -0,0 +1,15 @@ +/*-------------------------------------------------------------- +* HTBLA-Leonding / Class: 1xHIF +*-------------------------------------------------------------- +* Musterlösung-HA +*-------------------------------------------------------------- +* Description: SpaceShuttle +*-------------------------------------------------------------- +*/ + +namespace SpaceShuttle; + +public class SpaceShuttle +{ + //ToDo: Properties for SpaceShuttle +} \ No newline at end of file diff --git a/SpaceShuttle/SpaceShuttle.csproj b/SpaceShuttle/SpaceShuttle.csproj new file mode 100644 index 0000000..45b266c --- /dev/null +++ b/SpaceShuttle/SpaceShuttle.csproj @@ -0,0 +1,22 @@ + + + + Exe + net9.0 + + enable + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + diff --git a/SpaceShuttle/SpaceShuttleName.cs b/SpaceShuttle/SpaceShuttleName.cs new file mode 100644 index 0000000..7307bed --- /dev/null +++ b/SpaceShuttle/SpaceShuttleName.cs @@ -0,0 +1,15 @@ +/*-------------------------------------------------------------- +* HTBLA-Leonding / Class: 1xHIF +*-------------------------------------------------------------- +* Musterlösung-HA +*-------------------------------------------------------------- +* Description: SpaceShuttle +*-------------------------------------------------------------- +*/ + +namespace SpaceShuttle; + +public class SpaceShuttleName +{ + //ToDo: Properties for SpaceShuttleName +} \ No newline at end of file diff --git a/SpaceShuttle/SpaceShuttleStart.cs b/SpaceShuttle/SpaceShuttleStart.cs new file mode 100644 index 0000000..ea646bc --- /dev/null +++ b/SpaceShuttle/SpaceShuttleStart.cs @@ -0,0 +1,17 @@ +/*-------------------------------------------------------------- +* HTBLA-Leonding / Class: 1xHIF +*-------------------------------------------------------------- +* Musterlösung-HA +*-------------------------------------------------------------- +* Description: SpaceShuttle +*-------------------------------------------------------------- +*/ + +namespace SpaceShuttle; + +using System; + +public class SpaceShuttleStart +{ + //ToDo: Properties for SpaceShuttleStart +} \ No newline at end of file diff --git a/SpaceShuttle/Tools/CsvImport.cs b/SpaceShuttle/Tools/CsvImport.cs new file mode 100644 index 0000000..ded8626 --- /dev/null +++ b/SpaceShuttle/Tools/CsvImport.cs @@ -0,0 +1,328 @@ +/* + This file is part of https://github.com/aiten/Framework. + + Copyright (c) Herbert Aitenbichler + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +namespace SpaceShuttle.Tools; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; + +public class CsvImport : CsvImportBase where T : class +{ + public CsvImport() + { + if (typeof(T).GetCustomAttributes(typeof(CsvImportFormatAttribute)).FirstOrDefault() is CsvImportFormatAttribute formatAttribute) + { + if (!string.IsNullOrEmpty(formatAttribute.Format)) throw new ArgumentException("cannot use format for class attribute"); + if (!string.IsNullOrEmpty(formatAttribute.Culture)) + { + DateTimeCultureInfo = CultureInfo.GetCultureInfo(formatAttribute.Culture); + NumberFormat = DateTimeCultureInfo.NumberFormat; + } + } + } + + public class ColumnMapping + { + public required string ColumnName { get; set; } + + public PropertyInfo? MapTo { get; set; } + public bool Ignore { get; set; } + + public string? CsvFormat { get; set; } + + public CultureInfo? DateTimeCultureInfo { get; set; } + + public NumberFormatInfo? NumberFormat { get; set; } + +#pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. + public Func? GetValue { get; set; } + public Func? AdjustValue { get; set; } + public Action? SetValue { get; set; } + +#pragma warning restore CS8632 + + public bool IsConfigured => Ignore || MapTo != null || SetValue != null; + public bool IsMapped => !Ignore && MapTo != null; + public bool IsSetValue => !Ignore && SetValue != null; + } + + public ICollection? IgnoreColumns { get; set; } + public IDictionary? MapColumns { get; set; } + + public IList Read(string[] csvLines) + { + var lines = ReadStringMatrixFromCsv(csvLines, false); + return MapTo(lines); + } + + public IList Read(string fileName) + { + var lines = ReadStringMatrixFromCsv(fileName, false); + return MapTo(lines); + } + + public async Task> ReadAsync(string fileName) + { + var lines = await ReadStringMatrixFromCsvAsync(fileName, false); + return MapTo(lines); + } + + public IList MapTo(IList> lines) + { + // first line is columnLineHeader!!!! + + var mapping = GetPropertyMapping(lines[0]); + CheckPropertyMapping(mapping); + + var list = new List(); + var first = true; + + foreach (var line in lines) + { + if (first) + { + first = false; + } + else + { + list.Add(Map(line, mapping)); + } + } + + return list; + } + + private void CheckPropertyMapping(ColumnMapping[] mapping) + { + var notConfigured = mapping.Where(m => !m.IsConfigured).ToList(); + if (notConfigured.Any()) + { + foreach (var col in notConfigured) + { + if (typeof(T).GetField(col.ColumnName, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) != null) + { + throw new ArgumentException($"Column ist mapped to field instead of a property: {col.ColumnName}"); + } + + if (typeof(T).GetProperty(col.ColumnName, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) != null) + { + throw new ArgumentException($"Column ist mapped to none public property: {col.ColumnName}"); + } + } + + var columnList = string.Join(", ", notConfigured.Select(m => m.ColumnName)); + throw new ArgumentException($"Column cannot be mapped: {columnList}"); + } + + var notCanWrite = mapping.Where(x => x.IsMapped && !x.MapTo!.CanWrite).ToList(); + if (notCanWrite.Any()) + { + var columnList = string.Join(", ", notCanWrite.Select(m => m.ColumnName)); + throw new ArgumentException($"Column is readonly: {columnList}"); + } + } + + protected virtual ColumnMapping[] GetPropertyMapping(IList columnNames) + { + return columnNames + .Select(GetColumnMapping) + .ToArray(); + } + + public Action? ConfigureColumnMapping { get; set; } + + protected virtual ColumnMapping GetColumnMapping(string columnName) + { + var ignoreColumn = IgnoreColumns?.Contains(columnName, StringComparer.InvariantCultureIgnoreCase) ?? false; + var mapToColumn = (MapColumns?.ContainsKey(columnName) ?? false) ? MapColumns[columnName] : columnName; + + var columnMapping = new ColumnMapping + { + ColumnName = columnName, + Ignore = ignoreColumn, + MapTo = ignoreColumn ? null : GetPropertyInfo(mapToColumn), + }; + + if (columnMapping.MapTo != null) + { + if (columnMapping.MapTo.GetCustomAttributes(typeof(CsvImportFormatAttribute)).FirstOrDefault() is CsvImportFormatAttribute formatAttribute) + { + columnMapping.CsvFormat = formatAttribute.Format; + if (!string.IsNullOrEmpty(formatAttribute.Culture)) + { + columnMapping.DateTimeCultureInfo = CultureInfo.GetCultureInfo(formatAttribute.Culture); + columnMapping.NumberFormat = columnMapping.DateTimeCultureInfo.NumberFormat; + } + } + } + + ConfigureColumnMapping?.Invoke(columnMapping); + return columnMapping; + } + + public static PropertyInfo? GetPropertyInfo(string columnName) + { + return typeof(T).GetProperty(columnName, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance); + } + + private T Map(IList line, ColumnMapping[] mapping) + { + // because the T may be with "required", we cant use new() any more + // var newT = new T(); + // now create it with reflection + + var newT = (T)Activator.CreateInstance(typeof(T))!; + + if (mapping.Length < line.Count) + { + var message = $"Line '{string.Join(",", line)}' has to many columns"; + throw new ArgumentException(message); + } + + var idx = 0; + foreach (var column in line) + { + AssignProperty(newT, column, mapping[idx++]); + } + + return newT; + } + +#pragma warning disable 8632 + private object? GetValue(string valueAsString, Type asType, ColumnMapping mapping) +#pragma warning restore 8632 + { + if (asType.IsGenericType && asType.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + if (string.IsNullOrEmpty(valueAsString)) + { + return null; + } + + asType = asType.GenericTypeArguments[0]; + } + + try + { + if (asType == typeof(string)) + { + return ExcelString(valueAsString); + } + else if (asType == typeof(int)) + { + return ExcelInt(valueAsString); + } + else if (asType == typeof(long)) + { + return ExcelLong(valueAsString); + } + else if (asType == typeof(short)) + { + return ExcelShort(valueAsString); + } + else if (asType == typeof(uint)) + { + return ExcelUInt(valueAsString); + } + else if (asType == typeof(ulong)) + { + return ExcelULong(valueAsString); + } + else if (asType == typeof(ushort)) + { + return ExcelUShort(valueAsString); + } + else if (asType == typeof(decimal)) + { + return ExcelDecimal(valueAsString, mapping.NumberFormat ?? NumberFormat); + } + else if (asType == typeof(byte)) + { + return ExcelByte(valueAsString); + } + else if (asType == typeof(bool)) + { + return ExcelBool(valueAsString); + } + else if (asType == typeof(DateTime)) + { + return ExcelDateOrDateTime(valueAsString, mapping.CsvFormat, mapping.DateTimeCultureInfo ?? DateTimeCultureInfo); + } + else if (asType == typeof(DateOnly)) + { + return ExcelDateOnly(valueAsString, mapping.CsvFormat ?? DateFormat, mapping.DateTimeCultureInfo ?? DateTimeCultureInfo); + } + else if (asType == typeof(TimeOnly)) + { + return ExcelTimeOnly(valueAsString, mapping.CsvFormat ?? TimeFormat, mapping.DateTimeCultureInfo ?? DateTimeCultureInfo); + } + else if (asType == typeof(TimeSpan)) + { + return ExcelTimeSpan(valueAsString); + } + else if (asType == typeof(float)) + { + return ExcelFloat(valueAsString, mapping.NumberFormat ?? NumberFormat); + } + else if (asType == typeof(double)) + { + return ExcelDouble(valueAsString, mapping.NumberFormat ?? NumberFormat); + } + else if (asType.IsEnum) + { + return ExcelEnum(asType, valueAsString); + } + else if (asType == typeof(byte[])) + { + return ExcelImage(valueAsString); + } + } + catch (FormatException e) + { + throw new ArgumentException($"Illegal value for column '{mapping.ColumnName}:{asType.Name}': {valueAsString}", e); + } + + throw new ArgumentException($"Illegal type of column '{mapping.ColumnName}': {asType.Name}"); + } + + private void AssignProperty(object obj, string valueAsString, ColumnMapping mapping) + { + if (mapping.IsSetValue) + { + mapping.SetValue!((T)obj, valueAsString); + } + else if (mapping.IsMapped) + { + var mapTo = mapping.MapTo; +#pragma warning disable 8632 + object? val = mapping.GetValue != null + ? mapping.GetValue(valueAsString) + : GetValue(valueAsString, mapTo!.PropertyType, mapping); +#pragma warning restore 8632 + + if (mapping.AdjustValue != null) + { + val = mapping.AdjustValue(val); + } + + mapTo!.SetValue(obj, val); + } + } +} \ No newline at end of file diff --git a/SpaceShuttle/Tools/CsvImportBase.cs b/SpaceShuttle/Tools/CsvImportBase.cs new file mode 100644 index 0000000..6217a64 --- /dev/null +++ b/SpaceShuttle/Tools/CsvImportBase.cs @@ -0,0 +1,448 @@ +/* + This file is part of https://github.com/aiten/Framework. + + Copyright (c) Herbert Aitenbichler + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +namespace SpaceShuttle.Tools; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; +using System.Threading.Tasks; + +public class CsvImportBase +{ + private NumberFormatInfo _nfi; + + public Encoding Encoding { get; set; } = Encoding.Default; + + public string DateFormat { get; set; } = "yyyy/MM/dd"; + public string TimeFormat { get; set; } = "HH:mm:ss"; + public string Fraction3Format { get; set; } = ".fff"; + public string Fraction5Format { get; set; } = ".fffff"; + + public string? DateTimeFormat => GetDateTimeFormat(DateFormat, TimeFormat); + public string? DateTimeFraction1Format => GetDateTimeFormat(DateFormat, TimeFormat, Fraction3Format); + public string? DateTimeFraction5Format => GetDateTimeFormat(DateFormat, TimeFormat, Fraction5Format); + + public string GetDateTimeFormat(string dateFormat, string timeFormat, string? fractionFormat = null) => $"{dateFormat} {timeFormat}{fractionFormat ?? ""}"; + + public CultureInfo DateTimeCultureInfo { get; set; } = CultureInfo.InvariantCulture; + + public event EventHandler>? ReadFirstLine; + + public char ListSeparatorChar { get; set; } = ';'; + + public string? NewLineInString { get; set; } = "\n"; + + public CsvImportBase() + { + // Retrieve a writable NumberFormatInfo object. + var enUS = CultureInfo.CreateSpecificCulture("en-US"); + _nfi = enUS.NumberFormat; + } + + public NumberFormatInfo NumberFormat + { + get => _nfi; + protected set => _nfi = value; + } + + public string DecimalSeparator + { + get => _nfi.NumberDecimalSeparator; + set + { + _nfi.NumberDecimalSeparator = value; + _nfi.NumberGroupSeparator = value == "." ? "," : "."; + } + } + + public void SetAustriaNumberFormat() + { + _nfi.NumberDecimalSeparator = ","; + _nfi.NumberGroupSeparator = "."; + } + + #region read + + public IList> ReadStringMatrixFromCsv(string[] lines, bool skipTitleLine) + { + var elements = new List>(); + var lineIdx = 0; + var readLineIdx = 0; + var compareLineIdx = skipTitleLine ? 1 : 0; + + while (true) + { + var row = ReadLine(() => + { + if (readLineIdx >= lines.Length) + { + return null!; + } + + return lines[readLineIdx++]; + }); + + if (row == null!) + { + break; + } + + if (lineIdx == 0) + { + ReadFirstLine?.Invoke(this, row); + } + + if (lineIdx >= compareLineIdx) + { + elements.Add(row); + } + + lineIdx++; + } + + return elements; + } + + public IList> ReadStringMatrixFromCsv(string fileName, bool skipTitleLine) + { + var lines = File.ReadAllLines(fileName, Encoding); + return ReadStringMatrixFromCsv(lines, skipTitleLine); + } + + public async Task>> ReadStringMatrixFromCsvAsync(string fileName, bool skipTitleLine) + { + var lines = await File.ReadAllLinesAsync(fileName, Encoding); + return ReadStringMatrixFromCsv(lines, skipTitleLine); + } + + private IList ReadLine(Func getNextLine) + { + var line = getNextLine(); + if (line == null) + { + return null!; + } + + var columns = new List(); + var sb = new StringBuilder(line.Length); + var noQuoteChar = '\0'; + var quoteChar = noQuoteChar; + + while (true) + { + for (var idx = 0; idx < line.Length; idx++) + { + var ch = line[idx]; + + if (ch == quoteChar) + { + // end of " or "" + if ((idx + 1) < line.Length && line[idx + 1] == quoteChar) + { + idx++; + sb.Append(ch); + } + else + { + quoteChar = noQuoteChar; + } + } + else if (quoteChar == noQuoteChar && ch == '"') + { + quoteChar = ch; + } + else if (quoteChar == noQuoteChar && (ch == ListSeparatorChar)) + { + columns.Add(sb.ToString()); + sb.Clear(); + } + else + { + sb.Append(ch); + } + } + + if (quoteChar == noQuoteChar) + { + break; + } + + sb.Append(NewLineInString); + + line = getNextLine(); + } + + columns.Add(sb.ToString()); + + return columns; + } + + #endregion + + #region convert + + public string? ExcelString(string excelField) + { + return excelField; + } + + public short ExcelShort(string excelField) + { + return short.Parse(excelField); + } + + public int ExcelInt(string excelField) + { + return int.Parse(excelField); + } + + public long ExcelLong(string excelField) + { + return long.Parse(excelField); + } + + public ushort ExcelUShort(string excelField) + { + return ushort.Parse(excelField); + } + + public uint ExcelUInt(string excelField) + { + return uint.Parse(excelField); + } + + public ulong ExcelULong(string excelField) + { + return ulong.Parse(excelField); + } + + public byte ExcelByte(string excelField) + { + return byte.Parse(excelField); + } + + public bool ExcelBool(string excelField) + { + switch (excelField) + { + case @"0": + case @"false": + return false; + case @"1": + case @"true": + return true; + default: + throw new ArgumentOutOfRangeException(nameof(excelField), excelField, $@"cannot convert '{excelField}' to 'bool'."); + } + } + + public decimal ExcelDecimal(string excelField, NumberFormatInfo nfi) + { + return decimal.Parse(excelField, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands, nfi); + } + + public double ExcelDouble(string excelField, NumberFormatInfo nfi) + { + return double.Parse(excelField, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands, nfi); + } + + public float ExcelFloat(string excelField, NumberFormatInfo nfi) + { + return float.Parse(excelField, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint | NumberStyles.AllowThousands, nfi); + } + + public DateTime ExcelDateOrDateTime(string excelField, string? format, CultureInfo culture) + { + if (string.IsNullOrEmpty(format)) + { + if (DateTime.TryParseExact(excelField, DateFormat, culture, DateTimeStyles.None, out DateTime result)) + { + return result; + } + + return ExcelDateTime(excelField, DateFormat, TimeFormat, Fraction3Format, Fraction3Format); + } + + return ExcelDateTime(excelField, format, culture); + } + + public DateTime ExcelDateTime(string excelField, string format, CultureInfo culture) + { + try + { + return DateTime.ParseExact(excelField, format, culture); + } + catch (Exception) + { + throw; + } + } + + public DateOnly ExcelDateOnly(string excelField, string format, CultureInfo culture) + { + try + { + return DateOnly.ParseExact(excelField, format, culture); + } + catch (Exception) + { + throw; + } + } + + public TimeOnly ExcelTimeOnly(string excelField, string format, CultureInfo culture) + { + try + { + return TimeOnly.ParseExact(excelField, format, culture); + } + catch (Exception) + { + throw; + } + } + + public DateTime ExcelDate(string excelField) + { + return ExcelDateTime(excelField, DateFormat, DateTimeCultureInfo); + } + + public DateTime ExcelDateDMY(string excelField) + { + // Parse date and time with custom specifier. + // e.g. string dateString = "19.01.2018"; + return ExcelDateTime(excelField, "dd.MM.yyyy", DateTimeCultureInfo); + } + + public DateTime ExcelDateYMD(string excelField) + { + // Parse date and time with custom specifier. + // e.g. string dateString = "19.01.2018"; + return ExcelDateTime(excelField, "yyyy/MM/dd", DateTimeCultureInfo); + } + + public object ExcelTimeSpan(string excelField) + { + try + { + var timeSpan = TimeSpan.Parse(excelField); + return timeSpan; + } + catch (Exception e) + { + throw new Exception(e.StackTrace); + } + } + + public DateTime ExcelDateTime(string excelField, string formatDate, string formatTime, string formatFraction3, string formatFraction5) + { + try + { + var fractionFormat = string.Empty; + + var dotIdx = excelField.LastIndexOf('.'); + if (dotIdx > formatDate.Length) + { + var fractionLength = excelField.Length - dotIdx - 1; + fractionFormat = fractionLength == 3 ? formatFraction3 : formatFraction5; + } + + return DateTime.ParseExact(excelField, GetDateTimeFormat(formatDate, formatTime, fractionFormat), CultureInfo.InvariantCulture); + } + catch (Exception) + { + throw; + } + } + + public DateTime ExcelDateTime(string excelField) + { + return ExcelDateTime(excelField, DateFormat, TimeFormat, Fraction3Format, Fraction5Format); + } + + public DateTime ExcelDateTimeYMD(string excelField) + { + return ExcelDateTime(excelField, "yyyy/MM/dd", TimeFormat, Fraction3Format, Fraction5Format); + } + + public object ExcelEnum(Type enumType, string excelField) + { + try + { + var enumValue = Enum.Parse(enumType, excelField); + return enumValue; + } + catch (Exception) + { + throw; + } + } + + public byte[] ExcelImage(string excelField) + { + byte[] bytes; + + if (excelField.StartsWith(@"0x")) + { + if ((excelField.Length % 2) == 1) + { + throw new ArgumentException(@"string has odd length.", nameof(excelField)); + } + + int length = (excelField.Length - 2) / 2; + int chIdx = 2; + + bytes = new byte[length]; + + for (int i = 0; i < length; i++) + { + bytes[i] = (byte)(ToHex(excelField[chIdx]) * 16 + ToHex(excelField[chIdx + 1])); + chIdx += 2; + } + } + else + { + bytes = System.Convert.FromBase64String(excelField); + } + + return bytes; + } + + private int ToHex(char ch) + { + if (ch >= '0' && ch <= '9') + { + return ch - '0'; + } + + if (ch >= 'a' && ch <= 'f') + { + return 10 + ch - 'a'; + } + + if (ch >= 'A' && ch <= 'F') + { + return 10 + ch - 'F'; + } + + throw new ArgumentException(nameof(ch), $@"'{ch}' is not a hex digit."); + } + + #endregion +} \ No newline at end of file diff --git a/SpaceShuttle/Tools/CsvImportFormatAttribute.cs b/SpaceShuttle/Tools/CsvImportFormatAttribute.cs new file mode 100644 index 0000000..2338cac --- /dev/null +++ b/SpaceShuttle/Tools/CsvImportFormatAttribute.cs @@ -0,0 +1,25 @@ +/* + This file is part of https://github.com/aiten/Framework. + + Copyright (c) Herbert Aitenbichler + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +namespace SpaceShuttle.Tools; + +using System; + +public class CsvImportFormatAttribute : Attribute +{ + public string? Format { get; set; } + public string? Culture { get; set; } +} \ No newline at end of file diff --git a/SpaceShuttleName.csv b/SpaceShuttleName.csv new file mode 100644 index 0000000..e847326 --- /dev/null +++ b/SpaceShuttleName.csv @@ -0,0 +1,7 @@ +ShuttleName;ShipLiveNameFrom;NameFrom +Atlantis;1930–1960;Zweimastiges Segelschiff Atlantis, das von der Woods Hole Oceanographic Institution genutzt wurde. +Challenger;1870er Jahre;Forschungsschiff HMS Challenger der britischen Marine, das den Atlantischen und Pazifischen Ozean bereiste. +Columbia;ca. 1790er Jahre;Kleines Forschungsschiff, das außerhalb Bostons eingesetzt wurde und später die Mündung des nach ihm benannten Columbia River entdeckte. +Discovery;1610/11 bzw. 1778;Zwei berühmte Segelschiffe. Mit dem ersten suchte Henry Hudson nach einer Nordwestpassage zwischen Atlantik und Pazifik. Mit dem anderen entdeckte James Cook Hawaii. +Endeavour;1768;Das erste der von James Cook geführten Schiffe. Cook segelte in den Südpazifik, um auf Tahiti den Durchgang der Venus vor der Sonnenscheibe (Venustransit vom 3. Juni 1769) zu beobachten. Auf dieser Reise besuchte Cook außerdem Neuseeland, erkundete Australien und segelte zum Great Barrier Reef. +Enterprise;fiktive Raumschiffe;Der ursprüngliche Name war Constitution (Verfassung), da die 200-Jahr-Feier dazu 1988 anstand. Die Fangemeinde von Star Trek überreichte dem Weißen Haus eine Unterschriftensammlung. Obwohl der damalige US-Präsident Gerald Ford die Aktion nicht ernst nahm, setzte er letztendlich doch den Namen Enterprise bei der NASA durch. Er hatte im Zweiten Weltkrieg auf der USS Monterey gedient, die mit der USS Enterprise gemeinsam operierte. diff --git a/SpaceShuttleStart.csv b/SpaceShuttleStart.csv new file mode 100644 index 0000000..01e6016 --- /dev/null +++ b/SpaceShuttleStart.csv @@ -0,0 +1,136 @@ +No;LaunchDate;Mission;Shuttle;LaunchPad;LandingSite;Notes +1;12.04.1981;STS-1;Columbia;LC-39A;Edwards AFB;Erster Raumflug eines wiederverwendbaren Raumfahrzeugs +2;12.11.1981;STS-2;Columbia;LC-39A;Edwards AFB;Shuttle-Test-Mission, Canadarm erfolgreich getestet +3;22.03.1982;STS-3;Columbia;LC-39A;White Sands;Shuttle-Test-Mission, einzige Landung eines Shuttles in White Sands +4;27.06.1982;STS-4;Columbia;LC-39A;Edwards AFB;Shuttle-Test-Mission, geheime Nutzlast des DoD +5;11.11.1982;STS-5;Columbia;LC-39A;Edwards AFB;Mehrere Nachrichtensatelliten ANIK C-3 und SBS-C ausgesetzt +6;04.04.1983;STS-6;Challenger;LC-39A;Edwards AFB;TDRS-1 ausgesetzt, erster Außenbordeinsatz bei einer Shuttle-Mission durch Story Musgrave +7;18.06.1983;STS-7;Challenger;LC-39A;Edwards AFB;Kommunikationssatelliten ANIK C-2 und PALABA B-1 ausgesetzt, Sally Ride ist erste Amerikanerin im All +8;30.08.1983;STS-8;Challenger;LC-39A;Edwards AFB;Kommunikationssatellit INSAT-1B ausgesetzt +9;28.11.1983;STS-9;Columbia;LC-39A;Edwards AFB;erste Spacelab-Mission, erstmals sechs Astronauten im Shuttle, erstmals ein Nichtamerikaner an Bord eines Space Shuttle +10;03.02.1984;STS-41-B;Challenger;LC-39A;KSC;Kommunikationssatelliten WESTAR-VI und PALABA-B2 ausgesetzt, erfolgreicher MMU-Test +11;06.04.1984;STS-41-C;Challenger;LC-39A;Edwards AFB;LDEF ausgesetzt, Bergung von Solar Maximum Mission +12;30.08.1984;STS-41-D;Discovery;LC-39A;Edwards AFB;Kommunikationssatelliten SBS-D, TELSTAR-3C und IVSYNCOM IV-2 ausgesetzt +13;05.10.1984;STS-41-G;Challenger;LC-39A;KSC;Earth Radiation Budget Satellite ausgesetzt +14;08.11.1984;STS-51-A;Discovery;LC-39A;Edwards AFB;Kommunikationssatelliten TELESAT-H und SYNCOM IV-1 ausgesetzt, Rückholung von PALABA-B2 und WESTAR-IV +15;25.01.1986;STS-51-C;Discovery;LC-39A;Edwards AFB;Magnum ausgesetzt +16;12.04.1985;STS-51-D;Discovery;LC-39A;Edwards AFB;Kommunikationssatellit TELESAT-1 ausgesetzt, Start von SYNCOM-IV3 scheitert an fehlerhaftem Zündschalter +17;29.04.1985;STS-51-B;Challenger;LC-39A;Edwards AFB;Spacelab-Mission, GLOMR nicht ausgesetzt +18;17.06.1985;STS-51-G;Discovery;LC-39A;Edwards AFB;Kommunikationssatelliten ARABSAT-A, MORELOS-A und TELSTAR-3D ausgesetzt +19;29.07.1985;STS-51-F;Challenger;LC-39A;Edwards AFB;Spacelab-Mission. Einziger Abort-to-Orbit mit nur zwei Triebwerken und einziger Abbruch nach dem Start. Die Mission konnte trotzdem durchgeführt werden. +20;27.08.1985;STS-51-I;Discovery;LC-39A;Edwards AFB;Kommunikationssatelliten ASC-1, AUSSAT-1 und SYNCOM-IV4 ausgesetzt +21;03.10.1985;STS-51-J;Atlantis;LC-39A;Edwards AFB;Zwei DSCS-Satelliten ausgesetzt +22;30.10.1985;STS-61-A;Challenger;LC-39A;Edwards AFB;D-1-Spacelab-Mission, GLOMR ausgesetzt +23;27.11.1985;STS-61-B;Atlantis;LC-39A;Edwards AFB;Kommunikationssatelliten MORELOS-B, AUSSAT-2 und SATCOM KU-2 ausgesetzt +24;12.01.1986;STS-61-C;Columbia;LC-39A;Edwards AFB;Kommunikationssatellit SATCOM KU-1 ausgesetzt +25;28.01.1986;STS-51-L;Challenger;LC-39B;–;Start des 2. TDRS geplant, zu niedrige Temperatur zerstört Dichtungsring eines der SRBs, ET explodiert, Besatzung kommt ums Leben und Shuttle geht verloren +26;29.09.1988;STS-26;Discovery;LC-39B;Edwards AFB;TDRS-3 ausgesetzt +27;02.12.1988;STS-27;Atlantis;LC-39B;Edwards AFB;Spionagesatellit Lacrosse 1 ausgesetzt +28;13.03.1989;STS-29;Discovery;LC-39B;Edwards AFB;TDRS-4 ausgesetzt, Versuche mit Hühnerembryos +29;04.05.1989;STS-30;Atlantis;LC-39B;Edwards AFB;Venussonde Magellan ausgesetzt +30;08.08.1989;STS-28;Columbia;LC-39B;Edwards AFB;SDS-2 ausgesetzt +31;18.10.1989;STS-34;Atlantis;LC-39B;Edwards AFB;Jupitersonde Galileo ausgesetzt, erste Fotos von Blitzen, die die Gewitterwolken nach oben verlassen +32;23.11.1989;STS-33;Discovery;LC-39B;Edwards AFB;Magnum-Satellit ausgesetzt +33;09.01.1990;STS-32;Columbia;LC-39A;Edwards AFB;SYNCOM IV-5 ausgesetzt, +34;28.02.1990;STS-36;Atlantis;LC-39A;Edwards AFB;KH-11 Kennan ausgesetzt +35;24.04.1990;STS-31;Discovery;LC-39B;Edwards AFB;Hubble-Weltraumteleskop ausgesetzt +36;06.10.1990;STS-41;Discovery;LC-39B;Edwards AFB;Sonnensonde Ulysses ausgesetzt +37;15.11.1990;STS-38;Atlantis;LC-39A;KSC;Magnum-Satellit ausgesetzt +38;02.12.1990;STS-35;Columbia;LC-39B;Edwards AFB;ASTRO-1 Observatorium genutzt +39;05.04.1991;STS-37;Atlantis;LC-39B;Edwards AFB;Compton Gamma Ray Observatory ausgesetzt +40;28.04.1991;STS-39;Discovery;LC-39A;KSC;Mission für das Department of Defense (DoD) +41;05.06.1991;STS-40;Columbia;LC-39B;Edwards AFB;Spacelab-Mission +42;02.08.1991;STS-43;Atlantis;LC-39A;KSC;TDRS ausgesetzt +43;12.09.1991;STS-48;Discovery;LC-39A;Edwards AFB;Upper Atmosphere Research Satellite ausgesetzt +44;24.11.1991;STS-44;Atlantis;LC-39B;Edwards AFB;Defense Support Program Satellit ausgesetzt +45;22.01.1992;STS-42;Discovery;LC-39A;Edwards AFB;International Microgravity Laboratory-1 (IML-1) +46;24.03.1992;STS-45;Atlantis;LC-39A;KSC;Atmospheric Laboratory for Applications and Science (ATLAS-1) +47;07.05.1992;STS-49;Endeavour;LC-39B;Edwards AFB;Reparatur von Intelsat VI +48;25.06.1992;STS-50;Columbia;LC-39A;KSC;United States Microgravity Laboratory-1 (USML-1) +49;31.07.1992;STS-46;Atlantis;LC-39B;Edwards AFB;"Tethered Satellite System-1 (TSS-1); European Retrievable Carrier (EURECA)" +50;12.09.1992;STS-47;Endeavour;LC-39B;Edwards AFB;Spacelab-J +51;22.10.1992;STS-52;Columbia;LC-39B;Edwards AFB;"U.S. Microgravity Payload-1 (USMP-1); Laser Geodynamic Satellite-II (LAGEOS-II)" +52;02.12.1992;STS-53;Discovery;LC-39A;Edwards AFB;Geheime Mission für das Department of Defense (DoD) +53;13.01.1993;STS-54;Endeavour;LC-39B;Edwards AFB;TDRS ausgesetzt +54;08.04.1993;STS-56;Discovery;LC-39B;KSC;Atmospheric Laboratory for Applications and Science-2 (ATLAS-2) +55;26.04.1993;STS-55;Columbia;LC-39A;Edwards AFB;D-2 Spacelab-Mission +56;21.06.1993;STS-57;Endeavour;LC-39B;Edwards AFB;"Spacehab-1; European Retrievable Carrier (EURECA) geborgen" +57;12.09.1993;STS-51;Discovery;LC-39B;Edwards AFB;Advanced Communications Technology Satellite (ACTS) +58;18.10.1993;STS-58;Columbia;LC-39B;Edwards AFB;Spacelab SLS-2 +59;02.12.1993;STS-61;Endeavour;LC-39B;KSC;Wartung am Hubble-Weltraumteleskop +60;03.02.1994;STS-60;Discovery;LC-39A;KSC;Wake Shield Facility, Spacehab +61;04.03.1994;STS-62;Columbia;LC-39B;KSC;United States Microgravity Payload-2 +62;09.04.1994;STS-59;Endeavour;LC-39A;KSC;Space Radar Laboratory-1 +63;08.07.1994;STS-65;Columbia;LC-39A;KSC;International Microgravity Laboratory-2 (IML-2) +64;09.09.1994;STS-64;Discovery;LC-39B;Edwards AFB;LIDAR In-Space Technology Experiment (LITE) +65;30.09.1994;STS-68;Endeavour;LC-39A;Edwards AFB;Space Radar Laboratory-2 +66;03.11.1994;STS-66;Atlantis;LC-39B;Edwards AFB;Atmospheric Laboratory for Applications and Sciences-3 (ATLAS-03) +67;03.02.1995;STS-63;Discovery;LC-39B;KSC;Mir Rendezvous, Spacehab +68;02.03.1995;STS-67;Endeavour;LC-39A;Edwards AFB;ASTRO-2 +69;27.06.1995;STS-71;Atlantis;LC-39A;KSC;1. Shuttle-Mir Docking +70;13.07.1995;STS-70;Discovery;LC-39B;KSC;Tracking Data and Relay Satellite-G +71;07.09.1995;STS-69;Endeavour;LC-39A;KSC;"SPARTAN 201-03; Wake Shield Facility-2" +72;20.10.1995;STS-73;Columbia;LC-39B;KSC;United States Microgravity Laboratory-2 (USML-2) +73;12.11.1995;STS-74;Atlantis;LC-39A;KSC;2. Shuttle-Mir Docking +74;11.01.1996;STS-72;Endeavour;LC-39B;KSC;Space Flyer Unit +75;22.02.1996;STS-75;Columbia;LC-39B;KSC;Tethered Satellite System Reflight (TSS-1R) +76;22.03.1996;STS-76;Atlantis;LC-39B;Edwards AFB;3. Shuttle-Mir Docking, Spacehab +77;19.05.1996;STS-77;Endeavour;LC-39B;KSC;SPARTAN, Spacehab +78;20.06.1996;STS-78;Columbia;LC-39B;KSC;Life and Microgravity Spacelab (LMS) +79;16.09.1996;STS-79;Atlantis;LC-39A;KSC;4. Shuttle-Mir Docking, Spacehab +80;19.11.1996;STS-80;Columbia;LC-39B;KSC;ORFEUS-SPAS II +81;12.01.1997;STS-81;Atlantis;LC-39B;KSC;5. Shuttle-Mir Docking, Spacehab +82;11.02.1997;STS-82;Discovery;LC-39A;KSC;Wartung am Hubble-Weltraumteleskop +83;04.04.1997;STS-83;Columbia;LC-39A;KSC;Microgravity Science Laboratory-1 (MSL-1) +84;15.05.1997;STS-84;Atlantis;LC-39A;KSC;6. Shuttle-Mir Docking, Spacehab +85;01.07.1997;STS-94;Columbia;LC-39A;KSC;Microgravity Science Laboratory-1 +86;07.08.1997;STS-85;Discovery;LC-39A;KSC;CRISTA-SPAS-2 +87;26.09.1997;STS-86;Atlantis;LC-39A;KSC;7. Shuttle-Mir Docking, Spacehab +88;19.11.1997;STS-87;Columbia;LC-39B;KSC;United States Microgravity Payload-4 +89;23.01.1998;STS-89;Endeavour;LC-39A;KSC;8. Shuttle-Mir Docking, Spacehab +90;17.04.1998;STS-90;Columbia;LC-39B;KSC;Spacelab +91;02.06.1998;STS-91;Discovery;LC-39A;KSC;9. Shuttle-Mir Docking, Spacehab +92;29.10.1998;STS-95;Discovery;LC-39B;KSC;Spacehab +93;04.12.1998;STS-88;Endeavour;LC-39A;KSC;1. ISS-Mission (Knoten Unity) +94;27.05.1999;STS-96;Discovery;LC-39B;KSC;ISS-Mission, Spacehab +95;23.07.1999;STS-93;Columbia;LC-39B;KSC;Chandra-Röntgenteleskop +96;20.12.1999;STS-103;Discovery;LC-39B;KSC;Wartung am Hubble-Weltraumteleskop +97;11.02.2000;STS-99;Endeavour;LC-39A;KSC;Shuttle Radar Topography Mission (SRTM) +98;19.05.2000;STS-101;Atlantis;LC-39A;KSC;ISS-Mission, Spacehab +99;08.09.2000;STS-106;Atlantis;LC-39B;KSC;ISS-Mission, Spacehab +100;11.10.2000;STS-92;Discovery;LC-39A;Edwards AFB;ISS-Mission (Z1-Trägerstruktur, Andockstutzen) +101;01.12.2000;STS-97;Endeavour;LC-39B;KSC;ISS-Mission (P6-Trägerstruktur mit Solarzellenanlage) +102;07.02.2001;STS-98;Atlantis;LC-39A;Edwards AFB;ISS-Mission (US-Labor Destiny) +103;08.03.2001;STS-102;Discovery;LC-39B;KSC;ISS-Mission: Logistik-Modul Leonardo, Spacehab +104;19.04.2001;STS-100;Endeavour;LC-39A;Edwards AFB;ISS-Mission: Logistik-Modul Raffaello, Roboter-Arm +105;12.07.2001;STS-104;Atlantis;LC-39B;KSC;ISS-Mission (Luftschleuse Quest) +106;10.08.2001;STS-105;Discovery;LC-39A;KSC;ISS-Mission: Logistik-Modul Leonardo, Spacehab +107;05.12.2001;STS-108;Endeavour;LC-39B;KSC;ISS-Mission: Logistik-Modul Raffaello +108;01.03.2002;STS-109;Columbia;LC-39A;KSC;Wartung am Hubble-Weltraumteleskop +109;08.04.2002;STS-110;Atlantis;LC-39B;KSC;ISS-Mission (S0-Trägerstruktur) +110;05.06.2002;STS-111;Endeavour;LC-39A;Edwards AFB;ISS-Mission: Logistik-Modul Leonardo +111;07.10.2002;STS-112;Atlantis;LC-39B;KSC;ISS-Mission (S1-Trägerstruktur) +112;24.11.2002;STS-113;Endeavour;LC-39A;KSC;ISS-Mission (P1-Trägerstruktur) +113;16.01.2003;STS-107;Columbia;LC-39A;–;FREESTAR, Spacehab, Shuttle beim Wiedereintritt in die Atmosphäre zerstört und teilweise verglüht +114;26.07.2005;STS-114;Discovery;LC-39B;Edwards AFB;ISS-Mission: Logistik-Modul Raffaello, Spacehab +115;04.07.2006;STS-121;Discovery;LC-39B;KSC;ISS-Mission ULF1.1: Logistik-Modul Leonardo, Spacehab +116;09.09.2006;STS-115;Atlantis;LC-39B;KSC;ISS-Mission 12A: P3/P4-Trägerstruktur mit Solarzellenanlage, Spacehab +117;10.12.2006;STS-116;Discovery;LC-39B;KSC;ISS-Mission 12A.1: P5-Trägerstruktur und Spacehab-SM +118;08.06.2007;STS-117;Atlantis;LC-39A;Edwards AFB;ISS-Mission 13A: S3/S4-Trägerstruktur mit Solarzellenanlage +119;08.08.2007;STS-118;Endeavour;LC-39A;KSC;ISS-Mission 13A.1: S5-Trägerstruktur, Spacehab-SM und ESP3 +120;23.10.2007;STS-120;Discovery;LC-39A;KSC;ISS-Mission 10A: Harmony +121;07.02.2008;STS-122;Atlantis;LC-39A;KSC;ISS-Mission 1E: ESA-Modul Columbus +122;11.03.2008;STS-123;Endeavour;LC-39A;KSC;ISS-Mission 1J/A: JAXA-Experiment-Logistik-Modul +123;31.05.2008;STS-124;Discovery;LC-39A;KSC;ISS-Mission 1J: JAXA-Modul Kib? und japanischer Roboterarm +124;15.11.2008;STS-126;Endeavour;LC-39A;Edwards AFB;ISS-Mission ULF2: Logistikmodul Leonardo +125;15.03.2009;STS-119;Discovery;LC-39A;KSC;ISS-Mission 15A: S6-Trägerstruktur mit der letzten Solarzellenanlage +126;11.05.2009;STS-125;Atlantis;LC-39A;Edwards AFB;Letzte Wartung am Hubble-Weltraumteleskop +127;15.07.2009;STS-127;Endeavour;LC-39A;KSC;ISS-Mission 2J/A: Jap. Experiment- und Logistik-Plattform, DRAGONSat, ANDE-2 +128;29.08.2009;STS-128;Discovery;LC-39A;Edwards AFB;ISS-Mission 17A: Logistikmodul Leonardo +129;16.11.2009;STS-129;Atlantis;LC-39A;KSC;ISS-Mission ULF3: EXPRESS Logistics Carrier 1 und 2 +130;08.02.2010;STS-130;Endeavour;LC-39A;KSC;ISS-Mission 20A: Tranquility und Cupola (Aussichtskuppel) +131;05.04.2010;STS-131;Discovery;LC-39A;KSC;ISS-Mission 19A: Logistikmodul Leonardo +132;14.05.2010;STS-132;Atlantis;LC-39A;KSC;ISS-Mission ULF4: Logistik-Flug, ICC-VLD, Rasswet +133;24.02.2011;STS-133;Discovery;LC-39A;KSC;ISS-Mission ULF5: Permanent Multi-Purpose Module Leonardo, EXPRESS Logistics Carrier 4 +134;16.05.2011;STS-134;Endeavour;LC-39A;KSC;ISS-Mission ULF6: Alpha-Magnet-Spektrometer, EXPRESS Logistics Carrier 3 +135;08.07.2011;STS-135;Atlantis;LC-39A;KSC;ISS-Mission (Nutzlast: MPLM mit LMC) \ No newline at end of file