Exemplo n.º 1
0
DECLARE_EXPORT void SolverMRP::endElement(XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement)
{
  if (pAttr.isA(Tags::tag_constraints))
    setConstraints(pElement.getInt());
  else if (pAttr.isA(Tags::tag_autocommit))
    setAutocommit(pElement.getBool());
  else if (pAttr.isA(Tags::tag_userexit_flow))
    setUserExitFlow(pElement.getString());
  else if (pAttr.isA(Tags::tag_userexit_demand))
    setUserExitDemand(pElement.getString());
  else if (pAttr.isA(Tags::tag_userexit_buffer))
    setUserExitBuffer(pElement.getString());
  else if (pAttr.isA(Tags::tag_userexit_resource))
    setUserExitResource(pElement.getString());
  else if (pAttr.isA(Tags::tag_userexit_operation))
    setUserExitOperation(pElement.getString());
  else if (pAttr.isA(Tags::tag_plantype))
    setPlanType(pElement.getInt());
  // Less common parameters
  else if (pAttr.isA(tag_iterationthreshold))
    setIterationThreshold(pElement.getDouble());
  else if (pAttr.isA(tag_iterationaccuracy))
    setIterationAccuracy(pElement.getDouble());
  else if (pAttr.isA(tag_lazydelay))
    setLazyDelay(pElement.getTimeperiod());
  // Default parameters
  else
    Solver::endElement(pIn, pAttr, pElement);
}
Exemplo n.º 2
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.º 3
0
bool OracleWriter::prepareOpen(std::vector<DatabaseColumn *> const &oColumns)
{
    setSQLLog(createConfigPanel()->getPath(), createConfigPanel()->getExportSQL(), createConfigPanel()->getExportSQLOnly());
    if(!SociContainer::prepareOpen(oColumns))
        return false;

    OracleWriterPanel *wp = createConfigPanel();
    setAutocommit(wp->getAutoCommitCount());

    StdString table = getTablename();
    if(table.length() == 0)
    {
        ErrorMessage(spt::logging::LoggingItem::LOG_ERROR, MODULENAME, "No target table selected!");
        return false;
    }

    if(getSession() == NULL)
    {
        ErrorMessage(spt::logging::LoggingItem::LOG_ERROR, MODULENAME, "Database session not initialized!");
        return false;
    }

    if(mAllowTruncate)
    {
#warning TODO: Implement truncate
    }

    if(mAllowModifyColumns)
    {
#warning TODO: Implement modify columns
    }

    return true;
}