Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ArduBlock2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
letsgoING
ArduBlock Source
ArduBlock2
Commits
24397566
Commit
24397566
authored
4 years ago
by
Lucas Stratmann
Browse files
Options
Downloads
Patches
Plain Diff
Fixed Variables for SketchBlock
parent
afda6144
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/ardublock/translator/block/control/SketchBlock.java
+23
-19
23 additions, 19 deletions
...a/com/ardublock/translator/block/control/SketchBlock.java
with
23 additions
and
19 deletions
src/main/java/com/ardublock/translator/block/control/SketchBlock.java
+
23
−
19
View file @
24397566
...
@@ -107,28 +107,11 @@ public class SketchBlock extends TranslatorBlock
...
@@ -107,28 +107,11 @@ public class SketchBlock extends TranslatorBlock
Vector
<
SimCode
>
mainVec
=
new
Vector
<
SimCode
>();
Vector
<
SimCode
>
mainVec
=
new
Vector
<
SimCode
>();
Vector
<
SimCode
>
setup
=
new
Vector
<
SimCode
>();
Vector
<
SimCode
>
setup
=
new
Vector
<
SimCode
>();
Vector
<
SimCode
>
loop
=
new
Vector
<
SimCode
>();
Vector
<
SimCode
>
loop
=
new
Vector
<
SimCode
>();
//MainPart
TranslatorBlock
translatorBlock
=
getTranslatorBlockAtSocket
(
0
);
while
(
translatorBlock
!=
null
)
{
SimCode
newSimCode
=
translatorBlock
.
toSim
();
translatorBlock
=
translatorBlock
.
nextTranslatorBlock
();
if
(
newSimCode
!=
null
)
{
mainVec
.
add
(
newSimCode
);
}
}
Map
<
String
,
String
>
numbers
=
translator
.
getNuberMap
();
Map
<
String
,
String
>
bools
=
translator
.
getBooleanMap
();
for
(
String
var
:
numbers
.
keySet
())
{
mainVec
.
add
(
new
CodeIntSet
(
new
SimTypeString
(
var
),
new
SimTypeInt
(
0
)));
}
for
(
String
var
:
bools
.
keySet
())
{
mainVec
.
add
(
new
CodeBoolSet
(
new
SimTypeString
(
var
),
new
SimTypeBool
(
false
)));
}
//Setup
//Setup
translatorBlock
=
getTranslatorBlockAtSocket
(
1
);
TranslatorBlock
translatorBlock
=
getTranslatorBlockAtSocket
(
1
);
while
(
translatorBlock
!=
null
)
while
(
translatorBlock
!=
null
)
{
{
SimCode
newSimCode
=
translatorBlock
.
toSim
();
SimCode
newSimCode
=
translatorBlock
.
toSim
();
...
@@ -152,6 +135,27 @@ public class SketchBlock extends TranslatorBlock
...
@@ -152,6 +135,27 @@ public class SketchBlock extends TranslatorBlock
sim
.
stopSimu
();
sim
.
stopSimu
();
sim
.
resetFunctions
();
sim
.
resetFunctions
();
//MainPart
Map
<
String
,
String
>
numbers
=
translator
.
getNuberMap
();
Map
<
String
,
String
>
bools
=
translator
.
getBooleanMap
();
for
(
String
var
:
numbers
.
keySet
())
{
mainVec
.
add
(
new
CodeIntSet
(
new
SimTypeString
(
var
),
new
SimTypeInt
(
0
)));
}
for
(
String
var
:
bools
.
keySet
())
{
mainVec
.
add
(
new
CodeBoolSet
(
new
SimTypeString
(
var
),
new
SimTypeBool
(
false
)));
}
translatorBlock
=
getTranslatorBlockAtSocket
(
0
);
while
(
translatorBlock
!=
null
)
{
SimCode
newSimCode
=
translatorBlock
.
toSim
();
translatorBlock
=
translatorBlock
.
nextTranslatorBlock
();
if
(
newSimCode
!=
null
)
{
mainVec
.
add
(
newSimCode
);
}
}
SimTypeBool
boolTrue
=
new
SimTypeBool
(
true
);
SimTypeBool
boolTrue
=
new
SimTypeBool
(
true
);
mainVec
.
add
(
new
CodeExecuteFunction
(
"setup"
));
mainVec
.
add
(
new
CodeExecuteFunction
(
"setup"
));
...
...
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