本文整理汇总了C++中setOperation函数的典型用法代码示例。如果您正苦于以下问题:C++ setOperation函数的具体用法?C++ setOperation怎么用?C++ setOperation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOperation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: setOperation
//------------------------------------------------------------------------------
void ISerializable::writeObject(std::ostream &ostr)
{
setOperation(OP_WRITE);
ostr_ = &ostr;
serializeObject();
}
示例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()));
}
示例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;
}
示例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);
}
示例6: setRequest
void EWASiteRoutePoint::initStore( const QNetworkRequest& rec, QNetworkAccessManager::Operation op,
const QByteArray& data )
{
setRequest( rec );
setData( data );
setOperation( op );
}
示例7: inputsCount
bool Math::start()
{
if ( inputsCount() != outputsCount() )
return false;
buffer.reset( new float[ inputsCount() ]() );
settings->setRunMode( true );
setOperation();
return true;
}
示例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()));
}
示例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();
}
示例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()));
}
示例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);
}
示例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);
}
示例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()));
}
示例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>();
}
示例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);
}
}