...
 
Commits (38)
......@@ -6,6 +6,9 @@ out
!integrationTest.gradle
# Tables
src/main/resources/mapping/liblouis
src/integrationTest/resources/mapping/liblouis
src/test/resources/mapping/liblouis
# IntelliJ
.idea
......
......@@ -52,11 +52,25 @@ tasks.withType(Test) {
}
// Copy Braille tables from submodule to working dir
task copyBrailleTables(type: Copy) {
def brailleTablesCopySpec = copySpec {
from "$projectDir/third_party/liblouis/tables/"
into "$rootDir/src/main/resources/mapping/liblouis"
}
task copyBrailleTables(type: Copy) {
with brailleTablesCopySpec
into "$projectDir/src/main/resources/mapping/liblouis"
}
task copyBrailleTablesTest(type: Copy) {
with brailleTablesCopySpec
into "$projectDir/src/test/resources/mapping/liblouis"
}
task copyBrailleTablesIntegrationTest(type: Copy) {
with brailleTablesCopySpec
into "$projectDir/src/integrationTest/resources/mapping/liblouis"
}
processResources.dependsOn copyBrailleTables
processResources.dependsOn copyBrailleTablesTest
processResources.dependsOn copyBrailleTablesIntegrationTest
// Abort if files are missing
gradle.taskGraph.afterTask { copyBrailleTables ->
if(copyBrailleTables.state.noSource){
......@@ -65,15 +79,30 @@ gradle.taskGraph.afterTask { copyBrailleTables ->
}
// Delete tables on "clean" task
clean {
delete "$rootDir/src/main/resources/mapping/liblouis"
delete "$projectDir/src/main/resources/mapping/liblouis"
delete "$projectDir/src/test/resources/mapping/liblouis"
delete "$projectDir/src/integrationTest/resources/mapping/liblouis"
}
// Copy native liblouis libraries for major platforms to the resource folder
task copyLibLouisBinary(type: Copy) {
def liblouisBinaryCopySpec = copySpec {
from "$projectDir/third_party/liblouis_bin/bin/"
into "$rootDir/src/main/resources/native/liblouis"
}
task copyLibLouisBinary(type: Copy) {
with liblouisBinaryCopySpec
into "$projectDir/src/main/resources/native/liblouis"
}
task copyLibLouisBinaryTest(type: Copy) {
with liblouisBinaryCopySpec
into "$projectDir/src/test/resources/native/liblouis"
}
task copyLibLouisBinaryIntegrationTest(type: Copy) {
with liblouisBinaryCopySpec
into "$projectDir/src/integrationTest/resources/native/liblouis"
}
processResources.dependsOn copyLibLouisBinary
processResources.dependsOn copyLibLouisBinaryTest
processResources.dependsOn copyLibLouisBinaryIntegrationTest
// Abort if files are missing
gradle.taskGraph.afterTask { copyLibLouisBinary ->
if(copyLibLouisBinary.state.noSource){
......@@ -82,7 +111,9 @@ gradle.taskGraph.afterTask { copyLibLouisBinary ->
}
// Delete libraries on "clean" task
clean {
delete "$rootDir/src/main/resources/native/liblouis"
delete "$projectDir/src/main/resources/native/liblouis"
delete "$projectDir/src/test/resources/native/liblouis"
delete "$projectDir/src/integrationTest/resources/native/liblouis"
}
// Define the main class for the application
......@@ -104,6 +135,5 @@ checkstyleTest {
}
// Needed for Integrationtests
// Needed for integration tests
apply from: "$rootDir/integrationTest.gradle"
sourceSets {
integrationTest {
java.srcDir 'src/integrationTest'
resources.srcDir 'src/test/resources'
java.srcDir 'src/integrationTest/java'
resources.srcDir 'src/integrationTest/resources'
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath
}
......@@ -14,4 +14,4 @@ task integrationTest(type: Test) {
classpath = sourceSets.integrationTest.runtimeClasspath
mustRunAfter test
checkstyleIntegrationTest.enabled = false
}
\ No newline at end of file
}
......@@ -4,6 +4,7 @@ import de.tudresden.inf.mci.brailleplot.commandline.SettingsWriter;
import de.tudresden.inf.mci.brailleplot.configparser.Format;
import de.tudresden.inf.mci.brailleplot.configparser.JavaPropertiesConfigurationParser;
import de.tudresden.inf.mci.brailleplot.configparser.Printer;
import de.tudresden.inf.mci.brailleplot.diagrams.BarChart;
import de.tudresden.inf.mci.brailleplot.printerbackend.PrintDirector;
import de.tudresden.inf.mci.brailleplot.printerbackend.PrinterCapability;
import de.tudresden.inf.mci.brailleplot.printabledata.MatrixData;
......@@ -198,4 +199,6 @@ public class PrintableDataExporterIntegTest {
public void testIsPrintServiceOn() {
Assertions.assertTrue(PrintDirector.isPrintServiceOn());
}
}
......@@ -18,6 +18,8 @@
printer.name=Dummy Printer
printer.mode=normalprinter
printer.brailletable=src/integrationTest/resources/mapping/eurobraille.properties
printer.semantictable=src/integrationTest/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.resolution=0.05
# The following values represent the fixed indentation and maximum technical printing area of the embosser.
......
# JProperties Printer & Format Configuration
#
# Embosser: Index Everest-D V4
# Version 1 Rev. 8 (19-07-19)
#
# Description:
# This is the main configuration file for use with the braille plot application
# when embossing with the 'Index Everest-D V4'.
# The configuration specifies the general printer abilities and defines
# pre-selectable formats for this embosser.
#
# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files
# =============================================================================
### General Printer Properties
### ==========================
printer.name=Dummy Printer
printer.mode=INDEX_EVEREST_D_V4_FLOATINGDOT_PRINTER
printer.brailletable=src/integrationTest/resources/mapping/eurobraille.properties
printer.semantictable=src/integrationTest/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.resolution=0.05
# 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.)
printer.constraint.top=5.0
printer.constraint.left=0
#printer.constraint.width=? TODO: Check out manual, Conduct printing tests with bigger formats
#printer.constraint.height=?
# 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.width=2000
printer.raster.constraint.height=2000
# The following properties define the exact grid spacing.
printer.raster.cellDistance.horizontal=3.6
printer.raster.cellDistance.vertical=4.8
printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
### Format Definitions
### ==================
# A4 Format
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
# A5 Format
format.A5.page.width=148
format.A5.page.height=210
format.A5.margin.top=0
format.A5.margin.left=0
format.A5.margin.bottom=0
format.A5.margin.right=0
# Wide Format
format.wide.page.width=272
format.wide.page.height=210
format.wide.margin.top=0
format.wide.margin.left=0
format.wide.margin.bottom=0
format.wide.margin.right=0
# A3 Format
format.A3.page.width=297
format.A3.page.height=420
format.A3.margin.top=0
format.A3.margin.left=0
format.A3.margin.bottom=0
format.A3.margin.right=0
\ No newline at end of file
......@@ -40,7 +40,18 @@ printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
### Diagram Formatting
### ==================
representation.general.brailleLanguage=DE_BASISSCHRIFT
representation.general.nonexistentDataText=n/a
representation.general.legendKeyword=Legende:
representation.general.maxTitleHeight=2
representation.rasterize.barChart.maxBarThickness=3
representation.rasterize.barChart.minBarThickness=1
representation.rasterize.barChart.padding.title=0
representation.rasterize.barChart.padding.caption=1
representation.rasterize.barChart.padding.groups=2
representation.rasterize.barChart.padding.bars=1
### Format Definitions
### ==================
......
# JProperties Printer, Representation & Format Configuration
#
# Embosser: Default
# Version 2 Rev. 1 (19-09-25)
#
# Description:
# This is the default configuration file for the braille plot application.
# The configuration specifies the default values of required properties.
#
# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files
# =============================================================================
# ATTENTION: Changes to this configuration will affect settings for ALL printer and format definitions which
# are not overriding the defaults.
printer.mode=INDEX_EVEREST_D_V4_FLOATINGDOT_PRINTER
# Semantic Table: LibLouis String -> 6-Dot
printer.semantictable=../mapping/kurzschrift_DE.properties
# Braille (Output Encoding) Table: 6-Dot -> Octet-Stream
printer.brailletable=../mapping/eurobraille.properties
# 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.)
printer.constraint.top=0
printer.constraint.left=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=0
# Overall grid layout / type
printer.raster.type=6-dot
# The following properties define the exact grid spacing. Standard values based on the
# 'Marburg Medium' publication standard as described in the FFI braille technical guideline:
# https://www.ffi.de/assets/Uploads/Technische-Richtlinie-Blindenschrift.pdf
# See also: # https://codes.iccsafe.org/content/ICCA117_12003/chapter-7-communication-elements-and-features#ICCA117.1_2003_Ch07_Sec703
printer.raster.cellDistance.horizontal=3.5
printer.raster.cellDistance.vertical=5.0
printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
### Format Definitions
### ==================
# Default Format Definition (assume A4 portrait)
format.default.page.width=210
format.default.page.height=297
format.default.margin.top=0
format.default.margin.left=10
format.default.margin.bottom=0
format.default.margin.right=0
### Diagram Formatting
### ==================
representation.general.brailleLanguage=DE_BASISSCHRIFT
representation.general.nonexistentDataText=n/a
representation.general.legendKeyword=Legende:
representation.general.maxTitleHeight=2
representation.rasterize.barChart.maxBarThickness=3
representation.rasterize.barChart.minBarThickness=1
representation.rasterize.barChart.padding.title=0
representation.rasterize.barChart.padding.caption=1
representation.rasterize.barChart.padding.groups=2
representation.rasterize.barChart.padding.bars=1
representation.floatingDot.minBarWidth=5
representation.floatingDot.maxBarWidth=30
representation.floatingDot.minBarDist=20
representation.floatingDot.secondAxis=true
representation.floatingDot.frames=true
representation.floatingDot.derivation=false
representation.floatingDot.grid=true
representation.floatingDot.dotFrame=false
representation.floatingDot.barAccumulation=false
# This is a template. Do not define concrete formats in this file. Use the specific user config file for this purpose.
\ No newline at end of file
# JProperties Printer, Representation & Format Configuration
#
# Embosser: Default
# Version 2 Rev. 1 (19-09-25)
#
# Description:
# This is the default configuration file for the braille plot application.
# The configuration specifies the default values of required properties.
#
# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files
# =============================================================================
# ATTENTION: Changes to this configuration will affect settings for ALL printer and format definitions which
# are not overriding the defaults.
printer.mode=INDEX_EVEREST_D_V4_FLOATINGDOT_PRINTER
# Semantic Table: LibLouis String -> 6-Dot
printer.semantictable=../mapping/kurzschrift_DE.properties
# Braille (Output Encoding) Table: 6-Dot -> Octet-Stream
printer.brailletable=../mapping/eurobraille.properties
# 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.)
printer.constraint.top=0
printer.constraint.left=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=0
# Overall grid layout / type
printer.raster.type=6-dot
# The following properties define the exact grid spacing. Standard values based on the
# 'Marburg Medium' publication standard as described in the FFI braille technical guideline:
# https://www.ffi.de/assets/Uploads/Technische-Richtlinie-Blindenschrift.pdf
# See also: # https://codes.iccsafe.org/content/ICCA117_12003/chapter-7-communication-elements-and-features#ICCA117.1_2003_Ch07_Sec703
printer.raster.cellDistance.horizontal=3.5
printer.raster.cellDistance.vertical=5.0
printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
### Format Definitions
### ==================
# Default Format Definition (assume A4 portrait)
format.default.page.width=210
format.default.page.height=297
format.default.margin.top=0
format.default.margin.left=10
format.default.margin.bottom=0
format.default.margin.right=0
### Diagram Formatting
### ==================
representation.general.brailleLanguage=DE_BASISSCHRIFT
representation.general.nonexistentDataText=n/a
representation.general.legendKeyword=Legende:
representation.general.maxTitleHeight=2
representation.rasterize.barChart.maxBarThickness=3
representation.rasterize.barChart.minBarThickness=1
representation.rasterize.barChart.padding.title=0
representation.rasterize.barChart.padding.caption=1
representation.rasterize.barChart.padding.groups=2
representation.rasterize.barChart.padding.bars=1
representation.floatingDot.minBarWidth=20
representation.floatingDot.maxBarWidth=30
representation.floatingDot.minBarDist=20
representation.floatingDot.secondAxis=false
representation.floatingDot.frames=true
representation.floatingDot.derivation=true
representation.floatingDot.grid=true
representation.floatingDot.dotFrame=false
representation.floatingDot.barAccumulation=true
# This is a template. Do not define concrete formats in this file. Use the specific user config file for this purpose.
\ No newline at end of file
Kat. 1,Kat. 2,Kat. 3,Kat. 4,Kat. 5,Kat. 6,Kat. 7
Reihe a, 1, 2, 3, 4, 5, 6, 7
Reihe b, 7, 6, 5, 4, 3, 2, 1
\ No newline at end of file
Kat.1,Kat.2,Kat.3
Reihe a,3,4,"4,5"
Reihe b,"2,5",3,3
Reihe c,1,2,1
\ No newline at end of file
Korrelation1, ,"0,775255855182511","0,368073028744226","-0,0774355545549314","-0,158207901088214","-0,464863232969655","2,07683093359049","1,27292229424623","-1,02596213809209","-0,854175692692707","1,38823054990049","-0,207836908356637","0,107874230900401","0,818959587710846","0,544567814825666","-0,321992064584128","-0,450074995956481","0,328970397488688","-0,436664519369822","-2,13335127011001","-0,839941481387212","-2,09875543647225","1,19742513601418","-0,276105439727616","-0,610991782950308","-0,0560724636385776","1,2331290918756","-0,907687048027049","-0,956025442806663","-0,527918112380859","0,757936804391244","0,137724759386039","-1,57677227006678","0,654946026196366","-0,26122715703075","-0,154789151545368","-1,52876868873593","1,33596255776509","-0,95126735683135","-0,277919386342344","2,39483134951234","1,59086679030819","0,0867213038037117","-0,79526627893767","-0,697698738721855","0,546833020211353","-0,403713941914105","0,356662777189158","-0,412090846784257","0,471304043776305","1,05889040159954","-0,393467709826672","0,950884825504436","0,607746708941546","-0,210990404298049","0,574577454695953","0,917374981927551","0,0293844837112733","-0,493288924992868","0,548244585523835","0,702015603637678","1,94503393348227","0,713268308476276","-1,10265201344636","0,654274187877809","1,8769863730218","0,474297623145664","-0,530334881361105","-0,798140494840105","-2,25463167747514","0,983358588193768","0,544557382059903","-0,715766751957465","1,55205664613983","-2,52601250478268","-0,26340239930583","-0,097813556724421","-0,00215430582924243","-2,28130598921141","-1,43171619696485","0,668363136446143","-1,37843620203228","-0,214814420431987","0,0384439132847524","2,49593193895137","-0,880630255488722","0,896843659569798","1,04551683672223","0,680175035521527","0,689468913255014","0,883090514642645","0,91438381637687","2,26561703625526","-0,462227050198113","-0,494210079830744","-2,05062595903835","-1,22104222911583","0,850814403760617","0,935481075864822","-0,448819856581585","-1,11535649339491"
, "0,961407177631217","0,794841154752386","0,561434842240607","0,277772019818003","0,420737521592057","0,875311031988873","0,852852664629006","0,120060350573251","0,0746577739446822","0,767924215630629","0,51160989982783","0,136236250725291","0,929508146510451","0,405555604470102","0,0698313994390896","0,439711821236919","0,419527273059355","0,395765274364416","0,406599523606838","0,0995899597653276","0,162571928573699","0,729181152584596","0,58391704358175","0,637928332977225","0,84058774584428","0,773535784350505","0,259761580002888","0,841933576525812","0,500446867210304","0,925827099269501","0,681602254426131","0,453116481109165","0,911487200754364","0,434489333400949","0,41486581399494","0,286590491867084","0,821969364684118","0,647216892360936","0,665176081456778","0,80298561765056","0,934697826628607","0,265140831811931","0,128456440317435","0,400159266247005","0,156037221405436","0,593930132530912","0,442748102930403","0,445682682877042","0,2431848877058","0,533587882099505","0,192375080113062","0,42953448479606","0,627570487183083","0,900023974506623","0,660290946261442","0,559005273068119","0,559495147021275","0,678934116024012","0,678845773012475","0,858993802756294","0,825229855982673","0,875423750609057","0,54633785543968","0,298121172659163","0,922065872058222","0,751668072763604","0,477791672327832","0,0211159017296035","0,0273759812117941","0,952315727648515","0,56087670528002","0,239749942817194","0,990378969678848","0,00480709034802364","0,600451805234899","0,206631519543427","0,578798699068027","0,0145708922103312","0,401916917893654","0,544173941917234","0,512936589030865","0,207743732221143","0,555775955268869","0,995179382889499","0,26881646727796","0,555892222430879","0,807998529274282","0,806387503228604","0,78953800475505","0,598266556711831","0,794225483195215","0,961494201633229","0,645236715955924","0,00309228999439501","0,0377710413561887","0,0290383608730992","0,988356584088962","0,930774465588913","0,271028387333026","0,517802218454568"
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
# JProperties Semantic 6-Dot Mapping BrailleTable
#
# Table: basic_DE
# Version 1 Rev. 1 (19-08-20)
#
# Description:
# This table contains a mapping from letters to a 6*n-bit-string, representing the braillecell.
# It's used by the BrailleTextRasterizer.
# Sometimes, there are cases where we need more then one braillecell, these are then comma seperated.
# =============================================================================
#Special characters
# Space
\u0020=000000
# Exclamation mark
\u0021=011010
?=010001
.=001000
,=010000
:=010010
+=000100,011010
-=001001
/=000010,010000
%=001111,010110,001011
ß=011101
ü=110011
ö=010101
ä=001110
&=111101
@=000100,001110
*=000001,001010
°=000100,001011
_=000100,000111
|=000111,111000
[=000001,011011
]=000001,011011
{=000011,011011
}=000011,011011
# = character
\u003D=000100,011011
\u0023=001111
# Numbers
1=100000
2=110000
3=100100
4=100110
5=100010
6=110100
7=110110
8=110010
9=010100
0=010110
NUM=001111
# a-z
a=100000
b=110000
c=100100
d=100110
e=100010
f=110100
g=110110
h=110010
i=010100
j=010110
k=101000
l=111000
m=101100
n=101110
o=101010
p=111100
q=111110
r=111010
s=011100
t=011110
u=101001
v=111001
w=010111
x=101101
y=101111
z=101011
CAP=000101
# Suspension Braille
SUS=000001
# JProperties Semantic 6-Dot Mapping BrailleTable
#
# Table: kurzschrift_DE
# Version 1 Rev. 1 (30-08-20)
#
# Description:
# This table contains a mapping from letters to a 6*n-bit-string, representing the braillecell.
# It's used by the BrailleTextRasterizer.
# All the chars which need more than one braillecell are already taken into consideration in the
# kurzschrift table. Mostly taken form the de-chardefs6.cti.
# =============================================================================
#Special characters
# Space
\u0020=000000
# Exclamation mark
\u0021=011010
?=010001
.=001000
,=010000
\:=010010
-=001001
ß=011101
'=000001
# = character
)=011011
(=011011
\u0023=001111
=000111
+=011010
~=000010
"=000100
>=000110
;=011000
*=001010
-=001001
<=000011
_=000111
^=110111
\==011110
/=010011
$=000101
|=001100
{=111011
}=011111
`=001110
%=111111
&=111101
# Numbers
1=100000
2=110000
3=100100
4=100110
5=100010
6=110100
7=110110
8=110010
9=010100
0=010110
# a-z
a=100000
b=110000
c=100100
d=100110
e=100010
f=110100
g=110110
h=110010
i=010100
j=010110
k=101000
l=111000
m=101100
n=101110
o=101010
p=111100
q=111110
r=111010
s=011100
t=011110
u=101001
v=111001
w=010111
x=101101
y=101111
z=101011
......@@ -26,7 +26,7 @@ import static java.lang.StrictMath.ceil;
* @author Leonard Kupper, Georg Graßnick
* @version 2019.07.29
*/
final class UniformTextureBarChartRasterizer implements Rasterizer<BarChart> {
public final class UniformTextureBarChartRasterizer implements Rasterizer<BarChart> {
BarChart mDiagram;
RasterCanvas mCanvas;
......@@ -52,7 +52,7 @@ final class UniformTextureBarChartRasterizer implements Rasterizer<BarChart> {
/**
* Constructor. Create a new rasterizer for instances of {@link BarChart}.
*/
UniformTextureBarChartRasterizer() {
public UniformTextureBarChartRasterizer() {
mAxisRasterizer = new LinearMappingAxisRasterizer();
//mLegendRasterizer = new LegendRasterizer();
}
......
package de.tudresden.inf.mci.brailleplot;
import de.tudresden.inf.mci.brailleplot.App;
import de.tudresden.inf.mci.brailleplot.configparser.ConfigurationParsingException;
import de.tudresden.inf.mci.brailleplot.rendering.LiblouisBrailleTextRasterizer;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.io.File;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -15,5 +20,17 @@ public class AppTest {
assertEquals(mApp, App.getInstance());
}
@Test
public void smokeTest() {
LiblouisBrailleTextRasterizer.initModule();
Assertions.assertEquals(0, mApp.run(new String[]{
"-i",
"-p", "src/test/resources/config/dummyprinter.properties",
"-c", "src/test/resources/examples_csv/2_line_chart.csv",
"-d", "LineChart",
"-t", "title",
"-x", "X Axis",
"-y", "Y Axis"}));
}
// TODO Add system tests
}
......@@ -37,7 +37,7 @@ public class JavaPropertiesConfigurationParserTest {
@Test
public void testCorrectValues() {
// default values - not overwritten
Assertions.assertEquals(200, mPrinterConfig.getProperty("raster.constraint.width").toDouble());
Assertions.assertEquals(30, mPrinterConfig.getProperty("raster.constraint.width").toDouble());
Assertions.assertEquals("6-dot", mPrinterConfig.getProperty("raster.type").toString());
Assertions.assertEquals(10, mFormatConfig.getProperty("margin.bottom").toInt());
......@@ -47,7 +47,6 @@ public class JavaPropertiesConfigurationParserTest {
// values without default
Assertions.assertEquals("Dummy Printer", mPrinterConfig.getProperty("name").toString());
Assertions.assertEquals(0.05, mPrinterConfig.getProperty("floatingDot.resolution").toDouble());
}
@Test
......@@ -60,7 +59,7 @@ public class JavaPropertiesConfigurationParserTest {
@Test
public void testFallbackProperties() {
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 specifiedByConfig[] = {"name", "mode", "constraint.top", "constraint.left", "raster.dotDistance.horizontal", "raster.dotDistance.vertical", "raster.cellDistance.horizontal", "raster.cellDistance.vertical", "raster.dotDiameter", "brailletable"};
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
......
......@@ -23,7 +23,7 @@ class CsvDotParserTest {
@BeforeAll
static void initialize() throws Exception {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream csvStream = classloader.getResourceAsStream("examples.csv/1_scatter_plot.csv");
InputStream csvStream = classloader.getResourceAsStream("examples_csv/1_scatter_plot.csv");
assert csvStream != null;
Reader csvReader = new BufferedReader(new InputStreamReader(csvStream));
parser = new CsvParser(csvReader, ',', '\"');
......
package de.tudresden.inf.mci.brailleplot.csvparser;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class CsvOrientationTest {
@Test
public void testCsvOrientation() {
Assertions.assertEquals(CsvOrientation.fromString("vertical"), CsvOrientation.VERTICAL);
Assertions.assertEquals(CsvOrientation.fromString("h"), CsvOrientation.HORIZONTAL);
Assertions.assertDoesNotThrow(() -> {
CsvOrientation.CsvOrientationConverter or = new CsvOrientation.CsvOrientationConverter();
Assertions.assertEquals(or.convert("vertical"),CsvOrientation.VERTICAL);
});
}
}
......@@ -23,7 +23,7 @@ class CsvXAlignedCategoriesParserTest {
@BeforeAll
static void initialize() throws Exception {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream csvStream = classloader.getResourceAsStream("examples.csv/0_bar_chart_categorical.csv");
InputStream csvStream = classloader.getResourceAsStream("examples_csv/0_bar_chart_categorical.csv");
assert csvStream != null;
Reader csvReader = new BufferedReader(new InputStreamReader(csvStream));
parser = new CsvParser(csvReader, ',', '\"');
......
......@@ -23,7 +23,7 @@ class CsvXAlignedParserTest {
@BeforeAll
static void initialize() throws Exception {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
InputStream csvStream = classloader.getResourceAsStream("examples.csv/0_bar_chart.csv");
InputStream csvStream = classloader.getResourceAsStream("examples_csv/0_bar_chart.csv");
assert csvStream != null;
Reader csvReader = new BufferedReader(new InputStreamReader(csvStream));
parser = new CsvParser(csvReader, ',', '\"');
......
package de.tudresden.inf.mci.brailleplot.printabledata;
import de.tudresden.inf.mci.brailleplot.rendering.language.BrailleLanguage;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class BrailleCell6Test {
public static BrailleCell6<Boolean> cell;
@Test
@BeforeAll
public static void setUp() {
Assertions.assertDoesNotThrow(() -> {
cell = new BrailleCell6<>(true,true,true,true,true,true);
});
}
@Test
public void testGetters() {
Assertions.assertEquals(cell.get(0), true);
Assertions.assertEquals(cell.get(1), true);
Assertions.assertEquals(cell.get(2), true);
Assertions.assertEquals(cell.get(3), true);
Assertions.assertEquals(cell.get(4), true);
Assertions.assertEquals(cell.get(5), true);
Assertions.assertEquals(cell.getBitRepresentationFromBool(), "111111");
}
@Test
public void testSetters() {
Assertions.assertDoesNotThrow(() -> {
cell.set(2, false);
Assertions.assertEquals(cell.get(2), false);
cell.toString();
cell.data();
});
}
}
package de.tudresden.inf.mci.brailleplot.rendering;
import de.tudresden.inf.mci.brailleplot.layout.Rectangle;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;
/**
* Not the best design, but it does what it needs to do.
* @author Andrey Ruzhanskiy
* @version 28.09.2019
*/
public class AxisTest {
@BeforeAll
public static void testConstructorValid() {
Assertions.assertDoesNotThrow(() -> {
Axis xAxis = new Axis(Axis.Type.X_AXIS,0,0,0.5,1);
Axis yAxis = new Axis(Axis.Type.Y_AXIS,0,0,0.5,1);
});
}
@Test
public void testMethodsDoNotThrow() {
Axis xAxis = new Axis(Axis.Type.X_AXIS,0,0,0.5,1);
Assertions.assertDoesNotThrow(() -> {
xAxis.getStepWidth();
xAxis.getType();
xAxis.getOriginX();
xAxis.getOriginY();
xAxis.getTickSize();
xAxis.setLabels(new HashMap<Integer, String>());
xAxis.setBoundary(new Rectangle(0,0,0,0));
});
}
@Test
public void testGetters() {
Axis xAxis = new Axis(Axis.Type.X_AXIS,0.5,0,1,2);
Assertions.assertEquals(Axis.Type.X_AXIS, xAxis.getType());
Assertions.assertEquals(0.5, xAxis.getOriginX());
Assertions.assertEquals(0, xAxis.getOriginY());
Assertions.assertEquals(1, xAxis.getStepWidth());
Assertions.assertEquals(2, xAxis.getTickSize());
HashMap<Integer, String> test = new HashMap<Integer, String>();
xAxis.setLabels(test);
Assertions.assertEquals(test, xAxis.getLabels());
Rectangle rect = new Rectangle(0,0,0,0);
xAxis.setBoundary(rect);
Assertions.assertEquals(xAxis.hasLabels(), true);
Assertions.assertEquals(xAxis.hasBoundary(), true);
Assertions.assertEquals(xAxis.getBoundary(), rect);
}
@Test
public void testWrongTickSize() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
Axis wrongTick = new Axis(Axis.Type.X_AXIS,0.5,0,0,0);
});
}
}
package de.tudresden.inf.mci.brailleplot.rendering;
import de.tudresden.inf.mci.brailleplot.layout.Rectangle;
import de.tudresden.inf.mci.brailleplot.rendering.language.BrailleLanguage;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class BrailleTextTest {
@Test
public void setUp() {
Assertions.assertDoesNotThrow(() -> {
BrailleText text = new BrailleText("test", new Rectangle(0, 0, 0, 0), BrailleLanguage.Language.DE_BASISSCHRIFT);
});
}
}
package de.tudresden.inf.mci.brailleplot.rendering.language;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class BrailleLanguageTest {
@Test
public void testEnums() {
Assertions.assertEquals(BrailleLanguage.getCorrectLanguage(BrailleLanguage.Language.DE_BASISSCHRIFT),"de-g0.utb"
);
Assertions.assertEquals(BrailleLanguage.getCorrectLanguage(BrailleLanguage.Language.GERMAN_BASISSCHRIFT),"de-g0.utb"
);
Assertions.assertEquals(BrailleLanguage.getCorrectLanguage(BrailleLanguage.Language.DE_KURZSCHRIFT),"de-g2.ctb"
);
Assertions.assertEquals(BrailleLanguage.getCorrectLanguage(BrailleLanguage.Language.GERMAN_KURZSCHRIFT),"de-g2.ctb"
);
Assertions.assertEquals(BrailleLanguage.getCorrectLanguage(BrailleLanguage.Language.DE_VOLLSCHRIFT),"de-g1.ctb"
);
Assertions.assertEquals(BrailleLanguage.getCorrectLanguage(BrailleLanguage.Language.GERMAN_VOLLSCHRIFT),"de-g1.ctb"
);
Assertions.assertThrows(RuntimeException.class, () -> {
BrailleLanguage.getCorrectLanguage(null);
});
Assertions.assertDoesNotThrow(() -> {
BrailleLanguage lang = new BrailleLanguage();
});
}
}
......@@ -18,7 +18,6 @@
printer.name=Dummy Printer
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.resolution=0.05
# 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.)
......@@ -31,19 +30,8 @@ printer.raster.cellDistance.vertical=4.8
printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
printer.raster.constraint.height=28
### Format Definitions
### ==================
# A4 Format
format.A4.page.width=210
format.A4.page.height=297
format.A4.margin.left=0
# A5 Format
format.A5.page.width=148
format.A5.page.height=210
format.A5.margin.top=0
format.A5.margin.left=0
format.A5.margin.bottom=0
format.A5.margin.right=0
\ No newline at end of file
include-file standard_formats
# JProperties Printer & Format Configuration
#
# Embosser: Index Everest-D V4
# Version 1 Rev. 8 (19-07-19)
#
# Description:
# This is the main configuration file for use with the braille plot application
# when embossing with the 'Index Everest-D V4'.
# The configuration specifies the general printer abilities and defines
# pre-selectable formats for this embosser.
#
# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files
# =============================================================================
### General Printer Properties
### ==========================
printer.name=Dummy Printer
printer.mode=normalprinter
printer.brailletable=src/integrationTest/resources/mapping/eurobraille.properties
printer.semantictable=src/integrationTest/resources/mapping/kurzschrift_DE.properties
printer.floatingDot.resolution=0.05
# 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.)
printer.constraint.top=5.0
printer.constraint.left=0
#printer.constraint.width=? TODO: Check out manual, Conduct printing tests with bigger formats
#printer.constraint.height=?
# 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.width=35
printer.raster.constraint.height=29
# The following properties define the exact grid spacing.
printer.raster.cellDistance.horizontal=3.6
printer.raster.cellDistance.vertical=4.8
printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
### Format Definitions
### ==================
# A4 Format
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
# A5 Format
format.A5.page.width=148
format.A5.page.height=210
format.A5.margin.top=0
format.A5.margin.left=0
format.A5.margin.bottom=0
format.A5.margin.right=0
# Wide Format
format.wide.page.width=272
format.wide.page.height=210
format.wide.margin.top=0
format.wide.margin.left=0
format.wide.margin.bottom=0
format.wide.margin.right=0
\ No newline at end of file
# JProperties Printer & Format Configuration
# JProperties Printer, Representation & Format Configuration
#
# Embosser: Dummy Default
# Test Revision (19-09-25) (DON'T USE FOR PRINTING)
# Embosser: Default
# Version 2 Rev. 1 (19-09-25)
#
# Description:
# This is the default configuration file for the braille plot application.
......@@ -13,9 +13,12 @@
# ATTENTION: Changes to this configuration will affect settings for ALL printer and format definitions which
# are not overriding the defaults.
printer.mode=normalprinter
printer.semantictable=src/main/resources/mapping/kurzschrift_DE.properties
# Semantic Table: LibLouis String -> 6-Dot
printer.semantictable=../mapping/kurzschrift_DE.properties
# Braille (Output Encoding) Table: 6-Dot -> Octet-Stream
printer.brailletable=../mapping/eurobraille.properties
# 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.)
......@@ -25,8 +28,6 @@ printer.constraint.left=0
# 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=0
printer.raster.constraint.width=200
printer.raster.constraint.height=300
# Overall grid layout / type
printer.raster.type=6-dot
......@@ -40,22 +41,24 @@ printer.raster.cellDistance.vertical=5.0
printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
printer.raster.constraint.width=30
### Format Definitions
### ==================
# Default Format Definition
# Default Format Definition (assume A4 portrait)
format.default.page.width=210
format.default.page.height=297
format.default.margin.top=10
format.default.margin.left=10
format.default.margin.top=0
format.default.margin.left=0
format.default.margin.bottom=10
format.default.margin.right=10
format.default.margin.right=0
### Diagram Formatting
### ==================
representation.general.brailleLanguage=DE_KURZSCHRIFT
representation.general.brailleLanguage=DE_BASISSCHRIFT
representation.general.nonexistentDataText=n/a
representation.general.legendKeyword=Legende:
representation.general.maxTitleHeight=2
......@@ -65,5 +68,14 @@ representation.rasterize.barChart.padding.title=0
representation.rasterize.barChart.padding.caption=1
representation.rasterize.barChart.padding.groups=2
representation.rasterize.barChart.padding.bars=1
representation.floatingDot.minBarWidth=20
representation.floatingDot.maxBarWidth=30
representation.floatingDot.minBarDist=20
representation.floatingDot.secondAxis=true
representation.floatingDot.frames=true
representation.floatingDot.derivation=true
representation.floatingDot.grid=true
representation.floatingDot.dotFrame=false
representation.floatingDot.barAccumulation=false
# This is a template. Do not define concrete formats in this file. Use the specific user config file for this purpose.
\ No newline at end of file
# JProperties Printer & Format Configuration
#
# Embosser: Index Everest-D V4
# Version 2 Rev. 2 (19-09-10)
#
# Description:
# This is the main configuration file for use with the braille plot application
# when embossing with the 'Index Everest-D V4'.
# The configuration specifies the general printer abilities and defines
# pre-selectable formats for this embosser.
#
# https://gitlab.hrz.tu-chemnitz.de/s9444737--tu-dresden.de/brailleplot/wikis/Software%20Design#configuration-files
# =============================================================================
### General Printer Properties
### ==========================
printer.name=Dummy Printer
# 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.
# If the outputs don't fit on the page you might want to tweak this values. (Check the format too.)
printer.constraint.top=3.0
printer.constraint.left=5.0
#printer.constraint.width=? TODO: Check out manual, Conduct printing tests with bigger formats
#printer.constraint.height=?
# 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=0
printer.raster.constraint.width=35
printer.raster.constraint.height=29
# The following properties define the exact grid spacing.
printer.raster.cellDistance.horizontal=3.6
printer.raster.cellDistance.vertical=4.8
printer.raster.dotDistance.horizontal=2.5
printer.raster.dotDistance.vertical=2.5
printer.raster.dotDiameter=1.5
### Format Definitions
### ==================
# Standard formats
include-file standard_formats
# Wide Format (non standard, only for testing)
format.wide.page.width=272
format.wide.page.height=210
format.wide.margin.top=0
format.wide.margin.left=0
format.wide.margin.bottom=0
format.wide.margin.right=0
\ No newline at end of file
# JProperties Format Configuration
#
# Version 2 Rev. 0 (19-10-05)
#
# Description:
# 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
# =============================================================================
### A4 Format Standard
### ===================
format.A4.page.width=210
format.A4.page.height=297
### A4 Landscape Format
### ===================
format.A4L.page.width=297
format.A4L.page.height=210
### A5 Format Standard
### ===================
format.A5.page.width=148
format.A5.page.height=210
### 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
Erste Gruppe,"2,14577671155962","3,83957088149638","2,74381418592686","4,44040259535766","3,05835335915677","3,51347910532925","4,50752129340682","3,10684847076423"
,"1,86189289220467","0,845650622246947","1,62491581811196","0,716873892169058","1,07960644510134","1,25420442725184","0,868213570630901","0,3131242131342"
Zweite Gruppe,"2,13687514878477","1,0900468273911","0,202664216808808","-0,117994978447507","1,91197730783847","0,472235461102831","1,01858439429409","1,54912208686837"
,"0,983807817453276","2,34845526278731","0,785524371519466","0,220854402806683","1,77117365732932","3,01226487117459","-0,327141232914824","-0,210388758733043"
Dritte Gruppe,"4,11271848986168","4,99244908180646","5,98316851481515","4,95765061866595","4,00636404848764","5,49799175180235","4,34309770180236","5,36675690932105"
,"5,09261289722065","4,92838187744164","4,47540951345638","3,45104975190378","5,64998407245105","4,88914941630864","5,92876353824873","6,67452703834106"
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
# JProperties Semantic 6-Dot Mapping BrailleTable
#
# Table: basic_DE
# Version 1 Rev. 1 (19-08-20)
#
# Description:
# This table contains a mapping from letters to a 6*n-bit-string, representing the braillecell.
# It's used by the BrailleTextRasterizer.
# Sometimes, there are cases where we need more then one braillecell, these are then comma seperated.
# =============================================================================
#Special characters
# Space
\u0020=000000
# Exclamation mark
\u0021=011010
?=010001
.=001000
,=010000
:=010010
+=000100,011010
-=001001
/=000010,010000
%=001111,010110,001011
ß=011101
ü=110011
ö=010101
ä=001110
&=111101
@=000100,001110
*=000001,001010
°=000100,001011
_=000100,000111
|=000111,111000
[=000001,011011
]=000001,011011
{=000011,011011
}=000011,011011
# = character
\u003D=000100,011011
\u0023=001111
# Numbers
1=100000
2=110000
3=100100
4=100110
5=100010
6=110100
7=110110
8=110010
9=010100
0=010110
NUM=001111
# a-z
a=100000
b=110000
c=100100
d=100110
e=100010
f=110100
g=110110
h=110010
i=010100
j=010110
k=101000
l=111000
m=101100
n=101110
o=101010
p=111100
q=111110
r=111010
s=011100
t=011110
u=101001
v=111001
w=010111
x=101101
y=101111
z=101011
CAP=000101
# Suspension Braille
SUS=000001
# JProperties Semantic 6-Dot Mapping BrailleTable
#
# Table: kurzschrift_DE
# Version 1 Rev. 1 (30-08-20)
#
# Description:
# This table contains a mapping from letters to a 6*n-bit-string, representing the braillecell.
# It's used by the BrailleTextRasterizer.
# All the chars which need more than one braillecell are already taken into consideration in the
# kurzschrift table. Mostly taken form the de-chardefs6.cti.
# =============================================================================
#Special characters
# Space
\u0020=000000
# Exclamation mark
\u0021=011010
?=010001
.=001000
,=010000
\:=010010
-=001001
ß=011101
'=000001
# = character
)=011011
(=011011
\u0023=001111
=000111
+=011010
~=000010
"=000100
>=000110
;=011000
*=001010
-=001001
<=000011
_=000111
^=110111
\==011110
/=010011
$=000101
|=001100
{=111011
}=011111
`=001110
%=111111
&=111101
# Numbers
1=100000
2=110000
3=100100
4=100110
5=100010
6=110100
7=110110
8=110010
9=010100
0=010110
# a-z
a=100000
b=110000
c=100100
d=100110
e=100010
f=110100
g=110110
h=110010
i=010100
j=010110
k=101000
l=111000
m=101100
n=101110
o=101010
p=111100
q=111110
r=111010
s=011100
t=011110
u=101001
v=111001
w=010111
x=101101
y=101111
z=101011
# JProperties Mapping BrailleTable
#
# Table: de-chardefs6
# Version 1 Rev. 2 (19-07-11)
#
# Description:
# This table contains a mapping from 6-bit-strings to decimal ascii byte values.
# It is used by the printer backend to encode data sent to the embosser.
# The pairs are ordered by ascending ascii byte value.
#
# =============================================================================
# 0-31:NUL-US (non visible characters)
# Space
000000=32
# !
000010=33
# "
000100=34
# #
001111=35
# $
000101=36
# %
111111=37
# &
111101=38
# '
000001=39
# (
011001=40
# )
001011=41
# *
001010=42
# +
011010=43
# ,
010000=44
# -
001001=45
# .
001000=46
# /
010011=47
# 0
001101=48
# 1
100001=49
# 2
110001=50
# 3
100101=51
# 4
100111=52
# 5
100011=53
# 6
110101=54
# 7
110111=55
# 8
110011=