Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
kazoo
Commits
848b7a0a
Commit
848b7a0a
authored
Nov 29, 2021
by
Maxime Perrotin
Browse files
Give proper access to the system state to Python
parent
4dc61ebb
Changes
2
Hide whitespace changes
Inline
Side-by-side
templates/concurrency_view/simulation-adb/node.tmplt
View file @
848b7a0a
...
...
@@ -102,6 +102,9 @@ package body Simulator_Interface is
end
case
;
--
User
code
modified
the
application
state
->
place
it
in
the
full
state
Update_State
(
Full_State
,
User_State
);
--
Uncomment
the
following
line
to
display
the
current
system
state
--
(
useful
when
debugging
the
Python
interface
)
--
Put_Line
(
"[-] Simulator.State: "
&
ASN1_GSER
.
Image
(
User_State
));
end
Process_Event
;
...
...
templates/concurrency_view/simulation-ads/node.tmplt
View file @
848b7a0a
...
...
@@ -22,8 +22,11 @@ package Simulator_Interface is
--
not
visible
here
.
This
is
an
opaque
type
,
but
it
is
tagged
,
--
and
user
provides
function
to
read
/
write
the
application
state
Full_State
:
State_With_Observers
;
--
State
without
observers
,
exported
for
python
ctypes
interfacing
User_State
:
aliased
asn1SccSystem_State
User_State
:
aliased
asn1SccSystem_State
;
--
Interface
to
get
the
system
state
exported
for
python
calls
from
ctypes
function
Get_User_State
return
access
asn1SccSystem_State
is
(
User_State
'Access)
with Export, Convention => C, Link_Name => "global_state";
procedure Simulation_Startup;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment