Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
XSF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
fleet
formats
XSF
Commits
ee5239bd
Commit
ee5239bd
authored
May 24, 2019
by
PONCELET
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update asciidoctor generator, converging to GFAST
parent
3e33f07e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2993 additions
and
2948 deletions
+2993
-2948
sources/xsf.generator/XSFModel.json
sources/xsf.generator/XSFModel.json
+2972
-2939
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/AsciiDoctorGenerator.java
...ava/fr/ifremer/fr/xsf/generator/AsciiDoctorGenerator.java
+16
-8
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/model/GGroupAdapter.java
...java/fr/ifremer/fr/xsf/generator/model/GGroupAdapter.java
+1
-0
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/model/Group.java
...rc/main/java/fr/ifremer/fr/xsf/generator/model/Group.java
+4
-1
No files found.
sources/xsf.generator/XSFModel.json
View file @
ee5239bd
This diff is collapsed.
Click to expand it.
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/AsciiDoctorGenerator.java
View file @
ee5239bd
...
...
@@ -99,12 +99,12 @@ public class AsciiDoctorGenerator {
// Write group comments
writeLine
(
group
.
getComment
(),
context
.
globalOutput
);
writeLine
(
"include::"
+
computeAdocName
(
group
)+
"[]"
,
context
.
globalOutput
);
writeLine
(
"|==="
,
context
.
globalOutput
);
startTable
(
context
);
writeAttributes
(
group
.
getAttributes
(),
context
);
writeTypes
(
group
.
getTypes
(),
context
);
writeDimensions
(
group
.
getDims
(),
context
);
writeCoordinateVariables
(
group
.
getCoordinateVariables
(),
context
);
writeVariables
(
group
.
getVariables
(),
context
);
endTable
(
context
);
}
...
...
@@ -132,9 +132,6 @@ public class AsciiDoctorGenerator {
for
(
Dimension
v:
dims
)
{
String
value
=
v
.
getName
();
value
+=
":"
;
value
+=
v
.
getName
();
writeTableLine
(
value
,
v
.
getObligation
(),
v
.
getComment
(),
context
);
}
creturn
(
context
.
currentOutput
);
...
...
@@ -154,9 +151,14 @@ public class AsciiDoctorGenerator {
}
}
private
void
writeVariables
(
List
<
Variable
>
variables
,
Context
context
)
throws
IOException
{
private
void
writeCoordinateVariables
(
List
<
Variable
>
variables
,
Context
context
)
throws
IOException
{
if
(
variables
==
null
||
variables
.
isEmpty
())
return
;
reallyWriteVariable
(
"Coordinate variables"
,
variables
,
context
);
}
private
void
reallyWriteVariable
(
String
header
,
List
<
Variable
>
variables
,
Context
context
)
throws
IOException
{
writeSubHeader
(
"Variables"
,
context
);
writeSubHeader
(
header
,
context
);
boolean
first
=
true
;
for
(
Variable
v:
variables
)
{
...
...
@@ -185,6 +187,10 @@ public class AsciiDoctorGenerator {
}
creturn
(
context
.
currentOutput
);
}
private
void
writeVariables
(
List
<
Variable
>
variables
,
Context
context
)
throws
IOException
{
reallyWriteVariable
(
"Variables"
,
variables
,
context
);
}
private
void
writeVariableAttributes
(
List
<
Attribute
>
attributes
,
Context
context
)
throws
IOException
{
for
(
Attribute
v:
attributes
)
{
...
...
@@ -209,7 +215,9 @@ public class AsciiDoctorGenerator {
{
//on utilise des espace insécables pour se conformer à la doc WCFAST
value
+=
"\u00A0=\u00A0"
;
value
+=
v
.
getValue
();
//remove hyphen minus U002D sign with minus sign U2212
value
+=
v
.
getValue
().
replaceAll
(
"\u002D"
,
"\u2212"
).
replaceAll
(
".0f"
,
".0"
);
}
}
...
...
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/model/GGroupAdapter.java
View file @
ee5239bd
...
...
@@ -17,6 +17,7 @@ public class GGroupAdapter implements JsonSerializer<Group> {
object
.
add
(
"types"
,
context
.
serialize
(
value
.
types
));
object
.
add
(
"attributes"
,
context
.
serialize
(
value
.
attributes
));
object
.
add
(
"variables"
,
context
.
serialize
(
value
.
variables
));
object
.
add
(
"coordinatevariables"
,
context
.
serialize
(
value
.
coordinatevariables
));
object
.
add
(
"subGroups"
,
context
.
serialize
(
value
.
subGroups
));
return
object
;
...
...
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/model/Group.java
View file @
ee5239bd
...
...
@@ -9,6 +9,7 @@ public class Group extends Base{
List
<
Type
>
types
=
new
ArrayList
<>();
List
<
Dimension
>
dims
=
new
ArrayList
<>();
List
<
Variable
>
variables
=
new
ArrayList
<>();
List
<
Variable
>
coordinatevariables
=
new
ArrayList
<>();
protected
List
<
Group
>
subGroups
=
new
ArrayList
<>();
...
...
@@ -31,7 +32,9 @@ public class Group extends Base{
public
List
<
Variable
>
getVariables
()
{
return
variables
;
}
public
List
<
Variable
>
getCoordinateVariables
()
{
return
coordinatevariables
;
}
public
List
<
Group
>
getSubGroups
()
{
return
subGroups
;
}
...
...
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