当前位置: 首页>>代码示例>>C++>>正文


C++ Remote类代码示例

本文整理汇总了C++中Remote的典型用法代码示例。如果您正苦于以下问题:C++ Remote类的具体用法?C++ Remote怎么用?C++ Remote使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Remote类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main()
{
    using std::cout;
    Tv s42;
    cout << "Początkowe ustawienia telewizora 42\":\n";
    s42.settings();
    s42.onoff();
    s42.chanup();
    cout << "\nNowe ustawienia telewizora 42\":\n";
    s42.settings();

    Remote grey;

    grey.set_chan(s42, 10);
    grey.volup(s42);
    grey.volup(s42);
    cout << "\nUstawienia telewizora 42\" po użyciu pilota:\n";
    s42.settings();

    Tv s58(Tv::On);
    s58.set_mode();
    grey.set_chan(s58, 28);
    cout << "\nUstawienia telewizora 58\"\n";
    s58.settings();

    return 0;
}
开发者ID:Anvendir,项目名称:PrataCpp,代码行数:27,代码来源:use_tv.cpp

示例2: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    Remote w;
    QFile st(QDir::currentPath()+ "/remote.ini");
    if(!st.open(QIODevice::ReadOnly | QIODevice::Text))

    {
        cout<<"Need remote.ini to start";
        QString settingsFile = (QDir::currentPath()+ "/remote.ini");
        QSettings *settings =new QSettings(settingsFile,QSettings::IniFormat);
        settings->setValue("sshServer", "192.168.1.1");
        settings->setValue("sshUser", "user");
        settings->setValue("sshPwd", "123");
        settings->setValue("sshCommand", "free_port.sh");
        settings->sync();
        delete (settings);
    }
    st.close();

    w.setStyleSheet("background-image: url(:/suspects.png)");
    w.show();
    
    return a.exec();
}
开发者ID:algogr,项目名称:algo_remote,代码行数:26,代码来源:main.cpp

示例3: RTException

void	StateRoom::accessRoom()
{
  INetworkRelay *network = this->_world->getSharedObject<INetworkRelay>("NetworkRelay");

  if (network) {
    Remote *remote = NULL;
    if (this->_textboxRoom->getString() != "")
      this->_textboxRoom->setString("defaulte");
    if (!(remote = network->getRemote(0)))
      throw RTException("Invalid remote");
    IBuffer *buffer = network->getTCPBuffer();
    *buffer << static_cast<char>(INetworkRelay::CHANGE_ROOM_QUERY);
    *buffer << this->_textboxRoom->getString();
    remote->sendTCP(buffer);
    Thread<INetworkRelay> *thread = new Thread<INetworkRelay>();

    thread->start(network, &INetworkRelay::start, Any());

    while (42) {
      LockVector<IBuffer *> &recv_buffer = remote->getRecvBufferTCP();
      auto guard = create_lock(recv_buffer);

      for (auto it = recv_buffer.begin(); it != recv_buffer.end();)
	{
	  if (this->parsePacket(recv_buffer, it))
	    return ;
	}
    }
  } else {
    throw RTException("Invalid network");
  }
}
开发者ID:deb0ch,项目名称:R-Type,代码行数:32,代码来源:StateRoom.cpp

示例4: main

int main()
{
    using std::cout;
    Tv s27;
    cout << "Initial settings for 27\" TV:\n";
    s27.settings();
    s27.onoff();
    s27.chanup();
    cout << "\nAdjusted settings for 27\" TV:\n";
    s27.settings();

    Remote grey;

    grey.set_chan(s27, 10);
    grey.volup(s27);
    grey.volup(s27);
    cout << "\n27\" settings after using remote:\n";
    s27.settings();

    Tv s32(Tv::On);
    s32.set_mode();
    grey.set_chan(s32,28);
    cout << "\n32\" settings:\n";
    s32.settings();

    return 0; 
}
开发者ID:feiermi,项目名称:C-Primer-Plus-,代码行数:27,代码来源:use_tv.cpp

示例5: main

int main()
{
    using std::cout;
    Tv s42;
    cout << "Initial setting for 42\" TV:\n";
    s42.settings();
    s42.onoff();
    s42.chanup();
    cout << "\nAdjusted settings for 42\" TV:\n";
    s42.settings();

    Remote grey;

    grey.set_chan(s42, 10);
    grey.volup(s42);
    grey.volup(s42);
    cout << "\n42\" settings after using remote:\n";
    s42.settings();

    Tv s58(Tv::On);
    s58.set_mode();
    grey.set_chan(s58,28);
    cout << "\n58\" settings:\n";
    s58.settings();
    return 0;
}
开发者ID:whuhuanght,项目名称:CPP-Primer-Plus,代码行数:26,代码来源:use_tv.cpp

示例6: timerRemoteStart

volatile char timerRemoteStart(char key, char first)
{
	menu.message(TEXT("Started Remote"));
	remote.set(REMOTE_PROGRAM);
	remote.set(REMOTE_START);
	menu.spawn((void*)timerStatusRemote);
	return FN_JUMP;
}
开发者ID:dummey,项目名称:TimelapsePlus-Firmware,代码行数:8,代码来源:tlp_menu_functions.cpp

示例7: make_autostring

ListView::Row Manager::makeRow(const Remote &remote) const
{
  const auto_string &name = make_autostring(remote.name());
  const auto_string &url = make_autostring(remote.url());

  return {name, url, isRemoteEnabled(remote) ?
    AUTO_STR("Enabled") : AUTO_STR("Disabled")};
}
开发者ID:cfillion,项目名称:reapack,代码行数:8,代码来源:manager.cpp

示例8: apply

bool Manager::apply()
{
  if(!m_changes)
    return true;

  Transaction *tx = m_reapack->setupTransaction();

  if(!tx)
    return false;

  bool syncAll = false;

  if(m_autoInstall) {
    m_config->install.autoInstall = m_autoInstall.value();
    syncAll = m_autoInstall.value();
  }

  if(m_bleedingEdge)
    m_config->install.bleedingEdge = m_bleedingEdge.value();

  if(m_promptObsolete)
    m_config->install.promptObsolete = m_promptObsolete.value();

  for(const auto &pair : m_mods) {
    Remote remote = pair.first;
    const RemoteMods &mods = pair.second;

    if(m_uninstall.find(remote) != m_uninstall.end())
      continue;

    if(mods.enable) {
      m_reapack->setRemoteEnabled(*mods.enable, remote);

      if(*mods.enable && !syncAll)
        tx->synchronize(remote);
    }
    if(mods.autoInstall) {
      remote.setAutoInstall(*mods.autoInstall);
      m_config->remotes.add(remote);

      const bool isEnabled = mods.enable.value_or(remote.isEnabled());
      if(isEnabled && *mods.autoInstall && !syncAll)
        tx->synchronize(remote);
    }
  }

  for(const Remote &remote : m_uninstall)
    m_reapack->uninstall(remote);

  if(syncAll)
    m_reapack->synchronizeAll();

  tx->runTasks();
  m_config->write();
  reset();

  return true;
}
开发者ID:cfillion,项目名称:reapack,代码行数:58,代码来源:manager.cpp

示例9: isRemoteEnabled

bool Manager::isRemoteEnabled(const Remote &remote) const
{
  const auto it = m_mods.find(remote);

  if(it == m_mods.end())
    return remote.isEnabled();
  else
    return it->second.enable.value_or(remote.isEnabled());
}
开发者ID:cfillion,项目名称:reapack,代码行数:9,代码来源:manager.cpp

示例10: remoteAutoInstall

tribool Manager::remoteAutoInstall(const Remote &remote) const
{
  const auto it = m_mods.find(remote);

  if(it == m_mods.end())
    return remote.autoInstall();
  else
    return it->second.autoInstall.value_or(remote.autoInstall());
}
开发者ID:cfillion,项目名称:reapack,代码行数:9,代码来源:manager.cpp

示例11: kdDebug

void RemoteServer::loadRemotes()
{
	QStringList theFiles = KGlobal::dirs()->findAllResources("data", "remotes/*.remote.xml");
	for(QStringList::iterator i = theFiles.begin(); i != theFiles.end(); ++i)
	{	kdDebug() << "Found data file: " << *i << endl;
		Remote *p = new Remote();
		p->loadFromFile(*i);
		theRemotes.insert(p->id(), p);
	}
}
开发者ID:serghei,项目名称:kde3-kdeutils,代码行数:10,代码来源:remoteserver.cpp

示例12: onConsoleCommand

	virtual void onConsoleCommand(ConsoleWindow* con, const std::string& str)
	{ 
		if (_remote.getHostPeer() == NULL)
		{
			String cmd = str.c_str();
			if (StringUtil::startsWith(cmd, "connect"))
			{
				String addr = cmd.substr(8);

				if (_remote.connect(addr))
				{
					DataValue params = DataValue::fromJson("{ client:'nit-rsh', version:'1.0', log:true }");

					_remote.request(_remote.getHostPeer(), _channelID, RQ_ATTACH, params);
					_lastAddr = addr;
				}
				return;
			}
			else
			{
				if (!_lastAddr.empty())
				{
					if (_remote.connect(_lastAddr))
					{
						DataValue params = DataValue::fromJson("{ client:'nit-rsh', version:'1.0', log:true }");

						_remote.request(_remote.getHostPeer(), _channelID, RQ_ATTACH, params);
					}
				}

				if (_remote.getHostPeer() == NULL)
					LOG(0, "*** not connected\n");
			}
		}

		if (!str.empty())
		{
			Ref<RemotePeer> peer = _remote.getHostPeer();

			if (peer)
			{
				if (str == "bye")
					peer->disconnect();
				else
					_remote.notify(peer, _channelID, NT_COMMAND, DataValue(str.c_str(), (int) str.length()));
			}
		}
	}
开发者ID:noriter,项目名称:nit,代码行数:48,代码来源:nit-rsh.cpp

示例13: ConsoleApp

	ConsoleApp(ConsoleWindow* cw)
	{ 
		_console = cw;
		cw->setListener(this);

		_channelID = 0xdeb6;

		EventChannel* ch = _remote.getChannel(0);
		ch->bind(EVT::REMOTE_CONNECT, this, &ConsoleApp::onRemoteConnect);
		ch->bind(EVT::REMOTE_DISCONNECT, this, &ConsoleApp::onRemoteDisconnect);

		ch = _remote.openChannel(_channelID, "nit.RemoteDebugClient");

		ch->bind(EVT::REMOTE_NOTIFY, this, &ConsoleApp::onRemoteNotify);
		ch->bind(EVT::REMOTE_RESPONSE, this, &ConsoleApp::onRemoteResponse);
	}
开发者ID:noriter,项目名称:nit,代码行数:16,代码来源:nit-rsh.cpp

示例14: isRemoteEnabled

bool Manager::isRemoteEnabled(const Remote &remote) const
{
  const auto it = m_enableOverrides.find(remote);

  if(it == m_enableOverrides.end())
    return remote.isEnabled();
  else
    return it->second;
}
开发者ID:Tarasmetal,项目名称:reapack,代码行数:9,代码来源:manager.cpp

示例15: QLatin1String

bool RemoteModel::refresh(const QString &workingDirectory, QString *errorMessage)
{
    // Run branch command with verbose.
    QStringList remoteArgs;
    remoteArgs << QLatin1String("-v");
    QString output;
    if (!m_client->synchronousRemoteCmd(workingDirectory, remoteArgs, &output, errorMessage))
        return false;
    // Parse output
    m_workingDirectory = workingDirectory;
    m_remotes.clear();
    const QStringList lines = output.split(QLatin1Char('\n'));
    for (int r = 0; r < lines.count(); ++r) {
        Remote newRemote;
        if (newRemote.parse(lines.at(r)))
            m_remotes.push_back(newRemote);
    }
    reset();
    return true;
}
开发者ID:anchowee,项目名称:QtCreator,代码行数:20,代码来源:remotemodel.cpp


注:本文中的Remote类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。