Skip to content

Commit 37d4e9e

Browse files
committed
translated to german
1 parent db80d46 commit 37d4e9e

4 files changed

Lines changed: 35 additions & 31 deletions

File tree

Argument.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ public enum ArgumentType
1414

1515
public enum ConnectionType
1616
{
17-
Search,
18-
Auto,
19-
Tunneling,
20-
Routing
17+
search,
18+
auto,
19+
tunneling,
20+
routing
2121
}
2222

2323
public string Name { get; set; }
2424
public string Display { get; set; }
25-
public string Question { get; set; } = "";
26-
public string Regex { get; set; } = "";
2725
public object Value { get; set; }
2826
public ArgumentType Type { get; set; }
2927
public bool WasSet { get; set; } = false;

Arguments.cs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ namespace KnxFileTransferClient;
77
internal class Arguments{
88

99
private static List<Argument> arguments = new List<Argument> {
10-
new("delay", "Delay", Argument.ArgumentType.Int, 0),
11-
new("pkg", "Package Size", Argument.ArgumentType.Int, 128),
12-
new("force", "Force", Argument.ArgumentType.Bool, false),
13-
new("connect", "Verbindung", Argument.ArgumentType.Enum, Argument.ConnectionType.Search),
10+
new("delay", "Verzögerung", Argument.ArgumentType.Int, 0),
11+
new("pkg", "Telegrammgröße", Argument.ArgumentType.Int, 128),
12+
new("force", "Erzwingen", Argument.ArgumentType.Bool, false),
13+
new("connect", "Verbindung", Argument.ArgumentType.Enum, Argument.ConnectionType.search),
1414
new("verbose", "Verbose", Argument.ArgumentType.Bool, false),
15-
new("pa", "Physical Address", Argument.ArgumentType.String, "1.1.255", true) { Question = "PA des Geräts", Regex = @"^(1[0-5]|[0-9])\.(1[0-5]|[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$"},
15+
new("pa", "Physikalische Adresse", Argument.ArgumentType.String, "1.1.255", true),
1616
new("port", "Port", Argument.ArgumentType.Int, 3671),
1717
new("gw", "Gateway IP", Argument.ArgumentType.String, "192.168.178.2", true),
1818
new("ga", "Gateway PA", Argument.ArgumentType.String, "1.1.0", true),
1919
new("gs", "Routing Source Address", Argument.ArgumentType.String, "0.0.1", true),
2020
new("config", "Konfigurationsname", Argument.ArgumentType.String, ""),
21-
new("interactive", "All arguments need to be set by user", Argument.ArgumentType.Bool, false)
21+
new("interactive", "Alle Argumente müssen vom Benutzer eingegeben werden", Argument.ArgumentType.Bool, false)
2222
};
2323

2424
public UnicastAddress? PhysicalAddress { get; private set; } = null;
@@ -27,7 +27,7 @@ internal class Arguments{
2727
public string Target { get; private set; } = "";
2828
public string Command { get; private set; } = "";
2929
public bool IsRouting { get; private set; } = false;
30-
private static readonly List<string> toSave = new() { "connect", "port", "gw", "ga", "gs", "pkg", "delay" };
30+
private static readonly List<string> toSave = new() { "connect", "pa", "port", "gw", "ga", "gs", "pkg", "delay" };
3131

3232
public async Task Init(string[] args, bool isOpen = false)
3333
{
@@ -60,32 +60,32 @@ public async Task Init(string[] args, bool isOpen = false)
6060
arg.WasSet = false;
6161

6262
if(!GetRaw("pa").WasSet)
63-
GetInputArg("pa", "PA des Update-Geräts", @"^(1[0-5]|[0-9])\.(1[0-5]|[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$");
63+
GetInputArg("pa", "PA des Geräts", @"^(1[0-5]|[0-9])\.(1[0-5]|[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$");
6464

6565
if(!GetRaw("connect").WasSet)
6666
{
6767
Console.ForegroundColor = ConsoleColor.DarkGray;
6868
Console.WriteLine("(Auto|Search|Tunneling|Routing)");
6969
Console.ResetColor();
70-
GetInputArg("connect", "Verbindungstyp: ", @"(Auto|Search|Tunneling|Routing)");
70+
GetInputArg("connect", "Verbindungstyp: ", @"(auto|search|tunneling|routing)");
7171
}
7272

7373
switch(Get<Argument.ConnectionType>("connect"))
7474
{
75-
case Argument.ConnectionType.Auto:
75+
case Argument.ConnectionType.auto:
7676
await SearchGateways(true);
7777
break;
7878

79-
case Argument.ConnectionType.Search:
79+
case Argument.ConnectionType.search:
8080
await SearchGateways();
8181
break;
8282

83-
case Argument.ConnectionType.Tunneling:
83+
case Argument.ConnectionType.tunneling:
8484
if(!GetRaw("gw").WasSet)
8585
GetInputArg("gw", "IP-Adresse der Schnittstelle", @"((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}");
8686
break;
8787

88-
case Argument.ConnectionType.Routing:
88+
case Argument.ConnectionType.routing:
8989
if(!GetRaw("gw").WasSet)
9090
GetInputArg("gw", "IP-Adresse des Routers", @"((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}");
9191
if(!GetRaw("ga").WasSet)
@@ -287,6 +287,12 @@ private void ParseArgs(List<string> argL)
287287
arg.Value = argL[index + 1];
288288
break;
289289
}
290+
291+
case Argument.ArgumentType.Enum:
292+
{
293+
arg.Value = (Argument.ConnectionType)Enum.Parse<Argument.ConnectionType>(argL[index + 1].ToLower());
294+
break;
295+
}
290296
}
291297
}
292298

@@ -320,7 +326,7 @@ private bool GetInputArg(string name, string input, string regex)
320326
}
321327
Console.ResetColor();
322328

323-
answer = Console.ReadLine();
329+
answer = Console.ReadLine().ToLower();
324330
if(string.IsNullOrEmpty(answer))
325331
answer = arg.Value.ToString();
326332
} while(!CheckInput(answer, regex));

KnxFileTransferClient.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<ImplicitUsings>enable</ImplicitUsings>
1212
<Nullable>enable</Nullable>
1313

14-
<Version>0.2.0.0</Version>
15-
<AssemblyVersion>0.2.0.0</AssemblyVersion>
14+
<Version>0.2.1.0</Version>
15+
<AssemblyVersion>0.2.1.0</AssemblyVersion>
1616
</PropertyGroup>
1717

1818
<ItemGroup>

Program.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ private static int help()
262262
Arguments args = new Arguments();
263263
Console.WriteLine();
264264
Console.ForegroundColor = ConsoleColor.Yellow;
265-
Console.WriteLine($"KnxFileTransferClient <Command> <Source?> <Target?>");
265+
Console.WriteLine($"KnxFileTransferClient <Befehl> <Quelle?> <Ziel?>");
266266

267267
Console.Write($" ");
268268
foreach(Argument arg in args.GetArguments())
@@ -275,14 +275,14 @@ private static int help()
275275
Console.ResetColor();
276276
Console.WriteLine($"In Session:");
277277
Console.ForegroundColor = ConsoleColor.Yellow;
278-
Console.WriteLine($"<Command> <Source?> <Target?>");
278+
Console.WriteLine($"<Befehl> <Quelle?> <Ziel?>");
279279
Console.ResetColor();
280280
Console.WriteLine();
281-
Console.WriteLine("Command: Command to execute");
281+
Console.WriteLine("Befehl: Folgende Befehle sind vorhanden");
282282
Console.WriteLine(" format/exists/rename/list/mkdir/rmdir/open/close");
283283
Console.WriteLine(" upload/download/fwupdate/delete");
284-
Console.WriteLine("Source*: Path to the file on the host");
285-
Console.WriteLine("Target**: Path to the file on the knx device");
284+
Console.WriteLine("Quelle*: Pfad zur Datei auf dem Host");
285+
Console.WriteLine("Ziel**: Pfad zur Datei auf dem KNX-Gerät");
286286

287287
int maxLength = 17;
288288

@@ -301,11 +301,11 @@ private static int help()
301301

302302
Console.WriteLine();
303303
Console.ForegroundColor = ConsoleColor.DarkGray;
304-
Console.WriteLine("* only at command upload/download");
305-
Console.WriteLine("** only at command exists/rename/upload/download/list/mkdir/rmdir");
304+
Console.WriteLine("* nur bei Befehl upload/download");
305+
Console.WriteLine("** nur bei Befehl exists/rename/upload/download/list/mkdir/rmdir");
306306
Console.WriteLine();
307-
Console.WriteLine("Open = Session Start");
308-
Console.WriteLine("Close = Session End");
307+
Console.WriteLine("Open = Session Öffnen");
308+
Console.WriteLine("Close = Session Beenden");
309309
Console.ResetColor();
310310
return 0;
311311
}

0 commit comments

Comments
 (0)