本文整理汇总了C++中DiveComputerList类的典型用法代码示例。如果您正苦于以下问题:C++ DiveComputerList类的具体用法?C++ DiveComputerList怎么用?C++ DiveComputerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DiveComputerList类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: simpleNick
extern "C" void set_dc_nickname(struct dive *dive)
{
if (!dive)
return;
struct divecomputer *dc = &dive->dc;
while (dc) {
if (dc->model && *dc->model && dc->deviceid &&
!dcList.getExact(dc->model, dc->deviceid)) {
// we don't have this one, yet
const DiveComputerNode *existNode = dcList.get(dc->model);
if (existNode) {
// we already have this model but a different deviceid
QString simpleNick(dc->model);
if (dc->deviceid == 0)
simpleNick.append(" (unknown deviceid)");
else
simpleNick.append(" (").append(QString::number(dc->deviceid, 16)).append(")");
dcList.addDC(dc->model, dc->deviceid, simpleNick);
} else {
dcList.addDC(dc->model, dc->deviceid);
}
}
dc = dc->next;
}
}
示例2: get_dc_nickname
const QString get_dc_nickname(const char *model, uint32_t deviceid)
{
const DiveComputerNode *existNode = dcList.getExact(model, deviceid);
if (!existNode)
return QString();
else if (!existNode->nickName.isEmpty())
return existNode->nickName;
else
return model;
}
示例3:
extern "C" void create_device_node(const char *model, uint32_t deviceid, const char *serial, const char *firmware, const char *nickname)
{
dcList.addDC(model, deviceid, nickname, serial, firmware);
}