我正在使用红鹰 1.9。我使用默认设置创建了一个 Redhawk 设备、组件、节点和波形。我对以上所有内容都使用 C++ 实现。问题是无法分配设备,因为它不是可执行设备。在代码部分的实现选项卡中,“类型”变量设置为“可执行”(默认值)。如果这是不正确的,那应该是什么?
注意:当我从可执行设备派生设备时,问题就消失了。
我能够重现虚拟设备和组件的问题,如下所示:我更新了组件,以便它将使用该设备。
<usesdevice id="dummy_device_2" type="usesdevice">
<propertyref refid="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" value="dummy_device_kind_1"/>
</usesdevice>
我更新设备属性:
<simple id="DCE:cdc5ee18-7ceb-4ae6-bf4c-31f983179b4d" mode="readonly" name="device_kind" type="string">
<description>This specifies the device kind</description>
<value>dummy_device_kind_1</value>
<kind kindtype="configure"/>
<kind kindtype="allocation"/>
<action type="eq"/>
</simple>
我将此处创建的虚拟设备添加到此处创建的虚拟节点中。我将虚拟组件添加到虚拟波形中。我启动了仅包含虚拟设备的虚拟节点 我启动了仅包含上述虚拟设备的虚拟波形。我收到以下错误消息:
- 无法创建应用程序:DeviceOnlyTestWaveform_343_114533234 发生以下 CORBA 异常:创建应用程序时 InvalidCapacity IDL:CF/ApplicationFactory/CreateApplicationError:1.0*
域管理器(使用跟踪日志记录运行)显示以下内容:
DEBUG:ApplicationFactory_impl - Trying to find the device
TRACE:ApplicationFactory_impl - Searching for a place to deploy component amongst 1 devices
TRACE:ApplicationFactory_impl - Checking Device DummyNode:DeviceOnlyTesTDevice_1
TRACE:ApplicationFactory_impl - Device DummyNode:DeviceOnlyTesTDevice_1 is loadable
TRACE:ApplicationFactory_impl - Device DummyNode:DeviceOnlyTesTDevice_1 is not loadable
TRACE:ApplicationFactory_impl - Done checking all the devices
DEBUG:ApplicationFactory_impl - Device Allocation Failed.. need to clean up
在 ApplicationFactory_impl 中,代码似乎显示分配失败,因为设备不是从可执行设备派生的。代码部分的“类型”为 Executable(默认设置)。如果这不正确,那应该是什么?
// Check that the device meet's the needs of this component
// - Validate the type of device meets the requirements in the 'code' section of the implementation
//
LOG_TRACE(ApplicationFactory_impl, "Checking Device " << deviceNodeIter->identifier);
if (deviceNodeIter->device->usageState() == CF::Device::BUSY)
{
LOG_TRACE(ApplicationFactory_impl, "Ignoring Device " <<deviceNodeIter->label << " is BUSY");
continue;
}
if ((implementation->getCodeType() == CF::LoadableDevice::EXECUTABLE) ||
(implementation->getCodeType() == CF::LoadableDevice::SHARED_LIBRARY)) {
// Does this device provide LoadableDevice?
LOG_TRACE(ApplicationFactory_impl, "Device " << deviceNodeIter->identifier << " is loadable");
CF::LoadableDevice_var loaddev;
loaddev = ossie::corba::_narrowSafe<CF::LoadableDevice> (deviceNodeIter->device);
if(CORBA::is_nil(loaddev)) {
LOG_TRACE(ApplicationFactory_impl, "Device " << deviceNodeIter->identifier << " is not loadable");
continue;
}
if (implementation->getEntryPoint().size() != 0) {
// Does this device provide ExecutableDevice?
LOG_TRACE(ApplicationFactory_impl, "Device " << deviceNodeIter->identifier << " is executable");
CF::ExecutableDevice_var execdev;
execdev = ossie::corba::_narrowSafe<CF::ExecutableDevice> (deviceNodeIter->device);
if(CORBA::is_nil(execdev)) {
LOG_INFO(ApplicationFactory_impl, "Device " << deviceNodeIter->identifier << " is not executable");
continue;
}
}
}