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
44d14137
Commit
44d14137
authored
Jul 20, 2016
by
Maxime Perrotin
Browse files
Fix SaveTC to text file
parent
2e6fc2c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/asn1_value_editor.py
View file @
44d14137
...
...
@@ -649,11 +649,10 @@ class asn1Editor(QTreeView):
except
:
pass
@
property
def
gser
(
self
,
use_dash
=
False
):
''' Helper API function: return the GSER representation of the data '''
self
.
getVariable
(
dest
=
self
.
asn1Instance
)
res
=
self
.
asn1Instance
.
GSER
()
res
=
vn
.
format_gser
(
self
.
asn1Instance
.
GSER
()
)
return
res
if
use_dash
else
res
.
replace
(
'-'
,
'_'
)
def
to_asn1scc_ctypes
(
self
,
root
,
dest
,
ASN1Mod
,
sort
,
ASN1_AST
):
...
...
@@ -668,7 +667,8 @@ class asn1Editor(QTreeView):
self
.
getVariable
(
root
=
root
,
dest
=
dest
)
def
sendTC
(
self
):
''' Encode and send the TC to the main TASTE binary using message queue or UDP '''
''' Encode and send the TC to the main TASTE binary
using message queue or UDP '''
self
.
getVariable
(
dest
=
self
.
asn1Instance
)
gser
=
vn
.
format_gser
(
self
.
asn1Instance
.
GSER
())
msg
=
"{name}({gser})"
.
format
(
name
=
self
.
treeItem
.
text
(),
gser
=
gser
)
...
...
@@ -677,8 +677,11 @@ class asn1Editor(QTreeView):
self
.
backend
.
sendTC
(
self
.
asn1Instance
)
def
loadTC
(
self
):
''' Load/Decode a TC and populate the values in the model XXX fix this with ctypes'''
filename
=
QFileDialog
.
getOpenFileName
(
self
,
"Open TC"
,
"."
,
"ASN.1 Variable (*.tc)"
)[
0
]
''' Load/Decode a TC and populate the values in the model '''
filename
=
QFileDialog
.
getOpenFileName
(
self
,
"Open TC"
,
"."
,
"ASN.1 Variable (*.tc)"
)[
0
]
if
len
(
filename
)
==
0
:
return
try
:
...
...
@@ -692,7 +695,8 @@ class asn1Editor(QTreeView):
pass
def
dataPath
(
self
,
idx
):
''' Create a textual representation of a field path (e.g. myTM.myChoice.position.x) '''
''' Create a textual representation of a field path
(e.g. myTM.myChoice.position.x) '''
if
not
idx
.
isValid
():
return
''
subpath
=
self
.
dataPath
(
idx
.
parent
())
...
...
@@ -702,7 +706,8 @@ class asn1Editor(QTreeView):
return
subpath
def
pathToIdx
(
self
,
path
,
root
=
None
):
''' Find an index in the model based from a dot-splitted path representation '''
''' Find an index in the model based from a dot-splitted
path representation '''
if
root
is
None
:
root
=
self
.
treeItem
.
index
()
if
len
(
path
)
==
1
:
...
...
@@ -715,7 +720,8 @@ class asn1Editor(QTreeView):
return
result
def
newPlot
(
self
,
fifoId
=-
1
,
meter
=
False
):
''' Add a set of data (based on selected lines) to a new plotter or speedometer '''
''' Add a set of data (based on selected lines) to a new plotter
or speedometer '''
selectedIdxs
=
self
.
selectedIndexes
()
# Count the number of eligible lines for plotting (discard non-numerical types)
eligible
=
[]
...
...
Write
Preview
Supports
Markdown
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