Opened 8 years ago
Closed 7 years ago
#4426 closed defect (worksforme)
Flattening error for replaceable modell
Reported by: | Niklas Worschech | Owned by: | somebody |
---|---|---|---|
Priority: | high | Milestone: | 2.0.0 |
Component: | Frontend | Version: | |
Keywords: | replaceable package | Cc: | Adrian Pop, Per Östlund, Andreas.Hofmann7@… |
Description (last modified by )
For the attached modell the omc stops with the following error
Error: Class fluidWorld2.calcRho could not be found in scope of Testlib.Component (looking for a function or record).
Error: Error occurred while flattening model Testlib.test
Is this because of the use of replaceable package?
package Testlib model World replaceable package Fluid = Testlib.Fluids.BaseFluid constrainedby Testlib.Fluids.partialFluidPackage; //extends Fluid.FluidParameters; // function to calculate Rho function calcRho = Fluid.calcRho; annotation (defaultComponentName="fluidWorld2", defaultComponentPrefixes="inner", missingInnerMesage = "You will need a World componend within the model!",Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end World; package Fluids partial package partialFluidPackage end partialFluidPackage; package BaseFluid extends Testlib.Fluids.partialFluidPackage; record FluidParameters parameter Real a = 3; end FluidParameters; function calcRho output Real rho; algorithm rho :=5; end calcRho; end BaseFluid; package Fluid1 extends Testlib.Fluids.partialFluidPackage; record FluidParameters parameter Real b = 33; end FluidParameters; function calcRho output Real rho; algorithm rho := 8; end calcRho; end Fluid1; end Fluids; model Component outer Testlib.World fluidWorld2; Real p; Real rho; equation p = time; rho = fluidWorld2.calcRho(); end Component; model test inner World fluidWorld2(redeclare package Fluid = Fluids.Fluid1); Component component; end test; end Testlib;
Change History (3)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Milestone: | Future → 2.0.0 |
---|
comment:3 by , 7 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Yes. I propose to let this pattern wait for the new frontend (OM 2.0) where the model works fine:
If this is acceptable, you can close the ticket.