Commit dd7c811b00573949544aa48ee75f61bbca5fe6a0
1 parent
77e78c23
Exists in
master
and in
6 other branches
FIX: Add new measure after opening inv3 that had 1 measure
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
invesalius/data/measures.py
@@ -53,6 +53,7 @@ class MeasurementManager(object): | @@ -53,6 +53,7 @@ class MeasurementManager(object): | ||
53 | actors = mr.AddPoint(x, y, z) | 53 | actors = mr.AddPoint(x, y, z) |
54 | ps.Publisher().sendMessage(("Add actors", m.location), | 54 | ps.Publisher().sendMessage(("Add actors", m.location), |
55 | (actors, m.slice_number)) | 55 | (actors, m.slice_number)) |
56 | + self.current = None | ||
56 | 57 | ||
57 | 58 | ||
58 | def _add_point(self, pubsub_evt): | 59 | def _add_point(self, pubsub_evt): |
@@ -91,6 +92,7 @@ class MeasurementManager(object): | @@ -91,6 +92,7 @@ class MeasurementManager(object): | ||
91 | x, y, z = position | 92 | x, y, z = position |
92 | actors = self.current[1].AddPoint(x, y, z) | 93 | actors = self.current[1].AddPoint(x, y, z) |
93 | self.current[0].points.append(position) | 94 | self.current[0].points.append(position) |
95 | + print "--- actors", actors | ||
94 | ps.Publisher().sendMessage(("Add actors", location), | 96 | ps.Publisher().sendMessage(("Add actors", location), |
95 | (actors, self.current[0].slice_number)) | 97 | (actors, self.current[0].slice_number)) |
96 | 98 | ||
@@ -103,8 +105,11 @@ class MeasurementManager(object): | @@ -103,8 +105,11 @@ class MeasurementManager(object): | ||
103 | self.current[0].value = self.current[1].GetValue() | 105 | self.current[0].value = self.current[1].GetValue() |
104 | type_ = TYPE[type] | 106 | type_ = TYPE[type] |
105 | location = LOCATION[location] | 107 | location = LOCATION[location] |
106 | - value = u"%.2f mm"% self.current[0].value | ||
107 | - | 108 | + if type == const.LINEAR: |
109 | + value = u"%.2f mm"% self.current[0].value | ||
110 | + else: | ||
111 | + value = u"%.2f˚"% self.current[0].value | ||
112 | + | ||
108 | msg = 'Update measurement info in GUI', | 113 | msg = 'Update measurement info in GUI', |
109 | ps.Publisher().sendMessage(msg, | 114 | ps.Publisher().sendMessage(msg, |
110 | (index, name, colour, | 115 | (index, name, colour, |