本文整理汇总了C++中PythonObject::getTimeperiod方法的典型用法代码示例。如果您正苦于以下问题:C++ PythonObject::getTimeperiod方法的具体用法?C++ PythonObject::getTimeperiod怎么用?C++ PythonObject::getTimeperiod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PythonObject
的用法示例。
在下文中一共展示了PythonObject::getTimeperiod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setattro
DECLARE_EXPORT int SolverMRP::setattro(const Attribute& attr, const PythonObject& field)
{
if (attr.isA(Tags::tag_constraints))
setConstraints(field.getInt());
else if (attr.isA(Tags::tag_autocommit))
setAutocommit(field.getBool());
else if (attr.isA(Tags::tag_userexit_flow))
setUserExitFlow(field);
else if (attr.isA(Tags::tag_userexit_demand))
setUserExitDemand(field);
else if (attr.isA(Tags::tag_userexit_buffer))
setUserExitBuffer(field);
else if (attr.isA(Tags::tag_userexit_resource))
setUserExitResource(field);
else if (attr.isA(Tags::tag_userexit_operation))
setUserExitOperation(field);
else if (attr.isA(Tags::tag_plantype))
setPlanType(field.getInt());
// Less common parameters
else if (attr.isA(tag_iterationthreshold))
setIterationThreshold(field.getDouble());
else if (attr.isA(tag_iterationaccuracy))
setIterationAccuracy(field.getDouble());
else if (attr.isA(tag_lazydelay))
setLazyDelay(field.getTimeperiod());
else if (attr.isA(tag_allowsplits))
setAllowSplits(field.getBool());
else if (attr.isA(tag_planSafetyStockFirst))
setPlanSafetyStockFirst(field.getBool());
// Default parameters
else
return Solver::setattro(attr, field);
return 0;
}
示例2: if
DECLARE_EXPORT int SetupMatrix::Rule::setattro(const Attribute& attr, const PythonObject& field)
{
if (attr.isA(Tags::tag_priority))
setPriority(field.getInt());
else if (attr.isA(Tags::tag_fromsetup))
setFromSetup(field.getString());
else if (attr.isA(Tags::tag_tosetup))
setToSetup(field.getString());
else if (attr.isA(Tags::tag_duration))
setDuration(field.getTimeperiod());
else if (attr.isA(Tags::tag_cost))
setCost(field.getDouble());
else
return -1; // Error
return 0; // OK
}