本文整理汇总了C++中DeviceInfo类的典型用法代码示例。如果您正苦于以下问题:C++ DeviceInfo类的具体用法?C++ DeviceInfo怎么用?C++ DeviceInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DeviceInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PERF_TEST_P
PERF_TEST_P(DevInfo, StereoBeliefPropagation, testing::ValuesIn(devices()))
{
DeviceInfo devInfo = GetParam();
setDevice(devInfo.deviceID());
Mat img_l_host = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE);
Mat img_r_host = readImage("gpu/stereobm/aloe-R.png", CV_LOAD_IMAGE_GRAYSCALE);
ASSERT_FALSE(img_l_host.empty());
ASSERT_FALSE(img_r_host.empty());
GpuMat img_l(img_l_host);
GpuMat img_r(img_r_host);
GpuMat dst;
StereoBeliefPropagation bp(128);
declare.time(10.0);
SIMPLE_TEST_CYCLE()
{
bp(img_l, img_r, dst);
}
Mat dst_host(dst);
SANITY_CHECK(dst_host);
}
示例2: DeviceManagerModule
QTcpSocket* ServerCore::createSocket(QString deviceUID)
{
DeviceInfo info = DeviceManagerModule()->GetDeviceInfo(deviceUID);
QTcpSocket *socket = new QTcpSocket(this);
socket->connectToHost(info.getIP(), PORT_SERVER_BROADCAST, QIODevice::ReadWrite);
return socket;
}
示例3: qDebug
void SettingsTechnicalInfo::fillInfo(){
qDebug() << Q_FUNC_INFO;
DeviceInfo *deviceInfo = DeviceInfo::getInstance();
Storage *storageInfo = Storage::getInstance();
Wifi *wifiInfo = Wifi::getInstance();
MACaddressValLbl->setText(wifiInfo->getMacAddress());
internalMemValLbl->setText(human_readable_filesize(storageInfo->getTotalInternalMemory(), 2));
if (storageInfo->getRemovablePartition() && storageInfo->getRemovablePartition()->isMounted())
externalMemValLbl->setText(human_readable_filesize(storageInfo->getTotalExternalMemory(), 2));
else
externalMemValLbl->setText("--");
batteryValLbl->setText(QString::number(battery->getLevel()) + "%");
QHash<QString, QString> extraInformation = deviceInfo->getSpecificDeviceInfo();
qDebug() << extraInformation;
QHash<QString, QString> specificInfo = deviceInfo->getSpecificDeviceInfo();
internalVersionValLbl->setText(specificInfo.value("Internal Revision"));
rootFsValLbl->setText(specificInfo.value("Static rootfs version")
+ "/" + specificInfo.value("Actual rootfs version")
+ "/" + specificInfo.value("Private repo version"));
kernelVersionVaLbl->setText(specificInfo.value("Kernel version"));
softwareValLbl->setText(specificInfo.value("Software version"));
QString serialNum = deviceInfo->getSerialNumber();
if(serialNum.startsWith("SN-")) // Remove prefix if present
serialNum.remove(0,3);
idDeviceValLbl->setText(serialNum);
}
示例4: sstream
void RPCClient::request(JsonBox::Value& json, char* method, JsonBox::Object params)
{
string result = "";
stringstream sstream("");
DeviceInfo *dev = ((AppDelegate*)cocos2d::CCApplication::sharedApplication())->getDeviceInfo();
JsonBox::Object device;
dev->getJSONString(device);
params["authkey"] = JsonBox::Value(dev->getAuthKey());
params["device"] = JsonBox::Value(device);
JsonBox::Object data;
data["jsonrpc"] = JsonBox::Value("2.0");
data["id"] = JsonBox::Value("1");
data["method"] = JsonBox::Value(method);
data["params"] = JsonBox::Value(params);
sstream << data;
if(_send(sstream.str()))
_recv(result);
sstream.flush();
json.loadFromString(result);
}
示例5: fill_device_info
bool DeviceIndex::fill_device_info (DeviceInfo& info) const
{
if (!info.get_serial().empty())
{
for (const auto& d : device_list)
{
if (info.get_serial() == d.get_serial())
{
info = d;
return true;
}
}
return false;
}
if (!info.get_identifier().empty())
{
for (const auto& d : device_list)
{
if (info.get_identifier() == d.get_identifier())
{
info = d;
return true;
}
}
}
return false;
}
示例6: PERF_TEST_P
PERF_TEST_P(DevInfo_Size_MatType, transpose, testing::Combine(testing::ValuesIn(devices()),
testing::Values(GPU_TYPICAL_MAT_SIZES),
testing::Values(CV_8UC1, CV_32SC1, CV_64FC1)))
{
DeviceInfo devInfo = std::tr1::get<0>(GetParam());
Size size = std::tr1::get<1>(GetParam());
int type = std::tr1::get<2>(GetParam());
setDevice(devInfo.deviceID());
Mat src_host(size, type);
declare.in(src_host, WARMUP_RNG);
GpuMat src(src_host);
GpuMat dst(size.width, size.height, type);
declare.time(0.5).iterations(100);
SIMPLE_TEST_CYCLE()
{
transpose(src, dst);
}
Mat dst_host(dst);
SANITY_CHECK(dst_host);
}
示例7: name
void WmdmLister::WMDMDeviceAdded(const QString& canonical_name) {
ScopedWCharArray name(canonical_name);
IWMDMDevice* device = NULL;
if (thread_->manager()->GetDeviceFromCanonicalName(name, &device)) {
qLog(Warning) << "Error in GetDeviceFromCanonicalName for" << canonical_name;
return;
}
IWMDMDevice2* device2 = NULL;
if (device->QueryInterface(IID_IWMDMDevice2, (void**) &device2)) {
qLog(Warning) << "Error getting IWMDMDevice2 from device";
device->Release();
return;
}
device->Release();
DeviceInfo info = ReadDeviceInfo(device2);
if (info.is_suitable_) {
QString id = info.unique_id();
{
QMutexLocker l(&mutex_);
devices_[id] = info;
}
emit DeviceAdded(id);
} else {
device2->Release();
}
}
示例8: areaUnderSensor
QImage TwoDModelEngineApi::areaUnderSensor(const PortInfo &port, qreal widthFactor) const
{
DeviceInfo device = mModel.robotModels()[0]->configuration().type(port);
if (device.isNull()) {
device = mModel.robotModels()[0]->info().specialDevices()[port];
if (device.isNull()) {
return QImage();
}
}
const QPair<QPointF, qreal> neededPosDir = countPositionAndDirection(port);
const QPointF position = neededPosDir.first;
const qreal direction = neededPosDir.second;
const QRect imageRect = mModel.robotModels()[0]->info().sensorImageRect(device);
const qreal width = imageRect.width() * widthFactor / 2.0;
const QRectF sensorRectangle = QTransform().rotate(direction).map(QPolygonF(QRectF(imageRect))).boundingRect();
const qreal rotationFactor = sensorRectangle.width() / imageRect.width();
const qreal realWidth = width * rotationFactor;
const QRectF scanningRect = QRectF(position.x() - realWidth, position.y() - realWidth
, 2 * realWidth, 2 * realWidth);
const QImage image(mFakeScene->render(scanningRect));
const QPoint offset = QPointF(width, width).toPoint();
const QImage rotated(image.transformed(QTransform().rotate(-(90 + direction))));
const QRect realImage(rotated.rect().center() - offset + QPoint(1, 1), rotated.rect().center() + offset);
QImage result(realImage.size(), QImage::Format_RGB32);
result.fill(Qt::white);
QPainter painter(&result);
painter.drawImage(QRect(QPoint(), result.size()), rotated, realImage);
painter.end();
return result;
}
示例9: QWebView
DlgLogin::DlgLogin(QWidget *parent) :
QWebView(parent)
{
setWindowTitle(tr("Ingress Login"));
resize(1024,600);
QVariantMap xM;
xM["nemesisSoftwareVersion"]=VersionNemisis;
xM["deviceSoftwareVersion"]=VersionDevice;
//DecompAsmX86 xDC;xDC.Do();return;
DeviceInfo xD;
/*xM["a"]=*/xD.ToHandshakeEncoded();
//return;
QString sJ=QString::fromUtf8(QtJson::Json::serialize(xM).toPercentEncoding());
QString sURL=API::ms_URL+"handshake?json="+sJ;
m_pxNetMgrWWW=new QNetworkAccessManager(this);
connect(m_pxNetMgrWWW,SIGNAL(finished(QNetworkReply*)),this, SLOT(OnHttpDoneWWW(QNetworkReply*)));
m_pxCookies=new NetworkCookieJar(this);
m_pxCookies->FromVariant(DataCfg::Get()->m_xUserCfg.GetLoginCookies());
m_pxCookies->DoEndSession();
m_pxNetMgrWWW->setCookieJar(m_pxCookies);
connect(this,SIGNAL(urlChanged(QUrl)),this,SLOT(OnURLChanged(QUrl)));
connect(this,SIGNAL(loadFinished(bool)),this,SLOT(OnLoadFinished(bool)));
qDebug() << "Login:" << sURL;
page()->setNetworkAccessManager(m_pxNetMgrWWW);
load(QUrl(sURL));
}
示例10: DeviceInfo
//! [les-devicediscovery-3]
void Device::addDevice(const QBluetoothDeviceInfo &info)
{
if (info.coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration) {
DeviceInfo *d = new DeviceInfo(info);
devices.append(d);
setUpdate("Last device added: " + d->getName());
}
}
示例11: void
void cv::gpu::BFMatcher_GPU::knnMatch2Collection(const GpuMat& query, const GpuMat& trainCollection,
GpuMat& trainIdx, GpuMat& imgIdx, GpuMat& distance,
const GpuMat& maskCollection, Stream& stream)
{
if (query.empty() || trainCollection.empty())
return;
using namespace cv::gpu::device::bf_knnmatch;
typedef void (*caller_t)(const PtrStepSzb& query, const PtrStepSzb& trains, const PtrStepSz<PtrStepb>& masks,
const PtrStepSzb& trainIdx, const PtrStepSzb& imgIdx, const PtrStepSzb& distance,
int cc, cudaStream_t stream);
static const caller_t callersL1[] =
{
match2L1_gpu<unsigned char>, 0/*match2L1_gpu<signed char>*/,
match2L1_gpu<unsigned short>, match2L1_gpu<short>,
match2L1_gpu<int>, match2L1_gpu<float>
};
static const caller_t callersL2[] =
{
0/*match2L2_gpu<unsigned char>*/, 0/*match2L2_gpu<signed char>*/,
0/*match2L2_gpu<unsigned short>*/, 0/*match2L2_gpu<short>*/,
0/*match2L2_gpu<int>*/, match2L2_gpu<float>
};
static const caller_t callersHamming[] =
{
match2Hamming_gpu<unsigned char>, 0/*match2Hamming_gpu<signed char>*/,
match2Hamming_gpu<unsigned short>, 0/*match2Hamming_gpu<short>*/,
match2Hamming_gpu<int>, 0/*match2Hamming_gpu<float>*/
};
CV_Assert(query.channels() == 1 && query.depth() < CV_64F);
CV_Assert(norm == NORM_L1 || norm == NORM_L2 || norm == NORM_HAMMING);
const caller_t* callers = norm == NORM_L1 ? callersL1 : norm == NORM_L2 ? callersL2 : callersHamming;
const int nQuery = query.rows;
ensureSizeIsEnough(1, nQuery, CV_32SC2, trainIdx);
ensureSizeIsEnough(1, nQuery, CV_32SC2, imgIdx);
ensureSizeIsEnough(1, nQuery, CV_32FC2, distance);
if (stream)
stream.enqueueMemSet(trainIdx, Scalar::all(-1));
else
trainIdx.setTo(Scalar::all(-1));
caller_t func = callers[query.depth()];
CV_Assert(func != 0);
DeviceInfo info;
int cc = info.majorVersion() * 10 + info.minorVersion();
func(query, trainCollection, maskCollection, trainIdx, imgIdx, distance, cc, StreamAccessor::getStream(stream));
}
示例12: device
QMap<PortInfo, DeviceInfo> WaitBlock::usedDevices() const
{
DeviceInfo const deviceInfo = device();
PortInfo const portInfo = RobotModelUtils::findPort(mRobotModel, port(), deviceInfo.direction());
QMap<PortInfo, DeviceInfo> result;
if (!deviceInfo.isNull() && portInfo.isValid()) {
result[portInfo] = deviceInfo;
}
return result;
}
示例13: infoForDevice
void
PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::TableType type )
{
DeviceInfo* info = infoForDevice( device );
// Creating a partition table wipes all the disk, so there is no need to
// keep previous changes
info->forgetChanges();
PartitionModel::ResetHelper helper( partitionModelForDevice( device ) );
CreatePartitionTableJob* job = new CreatePartitionTableJob( device, type );
job->updatePreview();
info->jobs << Calamares::job_ptr( job );
refresh();
}
示例14: currentConfiguration
void GraphicsWatcherManager::updateSensorsList(const QString ¤tRobotModel)
{
mWatcher->clearTrackingObjects();
int index = 0;
for (const PortInfo &port : configuredPorts(currentRobotModel)) {
const DeviceInfo device = currentConfiguration(currentRobotModel, port);
/// @todo It must depend on port, port must return its variable
const QString variableName = port.reservedVariable();
if (!device.isNull() && !variableName.isEmpty()) {
mWatcher->addTrackingObject(index, variableName, QString("%1: %2").arg(port.name()
, device.friendlyName()));
++index;
}
}
}
示例15: setFieldValue
jobject JniDeviceInfo::toJava(DeviceInfo &deviceInfo)
{
if (!m_env)
return nullptr;
static jmethodID deviceInfoCtor = m_env->GetMethodID(gSimulatorClassRefs.deviceInfoCls, "<init>",
"()V");
jobject jDeviceInfo = m_env->NewObject(gSimulatorClassRefs.deviceInfoCls, deviceInfoCtor);
setFieldValue(jDeviceInfo, "mName", deviceInfo.getName());
setFieldValue(jDeviceInfo, "mID", deviceInfo.getID());
setFieldValue(jDeviceInfo, "mSpecVersion", deviceInfo.getSpecVersion());
setFieldValue(jDeviceInfo, "mDMVVersion", deviceInfo.getDataModelVersion());
return jDeviceInfo;
}