Commit baf14e48 authored by Georg Graßnick's avatar Georg Graßnick 🤔
Browse files

Merge branch 'refactor/release_ready-2-57' into 'master'

Refactor/release ready 2 57

See merge request !50
parents 0ff4f179 7921d69e
......@@ -18,7 +18,6 @@
printer.name=Dummy Printer
printer.mode=normalprinter
printer.brailletable=src/integrationTest/resources/mapping/eurobraille.properties
printer.floatingDot.support=true
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......
......@@ -15,7 +15,6 @@
printer.mode=normalprinter
printer.brailletable=src/test/resources/mapping/eurobraille.properties
printer.floatingDot.support=false
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.)
......
......@@ -18,7 +18,6 @@
printer.name=Index Everest-D V4
printer.mode=normalKek
printer.brailletable=src/main/resources/mapping/eurobraille.propertiesKek
printer.floatingDot.support=true
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......
......@@ -18,7 +18,6 @@
printer.name=Index Everest-D V4
printer.mode=normalKek
printer.brailletable=src/main/resources/mapping/eurobraille.properties
printer.floatingDot.support=true
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......
......@@ -166,14 +166,8 @@ public final class App {
// Config Parsing
JavaPropertiesConfigurationParser configParser;
URL defaultConfig = getClass().getClassLoader().getResource("config/default.properties");
if (!settingsReader.isPresent(SettingType.PRINTER_CONFIG_PATH)) { // TODO: exception if missing this argument, until then use default location for test runs
URL configUrl = getClass().getResource("/config/index_everest_d_v4.properties");
configParser = new JavaPropertiesConfigurationParser(configUrl, defaultConfig);
mLogger.warn("ATTENTION! Using default specific config from resources. Please remove default config behavior before packaging the jar.");
} else {
Path configPath = Path.of(settingsReader.getSetting(SettingType.PRINTER_CONFIG_PATH).get());
configParser = new JavaPropertiesConfigurationParser(configPath, defaultConfig);
}
Path configPath = Path.of(settingsReader.getSetting(SettingType.PRINTER_CONFIG_PATH).get());
configParser = new JavaPropertiesConfigurationParser(configPath, defaultConfig);
// Set up Printer, Representation & Format Configurables
Printer printer = configParser.getPrinter();
......@@ -187,13 +181,7 @@ public final class App {
// Parse csv data and create diagram
InputStream csvStream;
if (!settingsReader.isPresent(SettingType.CSV_LOCATION)) {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
csvStream = classloader.getResourceAsStream("examples/csv/0_bar_chart_categorical.csv");
mLogger.warn("ATTENTION! Using example csv. Please remove this behavior before packaging the jar.");
} else {
csvStream = new FileInputStream(settingsReader.getSetting(SettingType.CSV_LOCATION).get());
}
csvStream = new FileInputStream(settingsReader.getSetting(SettingType.CSV_LOCATION).get());
Reader csvReader = new BufferedReader(new InputStreamReader(Objects.requireNonNull(csvStream)));
CsvParser csvParser = new CsvParser(csvReader, ',', '\"');
Diagram diagram;
......
......@@ -50,7 +50,6 @@ public final class JavaPropertiesConfigurationValidator implements Configuration
definePrinterProperty("mode", requireNotEmpty);
definePrinterProperty("brailletable", requireNotEmpty, false); // checked in interpretation
definePrinterProperty("semantictable", requireNotEmpty, false); // before predicate validation
definePrinterProperty("floatingDot.support", requireBoolean);
definePrinterProperty("floatingDot.resolution", requireDouble.and(requirePositive), false);
definePrinterProperty("constraint.top", requireDouble.and(requirePositive));
definePrinterProperty("constraint.left", requireDouble.and(requirePositive));
......
......@@ -14,7 +14,6 @@
# are not overriding the defaults.
printer.mode=normalprinter
printer.floatingDot.support=false
# Semantic Table: LibLouis String -> 6-Dot
printer.semantictable=../mapping/kurzschrift_DE.properties
# Braille (Output Encoding) Table: 6-Dot -> Octet-Stream
......@@ -51,7 +50,7 @@ printer.raster.dotDiameter=1.5
format.default.page.width=210
format.default.page.height=297
format.default.margin.top=0
format.default.margin.left=5
format.default.margin.left=10
format.default.margin.bottom=0
format.default.margin.right=0
......
......@@ -18,7 +18,6 @@
printer.name=Index Everest-D V4
printer.mode=normalprinter
printer.brailletable=src/main/resources/mapping/eurobraille.properties
printer.floatingDot.support=true
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......
......@@ -16,8 +16,8 @@
### ==========================
printer.name=Index Basic-D V3
# The printer mode, available modes are: normalprinter
printer.mode=normalprinter
printer.floatingDot.support=false
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.)
......@@ -44,4 +44,4 @@ printer.raster.dotDiameter=1.5
### ==================
# Standard formats
include standard_formats
\ No newline at end of file
include-file standard_formats
\ No newline at end of file
......@@ -16,8 +16,8 @@
### ==========================
printer.name=Index Everest-D V4
printer.mode=index_everest_d_v4_floatingdot_printer
printer.floatingDot.support=true
# The printer mode, available modes are: normalprinter, index_everest_d_v4_floatingdot_printer
printer.mode=normalprinter
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......@@ -29,7 +29,7 @@ printer.constraint.left=5.0
# The second constraint in the printer.raster namespace helps to limit the available printing area in steps of
# whole cells, for example if the printer enforces a maximum char per line limit or borders are activated.
printer.raster.constraint.top=0
printer.raster.constraint.left=1
printer.raster.constraint.left=0
printer.raster.constraint.width=35
printer.raster.constraint.height=29
......@@ -44,7 +44,7 @@ printer.raster.dotDiameter=1.5
### ==================
# Standard formats
include standard_formats
include-file standard_formats
# Wide Format (non standard, only for testing)
format.wide.page.width=272
......
# JProperties Format Configuration
#
# Version 1 Rev. 1 (19-09-26)
# Version 2 Rev. 0 (19-10-05)
#
# Description:
# This is a collection of predefined formats which can be included in a printer configuration.
# This is a collection of predefined formats which can be included in a printer configuration by adding the following line:
# include standard_formats
#
# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files
# =============================================================================
......@@ -12,26 +13,28 @@
### ===================
format.A4.page.width=210
format.A4.page.height=297
format.A4.margin.top=0
format.A4.margin.left=0
format.A4.margin.bottom=0
format.A4.margin.right=0
### A4 Landscape Format No Margin
### A4 Landscape Format
### ===================
format.A4L.page.width=297
format.A4L.page.height=210
format.A4L.margin.top=0
format.A4L.margin.left=5
format.A4L.margin.bottom=0
format.A4L.margin.right=0
### A5 Format Standard
### ===================
format.A5.page.width=148
format.A5.page.height=210
format.A5.margin.top=0
format.A5.margin.left=10
format.A5.margin.bottom=0
format.A5.margin.right=0
\ No newline at end of file
### A5 Landscape Format
### ===================
format.A5L.page.width=210
format.A5L.page.height=148
### US Letter Format
### ===================
format.Letter.page.width=216
format.Letter.page.height=279
### US Letter Landscape Format
### ===================
format.LetterL.page.width=279
format.LetterL.page.height=216
\ No newline at end of file
Linie1, ,1,7,9,2,10
,1,2,5,4,10
Linie2, ,0,2,7,9,1,4
,3,9,4,2,5,7
\ No newline at end of file
......@@ -43,7 +43,6 @@ public class JavaPropertiesConfigurationParserTest {
// overwritten values
Assertions.assertEquals(true, mPrinterConfig.getProperty("floatingDot.support").toBool());
Assertions.assertEquals(0, mFormatConfig.getProperty("margin.left").toInt());
// values without default
......@@ -61,8 +60,8 @@ public class JavaPropertiesConfigurationParserTest {
@Test
public void testFallbackProperties() {
String specifiedByConfig[] = {"name", "mode", "floatingDot.support", "floatingDot.resolution", "constraint.top", "constraint.left", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter"};
String specifiedByFallback[] = {"mode", "semantictable", "floatingDot.support", "constraint.top", "constraint.left", "raster.constraint.top", "raster.constraint.left", "raster.constraint.width", "raster.constraint.height", "raster.type", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter"};
String specifiedByConfig[] = {"name", "mode", "floatingDot.resolution", "constraint.top", "constraint.left", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter"};
String specifiedByFallback[] = {"mode", "semantictable", "constraint.top", "constraint.left", "raster.constraint.top", "raster.constraint.left", "raster.constraint.width", "raster.constraint.height", "raster.type", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter"};
// config shall extend the fallback
HashSet<String> expectedPropertyNames = new HashSet<>(Arrays.asList(specifiedByConfig));
......@@ -123,7 +122,6 @@ public class JavaPropertiesConfigurationParserTest {
}
@Test
public void testIncompatibleTypeConversion() {
Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("floatingDot.support").toInt());
Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("raster.cellDistance.horizontal").toInt());
Assertions.assertThrows(NumberFormatException.class, () -> mPrinterConfig.getProperty("name").toDouble());
}
......
......@@ -18,7 +18,6 @@
printer.name=Dummy Printer
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.support=true
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......
......@@ -16,7 +16,6 @@
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.support=false
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.)
......
......@@ -16,7 +16,6 @@
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.support=false
# Illegal property name example
printer.garbageProperty=illegal
......
......@@ -15,7 +15,6 @@
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.support=false
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.)
......
......@@ -19,7 +19,6 @@
# printer.name=Dummy Printer
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.support=true
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......
......@@ -13,7 +13,6 @@ printer.name=Dummy Printer
printer.mode=normalprinter
printer.brailletable=src/test/resources/mapping/eurobraille.properties
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.support=true
printer.raster.type=6-dot
# Default grid spacing.
......
......@@ -12,7 +12,6 @@
printer.name=Dummy Printer
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.support=false
printer.raster.type=6-dot
# Default grid spacing.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment