Commit 44d14137 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix SaveTC to text file

parent 2e6fc2c8
......@@ -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=[]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment