本文整理汇总了C++中LogWarn函数的典型用法代码示例。如果您正苦于以下问题:C++ LogWarn函数的具体用法?C++ LogWarn怎么用?C++ LogWarn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LogWarn函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LogWarn
void visual_system_impl::init_eye()
{
// no eye is selected if camera name is incorrect to show problem visually!!!
// please don't change selection logic
#if 0
eye_ = (!props_.channel.camera_name.empty())
? find_object<visual_control_ptr>(this, props_.channel.camera_name)
: find_first_object<visual_control_ptr>(this) ;
if (!eye_ && !props_.channel.camera_name.empty())
LogWarn("Can't find camera: " << props_.channel.camera_name);
#else
eye_ = find_object<visual_control_ptr>(this, props_.channel.camera_name);
if (!eye_ && !props_.channel.camera_name.empty())
LogWarn("Can't find camera: " << props_.channel.camera_name);
if(!eye_)
eye_ = find_first_object<visual_control_ptr>(this) ;
#endif
#if 0
viewport_->SetClarityScale(props_.channel.pixel_scale);
viewport_->set_geom_corr(props_.channel.cylindric_geom_corr ? victory::IViewport::explicit_cylinder : victory::IViewport::no_geom_corr);
init_frustum_projection();
#endif
update_eye();
}
开发者ID:yaroslav-tarasov,项目名称:test_osg,代码行数:33,代码来源:visual_system_impl.cpp
示例2: pthread_win32_thread_attach_np
void *Thread::ThreadRun(void *myThread)
{
Thread *thread = reinterpret_cast<Thread*>(myThread);
thread->mRunning = true;
#ifdef PTW32_STATIC_LIB
pthread_win32_thread_attach_np();
#endif
try {
thread->mTask->run();
}
catch(const std::exception &e)
{
LogWarn("Thread::ThreadRun", String("Unhandled exception in thread: ") + e.what());
}
catch(...)
{
LogWarn("Thread::ThreadRun", String("Unhandled unknown exception in thread"));
}
thread->mRunning = false;
if(thread->mAutoDelete) delete thread;
#ifdef PTW32_STATIC_LIB
pthread_win32_thread_detach_np();
#endif
pthread_exit(NULL);
return NULL;
}
开发者ID:orinocoz,项目名称:Teapotnet,代码行数:30,代码来源:thread.cpp
示例3: setup_server_sockets
int setup_server_sockets(struct srv_sock_info ssi[])
{
int i=0;
ssi[0].sd = ssi[1].sd = -1;
// Only enqueue sockets successfully bound or that weren't disabled.
if (tcsd_options.disable_ipv4) {
LogWarn("IPv4 support disabled by configuration option");
} else {
if (setup_ipv4_socket(&ssi[i]) == 0)
i++;
}
if (tcsd_options.disable_ipv6) {
LogWarn("IPv6 support disabled by configuration option");
} else {
setup_ipv6_socket(&ssi[i]);
}
// It's only a failure if both sockets are unavailable.
if ((ssi[0].sd == -1) && (ssi[1].sd == -1)) {
return -1;
}
return 0;
}
开发者ID:IIJ-NetBSD,项目名称:netbsd-src,代码行数:26,代码来源:svrside.c
示例4: LogInfo
void ImageExport::processExport(){
exportQueued_ = false;
auto image = imagePort_.getData();
if (image && !imageFile_.get().empty()) {
const Layer* layer = image->getColorLayer();
if (layer){
std::string fileExtension = filesystem::getFileExtension(imageFile_.get());
auto writer =
DataWriterFactory::getPtr()->getWriterForTypeAndExtension<Layer>(fileExtension);
if (writer) {
try {
writer->setOverwrite(overwrite_.get());
writer->writeData(layer, imageFile_.get());
LogInfo("Image color layer exported to disk: " << imageFile_.get());
} catch (DataWriterException const& e) {
util::log(e.getContext(), e.getMessage(), LogLevel::Error);
}
} else {
LogError("Error: Could not find a writer for the specified extension and data type");
}
}
else {
LogError("Error: Could not find color layer to write out");
}
} else if (imageFile_.get().empty()) {
LogWarn("Error: Please specify a file to write to");
} else if (!image) {
LogWarn("Error: Please connect an image to export");
}
}
开发者ID:Ojaswi,项目名称:inviwo,代码行数:32,代码来源:imageexport.cpp
示例5: LogDebug
bool VidscaleSHMIntf::removeRabRecordInSharedMemory(umtsRab *pRabObject)
{
bool retVal = true;
LogDebug("removeTunnelInSharedMemory\n");
if(!(deleteSHMHashEntry((char*)(&(pRabObject->upTeidKey)), SHM_KEY_TUN, pRabObject->imsi)))
{
LogWarn("UPTEID - Old Session deletion failed \n");
retVal = false;
}
else
{
LogInfo("UPTEID - delete entry successful\n");
}
if(!(deleteSHMHashEntry((char*)(&(pRabObject->downTeidKey)), SHM_KEY_TUN, pRabObject->imsi)))
{
LogWarn("DOWN TEID -Old Session deletion failed \n");
retVal = false;
}
else
{
LogInfo("DOWNTEID - delete entry successful\n");
}
phashValueFreeMemMgrObj->pushFreeMem(pRabObject , (pRabObject->imsi%MAX_CONTROLLING_ENTITIES));
return retVal;
}
开发者ID:vkumarvs,项目名称:mysolutions,代码行数:28,代码来源:VidscaleSHMIntf.cpp
示例6: LogInfo
void VolumeExport::exportVolume() {
auto volume = volumePort_.getData();
if (volume && !volumeFile_.get().empty()) {
std::string fileExtension = filesystem::getFileExtension(volumeFile_.get());
auto writer =
DataWriterFactory::getPtr()->getWriterForTypeAndExtension<Volume>(fileExtension);
if (writer) {
try {
writer->setOverwrite(overwrite_.get());
writer->writeData(volume.get(), volumeFile_.get());
LogInfo("Volume exported to disk: " << volumeFile_.get());
} catch (DataWriterException const& e) {
util::log(e.getContext(), e.getMessage(), LogLevel::Error);
}
} else {
LogError("Error: Cound not find a writer for the specified extension and data type");
}
} else if (volumeFile_.get().empty()) {
LogWarn("Error: Please specify a file to write to");
} else if (!volume) {
LogWarn("Error: Please connect a volume to export");
}
}
开发者ID:Ojaswi,项目名称:inviwo,代码行数:25,代码来源:volumeexport.cpp
示例7: alcMakeContextCurrent
Utils::Ticket<AudioWorld> AudioWorld::playSound(Handle::SfxHandle h, const Math::float3& position, bool relative, float maxDist)
{
#ifdef RE_USE_SOUND
if (!m_Context)
return Utils::Ticket<AudioWorld>();
alcMakeContextCurrent(m_Context);
Sound& snd = m_Allocator.getElement(h);
// Get a cached source object
Source s = getFreeSource();
//LogInfo() << "play sound " << snd.sfx.file << " vol " << snd.sfx.vol;
alSourcef(s.m_Handle, AL_PITCH, m_Engine.getGameClock().getGameEngineSpeedFactor());
alSourcef(s.m_Handle, AL_GAIN, snd.sfx.vol / 127.0f);
alSource3f(s.m_Handle, AL_POSITION, position.x, position.y, position.z);
alSource3f(s.m_Handle, AL_VELOCITY, 0, 0, 0);
alSourcef(s.m_Handle, AL_MAX_DISTANCE, maxDist);
// Relative for sources directly attached to the listener
alSourcei(s.m_Handle, AL_SOURCE_RELATIVE, relative ? AL_TRUE : AL_FALSE);
// TODO: proper looping would require slicing and queueing multiple buffers
// and setting the source to loop when the non-looping buffer was played.
// start and end don't seem to be used, thoug?
alSourcei(s.m_Handle, AL_LOOPING, snd.sfx.loop ? AL_TRUE : AL_FALSE);
alSourcei(s.m_Handle, AL_BUFFER, snd.m_Handle);
ALenum error = alGetError();
if (error != AL_NO_ERROR)
{
static bool warned = false;
if (!warned)
{
LogWarn() << "Could not attach buffer to source: " << AudioEngine::getErrorString(error);
warned = true;
}
return Utils::Ticket<AudioWorld>();
}
alSourcePlay(s.m_Handle);
error = alGetError();
if (error != AL_NO_ERROR)
{
static bool warned = false;
if (!warned)
{
LogWarn() << "Could not start source!" << AudioEngine::getErrorString(error);
warned = true;
}
return Utils::Ticket<AudioWorld>();
}
return s.soundTicket;
#else
return Utils::Ticket<AudioWorld>();
#endif
}
开发者ID:degenerated1123,项目名称:REGoth,代码行数:60,代码来源:AudioWorld.cpp
示例8: setup_ipv6_socket
int setup_ipv6_socket(struct srv_sock_info *ssi)
{
struct sockaddr_in6 serv6_addr;
int sd6, opt;
ssi->sd = -1;
sd6 = socket(AF_INET6, SOCK_STREAM, 0);
if (sd6 < 0) {
LogWarn("Failed IPv6 socket: %s", strerror(errno));
goto err;
}
memset(&serv6_addr, 0, sizeof (serv6_addr));
serv6_addr.sin6_family = AF_INET6;
serv6_addr.sin6_port = htons(tcsd_options.port);
/* If no remote_ops are defined, restrict connections to localhost
* only at the socket. */
if (tcsd_options.remote_ops[0] == 0)
serv6_addr.sin6_addr = in6addr_loopback;
else
serv6_addr.sin6_addr = in6addr_any;
#ifdef __linux__
/* Linux, by default, allows one socket to be used by both IP stacks
* This option disables that behavior, so you must have one socket for
* each IP protocol. */
opt = 1;
if(setsockopt(sd6, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt)) == -1) {
LogWarn("Could not set IPv6 socket option properly.\n");
goto err;
}
#endif
opt = 1;
setsockopt(sd6, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
if (bind(sd6, (struct sockaddr *) &serv6_addr, sizeof (serv6_addr)) < 0) {
LogWarn("Failed IPv6 bind: %s", strerror(errno));
goto err;
}
if (listen(sd6, TCSD_MAX_SOCKETS_QUEUED) < 0) {
LogWarn("Failed IPv6 listen: %s", strerror(errno));
goto err;
}
ssi->domain = AF_INET6;
ssi->sd = sd6;
ssi->addr_len = sizeof(serv6_addr);
return 0;
err:
if (sd6 != -1)
close(sd6);
return -1;
}
开发者ID:IIJ-NetBSD,项目名称:netbsd-src,代码行数:59,代码来源:svrside.c
示例9: uid2grp_add_user
/**
* @brief Add a user entry to the cache
*
* @note The caller must hold uid2grp_user_lock for write.
*
* @param[in] group_data that has supplementary groups allocated
*
* @retval true on success.
* @retval false if our reach exceeds our grasp.
*/
bool uid2grp_add_user(struct group_data *gdata)
{
struct avltree_node *name_node;
struct avltree_node *id_node;
struct avltree_node *name_node2 = NULL;
struct avltree_node *id_node2 = NULL;
struct cache_info *info;
struct cache_info *tmp;
info = gsh_malloc(sizeof(struct cache_info));
if (!info) {
LogEvent(COMPONENT_IDMAPPER, "memory alloc failed");
return false;
}
info->uid = gdata->uid;
info->uname.addr = gdata->uname.addr;
info->uname.len = gdata->uname.len;
info->gdata = gdata;
/* The refcount on group_data should be 1 when we put it in
* AVL trees.
*/
uid2grp_hold_group_data(gdata);
/* We may have lost the race to insert. We remove existing
* entry and insert this new entry if so!
*/
name_node = avltree_insert(&info->uname_node, &uname_tree);
if (unlikely(name_node)) {
tmp = avltree_container_of(name_node,
struct cache_info,
uname_node);
uid2grp_remove_user(tmp);
name_node2 = avltree_insert(&info->uname_node, &uname_tree);
}
id_node = avltree_insert(&info->uid_node, &uid_tree);
if (unlikely(id_node)) {
/* We should not come here unless someone changed uid of
* a user. Remove old entry and re-insert the new
* entry.
*/
tmp = avltree_container_of(id_node,
struct cache_info,
uid_node);
uid2grp_remove_user(tmp);
id_node2 = avltree_insert(&info->uid_node, &uid_tree);
}
uid_grplist_cache[info->uid % id_cache_size] = &info->uid_node;
if (name_node && id_node)
LogWarn(COMPONENT_IDMAPPER, "shouldn't happen, internal error");
if ((name_node && name_node2) || (id_node && id_node2))
LogWarn(COMPONENT_IDMAPPER, "shouldn't happen, internal error");
return true;
}
开发者ID:ckhardin,项目名称:nfs-ganesha,代码行数:67,代码来源:uid2grp_cache.c
示例10: SubscribeToIncomingCalls
IW_TELEPHONY_API ApiErrorCode
SubscribeToIncomingCalls(IN LpHandlePtr stackIncomingHandle, IN LpHandlePtr listenerHandle)
{
FUNCTRACKER;
MsgCallSubscribeReq *msg = new MsgCallSubscribeReq();
msg->listener_handle = listenerHandle;
IwMessagePtr response = NULL_MSG;
// wait for ok or nack
ApiErrorCode res = GetCurrRunningContext()->DoRequestResponseTransaction(
stackIncomingHandle,
IwMessagePtr(msg),
response,
Seconds(5),
"SubscribeToIncomingCalls TXN");
if (res == API_TIMEOUT)
{
// just to be sure that timeout-ed call
// eventually gets hanged up
LogWarn("SubscribeToIncomingCalls - Timeout.");
return API_TIMEOUT;
}
if (IW_FAILURE(res))
{
LogWarn("SubscribeToIncomingCalls - failure res:" << res);
return API_FAILURE;
}
switch (response->message_id)
{
case MSG_CALL_SUBSCRIBE_ACK:
{
res = API_SUCCESS;
break;
}
default:
{
res = API_SERVER_FAILURE;
}
}
return res;
}
开发者ID:macntouch,项目名称:altalena,代码行数:51,代码来源:OfferAnswerSession.cpp
示例11: LogWarn
void PyInviwo::addModulePath(const std::string& path) {
if (!Py_IsInitialized()) {
LogWarn("addModulePath(): not initialized");
return;
}
std::string pathConv = path;
replaceInString(pathConv, "\\", "/");
std::string runString = "import sys\n";
runString.append(std::string("sys.path.append('") + pathConv + std::string("')"));
int ret = PyRun_SimpleString(runString.c_str());
if (ret != 0) LogWarn("Failed to add '" + pathConv + "' to Python module search path");
}
开发者ID:sarbi127,项目名称:inviwo,代码行数:14,代码来源:pyinviwo.cpp
示例12: setup_ipv4_socket
int setup_ipv4_socket(struct srv_sock_info ssi[])
{
struct sockaddr_in serv_addr;
int sd, opt;
ssi->sd = -1;
// Initialization of IPv4 socket.
sd = socket(AF_INET, SOCK_STREAM, 0);
if (sd < 0) {
LogWarn("Failed IPv4 socket: %s", strerror(errno));
goto err;
}
memset(&serv_addr, 0, sizeof (serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(tcsd_options.port);
/* If no remote_ops are defined, restrict connections to localhost
* only at the socket. */
if (tcsd_options.remote_ops[0] == 0)
serv_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
else
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
opt = 1;
setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
if (bind(sd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) < 0) {
LogWarn("Failed IPv4 bind: %s", strerror(errno));
goto err;
}
if (listen(sd, TCSD_MAX_SOCKETS_QUEUED) < 0) {
LogWarn("Failed IPv4 listen: %s", strerror(errno));
goto err;
}
ssi->domain = AF_INET;
ssi->sd = sd;
ssi->addr_len = sizeof(serv_addr);
return 0;
err:
if (sd != -1)
close(sd);
return -1;
}
开发者ID:IIJ-NetBSD,项目名称:netbsd-src,代码行数:49,代码来源:svrside.c
示例13: admin_dbus_grace
static bool admin_dbus_grace(DBusMessageIter *args,
DBusMessage *reply)
{
#define IP_INPUT 120
char *errormsg = "Started grace period";
bool success = true;
DBusMessageIter iter;
nfs_grace_start_t gsp;
char buf[IP_INPUT];
char *input = NULL;
char *ip;
dbus_message_iter_init_append(reply, &iter);
if (args == NULL) {
errormsg = "Grace period take 1 arguments: event:IP-address.";
LogWarn(COMPONENT_DBUS, "%s", errormsg);
success = false;
goto out;
}
if (DBUS_TYPE_STRING != dbus_message_iter_get_arg_type(args)) {
errormsg = "Grace period arg 1 not a string.";
success = false;
LogWarn(COMPONENT_DBUS, "%s", errormsg);
goto out;
}
dbus_message_iter_get_basic(args, &input);
gsp.nodeid = -1;
gsp.event = EVENT_TAKE_IP;
ip = strstr(input, ":");
if (ip == NULL)
gsp.ipaddr = input; /* no event specified */
else {
gsp.ipaddr = ip+1; /* point at the ip passed the : */
strncpy(buf, input, IP_INPUT);
ip = strstr(buf, ":");
if (ip != NULL) {
*ip = 0x0; /* replace ":" with null */
gsp.event = atoi(buf);
}
if (gsp.event == EVENT_TAKE_NODEID)
gsp.nodeid = atoi(gsp.ipaddr);
}
nfs4_start_grace(&gsp);
out:
dbus_status_reply(&iter, success, errormsg);
return success;
}
开发者ID:tsunamiwang,项目名称:nfs-ganesha-anand,代码行数:49,代码来源:nfs_admin_thread.c
示例14: defined
void Channel::HandleEventWithGuard(Timestamp receive_time) {
event_handling_ = true;
#if defined(__MACH__) || defined(__ANDROID_API__)
LogTrace("%s", REventsToString().c_str());
#else
VLOG(1) << REventsToString();
#endif
if ((revents_ & POLLHUP) && !(revents_ & POLLIN)) {
if (log_hup_) {
#if defined(__MACH__) || defined(__ANDROID_API__)
LogWarn("Channel::handle_event() POLLHUP");
#else
LOG(WARNING) << "Channel::handle_event() POLLHUP";
#endif
}
if (close_callback_) {
close_callback_();
}
}
if (revents_ & POLLNVAL) {
#if defined(__MACH__) || defined(__ANDROID_API__)
LogWarn("Channel::handle_event() POLLNVAL");
#else
LOG(WARNING) << "Channel::handle_event() POLLNVAL";
#endif
}
if (revents_ & (POLLERR | POLLNVAL)) {
if (error_callback_) error_callback_();
}
#ifndef POLLRDHUP
const int POLLRDHUP = 0;
#endif
if (revents_ & (POLLIN | POLLPRI | POLLRDHUP)) {
if (read_callback_) read_callback_(receive_time);
}
if (revents_ & POLLOUT) {
if (write_callback_) write_callback_();
}
event_handling_ = false;
}
开发者ID:adan830,项目名称:muduo-cpp11,代码行数:48,代码来源:channel.cpp
示例15: folderCache_
CacheMonitorServer::CacheMonitorServer()
: folderCache_(Factory::GetCacheFolder()),
folderMeta_(Factory::GetMetaFolder()),
run_(true),
minFreeSize_(0), maxFreeSize_(0),
thread_(boost::thread(&CacheMonitorServer::ServerThread,this))
{
struct statfs stat;
if ( 0 != statfs(folderCache_.string().c_str(),&stat) ) {
LogWarn(folderCache_);
return;
}
off_t sizeFileSystemOnePercent =
(off_t)stat.f_bsize * stat.f_blocks / 100;
Configure * config = Factory::GetConfigure();
minFreeSize_ = config->GetValueSize(Configure::CacheFreeMinSize);
off_t sizeMinFreePercent = sizeFileSystemOnePercent
* config->GetValueSize(Configure::CacheFreeMinPercent);
minFreeSize_ = max(minFreeSize_,sizeMinFreePercent);
LogDebug(minFreeSize_);
maxFreeSize_ = config->GetValueSize(Configure::CacheFreeMaxSize);
off_t sizeMaxFreePercent = sizeFileSystemOnePercent
* config->GetValueSize(Configure::CacheFreeMaxPercent);
maxFreeSize_ = max(maxFreeSize_,sizeMaxFreePercent);
LogDebug(maxFreeSize_);
}
开发者ID:BDT-GER,项目名称:SWIFT-TLC,代码行数:29,代码来源:CacheMonitorServer.cpp
示例16: lock
bool Store::Sink::push(Fountain::Combination &incoming)
{
std::unique_lock<std::mutex> lock(mMutex);
mSink.solve(incoming);
if(!mSink.isDecoded()) return false;
BinaryString sinkDigest;
mSink.hash(sinkDigest);
LogDebug("Store::push", "Block is complete, digest is " + sinkDigest.toString());
if(!mDigest.empty() && sinkDigest != mDigest)
{
LogWarn("Store::push", "Block digest is invalid (expected " + mDigest.toString() + ")");
mSink.clear();
return false;
}
mPath = Cache::Instance->path(mDigest);
File file(mPath, File::Write);
mSize = mSink.dump(file);
file.close();
return true;
}
开发者ID:paullouisageneau,项目名称:Teapotnet,代码行数:26,代码来源:store.cpp
示例17: dbus_heartbeat_cb
int dbus_heartbeat_cb(void *arg)
{
SetNameFunction("dbus_heartbeat");
int err = 0;
int rc = BCAST_STATUS_OK;
dbus_bool_t ishealthy = get_ganesha_health(&healthstats);
if (ishealthy) {
/* send the heartbeat pulse */
err = gsh_dbus_broadcast(DBUS_PATH HEARTBEAT_NAME,
DBUS_ADMIN_IFACE,
HEARTBEAT_NAME,
DBUS_TYPE_BOOLEAN,
&ishealthy,
DBUS_TYPE_INVALID);
if (err) {
LogCrit(COMPONENT_DBUS,
"heartbeat broadcast failed. err:%d",
err);
rc = BCAST_STATUS_WARN;
}
} else
LogWarn(COMPONENT_DBUS,
"Health status is unhealthy. Not sending heartbeat");
return rc;
}
开发者ID:Anuradha-Talur,项目名称:nfs-ganesha,代码行数:27,代码来源:dbus_heartbeat.c
示例18: fullpath_h
/**
* @brief Concatenate a number of pseudofs tokens into a string
*
* When reading pseudofs paths from export entries, we divide the
* path into tokens. This function will recombine a specific number
* of those tokens into a string.
*
* @param[in/out] fullpseudopath Must be not NULL. Tokens are copied to here.
* @param[in] node for which a full pseudopath needs to be formed.
* @param[in] maxlen maximum number of chars to copy to fullpseudopath
*
* @return void
*/
void fullpath_h(char *fullpseudopath, pseudofs_entry_t *this_node,
int *currlen, int maxlen)
{
if (this_node != &(gPseudoFs.root))
fullpath_h(fullpseudopath, this_node->parent, currlen, maxlen);
if (*currlen >= maxlen)
return;
if (*currlen + strlen(this_node->name) > maxlen) {
LogWarn(COMPONENT_NFS_V4_PSEUDO,
"Pseudopath length is very long, can't"
" create guaranteed unique handle with this.");
strncpy(fullpseudopath + (*currlen),
this_node->name,
maxlen - *currlen - 1); /* leave room for \0 */
*currlen += (maxlen - *currlen - 1);
fullpseudopath[*currlen] = '\0';
*currlen = maxlen;
return;
}
strncpy(fullpseudopath + (*currlen),
this_node->name,
strlen(this_node->name));
*currlen += strlen(this_node->name);
if (*currlen != maxlen && this_node != &(gPseudoFs.root)) {
fullpseudopath[(*currlen)++] = '/';
fullpseudopath[*currlen] = '\0';
} else
fullpseudopath[*currlen] = '\0';
}
开发者ID:asias,项目名称:nfs-ganesha,代码行数:45,代码来源:nfs4_pseudo.c
示例19: InviwoDockWidget
HelpWidget::HelpWidget(QWidget* parent)
: InviwoDockWidget(tr("Help"), parent), helpBrowser_(nullptr), helpEngine_(nullptr) {
setObjectName("HelpWidget");
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
QWidget* centralWidget = new QWidget();
QVBoxLayout* vLayout = new QVBoxLayout(centralWidget);
vLayout->setSpacing(7);
vLayout->setContentsMargins(0, 0, 0, 0);
std::string helpfile =
InviwoApplication::getPtr()->getPath(InviwoApplication::PATH_HELP, "/inviwo.qhc");
helpEngine_ = new QHelpEngineCore(QString::fromStdString(helpfile), this);
helpBrowser_ = new HelpBrowser(this, helpEngine_);
helpBrowser_->setHtml(QString("Hello world"));
vLayout->addWidget(helpBrowser_);
centralWidget->setLayout(vLayout);
setWidget(centralWidget);
connect(helpEngine_, SIGNAL(setupFinished()), this, SLOT(setupFinished()));
if (!helpEngine_->setupData()) {
LogWarn("Faild to setup the help engine:" << helpEngine_->error().toUtf8().constData());
delete helpEngine_;
helpEngine_ = nullptr;
}
}
开发者ID:sarbi127,项目名称:inviwo,代码行数:29,代码来源:helpwidget.cpp
示例20: TriggerEventByID
/*
* Trigger an event
*/
int TriggerEventByID(char *id)
{
LogDebug(VB_EVENT, "TriggerEventByID(%s)\n", id);
if (getFPPmode() == MASTER_MODE)
SendEventPacket(id);
FPPevent *event = LoadEvent(id);
if (!event)
{
LogWarn(VB_EVENT, "Unable to load event %s\n", id);
return 0;
}
if (event->effect)
StartEffect(event->effect, event->startChannel);
if (event->script)
RunEventScript(event);
FreeEvent(event);
return 1;
}
开发者ID:darylc,项目名称:fpp,代码行数:28,代码来源:events.c
注:本文中的LogWarn函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论