Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mbe-tools
TTool
Commits
164cf006
Commit
164cf006
authored
5 years ago
by
Daniela Genius
Browse files
Options
Downloads
Patches
Plain Diff
Stand alone ELN and TDF
parent
e007174e
No related branches found
No related tags found
1 merge request
!140
Master clone
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/elntranslator/toELN/TopCellGenerator.java
+21
-6
21 additions, 6 deletions
src/main/java/elntranslator/toELN/TopCellGenerator.java
src/main/java/ui/window/JDialogELNExecutableCodeGeneration.java
+3
-1
3 additions, 1 deletion
...in/java/ui/window/JDialogELNExecutableCodeGeneration.java
with
24 additions
and
7 deletions
src/main/java/elntranslator/toELN/TopCellGenerator.java
+
21
−
6
View file @
164cf006
...
...
@@ -62,8 +62,11 @@ import elntranslator.*;
public
class
TopCellGenerator
{
public
static
ELNSpecification
eln
;
private
final
static
String
GENERATED_PATH1
=
"generated_CPP"
+
File
.
separator
;
private
final
static
String
GENERATED_PATH2
=
"generated_H"
+
File
.
separator
;
//private final static String GENERATED_PATH1 = "generated_CPP" + File.separator;
//private final static String GENERATED_PATH2 = "generated_H" + File.separator;
private
String
GENERATED_PATH1
=
"generated_CPP"
+
File
.
separator
;
private
String
GENERATED_PATH2
=
"generated_H"
+
File
.
separator
;
public
TopCellGenerator
(
ELNSpecification
_eln
)
{
eln
=
_eln
;
...
...
@@ -93,13 +96,19 @@ public class TopCellGenerator {
return
(
top
);
}
public
void
saveFile
(
String
path
)
{
public
void
saveFile
(
String
path
,
Boolean
standalone
)
{
ELNTCluster
cluster
=
TopCellGenerator
.
eln
.
getCluster
();
LinkedList
<
ELNTConnector
>
connectorsModule
=
TopCellGenerator
.
eln
.
getAllConnectorsInModule
();
LinkedList
<
ELNTConnector
>
connectorsCluster
=
TopCellGenerator
.
eln
.
getAllConnectorsInCluster
();
String
top
;
if
(
standalone
){
GENERATED_PATH1
=
""
;
GENERATED_PATH2
=
""
;
}
try
{
// Save file .cpp
System
.
err
.
println
(
path
+
GENERATED_PATH1
+
cluster
.
getName
()
+
".cpp"
);
...
...
@@ -111,13 +120,19 @@ public class TopCellGenerator {
ex
.
printStackTrace
();
}
// Save files .h
saveFileModule
(
path
,
cluster
,
connectorsModule
);
saveFileModule
(
path
,
cluster
,
connectorsModule
,
standalone
);
}
public
void
saveFileModule
(
String
path
,
ELNTCluster
cluster
,
List
<
ELNTConnector
>
connectors
)
{
public
void
saveFileModule
(
String
path
,
ELNTCluster
cluster
,
List
<
ELNTConnector
>
connectors
,
Boolean
standalone
)
{
LinkedList
<
ELNTModule
>
modules
=
cluster
.
getModule
();
String
code
;
if
(
standalone
){
GENERATED_PATH1
=
""
;
GENERATED_PATH2
=
""
;
}
for
(
ELNTModule
module
:
modules
)
{
try
{
...
...
@@ -131,4 +146,4 @@ public class TopCellGenerator {
}
}
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
src/main/java/ui/window/JDialogELNExecutableCodeGeneration.java
+
3
−
1
View file @
164cf006
...
...
@@ -500,6 +500,8 @@ public class JDialogELNExecutableCodeGeneration extends javax.swing.JFrame imple
// String list;//, data;
// hasError = false;
Boolean
standalone
=
true
;
//are there any GPIO blocks? Currently ELN is always standalone and has no direct connection to SocLib (via TDF: yes)
try
{
if
(
jp1
.
getSelectedIndex
()
==
0
)
{
jta
.
append
(
"Generating executable code (ELN version)\n"
);
...
...
@@ -531,7 +533,7 @@ public class JDialogELNExecutableCodeGeneration extends javax.swing.JFrame imple
pathCode
=
code2
.
getText
();
System
.
err
.
println
(
"ELN TOPCELL : "
+
elnSpec
.
getCluster
().
getName
()
+
"saved in "
+
code2
.
getText
());
topCellGenerator
.
saveFile
(
pathCode
);
topCellGenerator
.
saveFile
(
pathCode
,
standalone
);
jta
.
append
(
"Code saved\n"
);
}
catch
(
Exception
e
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment