Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
ac79c3b2
Commit
ac79c3b2
authored
Jul 17, 2016
by
Maxime Perrotin
Browse files
Fix Scenario (sending side)
parent
8d7a65ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/Scenario.py
View file @
ac79c3b2
...
...
@@ -29,18 +29,24 @@ try:
except
ImportError
:
print
'ERROR importing PythonController'
TASTE_INST
=
os
.
popen
(
'taste-config --prefix'
).
readlines
()[
0
].
strip
()
sys
.
path
.
append
(
TASTE_INST
+
'/share/asn1-editor'
)
from
opengeode
import
Asn1scc
as
asn1scc
#TASTE_INST = os.popen('taste-config --prefix').readlines()[0].strip()
#sys.path.append(TASTE_INST + '/share/asn1-editor')
class
Scenario
(
QThread
,
object
):
#done = Signal(int)
''' Generic class handling the execution of an MSC scenario '''
def
__init__
(
self
,
func
):
QThread
.
__init__
(
self
)
self
.
msg_q
=
Queue
.
Queue
()
self
.
modules
=
{}
self
.
scenario
=
func
# Parse the dataview.asn to get the Python AST
dataView
=
asn1scc
.
parse_asn1
([
'dataview-uniq.asn'
],
rename_policy
=
asn1scc
.
ASN1
.
RenameOnlyConflicting
,
ast_version
=
asn1scc
.
ASN1
.
UniqueEnumeratedNames
,
flags
=
[
asn1scc
.
ASN1
.
AstOnly
])
# Control the end of the scenario
self
.
stop_requested
=
False
# Load all TM and TC backends, once for all
...
...
@@ -58,6 +64,8 @@ class Scenario(QThread, object):
.
format
(
b
=
backend
)))
continue
mod
.
setMsgQ
()
# set the ASN.AST into the backend module, needed to convert VN
mod
.
ASN1_AST
=
dataView
.
types
self
.
modules
[
backend
]
=
mod
def
__call__
(
self
,
log
,
name
=
'Scenario'
):
...
...
@@ -182,14 +190,13 @@ class PollerThread(QThread):
while
True
:
if
self
.
stop_requested
:
return
0
msg_received_type
=
RetrieveMessageFromQueue
(
msg_q
,
buffer_size
,
p_data_from_mq
)
msg_received_type
=
RetrieveMessageFromQueue
(
msg_q
,
buffer_size
,
p_data_from_mq
)
if
msg_received_type
==
-
1
:
time
.
sleep
(
0.01
)
continue
else
:
#print('Received message from TASTE message queue, id =',
# msg_received_type)
for
slot
in
self
.
slots
:
slot
.
put
((
msg_received_type
,
p_data_from_mq
))
...
...
asn1_value_editor/asn1_value_editor.py
View file @
ac79c3b2
...
...
@@ -656,10 +656,8 @@ class asn1Editor(QTreeView):
@
property
def
gser
(
self
,
use_dash
=
False
):
''' Helper API function: return the GSER representation of the data '''
# data, = self.getVariable().values()
self
.
getVariable
(
dest
=
self
.
asn1Instance
)
res
=
self
.
asn1Instance
.
GSER
()
# raw = vn.toASN1ValueNotation(data).strip()
return
res
if
use_dash
else
res
.
replace
(
'-'
,
'_'
)
def
to_asn1scc_ctypes
(
self
,
root
,
dest
,
ASN1Mod
,
sort
,
ASN1_AST
):
...
...
asn1_value_editor/vn.py
View file @
ac79c3b2
...
...
@@ -176,6 +176,7 @@ def format_gser(gser):
def
toASN1ValueNotation
(
val
):
''' Create a GSER reprentation of the Python variable '''
# DEPRECATED. No more use of the Python variable
result
=
''
if
isinstance
(
val
,
dict
):
if
'Choice'
in
val
:
...
...
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