Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Enigma
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dennis Eisold
Enigma
Commits
b79f46fd
Commit
b79f46fd
authored
5 years ago
by
Dennis Eisold
Browse files
Options
Downloads
Patches
Plain Diff
Neue Funktionen für die Kommunikation zwischen Codierer und GUI
parent
d61cc439
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#229
failed with stages
in 2 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/projekt/enigma/model/Codierer.java
+21
-5
21 additions, 5 deletions
src/main/java/projekt/enigma/model/Codierer.java
src/main/java/projekt/enigma/model/Walze.java
+2
-0
2 additions, 0 deletions
src/main/java/projekt/enigma/model/Walze.java
with
23 additions
and
5 deletions
src/main/java/projekt/enigma/model/Codierer.java
+
21
−
5
View file @
b79f46fd
...
...
@@ -143,8 +143,8 @@ public class Codierer {
// Spruchschlüssel anhängen
this
.
spruchschluesselCodiert
.
substring
(
0
,
3
)
+
" "
+
this
.
spruchschluesselCodiert
.
substring
(
3
,
6
)
+
" "
;
// Kenngruppe an das Ende setzen
//this.kenngruppeCodiert;
// Kenngruppe an das Ende setzen
//this.kenngruppeCodiert;
}
/**
...
...
@@ -173,7 +173,7 @@ public class Codierer {
/**
* Gibt die letzte empfangene Nachricht zurück
* <br>
* String[0
}
Tag wann die Nachricht gesendet wurde
* String[0
]
Tag wann die Nachricht gesendet wurde
* String[1] = Die verschlüsselte Nachricht
* String[2] = Nachricht im Klartext
*/
...
...
@@ -188,6 +188,19 @@ public class Codierer {
nachricht
[
0
]
=
codierteNachricht
[
0
];
nachricht
[
1
]
=
mc
.
convertMorsecodeToBuchstabe
(
codierteNachricht
[
1
]);
nachricht
[
2
]
=
this
.
decodiere
(
nachricht
[
1
],
Integer
.
parseInt
(
nachricht
[
0
]));
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
nachricht
[
1
],
0
,
16
);
for
(
int
i
=
17
;
i
<=
nachricht
[
1
].
length
();)
{
if
((
i
+
5
)
<
nachricht
[
1
].
length
())
{
sb
.
append
(
nachricht
[
1
],
i
,
i
+
5
).
append
(
" "
);
i
+=
5
;
}
else
{
sb
.
append
(
nachricht
[
1
].
substring
(
i
));
break
;
}
}
nachricht
[
1
]
=
sb
.
toString
();
}
return
nachricht
;
...
...
@@ -255,7 +268,7 @@ public class Codierer {
*/
public
char
codiere
(
char
buchstabe
,
boolean
save
)
{
char
codiert
=
this
.
hardware
.
codiere
(
buchstabe
);
if
(
save
)
{
if
(
save
)
{
this
.
nachricht
+=
codiert
;
}
...
...
@@ -264,6 +277,7 @@ public class Codierer {
/**
* TODO: Dokumentieren
*
* @param klartext
* @param save
* @return
...
...
@@ -319,6 +333,7 @@ public class Codierer {
/**
* TODO: Dokumentieren
*
* @param nachricht
* @return
*/
...
...
@@ -343,7 +358,8 @@ public class Codierer {
}
/**
* TODO: Dokumentieren
* Setzt die Walze auf der Position (walzenPosition) in die Enigma ein.
* Mit dem char (position) sagt man auf welchen Buchstaben sie eingestellt werden soll.
*
* @param walzenPosition
* @param position
...
...
This diff is collapsed.
Click to expand it.
src/main/java/projekt/enigma/model/Walze.java
+
2
−
0
View file @
b79f46fd
...
...
@@ -140,6 +140,8 @@ public class Walze {
/**
* TODO: Dokumentieren
* TODO: Ich glaube das kann weg?
*
* @return
*/
public
char
getAnzeige
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment