Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
bdfbf052
Commit
bdfbf052
authored
Jan 18, 2019
by
Daniel Lehmberg
Browse files
Merge branches 'change_dataprocessing_text' and 'master' of gitlab.lrz.de:vadere/vadere
parents
12046d17
2a34665d
Changes
5
Hide whitespace changes
Inline
Side-by-side
VadereGui/resources/messages.properties
View file @
bdfbf052
...
@@ -51,7 +51,7 @@ DataProcessingView.msgFileEmpty=File name can't be empty
...
@@ -51,7 +51,7 @@ DataProcessingView.msgFileEmpty=File name can't be empty
DataProcessingView.msgFileInUse
=
File name is already in use
DataProcessingView.msgFileInUse
=
File name is already in use
DataProcessingView.dialogInvalidFile.label
=
Invalid file name
DataProcessingView.dialogInvalidFile.label
=
Invalid file name
DataProcessingView.dialogOutputDataKeySelection.label
=
Data Key
DataProcessingView.dialogOutputDataKeySelection.label
=
Data Key
DataProcessingView.dialogOutput
Header
Selection.label
=
Hea
de
r
DataProcessingView.dialogOutput
Indices
Selection.label
=
In
de
x
ProgressPanelDone.text
=
Done
ProgressPanelDone.text
=
Done
ProgressPanelWorking.text
=
Working...
ProgressPanelWorking.text
=
Working...
...
@@ -325,7 +325,7 @@ Tab.Model.insertModelNameSubMenu.title=Main models
...
@@ -325,7 +325,7 @@ Tab.Model.insertModelNameSubMenu.title=Main models
Tab.Pedestrians.title
=
Pedestrians
Tab.Pedestrians.title
=
Pedestrians
Tab.Topography.title
=
Topography
Tab.Topography.title
=
Topography
Tab.Event.title
=
Events
Tab.Event.title
=
Events
Tab.OutputProcessors.title
=
Data processing
GUI
Tab.OutputProcessors.title
=
Data processing
Tab.TopographyCreator.title
=
Topography creator
Tab.TopographyCreator.title
=
Topography creator
Tab.PostVisualization.title
=
Post-Visualization
Tab.PostVisualization.title
=
Post-Visualization
...
...
VadereGui/resources/messages_de_DE.properties
View file @
bdfbf052
...
@@ -50,7 +50,7 @@ DataProcessingView.msgFileEmpty=Datei darf nicht leer sein
...
@@ -50,7 +50,7 @@ DataProcessingView.msgFileEmpty=Datei darf nicht leer sein
DataProcessingView.msgFileInUse
=
Dateiname bereits vorhanden
DataProcessingView.msgFileInUse
=
Dateiname bereits vorhanden
DataProcessingView.dialogInvalidFile.label
=
Ung
\u
00FCltiger Dateiname
DataProcessingView.dialogInvalidFile.label
=
Ung
\u
00FCltiger Dateiname
DataProcessingView.dialogOutputDataKeySelection.label
=
Rubrik
DataProcessingView.dialogOutputDataKeySelection.label
=
Rubrik
DataProcessingView.dialogOutput
Header
Selection.label
=
Kopfzeile
DataProcessingView.dialogOutput
Indices
Selection.label
=
index
ProgressPanelDone.text
=
Fertig
ProgressPanelDone.text
=
Fertig
ProgressPanelWorking.text
=
Arbeite...
ProgressPanelWorking.text
=
Arbeite...
...
...
VadereGui/src/org/vadere/gui/projectview/view/DataProcessingView.java
View file @
bdfbf052
...
@@ -580,11 +580,11 @@ class DataProcessingView extends JPanel implements IJsonView {
...
@@ -580,11 +580,11 @@ class DataProcessingView extends JPanel implements IJsonView {
c
.
gridx
=
0
;
c
.
gridx
=
0
;
c
.
gridy
=
2
;
c
.
gridy
=
2
;
panel
.
add
(
new
JLabel
(
Messages
.
getString
(
"DataProcessingView.dialogOutput
Header
Selection.label"
)+
":"
),
c
);
panel
.
add
(
new
JLabel
(
Messages
.
getString
(
"DataProcessingView.dialogOutput
Indices
Selection.label"
)+
":"
),
c
);
c
.
gridx
=
1
;
c
.
gridx
=
1
;
c
.
gridy
=
2
;
c
.
gridy
=
2
;
panel
.
add
(
new
JLabel
(
outputFile
.
get
Header
()),
c
);
panel
.
add
(
new
JLabel
(
outputFile
.
get
Indices
()),
c
);
c
.
gridx
=
0
;
c
.
gridx
=
0
;
c
.
gridy
=
3
;
c
.
gridy
=
3
;
...
...
VadereSimulator/src/org/vadere/simulator/projects/dataprocessing/outputfile/OutputFile.java
View file @
bdfbf052
...
@@ -29,7 +29,12 @@ import java.util.stream.Stream;
...
@@ -29,7 +29,12 @@ import java.util.stream.Stream;
*/
*/
public
abstract
class
OutputFile
<
K
extends
DataKey
<
K
>>
{
public
abstract
class
OutputFile
<
K
extends
DataKey
<
K
>>
{
private
String
[]
keyHeaders
;
//Note: Only header information from data keys are written in this, therefore, these are the indices
// Each processor attached to this processor itself attaches also headers, but they are not listed in this
// attribute.
private
String
[]
dataIndices
;
/**
/**
* The file name without the path to the file
* The file name without the path to the file
...
@@ -48,8 +53,8 @@ public abstract class OutputFile<K extends DataKey<K>> {
...
@@ -48,8 +53,8 @@ public abstract class OutputFile<K extends DataKey<K>> {
private
VadereWriterFactory
writerFactory
;
private
VadereWriterFactory
writerFactory
;
private
VadereWriter
writer
;
private
VadereWriter
writer
;
protected
OutputFile
(
final
String
...
keyHeader
s
)
{
protected
OutputFile
(
final
String
...
dataIndice
s
)
{
this
.
keyHeaders
=
keyHeader
s
;
this
.
dataIndices
=
dataIndice
s
;
this
.
dataProcessors
=
new
ArrayList
<>();
this
.
dataProcessors
=
new
ArrayList
<>();
this
.
writerFactory
=
VadereWriterFactory
.
getFileWriterFactory
();
this
.
writerFactory
=
VadereWriterFactory
.
getFileWriterFactory
();
}
}
...
@@ -84,7 +89,7 @@ public abstract class OutputFile<K extends DataKey<K>> {
...
@@ -84,7 +89,7 @@ public abstract class OutputFile<K extends DataKey<K>> {
if
(!
isEmpty
())
{
if
(!
isEmpty
())
{
try
(
VadereWriter
out
=
writerFactory
.
create
(
absoluteFileName
))
{
try
(
VadereWriter
out
=
writerFactory
.
create
(
absoluteFileName
))
{
writer
=
out
;
writer
=
out
;
print
Header
(
out
);
print
Indices
(
out
);
this
.
dataProcessors
.
stream
().
flatMap
(
p
->
p
.
getKeys
().
stream
())
this
.
dataProcessors
.
stream
().
flatMap
(
p
->
p
.
getKeys
().
stream
())
.
distinct
().
sorted
()
.
distinct
().
sorted
()
...
@@ -101,16 +106,16 @@ public abstract class OutputFile<K extends DataKey<K>> {
...
@@ -101,16 +106,16 @@ public abstract class OutputFile<K extends DataKey<K>> {
return
this
.
dataProcessors
.
isEmpty
();
return
this
.
dataProcessors
.
isEmpty
();
}
}
private
List
<
String
>
get
FieldHeader
s
()
{
private
List
<
String
>
get
DataIndice
s
()
{
return
composeLine
(
keyHeader
s
,
p
->
Arrays
.
stream
(
p
.
getHeaders
()));
return
composeLine
(
dataIndice
s
,
p
->
Arrays
.
stream
(
p
.
getHeaders
()));
}
}
public
void
print
Header
(
VadereWriter
out
)
{
public
void
print
Indices
(
VadereWriter
out
)
{
writeLine
(
out
,
get
FieldHeader
s
());
writeLine
(
out
,
get
DataIndice
s
());
}
}
public
String
get
Header
()
{
public
String
get
Indices
()
{
return
String
.
join
(
this
.
separator
,
get
FieldHeader
s
());
return
String
.
join
(
this
.
separator
,
get
DataIndice
s
());
}
}
private
void
printRow
(
final
VadereWriter
out
,
final
K
key
)
{
private
void
printRow
(
final
VadereWriter
out
,
final
K
key
)
{
...
@@ -133,7 +138,7 @@ public abstract class OutputFile<K extends DataKey<K>> {
...
@@ -133,7 +138,7 @@ public abstract class OutputFile<K extends DataKey<K>> {
}
}
/**
/**
* Return the column
header
s as string or the empty array.
* Return the column
indice
s as string or the empty array.
*/
*/
public
String
[]
toStrings
(
K
key
)
{
public
String
[]
toStrings
(
K
key
)
{
return
new
String
[]{
key
.
toString
()};
return
new
String
[]{
key
.
toString
()};
...
...
VadereSimulator/tests/org/vadere/simulator/dataprocessing/TestOutputFileAfterMultipleRuns.java
View file @
bdfbf052
...
@@ -40,19 +40,19 @@ public class TestOutputFileAfterMultipleRuns {
...
@@ -40,19 +40,19 @@ public class TestOutputFileAfterMultipleRuns {
@Test
()
@Test
()
public
void
testFileFormatAfterMultipleSimulationRuns
()
{
public
void
testFileFormatAfterMultipleSimulationRuns
()
{
ArrayList
<
String
>
header
AfterFirstRun
=
new
ArrayList
<>();
ArrayList
<
String
>
indices
AfterFirstRun
=
new
ArrayList
<>();
ArrayList
<
String
>
header
AfterSecondRun
=
new
ArrayList
<>();
ArrayList
<
String
>
indices
AfterSecondRun
=
new
ArrayList
<>();
ProcessorManager
manager
=
testScenario
.
getDataProcessingJsonManager
()
ProcessorManager
manager
=
testScenario
.
getDataProcessingJsonManager
()
.
createProcessorManager
(
mainModel
);
.
createProcessorManager
(
mainModel
);
manager
.
initOutputFiles
();
manager
.
initOutputFiles
();
List
<
OutputFile
<?>>
outputFiles
=
testScenario
.
getDataProcessingJsonManager
().
getOutputFiles
();
List
<
OutputFile
<?>>
outputFiles
=
testScenario
.
getDataProcessingJsonManager
().
getOutputFiles
();
outputFiles
.
forEach
(
f
->
header
AfterFirstRun
.
add
(
f
.
get
Header
()));
outputFiles
.
forEach
(
f
->
indices
AfterFirstRun
.
add
(
f
.
get
Indices
()));
manager
.
initOutputFiles
();
manager
.
initOutputFiles
();
outputFiles
.
forEach
(
f
->
header
AfterSecondRun
.
add
(
f
.
get
Header
()));
outputFiles
.
forEach
(
f
->
indices
AfterSecondRun
.
add
(
f
.
get
Indices
()));
assertEquals
(
"Duplicated Processors in OutputFile after multiple Simulations"
,
assertEquals
(
"Duplicated Processors in OutputFile after multiple Simulations"
,
header
AfterFirstRun
,
header
AfterSecondRun
);
indices
AfterFirstRun
,
indices
AfterSecondRun
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment