Changeset 14180


Ignore:
Timestamp:
Nov 26, 2019 10:46:16 AM (9 days ago)
Author:
jwedin
Message:

Refactored the Fmi XML code generation. #5720

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-cw-ii/Compiler/FmiXMLCodeGen/src/jastadd/FmiXMLGenerator.jrag

    r13384 r14180  
    3737                isInput() ||
    3838                myOptions().getBooleanOption("expose_temp_vars_in_fmu") && uses().size() > 0);
     39    }
     40
     41    /**
     42     * Checks if a derivative variable should be exposed in the XML
     43     */
     44    public boolean FVariable.shouldGenerateXMLDerivativeVariable() {
     45        return isDerivativeVariable() || isDummyDerivativeVariable();
    3946    }
    4047
     
    15231530                    return fclass.xmlVariableIndexMap().get(lowerOrderVar.asFVariable().generateXMLName());
    15241531                } else {
    1525                     //throw new InternalCompilerError("Unable to find lower order variable for derivative variable " + var.displayName());
    1526                     return 0; //TODO: This should not be needed! Fix upstream.
     1532                    throw new InternalCompilerError("Unable to find lower order variable for derivative variable " + var.displayName());
    15271533                }
    15281534            }
     
    15361542                generateAttributeIfSet(FAttribute.NOMINAL, variable, genPrinter);
    15371543                generateStartAttributeIfSet(variable, genPrinter);
    1538                 if (variable.isDerivativeVariable() || variable.isDummyDerivativeVariable()) {
     1544                if (variable.shouldGenerateXMLDerivativeVariable()) {
    15391545                    generateAttribute("derivative", getDerivativeIdx(variable), genPrinter);
    15401546                }
Note: See TracChangeset for help on using the changeset viewer.