Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OUTDATED Verse-library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
AutonomyCourse_ECEIllinois
OUTDATED Verse-library
Commits
bba24c94
Commit
bba24c94
authored
3 years ago
by
braught2
Browse files
Options
Downloads
Patches
Plain Diff
fix reset mode parsing
parent
141fd30e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pythonparser.py
+7
-5
7 additions, 5 deletions
pythonparser.py
toythermomini.py
+15
-7
15 additions, 7 deletions
toythermomini.py
with
22 additions
and
12 deletions
pythonparser.py
+
7
−
5
View file @
bba24c94
...
@@ -56,10 +56,12 @@ class Reset(Statement):
...
@@ -56,10 +56,12 @@ class Reset(Statement):
def
parseReset
(
node
,
code
):
def
parseReset
(
node
,
code
):
#assume reset is modeType = newMode
#assume reset is modeType = newMode
print
(
str
(
node
.
targets
[
0
]))
if
isinstance
(
node
.
value
,
ast
.
Attribute
):
if
(
"
mode
"
in
str
(
node
.
targets
[
0
].
id
)):
#print("resets " + str(node.value.value.id))
modeType
=
node
.
targets
[
0
]
#print("resets " + str(node.value.attr))
mode
=
node
.
value
if
(
"
Mode
"
in
str
(
node
.
value
.
value
.
id
)):
modeType
=
str
(
node
.
value
.
value
.
id
)
mode
=
str
(
node
.
value
.
attr
)
return
Reset
(
ast
.
get_source_segment
(
code
,
node
),
mode
,
modeType
)
return
Reset
(
ast
.
get_source_segment
(
code
,
node
),
mode
,
modeType
)
return
Reset
(
ast
.
get_source_segment
(
code
,
node
),
None
,
None
)
return
Reset
(
ast
.
get_source_segment
(
code
,
node
),
None
,
None
)
...
@@ -160,7 +162,7 @@ if __name__ == "__main__":
...
@@ -160,7 +162,7 @@ if __name__ == "__main__":
output_dict
.
update
(
input_json
)
output_dict
.
update
(
input_json
)
#TODO: create graph!
...
...
This diff is collapsed.
Click to expand it.
toythermomini.py
+
15
−
7
View file @
bba24c94
...
@@ -18,20 +18,28 @@ class State:
...
@@ -18,20 +18,28 @@ class State:
def
controller
(
posx
,
posy
,
mode
):
def
controller
(
posx
,
posy
,
mode
):
out
stat
e
=
mode
out
mod
e
=
mode
#todo: how would this actually be given
#todo: how would this actually be given
if
(
stat
e
==
Modes
.
NormalA
):
if
(
mod
e
==
Modes
.
NormalA
):
if
posy
<
0
and
posy
>=-
0.0
1
:
if
posy
<
0
and
posy
>=-
0.0
:
posy
=
0
posy
=
0
outstate
=
Modes
.
NormalA
outmode
=
Modes
.
NormalA
if
posy
>
0
and
posy
==-
0.01
:
if
posy
>
10
and
posy
==-
10
:
posy
=
10
outmode
=
Modes
.
NormalB
if
(
mode
==
Modes
.
NormalB
):
if
posy
<
0
and
posy
>=-
0.0
:
posy
=
0
posy
=
0
outstate
=
Modes
.
NormalB
outmode
=
Modes
.
NormalA
if
posy
>
10
and
posy
==-
10
:
posy
=
10
outmode
=
Modes
.
NormalB
return
out
stat
e
return
out
mod
e
#TODO: what is output?
#TODO: what is output?
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