本文整理汇总了C++中setConnected函数的典型用法代码示例。如果您正苦于以下问题:C++ setConnected函数的具体用法?C++ setConnected怎么用?C++ setConnected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setConnected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setConnected
void REIXSXESMCPDetector::onControlsConnected(bool connected){
if(connected)
setConnected(connected);
else
setConnected(false);
if(connected)
setReadyForAcquisition();
else if(!isNotReadyForAcquisition())
setNotReadyForAcquisition();
}
示例2: qDebug
void
LNetworkConnectionMonitor::onStateChange( uint newState )
{
qDebug() << "Networkmanager state change!";
if ( newState == Disconnected )
{
setConnected( false );
}
else if ( newState == Connected )
{
setConnected( true );
}
}
示例3: qDebug
void
lastfm::LNetworkConnectionMonitor::onStateChange( uint newState )
{
qDebug() << "Networkmanager state change!";
if ( newState == NM_STATE_DISCONNECTED || newState == NM_STATE_ASLEEP )
{
setConnected( false );
}
else if ( newState == NM_STATE_CONNECTED_GLOBAL )
{
setConnected( true );
}
}
示例4: qDebug
void CDatabaseItem::init(const QString &dbname)
{
#ifdef DEBUG
qDebug("CDatabaseItem::init('%s')", debug_string(dbname));
#endif
setText(0,dbname);
setDatabaseName(dbname);
widgetData.setAutoDelete(true);
if (databaseDisconnectedIcon.isNull())
databaseDisconnectedIcon = getPixmapIcon("databaseDisconnectedIcon");
if (databaseConnectedIcon.isNull())
databaseConnectedIcon = getPixmapIcon("databaseConnectedIcon");
databaseConnectIcon = getPixmapIcon("databaseConnectIcon");
databaseDisconnectIcon = getPixmapIcon("databaseDisconnectIcon");
sqlIcon = getPixmapIcon("sqlIcon");
deleteIcon = getPixmapIcon("deleteIcon");
newWindowIcon = getPixmapIcon("newWindowIcon");
if (is_connected)
setConnected(is_connected);
else
setPixmap(0, databaseDisconnectedIcon);
}
示例5: Log
void IcyConnector::ProcessHeaders(const QString &hdrs)
{
QStringList f0;
QStringList f1;
QString txt;
f0=hdrs.split("\r\n");
if(f0[0]!="OK2") {
Log(LOG_WARNING,
QString().sprintf("login to \"%s:%d\" rejected: %s",
(const char *)hostHostname().toUtf8(),
0xFFFF&hostPort(),
(const char *)f0[0].toUtf8()));
return;
}
icy_authenticated=true;
WriteHeader("icy-name: "+streamName());
WriteHeader("icy-genre: "+streamGenre());
WriteHeader("icy-pub: "+QString().sprintf("%d",streamPublic()));
WriteHeader("icy-br: "+QString().sprintf("%u",audioBitrate()));
if(icy_protocol_version==1) {
WriteHeader("icy-url: "+streamUrl());
}
WriteHeader("icy-irc: "+streamIrc());
WriteHeader("icy-icq: "+streamIcq());
WriteHeader("icy-aim: "+streamAim());
WriteHeader("Content-Type: "+contentType());
WriteHeader("");
setConnected(true);
}
示例6: memset
void WlanCoreImpl::cacheInterfaceInfo()
{
m_deviceOk = false;
memset(&m_deviceId, 0, sizeof(m_deviceId));
PWLAN_INTERFACE_INFO_LIST intfList;
if (ERROR_SUCCESS == m_wlanapi->WlanEnumInterfaces(m_wlanHandle, NULL, &intfList)) {
if (intfList->dwNumberOfItems > 0) {
const WLAN_INTERFACE_INFO *intf = intfList->InterfaceInfo + 0;
m_deviceOk = true;
m_deviceId = intf->InterfaceGuid;
m_deviceState = intf->isState;
m_deviceDesc = QString::fromWCharArray(intf->strInterfaceDescription);
}
m_wlanapi->WlanFreeMemory(intfList);
}
if (m_deviceOk) {
cacheRadioState();
cacheConnectionInfo();
} else {
setSoftwareEnabled(false);
setHardwareEnabled(false);
setEnabled(false);
setSsid(QString());
setMacAddress(QByteArray());
setSignalQuality(0);
setProfileName(QString());
setConnected(false);
}
}
示例7: sizeof
void WlanCoreImpl::cacheConnectionInfo()
{
QString profileName;
QString ssid;
bool connected = false;
int signalQuality = 0;
QByteArray macAddress;
if (m_deviceOk) {
PWLAN_CONNECTION_ATTRIBUTES conn;
DWORD cb = sizeof(conn);
WLAN_OPCODE_VALUE_TYPE vt;
if (ERROR_SUCCESS == m_wlanapi->WlanQueryInterface(m_wlanHandle, &m_deviceId, wlan_intf_opcode_current_connection, NULL, &cb, reinterpret_cast<PVOID*>(&conn), &vt)) {
profileName = QString::fromWCharArray(conn->strProfileName).trimmed();
connected = (conn->isState == wlan_interface_state_connected);
ssid = QString::fromLatin1(reinterpret_cast<char*>(conn->wlanAssociationAttributes.dot11Ssid.ucSSID), conn->wlanAssociationAttributes.dot11Ssid.uSSIDLength);
signalQuality = conn->wlanAssociationAttributes.wlanSignalQuality;
macAddress = QByteArray(reinterpret_cast<char*>(conn->wlanAssociationAttributes.dot11Bssid), 6);
m_wlanapi->WlanFreeMemory(conn);
}
}
setSsid(ssid);
setMacAddress(macAddress);
setSignalQuality(signalQuality);
setProfileName(profileName);
setConnected(connected);
}
示例8: catch
void DkCamControls::closeDeviceAndSetState() {
bool lvActive = false;
try {
lvActive = maidFacade->isLiveViewActive();
} catch (Maid::MaidError) {
lvActive = false;
}
if (lvActive) {
maidFacade->toggleLiveView();
liveViewTimer->stop();
// TODO: get the plugin viewport here?!
//viewport->setImage(QImage());
//emit updateImage(QImage()); // is setting an empty image here intentional?
}
try {
maidFacade->closeSource();
} catch (Maid::MaidError) {
// there is probably nothing left to close
}
connectedDeviceId.second = false;
setConnected(false);
updateUiValues();
}
示例9: dialog
void DkCamControls::onDeviceOpened() {
if (openDeviceProgressDialog) {
openDeviceProgressDialog->cancel();
}
try {
if (!maidFacade->isSourceAlive()) {
return;
}
if (!maidFacade->checkCameraType()) {
QMessageBox dialog(this);
dialog.setIcon(QMessageBox::Warning);
dialog.setText(tr("This program is not compatible with the selected camera model."));
dialog.show();
dialog.exec();
//qDebug() << tr("This program is not compatible with the selected camera model.");
closeDeviceAndSetState();
return;
}
setConnected(true);
updateUiValues();
} catch (Maid::MaidError e) {
qDebug() << tr("[ERROR] after opening device");
}
}
示例10: setConnected
void BioXASSSRLMonochromatorRegionControl::updateConnected()
{
bool slitsOK = ( maskUpperBlade_ && maskUpperBlade_->isConnected() && maskLowerBlade_ && maskLowerBlade_->isConnected() && maskBladesStatus_ && maskBladesStatus_->isConnected() );
bool paddleOK = (paddle_ && paddle_->isConnected());
bool paddleStatusOK = (paddleStatus_ && paddleStatus_->isConnected());
bool keyStatusOK = (keyStatus_ && keyStatus_->isConnected());
bool brakeStatusOK = (brakeStatus_ && brakeStatus_->isConnected());
bool braggOK = (bragg_ && bragg_->isConnected());
bool braggAtCrystalChangePositionStatusOK = (braggAtCrystalChangePositionStatus_ && braggAtCrystalChangePositionStatus_->isConnected());
bool crystalChangeOK = (crystalChange_ && crystalChange_->isConnected());
bool crystalChangeCWLimitStatusOK = (crystalChangeCWLimitStatus_ && crystalChangeCWLimitStatus_->isConnected());
bool crystalChangeCCWLimitStatusOK = (crystalChangeCCWLimitStatus_ && crystalChangeCCWLimitStatus_->isConnected());
bool regionAStatusOK = (regionAStatus_ && regionAStatus_->isConnected());
bool regionBStatusOK = (regionBStatus_ && regionBStatus_->isConnected());
bool isConnected = (
slitsOK &&
paddleOK &&
paddleStatusOK &&
keyStatusOK &&
brakeStatusOK &&
braggOK &&
braggAtCrystalChangePositionStatusOK &&
crystalChangeOK &&
crystalChangeCWLimitStatusOK &&
crystalChangeCCWLimitStatusOK &&
regionAStatusOK &&
regionBStatusOK
);
setConnected(isConnected);
}
示例11: qDebug
int HidController::close() {
if (!isOpen()) {
qDebug() << "HID device" << getName() << "already closed";
return -1;
}
qDebug() << "Shutting down HID device" << getName();
// Stop the reading thread
if (m_pReader == NULL) {
qWarning() << "HidReader not present for" << getName()
<< "yet the device is open!";
} else {
disconnect(m_pReader, SIGNAL(incomingData(QByteArray, mixxx::Duration)),
this, SLOT(receive(QByteArray, mixxx::Duration)));
m_pReader->stop();
hid_set_nonblocking(m_pHidDevice, 1); // Quit blocking
controllerDebug(" Waiting on reader to finish");
m_pReader->wait();
delete m_pReader;
m_pReader = NULL;
}
// Stop controller engine here to ensure it's done before the device is closed
// incase it has any final parting messages
stopEngine();
// Close device
setConnected(false);
controllerDebug(" Closing device");
hid_close(m_pHidDevice);
setOpen(false);
return 0;
}
示例12: WideCharToMultiByte
void
Server::sendMessage(wstring* message)
{
if(isConnected())
{
int result = 0;
int mbsize = WideCharToMultiByte(CP_UTF8, 0, message->c_str(), static_cast<int>(message->length()), NULL, 0, NULL, NULL);
if (mbsize > 0)
{
char *szMessage = (char*)malloc(mbsize);
int bytes = WideCharToMultiByte(CP_UTF8, 0, message->c_str(), static_cast<int>(message->length()), szMessage, mbsize, NULL, NULL);
result = send(serverSocket, szMessage, bytes, 0);
DebugPrint(L"Capture-Server-sendMessage: Allocated: %i, Converted: %i, Sent: %i\n", mbsize, bytes, result);
if(result == SOCKET_ERROR)
{
DebugPrint(L"Capture-Server-sendMessage: Socket Error %i: %s\n", WSAGetLastError(), szMessage);
if(WSAGetLastError() == WSAENOTCONN)
{
setConnected(false);
}
}
free(szMessage);
}
}
}
示例13: setConnected
void Ableton::setup(string abletonOscHost)
{
this->abletonOscHost = abletonOscHost;
sender.setup(abletonOscHost, ABLETON_OSC_PORT_OUT);
receiver.setup(ABLETON_OSC_PORT_IN);
setConnected(true);
setAutoUpdate(true);
setAutoDraw(true);
control.addToggle("Connected", &connected, this, &Ableton::eventSetConnected); // unusued
control.addButton("Refresh", this, &Ableton::eventRefresh);
GuiWidget *widgetGlobal = control.addWidget("Global");
widgetGlobal->addSlider("Tempo", &tempo, 4.0f, 999.0f, this, &Ableton::eventSetTempo);
widgetGlobal->addSlider("Time", &time, 4.0f, 999.0f, this, &Ableton::eventSetTime);
widgetGlobal->addSlider("Volume", &volume, 0.0f, 1.0f, this, &Ableton::eventSetVolume);
widgetGlobal->addSlider("Pan", &pan, -1.0f, 1.0f, this, &Ableton::eventSetPan);
widgetGlobal->addToggle("Overdub", &overdub, this, &Ableton::eventSetOverdub);
GuiWidget *widgetPlayback = control.addWidget("Playback");
widgetPlayback->addButton("Prev cue", this, &Ableton::eventPrevCue);
widgetPlayback->addButton("Next cue", this, &Ableton::eventNextCue);
widgetPlayback->addButton("Play", this, &Ableton::eventPlay);
widgetPlayback->addButton("Continue", this, &Ableton::eventPlayContinue);
widgetPlayback->addButton("Play selection", this, &Ableton::eventPlaySelection);
widgetPlayback->addButton("Stop", this, &Ableton::eventStop);
scanLiveSet();
// REFRESH OPTION!
// -> delete everything
// -> redo scanLiveSet
// CONNECTED variable
}
示例14: printBytes
/**
* Initializes the temperature sensor.
* This method is called when the sensor is first created and also any time the sensor reports it's disconnected.
* If the result is TEMP_SENSOR_DISCONNECTED then subsequent calls to read() will also return TEMP_SENSOR_DISCONNECTED.
* Clients should attempt to re-initialize the sensor by calling init() again.
*/
bool OneWireTempSensor::init(){
// save address and pinNr for log messages
char addressString[17];
printBytes(sensorAddress, 8, addressString);
uint8_t pinNr = oneWire->pinNr();
bool success = false;
if (sensor==NULL) {
sensor = new DallasTemperature(oneWire);
if (sensor==NULL) {
logErrorString(ERROR_SRAM_SENSOR, addressString);
}
}
logDebug("init onewire sensor");
// This quickly tests if the sensor is connected and initializes the reset detection.
// During the main TempControl loop, we don't want to spend many seconds
// scanning each sensor since this brings things to a halt.
if (sensor && sensor->initConnection(sensorAddress) && requestConversion()) {
logDebug("init onewire sensor - wait for conversion");
waitForConversion();
temperature temp = readAndConstrainTemp();
DEBUG_ONLY(logInfoIntStringTemp(INFO_TEMP_SENSOR_INITIALIZED, pinNr, addressString, temp));
success = temp!=DEVICE_DISCONNECTED && requestConversion();
}
setConnected(success);
logDebug("init onewire sensor complete %d", success);
return success;
}
示例15: joined
void JabberRoomChat::joined()
{
auto details = static_cast<ChatDetailsRoom *>(m_chat.details());
details->setConnected(true);
emit joined(m_chat);
}