Skip to content

Commit

Permalink
Fix some PandA errors
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Feb 7, 2017
1 parent 8b02a9f commit 35d8d31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 8 additions & 4 deletions malcolm/parts/pandabox/pandaboxblockmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def make_parts_for(self, field_name, field_data):
self._make_out(field_name, field_data, "pos")
self._make_scale_offset(field_name)
self._make_out_capture(field_name, field_data)
self._make_data_delay(field_name)
elif typ == "ext_out":
self._make_out_capture(field_name, field_data)
elif typ == "bit_mux":
Expand Down Expand Up @@ -168,15 +169,18 @@ def _make_out(self, field_name, field_data, typ):
tags=[group_tag, flow_tag], writeable=False)
self._make_field_part(field_name, meta, writeable=False)

def _make_out_capture(self, field_name, field_data):
def _make_data_delay(self, field_name):
group_tag = self._make_group("outputs")
meta = ChoiceMeta("Capture %s in PCAP?" % field_name,
field_data.labels, tags=[group_tag, widget("combo")])
self._make_field_part(field_name + ".CAPTURE", meta, writeable=True)
meta = NumberMeta(
"uint8", "How many FPGA ticks to delay data capture",
tags=[group_tag, widget("textinput")])
self._make_field_part(field_name + ".DATA_DELAY", meta, writeable=True)

def _make_out_capture(self, field_name, field_data):
group_tag = self._make_group("outputs")
meta = ChoiceMeta("Capture %s in PCAP?" % field_name,
field_data.labels, tags=[group_tag, widget("combo")])
self._make_field_part(field_name + ".CAPTURE", meta, writeable=True)
if self.area_detector:
# Make a string part to hold the name of the dataset
part_name = field_name + ".DATASET_NAME"
Expand Down
3 changes: 3 additions & 0 deletions malcolm/parts/pandabox/pandaboxfieldpart.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from malcolm.core import Part
from malcolm.core.vmetas import BooleanMeta
from malcolm.parts.pandabox.pandaboxutil import make_label_attr_name


Expand Down Expand Up @@ -39,5 +40,7 @@ def set_field(self, value):
value = "BITS.ZERO"
elif value == "ONE":
value = "BITS.ONE"
elif isinstance(self.meta, BooleanMeta):
value = int(value)
self.control.set_field(self.block_name, self.field_name, value)

0 comments on commit 35d8d31

Please sign in to comment.