//  Conversion script for Buildings library
//  from: Version 11
//  to:   Version 12.0.0

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/4149
convertClass("Buildings.ThermalZones.EnergyPlus_9_6_0",
             "Buildings.Obsolete.ThermalZones.EnergyPlus_9_6_0");

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/4134
convertModifiers("Buildings.DHC.ETS.Combined.Controls.Reset",
                 {"THeaWatSupSetMin"}, {"TWatSupSetMinMax"}, true);

// Conversion for https://github.com/ibpsa/modelica-ibpsa/issues/1956
convertModifiers("Buildings.Fluid.SolarCollectors.ASHRAE93",
                {"nPanelsSer"}, fill("",0), true);
convertModifiers("Buildings.Fluid.SolarCollectors.EN12975",
                {"nPanelsSer"}, fill("",0), true);

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/4069

convertModifiers("Buildings.Occupants.Office.Blinds.Haldi2008BlindsTIn",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Blinds.Haldi2008BlindsTOut",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Blinds.Inkarojrit2008BlindsSolarIntensity",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Blinds.Zhang2012BlindsSolarAltitude",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Blinds.Zhang2012BlindsSolarIntensity",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Lighting.Gunay2016Light",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Lighting.Hunt1979Light",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Lighting.Love1998Light1",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Lighting.Love1998Light2",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Lighting.Reinhart2003Light",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Occupancy.Wang2005Occupancy",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Haldi2008WindowsTIn",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Haldi2008WindowsTOut",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Haldi2009WindowsTInTout",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Herkel2008WindowsCompletelyOpen",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Herkel2008WindowsSmall",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Herkel2008WindowsTiltedOpen",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Rijal2007WindowsTInTOutTComf",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Yun2008WindowsTIn",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Yun2008WindowsTOut",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Zhang2012WindowsAll",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Zhang2012WindowsEast",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Zhang2012WindowsNorth",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Zhang2012WindowsSouth",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Office.Windows.Zhang2012WindowsWest",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.AirConditioning.Ren2014ACBedroom",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.AirConditioning.Ren2014ACLivingroom",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.Heating.Nicol2001HeatingEU",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.Heating.Nicol2001HeatingPakistan",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.Heating.Nicol2001HeatingUK",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.Windows.Nicol2001WindowsEU",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.Windows.Nicol2001WindowsPakistan",
                 {"seed"}, {"localSeed"}, true);
convertModifiers("Buildings.Occupants.Residential.Windows.Nicol2001WindowsUK",
                 {"seed"}, {"localSeed"}, true);

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/3965

convertModifiers("Buildings.Fluid.Movers.FlowControlled_dp",
                 {"use_inputFilter"}, {"use_riseTime"}, true);
convertModifiers("Buildings.Fluid.Movers.FlowControlled_m_flow",
                 {"use_inputFilter"}, {"use_riseTime"}, true);
convertModifiers("Buildings.Fluid.Movers.SpeedControlled_y",
                 {"use_inputFilter"}, {"use_riseTime"}, true);
convertModifiers("Buildings.Fluid.Movers.Preconfigured.FlowControlled_dp",
                 {"use_inputFilter"}, {"use_riseTime"}, true);
convertModifiers("Buildings.Fluid.Movers.Preconfigured.FlowControlled_m_flow",
                 {"use_inputFilter"}, {"use_riseTime"}, true);
convertModifiers("Buildings.Fluid.Movers.Preconfigured.SpeedControlled_y",
                 {"use_inputFilter"}, {"use_riseTime"}, true);

convertModifiers("Buildings.Fluid.Actuators.Dampers.Exponential",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Dampers.MixingBox",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Dampers.MixingBoxMinimumFlow",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Dampers.PressureIndependent",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.ThreeWayLinear",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.ThreeWayTable",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.TwoWayButterfly",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.TwoWayLinear",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.TwoWayPolynomial",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.TwoWayPressureIndependent",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.Actuators.Valves.TwoWayTable",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);


convertModifiers("Buildings.DHC.Plants.Cooling.Subsystems.CoolingTowersParallel",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.DHC.Plants.Cooling.Subsystems.CoolingTowersWithBypass",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);

convertModifiers("Buildings.Fluid.HydronicConfigurations.Components.ThreeWayValve",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.HydronicConfigurations.Components.TwoWayValve",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.Fluid.HydronicConfigurations.Components.Pump",
                 {"use_inputFilter"}, {"use_riseTime"}, true);

convertModifiers("Buildings.DHC.Plants.Combined.Subsystems.ChillerGroup",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.DHC.Plants.Combined.Subsystems.ChillerHeatRecoveryGroup",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);
convertModifiers("Buildings.DHC.Plants.Combined.Subsystems.HeatPumpGroup",
                 {"use_inputFilter", "riseTime"}, {"use_strokeTime", "strokeTime"}, true);

convertModifiers("Buildings.DHC.Plants.Combined.Subsystems.MultiplePumpsDp",
                 {"use_inputFilter"}, {"use_riseTime"}, true);
convertModifiers("Buildings.DHC.Plants.Combined.Subsystems.MultiplePumpsFlow",
                 {"use_inputFilter"}, {"use_riseTime"}, true);
convertModifiers("Buildings.DHC.Plants.Combined.Subsystems.MultiplePumpsSpeed",
                 {"use_inputFilter"}, {"use_riseTime"}, true);

// Remove non-used parameter
convertModifiers("Buildings.DHC.Plants.Cooling.Controls.FlowControl",
                {"use_outFil"}, fill("",0), true);


// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/3787
convertModifiers("Buildings.Controls.OBC.CDL.Logical.TrueHold",
                 {"duration", "falseHoldDuration"},
                 {"trueHoldDuration=%duration%", "final falseHoldDuration=0"})
convertClass("Buildings.Controls.OBC.CDL.Logical.TrueHold",
             "Buildings.Controls.OBC.CDL.Logical.TrueFalseHold")

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/3809
convertClass("Buildings.Templates.Plants.Controls.Utilities.SortWithIndices",
             "Buildings.Controls.OBC.CDL.Reals.Sort");

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/3604
convertClass("Buildings.Fluid.SolarCollectors",
             "Buildings.Obsolete.Fluid.SolarCollectors");

// Conversion for https://github.com/ibpsa/modelica-ibpsa/issues/1885
convertModifiers("Buildings.Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield",
                {"dynFil"}, fill("",0), true);
convertModifiers("Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube",
                {"dynFil"}, fill("",0), true);
convertModifiers("Buildings.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube",
                {"dynFil"}, fill("",0), true);
