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
61d834ac
Commit
61d834ac
authored
Mar 17, 2020
by
PONCELET
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move network_attitude
parent
29967611
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
260 additions
and
250 deletions
+260
-250
sources/xsf.generator/XSFModel.json
sources/xsf.generator/XSFModel.json
+233
-243
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
+8
-1
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/model/SCGroupAdapter.java
...ava/fr/ifremer/fr/xsf/generator/model/SCGroupAdapter.java
+19
-6
No files found.
sources/xsf.generator/XSFModel.json
View file @
61d834ac
This diff is collapsed.
Click to expand it.
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/model/Group.java
View file @
61d834ac
...
...
@@ -3,15 +3,22 @@ package fr.ifremer.fr.xsf.generator.model;
import
java.util.ArrayList
;
import
java.util.List
;
enum
GroupCategory
{
eStandard
,
eSensor
}
public
class
Group
extends
Base
{
GroupCategory
groupCategory
=
GroupCategory
.
eStandard
;
List
<
Attribute
>
attributes
=
new
ArrayList
<>();
List
<
Type
>
types
=
new
ArrayList
<>();
List
<
Dimension
>
dims
=
new
ArrayList
<>();
List
<
Variable
>
variables
=
new
ArrayList
<>();
List
<
Variable
>
coordinatevariables
=
new
ArrayList
<>();
public
GroupCategory
getGroupCategory
()
{
if
(
groupCategory
==
null
)
return
GroupCategory
.
eStandard
;
//deserialization could lead to null values in this variables
return
groupCategory
;
}
protected
List
<
Group
>
subGroups
=
new
ArrayList
<>();
public
Group
(
String
name
,
String
description
,
String
comment
,
String
obligation
)
{
...
...
sources/xsf.generator/src/main/java/fr/ifremer/fr/xsf/generator/model/SCGroupAdapter.java
View file @
61d834ac
...
...
@@ -77,8 +77,10 @@ public class SCGroupAdapter {
sourceCode
.
add
(
String
.
format
(
"public class %s extends NCGroup {"
,
getClassName
(
group
,
""
)));
// Group name
sourceCode
.
add
(
String
.
format
(
"\n\tpublic static final String GROUP_NAME = \"%s\";"
,
group
.
name
));
//if group is a sensor, group name is computed
if
(
group
.
getGroupCategory
()
==
GroupCategory
.
eStandard
)
sourceCode
.
add
(
String
.
format
(
"\n\tpublic static final String GROUP_NAME = \"%s\";"
,
group
.
name
));
// Dimension name code generation
if
(!
group
.
dims
.
isEmpty
())
{
...
...
@@ -100,10 +102,21 @@ public class SCGroupAdapter {
// Dimension declaration
group
.
dims
.
forEach
(
d
->
sourceCode
.
add
(
SCDimensionAdapter
.
getSourceDeclaration
(
d
)));
// Start constructor
sourceCode
.
add
(
String
.
format
(
"\n\tpublic %s(NCGroup parent, IDataProxy dataProxy) throws NCException {\n\t\tsuper(GROUP_NAME,parent);"
,
getClassName
(
group
,
""
)));
// Start constructor if not a sensor
switch
(
group
.
getGroupCategory
())
{
case
eStandard:
sourceCode
.
add
(
String
.
format
(
"\n\tpublic %s(NCGroup parent, IDataProxy dataProxy) throws NCException {\n\t\tsuper(GROUP_NAME,parent);"
,
getClassName
(
group
,
""
)));
break
;
case
eSensor:
sourceCode
.
add
(
String
.
format
(
"\n\tpublic %s(NCGroup parent, IDataProxy dataProxy, String sensor_id) throws NCException {\n\t\tsuper(sensor_id,parent);"
,
getClassName
(
group
,
""
)));
break
;
}
// Sub groups
if
(!
group
.
subGroups
.
isEmpty
())
{
...
...
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