Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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
}