• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setOperation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: printString

void printString(const uint8_t *string, int len, uint8_t ddramAddr) {
   const uint8_t *character = string;

   // Clear screen and move cursor to top left
   setOperation(0x01);
   __delay_cycles(1000);
   setOperation(0x03);

   // Enable for writing
   P2OUT |= P2OUT_RS_SET;
   P2OUT &= P2OUT_RW_CLEAR;

   if (ddramAddr > LCD_END_OF_SECOND_LINE) {
 	 ddramAddr = LCD_START_OF_FIRST_LINE;
   }
   while (len--) {
      // Set DDRAM Address
      P2OUT &= P2OUT_RS_CLEAR;
      writeToGPIOs(ddramAddr);
      P2OUT |= P2OUT_RS_SET;

	  // Write char to LCD
	  writeToGPIOs(*character++);

	  // Account for end-of-line
      ddramAddr = ddramAddr == LCD_END_OF_FIRST_LINE ?
         LCD_START_OF_SECOND_LINE : ddramAddr + 0x01;
      if (ddramAddr > LCD_END_OF_SECOND_LINE) {
    	 ddramAddr = LCD_START_OF_FIRST_LINE;
      }
   }

   // Clear cursor
   setOperation(0x0C);
}
开发者ID:OohNahGii,项目名称:329p1,代码行数:35,代码来源:main.c


示例2: setOperation

//------------------------------------------------------------------------------
void ISerializable::writeObject(std::ostream &ostr)
{
  setOperation(OP_WRITE);
  ostr_ = &ostr;
  serializeObject();

}
开发者ID:Jon0,项目名称:genie,代码行数:8,代码来源:ISerializable.cpp


示例3: QNetworkReply

internal_img_network_reply::internal_img_network_reply(const QNetworkRequest& req, const QString& encoded_img, int type, QObject* parent) : QNetworkReply(parent)
{
  /* internal_img_network_reply is modeled after:
     http://qt.gitorious.org/qt-labs/graphics-dojo/blobs/master/url-rendering/main.cpp
  */
  setRequest(req);
  if (type==1) { // Face
    m_buffer = QByteArray::fromBase64(encoded_img.toAscii().constData());
  }
  else { // X-Face
    QImage qi;
    QString s;
    xface_to_xpm(encoded_img.toAscii().constData(), s);
    
    if (qi.loadFromData((const uchar*)s.toAscii().constData(), s.length(), "XPM")) {
      QBuffer b(&m_buffer);
      qi.save(&b, "PNG");
    }
  }
  setOperation(QNetworkAccessManager::GetOperation);
  setHeader(QNetworkRequest::ContentTypeHeader, "image/png");
  open(ReadOnly|Unbuffered);
  setUrl(req.url());
  QTimer::singleShot(0, this, SLOT(go()));
}
开发者ID:albancrommer,项目名称:manitou-mail-ui,代码行数:25,代码来源:body_view.cpp


示例4: setType

void ExpressionNode::replace(const ExpressionNode &newNode)
{
	std::clog << "...<replacing> "  << *this << " with " << newNode << std::endl;
	
	//ExpressionNode *curOld;
	//ExpressionNode *curNew;
	
	setType(newNode.getType());
	setOperation(newNode.getOperation());
//	setRight(newNode.getRight());
	setFirstChild(newNode.getFirstChild()); // automatically also sets other children
	//curOld = firstChild;
	//curNew = newNode.getFirstChild();
	
	//while (curNew != 0)
	//{
		//curOld->setRight(curNew->getRight());
		//curOld = curOld->getRight();
		//curNew = curNew->getRight();
	//}
	setVariable(newNode.getVariable());
	setValue(newNode.getValue());
	
	std::clog << "...</replacing>" << std::endl;
}
开发者ID:vk-eipi,项目名称:MathParser,代码行数:25,代码来源:expression.cpp


示例5: doActivities

void doActivities()
{
	setNum1(4545);
	setNum2(5);
	setOperation(8);
	getResult();

	doOperation(10, 51, MYCALC_ADD);

	setNum1(4545);
	setNum2(5);
	setOperation(MYCALC_DIV);
	getResult();

	doOperation(740, -4551, MYCALC_MUL);
}
开发者ID:ivan-gomez,项目名称:linux-driver,代码行数:16,代码来源:app.c


示例6: setRequest

void EWASiteRoutePoint::initStore( const QNetworkRequest& rec, QNetworkAccessManager::Operation op,
    const QByteArray& data )
{
    setRequest( rec );
    setData( data );
    setOperation( op );
}
开发者ID:sendevent,项目名称:ewa,代码行数:7,代码来源:ewa_siteroutepoint.cpp


示例7: inputsCount

bool Math::start()
{
	if ( inputsCount() != outputsCount() )
		return false;
	buffer.reset( new float[ inputsCount() ]() );
	settings->setRunMode( true );
	setOperation();
	return true;
}
开发者ID:zaps166,项目名称:DSPBlocks,代码行数:9,代码来源:Math.cpp


示例8: QNetworkReply

AdBlockNetworkReply::AdBlockNetworkReply(const QNetworkRequest &request, const QString &urlString, QObject *parent)
        : QNetworkReply(parent)
{
    setOperation(QNetworkAccessManager::GetOperation);
    setRequest(request);
    setUrl(request.url());
    setError(QNetworkReply::ContentAccessDenied, i18n("Blocked by AdBlockRule: %1", urlString));
    QTimer::singleShot(0, this, SLOT(delayedFinished()));
}
开发者ID:Fxrh,项目名称:rekonq,代码行数:9,代码来源:adblocknetworkreply.cpp


示例9: _resourceRequest

AtpReply::AtpReply(const QUrl& url, QObject* parent) :
        _resourceRequest(ResourceManager::createResourceRequest(parent, url)) {
    setOperation(QNetworkAccessManager::GetOperation);

    connect(_resourceRequest, &AssetResourceRequest::progress, this, &AtpReply::downloadProgress);
    connect(_resourceRequest, &AssetResourceRequest::finished, this, &AtpReply::handleRequestFinish);

    _resourceRequest->send();
}
开发者ID:AlexanderOtavka,项目名称:hifi,代码行数:9,代码来源:AtpReply.cpp


示例10: QNetworkReply

AdBlockBlockedNetworkReply::AdBlockBlockedNetworkReply(const AdBlockRule* rule, QObject* parent)
  : QNetworkReply(parent)
{
  setOperation(QNetworkAccessManager::GetOperation);
  setError(QNetworkReply::ContentAccessDenied, QString("AdBlock: %1 (%2)").arg(rule->subscription()->title(), rule->filter()));

  open(QIODevice::ReadOnly);

  QTimer::singleShot(0, this, SLOT(delayedFinished()));
}
开发者ID:Manasmitha,项目名称:quiterss,代码行数:10,代码来源:adblockblockednetworkreply.cpp


示例11: turningOnLCD

void turningOnLCD() {
   // Sets all bits in P1OUT to out
   P1DIR |= 0xFF;
   // Sets bottom 3 bits in P2OUT to out
   P2DIR |= 0x07;
   // wait 20 ms
   __delay_cycles(30000);
   // Set Function
   setOperation(0x38);
   // wait 37 us
   __delay_cycles(100);
   // Display Set
   setOperation(0x0F);
   // wait 37 us
   __delay_cycles(100);
   // Display Clear
   setOperation(0x01);
   // wait 1.52 ms
   __delay_cycles(2000);
}
开发者ID:OohNahGii,项目名称:329p1,代码行数:20,代码来源:main.c


示例12: setOperation

OgreNetworkReply::OgreNetworkReply(const QNetworkRequest &request)
{
    setOperation(QNetworkAccessManager::GetOperation);
    setRequest(request);
    setUrl(request.url());

    QString path = request.url().toString(QUrl::RemoveScheme);

    // Remote slashes at the beginning
    while (path.startsWith('/'))
        path = path.mid(1);

    qDebug() << "Opening" << path << "from ogre resource.";

    Ogre::ResourceGroupManager &resourceManager = Ogre::ResourceGroupManager::getSingleton();

    qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError");

    /* Is it a directory? */
    Ogre::FileInfoListPtr fileInfo = resourceManager.findResourceFileInfo("General", path.toStdString(), true);
    if (fileInfo->size() > 0) {
        QString msg = QString("Cannot open %1: Path is a directory").arg(path);
        setError(ContentOperationNotPermittedError, msg);
        QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
                                  Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ContentOperationNotPermittedError));
        QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
        return;
    }

    try {
        mDataStream = resourceManager.openResource(path.toStdString());
    } catch (Ogre::FileNotFoundException &e) {
        qWarning("Couldn't find %s: %s", qPrintable(path), e.getFullDescription().c_str());
        setError(ContentNotFoundError, "Couldn't find " + path);
        QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
                                  Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ContentNotFoundError));
        QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
        return;
    }

    open(QIODevice::ReadOnly);

    setHeader(QNetworkRequest::ContentLengthHeader, mDataStream->size());

    QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection);
    QMetaObject::invokeMethod(this, "downloadProgress", Qt::QueuedConnection,
                              Q_ARG(qint64, mDataStream->size()), Q_ARG(qint64, mDataStream->size()));
    QMetaObject::invokeMethod(this, "readyRead", Qt::QueuedConnection);
    QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
}
开发者ID:GrognardsFromHell,项目名称:EvilTemple-Native,代码行数:50,代码来源:ogrenetworkaccessmanager.cpp


示例13: QNetworkReply

NetworkReplyReceipts::NetworkReplyReceipts(QNetworkAccessManager::Operation AOperation, const QNetworkRequest &ARequest, QIODevice *AOutgoingData, Receipts *AReceipts, const QByteArray *AImageData, QObject *parent):
    QNetworkReply(parent),
    FReceipts(AReceipts),
    FImageData(AImageData),
    ready(false)
{
	Q_UNUSED(AOutgoingData)

    setOperation(AOperation);
    setRequest(ARequest);
    setUrl(ARequest.url());
    open(ReadOnly); // Open the device as Read Only
    connect(FReceipts, SIGNAL(delivered(QString)), SLOT(onDelivered(QString)));
    QTimer::singleShot(0, this, SLOT(readDataChunk()));
}
开发者ID:RoadWorksSoftware,项目名称:eyecu-qt,代码行数:15,代码来源:networkreplyreceipts.cpp


示例14: setIStream

//------------------------------------------------------------------------------
void SlpFrame::loadHeader(std::istream &istr)
{
  setIStream(istr);
  setOperation(OP_READ);
  
  cmd_table_offset_     = read<uint32_t>();
  outline_table_offset_ = read<uint32_t>();
  palette_offset_       = read<uint32_t>();
  properties_           = read<uint32_t>();
  
  width_     = read<uint32_t>();
  height_    = read<uint32_t>();
  
  hotspot_x_ = read<int32_t>();
  hotspot_y_ = read<int32_t>();
}
开发者ID:apreiml,项目名称:genieutils,代码行数:17,代码来源:SlpFrame.cpp


示例15: endElement

DECLARE_EXPORT void Item::endElement(XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement)
{
  if (pAttr.isA(Tags::tag_operation))
  {
    Operation *o = dynamic_cast<Operation*>(pIn.getPreviousObject());
    if (o) setOperation(o);
    else throw LogicException("Incorrect object type during read operation");
  }
  else if (pAttr.isA(Tags::tag_price))
    setPrice(pElement.getDouble());
  else
  {
    HasDescription::endElement(pIn, pAttr, pElement);
    HasHierarchy<Item>::endElement(pIn, pAttr, pElement);
  }
}
开发者ID:albertca,项目名称:frePPLe,代码行数:16,代码来源:item.cpp


示例16: QNetworkReply

NoFileAccessReply::NoFileAccessReply(QObject* parent, const QNetworkRequest& req, const QNetworkAccessManager::Operation op)
    : QNetworkReply(parent)
{
    setRequest(req);
    setUrl(req.url());
    setOperation(op);

    qRegisterMetaType<NetworkError>();
    QString msg = (QCoreApplication::translate("QNetworkReply", "Protocol \"%1\" is unknown")
                   .arg(req.url().scheme()));
    setError(ProtocolUnknownError, msg);

    QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
                              Q_ARG(QNetworkReply::NetworkError, ProtocolUnknownError));
    QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
}
开发者ID:jobinsjohn,项目名称:phantomjs,代码行数:16,代码来源:networkaccessmanager.cpp


示例17: QNetworkReply

RendererReply::RendererReply(QObject* object, const QNetworkRequest& request)
    : QNetworkReply(object)
      , m_position(0)
{
    setRequest(request);
    setOperation(QNetworkAccessManager::GetOperation);
    setHeader(QNetworkRequest::ContentTypeHeader,QVariant("image/png"));
    open(ReadOnly|Unbuffered);
    setUrl(request.url());

    QString fileName = request.url().host();
    g_mainWindow->loadImageFromDB(fileName, m_buffer);
    setHeader(QNetworkRequest::ContentTypeHeader, "image/png");
    m_position = 0;
    QTimer::singleShot(0, this, SIGNAL(readyRead()));
    QTimer::singleShot(0, this, SIGNAL(finished()));
}
开发者ID:brookhong,项目名称:wikenotes,代码行数:17,代码来源:noteitem.cpp


示例18: reset

bool
xpcc::Scp1000<Spi, Cs, Int>::initialize(scp1000::Operation opMode)
{
	chipSelect.setOutput();
	chipSelect.set();
#if defined XPCC__CPU_ATXMEGA
	interruptPin.setInput(::xpcc::atxmega::PULLDOWN);
#else
	interruptPin.setInput();
#endif
	bool result;
	// Reset the chip
	result = reset();
	if (result) {
		result &= setOperation(opMode);
	}
	return result;
}
开发者ID:pikeBishop,项目名称:OMP_IndMatrixDisplay,代码行数:18,代码来源:scp1000_impl.hpp


示例19: QNetworkReply

KVNetworkReply::KVNetworkReply(QObject *parent, QNetworkReply *toCopy, QNetworkAccessManager *mgr, bool translate) :
	QNetworkReply(parent) {
	d = new KVNetworkReplyPrivate;
	d->finished = false;
	d->copied = toCopy;
	d->manager = mgr;
	d->translate = translate;

	setOperation(d->copied->operation());
	setRequest(d->copied->request());
	setUrl(d->copied->url());

	// Translate reply when it's complete
	connect(d->copied, SIGNAL(finished()), SLOT(handleResponse()));

	connect(d->copied, SIGNAL(encrypted()), SIGNAL(encrypted()));
	connect(d->copied, SIGNAL(metaDataChanged()), SIGNAL(metaDataChanged()));
}
开发者ID:KanColleTool,项目名称:kct-viewer,代码行数:18,代码来源:KVNetworkReply.cpp


示例20: QNetworkReply

QNetworkReplyDataImpl::QNetworkReplyDataImpl(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op)
    : QNetworkReply(*new QNetworkReplyDataImplPrivate(), parent)
{
    Q_D(QNetworkReplyDataImpl);
    setRequest(req);
    setUrl(req.url());
    setOperation(op);
    setFinished(true);
    QNetworkReply::open(QIODevice::ReadOnly);

    QUrl url = req.url();

    // FIXME qDecodeDataUrl should instead be rewritten to have the QByteArray
    // and the mime type as an output parameter and return a bool instead
    d->decodeDataUrlResult = qDecodeDataUrl(url);

    if (! d->decodeDataUrlResult.first.isNull()) {
        QString &mimeType = d->decodeDataUrlResult.first;
        qint64 size = d->decodeDataUrlResult.second.size();
        setHeader(QNetworkRequest::ContentTypeHeader, mimeType);
        setHeader(QNetworkRequest::ContentLengthHeader, size);
        QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection);

        d->decodedData.setBuffer(&d->decodeDataUrlResult.second);
        d->decodedData.open(QIODevice::ReadOnly);

        QMetaObject::invokeMethod(this, "downloadProgress", Qt::QueuedConnection,
                                  Q_ARG(qint64,size), Q_ARG(qint64, size));
        QMetaObject::invokeMethod(this, "readyRead", Qt::QueuedConnection);
        QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
    } else {
        // something wrong with this URI
        const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend",
                            "Invalid URI: %1").arg(QString::fromLatin1(url.toEncoded()));
        setError(QNetworkReply::ProtocolFailure, msg);
        QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection,
                                  Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProtocolFailure));
        QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
    }
}
开发者ID:redanium,项目名称:qt,代码行数:40,代码来源:qnetworkreplydataimpl.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setOption函数代码示例发布时间:2022-05-30
下一篇:
C++ setOpenMode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap