-
Notifications
You must be signed in to change notification settings - Fork 0
Test AnalyseClient #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
74b986d
Client und Config soweit fertig
299e4c6
Merge branch 'main' into test-analyseclient
joshuajeschek 4b28a49
Merge branch 'main' into test-analyseclient
8433c16
Änderungen @param
6bfb8bf
Merge branch 'main' into test-analyseclient
54ee638
Merge branch 'main' into test-analyseclient
846b80d
ClientTest erweitert & Test-Messages
d765bc7
Merge branch 'main' into test-analyseclient
b68f5d6
Format
fc6085c
Restliche Klassen erstellt
c183fef
Update Client
22b7d87
Weitere Tesklassen und newline pom
59b1812
Formatierung
823ae79
Merge branch 'main' into test-analyseclient
30fac7f
Ergänzung
56c365c
Typo
philipkbh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package github.weichware10.analyse; | ||
|
|
||
| import github.weichware10.util.Data; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * beinhaltet Methoden die zur Analyse benötigt werden. | ||
| */ | ||
| public abstract class Analyse { | ||
|
|
||
| /** | ||
| * berechnet die relativen Häufigkeiten der Bildkoordinaten. | ||
| * | ||
| * @return Liste mit den relativen Häufigkeiten der Bildkoordinaten | ||
| */ | ||
| protected List<List<Float>> calcRelFreq(Data data) { | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
| * erstellt eine Tabelle mit den Zeitpunkten und dazugehörigen Bildkoordinaten | ||
| * bzw. Zoomstärken | ||
| * | ||
| * @return Tabelle mit Zeitpunkten und dazugehörigen Bildkoordinaten bzw. | ||
| * Zoomstärken | ||
| */ | ||
| protected List<List<Float>> createTimeTable(Data data) { | ||
| return null; | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package github.weichware10.analyse; | ||
|
|
||
| /** | ||
| * Enum der möglichen Analyse-Typen. | ||
| */ | ||
| public enum AnalyseType { | ||
| HEATPMAP, | ||
| COMPHEATMAP, | ||
| VERLAUF, | ||
| RELFRQIMGAREA, | ||
| VIEWTIMEDISTR | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| package github.weichware10.analyse; | ||
|
|
||
| import github.weichware10.util.Data; | ||
| import github.weichware10.util.Enums.ToolType; | ||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import org.joda.time.DateTime; | ||
|
|
||
| /** | ||
| * Grundlegende Klasse für den Analyse-Client. | ||
| */ | ||
| public class Client { | ||
| private Data data; | ||
| private Data dataForComp; | ||
| private List<AnalyseType> analyseTypes; | ||
| private List<String> analyzedData; | ||
| private ConfigHeatmap confHm; | ||
| private ConfigDiagramm confDia; | ||
|
|
||
| public Client() { | ||
| analyseTypes = new ArrayList<AnalyseType>(); | ||
| analyzedData = new ArrayList<String>(); | ||
| } | ||
|
|
||
| /** | ||
| * setzt die ausgewählten Analyse-Typen. | ||
| * | ||
| * @param selectedAnalyseTypes - die ausgewählten Analyse-Typen | ||
| * @return | ||
| * true, falls Analyse-Typen gesetzt wurden; | ||
| * false, falls keine Analyse-Typen gesetzt wurden | ||
| */ | ||
| public boolean setAnalyseTypes(List<AnalyseType> selectedAnalyseTypes) { | ||
| if (selectedAnalyseTypes.isEmpty()) { | ||
| return false; | ||
| } | ||
| this.analyseTypes = selectedAnalyseTypes; | ||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * gibt die Anaylse-Typen zurück. | ||
| * | ||
| * @return Analyse-Typen | ||
| */ | ||
| public List<AnalyseType> getAnalyseTypes() { | ||
| return this.analyseTypes; | ||
| } | ||
|
|
||
| /** | ||
| * holt die angeforderten Daten vom Speichermedium, falls diese existieren. | ||
| * | ||
| * @param start - Startzeitpunkt der benötigten Daten | ||
| * @param end - Endzeitpunkt der benötigten Daten | ||
|
philipkbh marked this conversation as resolved.
|
||
| * @param dataType - Tool-Typ der benötigten Daten | ||
| * @return | ||
| * true, falls benötigte Daten gefunden und gesetzt wurden; | ||
| * false, falls benötigte Daten nicht gefunden wurden | ||
| */ | ||
| public boolean getData(DateTime start, DateTime end, ToolType dataType) { | ||
| if (start.isAfter(end) || start.isAfter(DateTime.now()) || end.isAfter(DateTime.now())) { | ||
| return false; | ||
| } | ||
|
|
||
| // * Provisorische Lösung für Test, da er sonst nicht funktionieren würde | ||
| int amountData = 3; | ||
| List<DateTime> dataStart = new ArrayList<DateTime>(Arrays.asList( | ||
| new DateTime(2021, 11, 28, 16, 0, 0), new DateTime(2021, 11, 28, 15, 0, 0), | ||
| new DateTime(2021, 11, 28, 19, 0, 0))); | ||
| List<DateTime> dataEnd = new ArrayList<DateTime>(Arrays.asList( | ||
| new DateTime(2021, 11, 28, 19, 0, 0), new DateTime(2021, 11, 28, 18, 0, 0), | ||
| new DateTime(2021, 11, 28, 20, 0, 0))); | ||
| List<ToolType> dataToolType = new ArrayList<ToolType>(Arrays.asList( | ||
| ToolType.ZOOM, ToolType.EYETRACKING, ToolType.CODECHARTS)); | ||
|
|
||
| for (int id = 0; id < amountData; id++) { | ||
| if (dataStart.get(id).equals(start) && dataEnd.get(id).equals(end) | ||
| && dataToolType.get(id).equals(dataType)) { | ||
| return true; | ||
| } | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * holt die angeforderten Daten zum Vergleich vom Speichermedium, falls diese | ||
| * existieren. | ||
| * | ||
| * @param start - Startzeitpunkt der benötigten Daten zum Vergleich | ||
| * @param end - Endzeitpunkt der benötigten Daten zum Vergleich | ||
| * @return | ||
| * true, falls benötigte Daten zum Vergleich gefunden und gesetzt | ||
| * wurden; | ||
| * false, falls benötigte Daten zum Vergleich nicht gefunden wurden | ||
| */ | ||
| public boolean getDataForComp(DateTime start, DateTime end) { | ||
| if (start.isAfter(end) || start.isAfter(DateTime.now()) || end.isAfter(DateTime.now())) { | ||
| return false; | ||
| } | ||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * verändert die Standard-Konfiguration für die Heatmap-Analyse. | ||
| * | ||
| * @param confHm - Konfiguration der Heatmap-Analyse | ||
| */ | ||
| public void setConfigAnalyseHm(ConfigHeatmap confHm) { | ||
| this.confHm = confHm; | ||
| } | ||
|
|
||
| /** | ||
| * verändert die Standard-Konfiguration für die Diagramm-Analyse. | ||
| * | ||
| * @param confDia - Konfiguration der Diagramm-Analyse | ||
| */ | ||
| public void setConfigAnalyseDia(ConfigDiagramm confDia) { | ||
| this.confDia = confDia; | ||
| } | ||
|
|
||
| /** | ||
| * führt die ausgewählten Analysen durch. | ||
| */ | ||
| public void analyseData() { | ||
| ; | ||
| } | ||
|
|
||
| /** | ||
| * zeigt die analysierten Daten an. | ||
| */ | ||
| public void displayAnalyzedData() { | ||
| ; | ||
| } | ||
|
|
||
| /** | ||
| * exportiert die analysierten Daten. | ||
| * | ||
| * @return | ||
| * true, wenn Export erfolreich war; | ||
| * false, wenn Fehler aufgetreten ist | ||
| */ | ||
| public boolean export() { | ||
| return true; | ||
| } | ||
|
|
||
| /** | ||
| * exportiert die rohen Daten der Analyse. | ||
| * | ||
| * @return | ||
| * true, wenn Export erfolreich war; | ||
| * false, wenn Fehler aufgetreten ist | ||
| */ | ||
| public boolean exportRaw() { | ||
| return true; | ||
| } | ||
|
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package github.weichware10.analyse; | ||
|
|
||
| /** | ||
| * verantwortliche für die graphische Benutzeroberfläche des Clients mit Ein- | ||
| * und Ausgabe. | ||
| */ | ||
| public class ClientGui { | ||
| private Client client; | ||
|
|
||
| /** | ||
| * verantwortliche für die graphische Benutzeroberfläche des Clients mit Ein- | ||
| * und Ausgabe. | ||
| */ | ||
| public ClientGui() { | ||
| this.client = new Client(); | ||
| } | ||
|
|
||
| /** | ||
| * zeigt die graphische Benutzeroberfläche an. | ||
| */ | ||
| public void showGui() { | ||
| ; | ||
| } | ||
|
|
||
| } |
119 changes: 119 additions & 0 deletions
119
src/main/java/github/weichware10/analyse/ConfigDiagramm.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| package github.weichware10.analyse; | ||
|
|
||
| /** | ||
| * Speicherung der Konfiguration der Diagramm-Analysemethoden. | ||
| */ | ||
| public class ConfigDiagramm { | ||
| private int amountAreas; // * 2,4,6,8 | ||
| private float minTime; // * >= 0 Länge | Zoomstufe | ||
| private float maxTime; // * <= 10 Länge | Zoomstufe | ||
| private int stepsBetween; // * [1,10], minTime=maxTime: steps = 0 | ||
|
|
||
| /** | ||
| * Speicherung der Konfiguration der Diagramm-Analysemethoden. | ||
| */ | ||
| public ConfigDiagramm() { | ||
| this.amountAreas = 4; | ||
| this.minTime = 0.5f; | ||
| this.maxTime = 2.5f; | ||
| this.stepsBetween = 4; | ||
| } | ||
|
|
||
| /** | ||
| * setzt neue Anzahl der Felder. | ||
| * | ||
| * @param amountAreas - neue Anzahl der Felder | ||
| * @return | ||
| * true, falls neue Anzahl erfolgreich gesetzt wurde; | ||
| * false, falls neue Anzahl nicht gesetzt wurde | ||
| */ | ||
| public boolean setAmountAreas(int amountAreas) { | ||
| if (amountAreas % 2 == 0 && amountAreas >= 2 && amountAreas <= 8) { | ||
| this.amountAreas = amountAreas; | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * gibt die Anzahl der Felder zurück. | ||
| * | ||
| * @return Anzahl der Felder | ||
| */ | ||
| public int getAmountAreas() { | ||
| return amountAreas; | ||
| } | ||
|
|
||
| /** | ||
| * setzt neue minimale und maximale Zeit. | ||
| * | ||
| * @param minTime - neue minimale Zeit | ||
| * @param maxTime - neue maximale Zeit | ||
| * @return | ||
| * true, falls neue min. und max. Zeit erfolgreich gesetzt wurden; | ||
| * false, falls neue min. und max. Zeit nicht gesetzt wurden | ||
| */ | ||
| public boolean setNewTime(float minTime, float maxTime) { | ||
| if (minTime >= 0.0f && maxTime <= 10.0f && minTime <= maxTime) { | ||
| this.minTime = minTime; | ||
| this.maxTime = maxTime; | ||
| if (this.maxTime == this.minTime) { | ||
| this.stepsBetween = 0; | ||
| } | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * gibt die minimale Zeit zurück. | ||
| * | ||
| * @return minimale Zeit | ||
| */ | ||
| public float getMinTime() { | ||
| return minTime; | ||
| } | ||
|
|
||
| /** | ||
| * gibt die maximale Zeit zurück. | ||
| * | ||
| * @return maximale Zeit | ||
| */ | ||
| public float getMaxTime() { | ||
| return maxTime; | ||
| } | ||
|
|
||
| /** | ||
| * setzt neue Anzahl an Zwischenschritten. | ||
| * | ||
| * @param stepsBetween - neue Anzahl Zwischenschritte | ||
| * @return | ||
| * true, falls neue Anzahl an Zwischenschritten erfolgreich gesetzt | ||
| * wurde; | ||
| * false, falls neue Anzahl an Zwischenschritten nicht gesetzt | ||
| * wurde | ||
| */ | ||
| public boolean setStepsBetween(int stepsBetween) { | ||
| if (this.getMinTime() == this.getMaxTime()) { | ||
|
philipkbh marked this conversation as resolved.
|
||
| this.stepsBetween = 0; | ||
| return true; | ||
| } else if (stepsBetween <= 10 && stepsBetween >= 1) { | ||
| this.stepsBetween = stepsBetween; | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * gibt die Anzahl der Zwischenschritte zurück. | ||
| * | ||
| * @return Anzahl der Zwischenschritte | ||
| */ | ||
| public int getStepsBetween() { | ||
| return stepsBetween; | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.