本文整理汇总了C++中generatorbase::GeneratorCustomizer类的典型用法代码示例。如果您正苦于以下问题:C++ GeneratorCustomizer类的具体用法?C++ GeneratorCustomizer怎么用?C++ GeneratorCustomizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GeneratorCustomizer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BindingGenerator
PioneerGetLPSPosition::PioneerGetLPSPosition(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "quadcopterCommands/getLPSPosition.t"
, {
Binding::createConverting(
"@@[email protected]@"
, "X"
, customizer.factory()->stringPropertyConverter(id, "X"))
, Binding::createConverting(
"@@[email protected]@"
, "Y"
, customizer.factory()->stringPropertyConverter(id, "Y"))
, Binding::createConverting(
"@@[email protected]@"
, "Z"
, customizer.factory()->stringPropertyConverter(id, "Z"))
}
, parent)
{
customizer.factory()->functionBlockConverter(id, "")->convert(
QString("%1 = 0;%2 = 0;%3 = 0;")
.arg(repo.stringProperty(id, "X"))
.arg(repo.stringProperty(id, "Y"))
.arg(repo.stringProperty(id, "Z")));
}
示例2: BindingGenerator
EnginesStopGenerator::EnginesStopGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "engines/stop.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Ports"
, static_cast<Ev3GeneratorFactory *>(customizer.factory())->outputPortNameConverter())
<< Binding::createConverting("@@[email protected]@", "Mode", customizer.factory()->breakModeConverter())
, parent)
{
}
示例3: BindingGenerator
ReadSensorArrayGenerator::ReadSensorArrayGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "sensors/lineLeader/readSensorArray.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port"
, static_cast<Ev3GeneratorFactory *>(customizer.factory())->portNameConverter())
, parent)
{
Binding::ConverterInterface *nameNormalizer = customizer.factory()->nameNormalizerConverter();
const QString variable = nameNormalizer->convert(mRepo.property(mId, "Variable").toString());
addBinding(Binding::createStatic("@@[email protected]@", variable));
customizer.factory()->functionBlockConverter(id, "Variable")->convert(QString("%1 = {0}").arg(variable));
}
示例4: BindingGenerator
TrikEnginesGenerator::TrikEnginesGenerator(qrRepo::RepoApi const &repo
, generatorBase::GeneratorCustomizer &customizer
, qReal::Id const &id
, QString const &engineType
, QObject *parent)
: BindingGenerator(repo, customizer, id
, engineType.contains("EnginesBackward") ? "engines/backward.t" : "engines/forward.t"
, { Binding::createMultiTarget("@@[email protected]@", "Ports"
, dynamic_cast<trik::TrikGeneratorFactory *>(customizer.factory())->enginesConverter())
, Binding::createConverting("@@[email protected]@", "Power", customizer.factory()->intPropertyConverter()) }
, parent)
{
// AngularServo is just another block for EnginesForward, since it is controlled the same way as radial servo
// or power motor.
mCustomizer.factory()->engines()->registerUsageOnPorts(repo.property(id, "Ports").toString());
}
示例5: BindingGenerator
DrawPixelGenerator::DrawPixelGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/drawPixel.t"
, {
Binding::createConverting("@@[email protected]@", "XCoordinatePix"
, customizer.factory()->intPropertyConverter(id, "XCoordinatePix"))
, Binding::createConverting("@@[email protected]@", "YCoordinatePix"
, customizer.factory()->intPropertyConverter(id, "YCoordinatePix"))
}
, parent)
{
// Calling virtual readTemplate() before base class constructor will cause segfault.
addBinding(Binding::createStatic("@@[email protected]@", repo.property(id, "Redraw").toBool()
? readTemplate("drawing/redraw.t") : QString()));
}
示例6: BindingGenerator
DrawEllipseGenerator::DrawEllipseGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/drawEllipse.t"
, {
Binding::createConverting("@@[email protected]@", "XCoordinateEllipse"
, customizer.factory()->intPropertyConverter(id, "XCoordinateEllipse"))
, Binding::createConverting("@@[email protected]@", "YCoordinateEllipse"
, customizer.factory()->intPropertyConverter(id, "YCoordinateEllipse"))
, Binding::createConverting("@@[email protected]@", "WidthEllipse"
, customizer.factory()->intPropertyConverter(id, "WidthEllipse"))
, Binding::createConverting("@@[email protected]@", "HeightEllipse"
, customizer.factory()->intPropertyConverter(id, "HeightEllipse"))
}
, parent)
{
}
示例7: BindingGenerator
SetPainterColorGenerator::SetPainterColorGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/setPainterColor.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Color", new BackgroundColorConverter(customizer.factory()->pathToTemplates()))
, parent)
{
}
示例8: BindingGenerator
WaitForButtonGenerator::WaitForButtonGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/button.t"
, {Binding::createConverting("@@[email protected]@", "Button", customizer.factory()->portNameConverter())}
, parent)
{
}
示例9: BindingGenerator
DrawRectGenerator::DrawRectGenerator(qrRepo::RepoApi const &repo
, generatorBase::GeneratorCustomizer &customizer
, qReal::Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/drawRect.t"
, {
Binding::createConverting("@@[email protected]@", "XCoordinateRect"
, customizer.factory()->intPropertyConverter(id, "XCoordinateRect"))
, Binding::createConverting("@@[email protected]@", "YCoordinateRect"
, customizer.factory()->intPropertyConverter(id, "YCoordinateRect"))
, Binding::createConverting("@@[email protected]@", "WidthRect"
, customizer.factory()->intPropertyConverter(id, "WidthRect"))
, Binding::createConverting("@@[email protected]@", "HeightRect"
, customizer.factory()->intPropertyConverter(id, "HeightRect"))
}
, parent)
{
}
示例10: BindingGenerator
StartCompassCalibrationGenerator::StartCompassCalibrationGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "sensors/startCompassCalibration.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port"
, static_cast<Ev3GeneratorFactory *>(customizer.factory())->portNameConverter())
, parent)
{
}
示例11: BindingGenerator
WaitGamepadButtonGenerator::WaitGamepadButtonGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/gamepadButton.t"
, {Binding::createConverting(
"@@[email protected]@", "Button", customizer.factory()->stringPropertyConverter(id, "Button"))
}
, parent)
{
}
示例12: BindingGenerator
ReadRGBGenerator::ReadRGBGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "sensors/readRGBIntoVariables.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port"
, static_cast<Ev3GeneratorFactory *>(customizer.factory())->portNameConverter())
, parent)
{
Binding::ConverterInterface *nameNormalizer = customizer.factory()->nameNormalizerConverter();
const QString rVariable = nameNormalizer->convert(mRepo.property(mId, "RVariable").toString());
addBinding(Binding::createStatic("@@[email protected]@", rVariable));
const QString gVariable = nameNormalizer->convert(mRepo.property(mId, "GVariable").toString());
addBinding(Binding::createStatic("@@[email protected]@", gVariable));
const QString bVariable = nameNormalizer->convert(mRepo.property(mId, "BVariable").toString());
addBinding(Binding::createStatic("@@[email protected]@", bVariable));
customizer.factory()->functionBlockConverter(id, "")->convert(
QString("%1 = 0;%2 = 0;%3 = 0;").arg(rVariable).arg(gVariable).arg(bVariable));
}
示例13: BindingGenerator
InitCameraGenerator::InitCameraGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id
, "videosensors/init" + repo.property(id, "Mode").toString() + "Sensor.t"
, { Binding::createConverting("@@[email protected]@"
, "DrawStream", customizer.factory()->boolPropertyConverter(id, "DrawStream", false))
}
, parent)
{
}
示例14: BindingGenerator
DrawRectGenerator::DrawRectGenerator(const qrRepo::RepoApi &repo
, generatorBase::GeneratorCustomizer &customizer
, const qReal::Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, (repo.stringProperty(id, "Filled") == "true")
? "drawing/drawFilledRect.t"
: "drawing/drawRect.t"
, {
Binding::createConverting("@@[email protected]@", "XCoordinateRect"
, customizer.factory()->intPropertyConverter(id, "XCoordinateRect"))
, Binding::createConverting("@@[email protected]@", "YCoordinateRect"
, customizer.factory()->intPropertyConverter(id, "YCoordinateRect"))
, Binding::createConverting("@@[email protected]@", "WidthRect"
, customizer.factory()->intPropertyConverter(id, "WidthRect"))
, Binding::createConverting("@@[email protected]@", "HeightRect"
, customizer.factory()->intPropertyConverter(id, "HeightRect"))
}
, parent)
{
addBinding(Binding::createStatic("@@[email protected]@", repo.property(id, "Redraw").toBool()
? readTemplate("drawing/redraw.t") : QString()));
}
示例15: BindingGenerator
ClearScreenBlockGenerator::ClearScreenBlockGenerator(qrRepo::RepoApi const &repo
, generatorBase::GeneratorCustomizer &customizer
, qReal::Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id
, static_cast<NxtGeneratorFactory *>(customizer.factory())->images().bmpFilesCount()
// WARNING: this may not work when we traverse here earlier than
// into drawing block but it will be executed before this block
? "drawing/clearUsedScreen.t"
: "drawing/clearUnusedScreen.t"
, {}, parent)
{
}