前端II接口兼容设备的分配 [英] Allocation of Front End II interface compliant device
问题描述
我正在Centos 6.4(32位)操作系统上使用REDHAWK 1.9.
I am working REDHAWK 1.9 on Centos 6.4 (32 bit) OS.
我有一个符合Tuner的FrontEnd(FE)II接口的设备.符合FEII的设备的分配是通过结构(frontend_tuner_allocation)进行的. IDE似乎不允许在实现"选项卡上定义此分配.
I have a device that conforms to the FrontEnd( FE) II interface for a Tuner. The allocation of an FEII compliant device is via a structure (frontend_tuner_allocation). The IDE does not appear to allow to define this allocation on the implementations tab.
我查看了 REDHAWK UHD设备使用情况.它描述了如何进行必要的连接,但我看不到如何通过调谐器分配结构进行分配.
I looked at REDHAWK UHD device usage. It describes how to make the necessary connections but I didn't see how to allocate via the tuner allocation structure.
我已经看到了示例(离线),在其中进行此分配,必须将分配结构手动编码到xml文件中.在一种情况下,我看到这是在组件spd.xml文件中完成的.我还有另一个在波形中完成的示例.
I have seen example (offline) where to do this allocation the allocation structure has to be hand coded into the xml file. I saw in one case this was done in the components spd.xml file. I have another example where it was done in the waveform.
示例1: 在组件中spd.xml
example 1: In components spd.xml
<usesdevice id="DCE:11bafc63-d8ce-428b-8b4e-39cb96034e8c" type="usesDevice">
<propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" value="FRONTEND:TUNER"/>
<structref refid="FRONTEND::tuner_allocation">
<simpleref refid="FRONTEND::tuner_allocation::allocation_id" value="SimFE2TestSink"/>
<simpleref refid="FRONTEND::tuner_allocation::center_frequency" value="857000000.0"/>
</structref>
</usesdevice>
示例2: 在波形spd.xml中
example 2: In waveform spd.xml
<usesdevicedependencies>
<usesdevice id="DCE:93a650f5-719f-4dc3-8143-fd438b94c19f" type="usesXX">
<propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" value="FRONTEND::TUNER"/>
<structref refid="FRONTEND::tuner_allocation">
<simpleref refid="FRONTEND::tuner_allocation::tuner_type" value="RX_DIGITIZER_CHANNELIZER"/>
<simpleref refid="FRONTEND::tuner_allocation::allocation_id" value="XXDevice"/>
<simpleref refid="FRONTEND::tuner_allocation::center_frequency" value="100000000"/>
<simpleref refid="FRONTEND::tuner_allocation::bandwidth" value="128000"/>
<simpleref refid="FRONTEND::tuner_allocation::sample_rate" value="256000"/>
<simpleref refid="FRONTEND::tuner_allocation::group_id" value=""/>
<simpleref refid="FRONTEND::tuner_allocation::rf_flow_id" value=""/>
</structref>
</usesdevice>
</usesdevicedependencies>
分配前端调谐器的最佳方法是什么?
How is the best way to allocate FrontEnd Tuner?
推荐答案
分配前端调谐器设备并不是真正的最佳"方法.实际上,这取决于哪种方式最适合您的特定情况.
There isn't really a 'best' way to allocate a frontend tuner device. It really just depends on which way makes the most sense for your specific scenario.
您提供的两个示例是通过XML分配前端调谐器的有效方法,但是还有另一个选择(使用python)可能有助于弄清实际情况.
The two examples you provided are valid ways of allocating a frontend tuner via XML, but there's another option (using python) that may help clarify what is going on under the hood.
假设您的设备已经在运行:
Assuming your device is already running:
from ossie.utils import redhawk
from ossie.cf import CF
# Attach to the domain
domain = redhawk.attach("REDHAWK_DEV")
# Locate your FEI device
myFEIDevice = None
for device in domain.devices:
if device.name == "myFEIDevice":
myFEIDevice = device
# Sanity check
if not myFEIDevice:
raise Exception("Unable to locate myFEIDevice!")
此时,您的FEI设备应该接受allocateCapacity(tunerRequestProps)
呼叫:
At this point, your FEI device should accept an allocateCapacity(tunerRequestProps)
call:
from ossie.utils import uuid
# Setup tuning variables
allocationId = str(uuid.uuid4())
tunerType = "RX_DIGITIZER_CHANNELIZER"
centerFreq = 100e6
sampleRate = 48000.0
sampleRateTol = 10.0
bandwidth = 16000.0
bandwidthTol = 10.0
deviceControl = False
groupId = ""
rfFlowId = ""
# Setup allocation request properties
props = []
props.append(CF.DataType("FRONTEND::tuner_allocation::tuner_type", tunerType))
props.append(CF.DataType("FRONTEND::tuner_allocation::allocation_id", allocationId))
props.append(CF.DataType("FRONTEND::tuner_allocation::center_frequency", centerFreq))
props.append(CF.DataType("FRONTEND::tuner_allocation::bandwidth", bandwidth))
props.append(CF.DataType("FRONTEND::tuner_allocation::bandwidth_tolerance", bandwidthTol))
props.append(CF.DataType("FRONTEND::tuner_allocation::sample_rate", sampleRate))
props.append(CF.DataType("FRONTEND::tuner_allocation::sample_rate_tolerance", sampleRateTol))
props.append(CF.DataType("FRONTEND::tuner_allocation::device_control", deviceControl))
props.append(CF.DataType("FRONTEND::tuner_allocation::group_id", groupId))
props.append(CF.DataType("FRONTEND::tuner_allocation::rf_flow_id", rfFlowId))
# Setup tuner request struct properties
fe_alloc_props = {}
fe_alloc_props["FRONTEND::tuner_allocation"] = props
# Attempt to allocate your device
allocationResult = myFEIDevice.allocateCapacity(fe_alloc_props)
这时,如果分配成功,您应该看到分配请求现在已在设备的frontend_tuner_status属性中表示
At this point, if the allocation was successful, you should see the allocation request is now represented in the device's frontend_tuner_status property
这篇关于前端II接口兼容设备的分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!