Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
69a56720
Commit
69a56720
authored
Jan 13, 2025
by
Riegel
Browse files
Feat: Add checking of entire ZIP file
parent
d33d54b8
Pipeline
#10900
passed with stage
in 4 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
View file @
69a56720
...
...
@@ -32,6 +32,7 @@ import org.xml.sax.SAXParseException;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Path
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Function
;
...
...
@@ -916,6 +917,65 @@ public class CityDoctorController {
}
}
public
void
startZipFileChecks
(
ValidationConfiguration
config
,
ProgressListener
l
,
boolean
lowMemoryMode
,
Path
outputPath
,
boolean
pdfReports
,
boolean
xmlReports
)
{
if
(
zipArchive
==
null
)
{
logger
.
warn
(
Localization
.
getText
(
"CityDoctorController.noZipFile"
));
}
if
(
lowMemoryMode
)
{
startZipFileCheckStream
(
config
,
outputPath
,
pdfReports
,
xmlReports
);
return
;
}
try
{
Platform
.
runLater
(()
->
{
mainWindow
.
getCheckButton
().
setDisable
(
true
);
mainWindow
.
getErrorTree
().
getRoot
().
getChildren
().
clear
();
mainWindow
.
getGlobalErrorsView
().
getItems
().
clear
();
});
previousCheckers
=
new
HashMap
<>();
zipArchive
.
mountArchive
(
currentConfig
);
config
.
setNumberOfRoundingPlacesInGlobalParameters
(
currentConfig
.
getNumberOfRoundingPlaces
());
config
.
setParserConfig
(
currentConfig
);
int
totalEntries
=
zipArchive
.
getEntries
().
size
();
int
checkedEntries
=
0
;
for
(
CityGmlZipEntry
entry
:
zipArchive
.
getEntries
())
{
if
(
entry
.
getErrorType
()
!=
null
&&
entry
.
getModel
()
==
null
)
{
continue
;
}
model
=
entry
.
getModel
();
currentChecker
=
new
Checker
(
config
,
model
);
currentChecker
.
runChecks
();
previousCheckers
.
put
(
model
,
currentChecker
);
checkedEntries
++;
if
(
l
!=
null
)
{
l
.
updateProgress
((
float
)
checkedEntries
/
totalEntries
);
}
}
Platform
.
runLater
(()
->
{
// apply check results to tree views
updateFeatureTrees
();
updateTree
(
mainWindow
.
getPolygonsView
().
getRoot
());
for
(
CheckError
e
:
model
.
getGlobalErrors
())
{
if
(
e
instanceof
SchematronError
se
)
{
mainWindow
.
getGlobalErrorsView
().
getItems
().
add
(
se
.
getErrorIdString
());
}
}
renderer
.
refresh
();
mainWindow
.
getWriteReportButton
().
setDisable
(
false
);
currentZipEntryManager
.
refresh
();
});
}
finally
{
Platform
.
runLater
(()
->
mainWindow
.
getCheckButton
().
setDisable
(
false
));
}
}
private
void
startZipFileCheckStream
(
ValidationConfiguration
config
,
Path
outputPath
,
boolean
pdfReports
,
boolean
xmlReports
)
{
}
void
updateFeatureTrees
()
{
updateTree
(
mainWindow
.
getBuildingsView
().
getRoot
());
updateTree
(
mainWindow
.
getVegetationView
().
getRoot
());
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
View file @
69a56720
...
...
@@ -239,13 +239,7 @@ public class ZipEntryManager {
checkAllBtn
.
setOnAction
(
e
->
{
disableTaskButtons
();
setEntryListLocked
(
true
);
try
{
dialog
.
show
();
}
finally
{
setEntryListLocked
(
false
);
}
dialog
.
show
();
});
...
...
@@ -344,6 +338,10 @@ public class ZipEntryManager {
decompressAllBtn
.
setDisable
(
true
);
}
public
void
refresh
()
{
populateZipEntryList
(
entryList
.
getSelectionModel
().
getSelectedIndex
());
}
private
String
getErrorText
(
ZipEntryErrorType
error
)
{
switch
(
error
)
{
case
EXCESSIVE_FILESIZE
->
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment