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
8e17d4d9
Commit
8e17d4d9
authored
Jun 26, 2016
by
Maxime Perrotin
Browse files
Fix underscore/dash issue with GUIs (major)
parent
b9a10554
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
8e17d4d9
...
...
@@ -34,6 +34,7 @@ LICENSE: LGPL - see LICENSE file
CHANGELOG:
1.
4.0 - Keep ASN.1 dash in the GUI (change of API)
1.
3.0 - Fully using ctypes / compatible with latest DMT
1.
2.3 - Removed SWIG handling of message queues
1.
2.2 - Fix opengeode simulation mode (startup did not show the right state)
...
...
asn1_value_editor/asn1_value_editor.py
View file @
8e17d4d9
...
...
@@ -16,7 +16,7 @@
__author__
=
"Maxime Perrotin"
__license__
=
"LGPLv3"
__version__
=
"1.
3
.0"
__version__
=
"1.
4
.0"
__url__
=
"http://taste.tuxfamily.org"
import
sys
...
...
@@ -162,7 +162,9 @@ some user data when role >= 32. 32 is Qt.UserRole. '''
val
=
editor
.
value
()
model
.
setData
(
index
,
val
)
# Sequence of: display only the corresponding number of elements
self
.
seqof
.
emit
(
index
.
sibling
(
index
.
row
(),
0
),
val
,
index
.
data
(
MAX_RANGE
))
self
.
seqof
.
emit
(
index
.
sibling
(
index
.
row
(),
0
),
val
,
index
.
data
(
MAX_RANGE
))
elif
asnType
==
'ENUMERATED'
:
val
=
editor
.
currentText
()
model
.
setData
(
index
,
val
)
...
...
@@ -170,7 +172,9 @@ some user data when role >= 32. 32 is Qt.UserRole. '''
val
=
editor
.
currentText
()
model
.
setData
(
index
,
val
)
# display only the corresponding choice definition
self
.
choice
.
emit
(
index
.
sibling
(
index
.
row
(),
0
),
len
(
index
.
data
(
CHOICE_LIST
)),
editor
.
currentIndex
())
self
.
choice
.
emit
(
index
.
sibling
(
index
.
row
(),
0
),
len
(
index
.
data
(
CHOICE_LIST
)),
editor
.
currentIndex
())
elif
asnType
==
'REAL'
:
val
=
editor
.
value
()
model
.
setData
(
index
,
val
)
...
...
@@ -408,7 +412,7 @@ class asn1Editor(QTreeView):
seqOf
=
True
for
i
in
range
(
nbRows
):
name
=
root
.
child
(
i
,
0
).
text
()
name_u
=
name
.
replace
(
'-'
,
'_'
)
name_u
=
name
#
.replace('-', '_')
asnType
=
root
.
child
(
i
,
1
).
text
()
child
=
root
.
child
(
i
,
3
)
if
seqOf
:
...
...
asn1_value_editor/sdlHandler.py
View file @
8e17d4d9
...
...
@@ -827,7 +827,8 @@ class sdlHandler(QObject):
msg
=
'{tc}{arg}'
.
format
(
tc
=
name
,
arg
=
'({})'
.
format
(
param
.
GSER
())
if
param
else
''
)
self
.
add_to_msc
(
'out'
,
msg
)
self
.
add_to_msc
(
'out'
,
msg
.
replace
(
' '
,
' '
)
.
replace
(
' ,'
,
','
))
old_state
=
self
.
current_hash
# Send the TC
...
...
asn1_value_editor/vn.py
View file @
8e17d4d9
...
...
@@ -14,7 +14,7 @@
2) toASN1ValueNotation(val)
Does the reverse (from Qt widget to ASN.1 Value Notation/GSER)
3) valueNotationToC
t
ypes(gser, dest, sort, ASN1Mod, ASN1_AST, var=None)
3) valueNotationToC
T
ypes(gser, dest, sort, ASN1Mod, ASN1_AST, var=None)
Parse a Value Notation string and fill a ctypes instance with the values
Copyright (c) 2012-2015 European Space Agency
...
...
@@ -141,13 +141,11 @@ choiceValue.setParseAction(parseChoiceValue)
def
parseValueReference
(
s
,
l
,
t
):
''' Parsing ENUMERATED Id '''
value
=
t
[
0
].
replace
(
'-'
,
'_'
)
value
=
t
[
0
]
#
.replace('-', '_')
return
{
'Enum'
:
value
}
valuereference
.
setParseAction
(
parseValueReference
)
#choiceValue.setParseAction(lambda s, l, t: {'Choice': t[0].replace('-', '_'), t[0].replace('-', '_'): t[2]})
#valuereference.setParseAction(lambda s, l, t: {'Enum': t[0].replace('-', '_')})
namedValue
.
setParseAction
(
lambda
s
,
l
,
t
:
{
t
[
0
].
replace
(
'-'
,
'_'
):
t
[
1
]})
FloatingPointLiteral
.
setParseAction
(
lambda
s
,
l
,
t
:
float
(
t
[
0
]))
INT
.
setParseAction
(
lambda
s
,
l
,
t
:
int
(
t
[
0
]))
...
...
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