// Convert from VehicleInterfaces 1.2.5 to VehicleInterfaces 2.0.0

// clear
convertClear();

// Change references to classes that are obsolete
convertClass("VehicleInterfaces.Brakes.Interfaces.StandardBus",
              "ObsoleteVehicleInterfaces2.Brakes.Interfaces.StandardBus");
convertClass("VehicleInterfaces.Chassis.Interfaces.StandardBus",
              "ObsoleteVehicleInterfaces2.Chassis.Interfaces.StandardBus");
convertClass("VehicleInterfaces.DriverEnvironments.Interfaces.MinimalBus",
              "ObsoleteVehicleInterfaces2.DriverEnvironments.Interfaces.MinimalBus");
convertClass("VehicleInterfaces.DriverEnvironments.Interfaces.BusForAutomaticTransmission",
              "ObsoleteVehicleInterfaces2.DriverEnvironments.Interfaces.BusForAutomaticTransmission");
convertClass("VehicleInterfaces.DriverEnvironments.Interfaces.BusForManualTransmission",
              "ObsoleteVehicleInterfaces2.DriverEnvironments.Interfaces.BusForManualTransmission");
convertClass("VehicleInterfaces.Drivers.Interfaces.MinimalBus",
              "ObsoleteVehicleInterfaces2.Drivers.Interfaces.MinimalBus");
convertClass("VehicleInterfaces.Drivers.Interfaces.BusForAutomaticTransmission",
              "ObsoleteVehicleInterfaces2.Drivers.Interfaces.BusForAutomaticTransmission");
convertClass("VehicleInterfaces.Drivers.Interfaces.BusForManualTransmission",
              "ObsoleteVehicleInterfaces2.Drivers.Interfaces.BusForManualTransmission");
convertClass("VehicleInterfaces.Engines.Interfaces.StandardBus",
              "ObsoleteVehicleInterfaces2.Engines.Interfaces.StandardBus");
convertClass("VehicleInterfaces.Transmissions.Interfaces.StandardBus",
              "ObsoleteVehicleInterfaces2.Transmissions.Interfaces.StandardBus");
convertClass("VehicleInterfaces.Transmissions.Interfaces.StandardControlBus",
              "ObsoleteVehicleInterfaces2.Transmissions.Interfaces.StandardControlBus");

convertClass("VehicleInterfaces.Blocks.RealPassThrough",
              "Modelica.Blocks.Routing.RealPassThrough");
convertClass("VehicleInterfaces.Blocks.IntegerPassThrough",
              "Modelica.Blocks.Routing.IntegerPassThrough");
convertClass("VehicleInterfaces.Blocks.BooleanPassThrough",
              "Modelica.Blocks.Routing.BooleanPassThrough");
convertClass("VehicleInterfaces.Icons.VariantLibrary",
              "Modelica.Icons.VariantsPackage");
convertClass("VehicleInterfaces.Icons.BaseClassPackage",
              "Modelica.Icons.BasesPackage");

// Parameter renamed
convertElement("VehicleInterfaces.Accessories.Interfaces.Base",
               "includeAccessoriesBearing", "includeEngineBearing");
convertElement({"VehicleInterfaces.Transmissions.Interfaces.Base",
                "VehicleInterfaces.Transmissions.Interfaces.BaseAutomaticTransmission",
                "VehicleInterfaces.Transmissions.Interfaces.BaseManualTransmission",
                "VehicleInterfaces.Transmissions.Interfaces.BaseTwoInputTransmission"},
                "includeTransmissionBearing", "includeEngineBearing");
convertElement("VehicleInterfaces.Chassis.Interfaces.ThreeAxleBase",
               {"end_5", "end_6"}, {"end_6", "end_5"});
convertElement("VehicleInterfaces.Chassis.Interfaces.FourAxleBase",
               {"end_5", "end_6", "end_7", "end_8"}, {"end_6", "end_5", "end_8", "end_7"});

convertElement({"VehicleInterfaces.Roads.CircleRoad",
                "VehicleInterfaces.Roads.FlatRoad",
                "VehicleInterfaces.Roads.Examples.Utilities.DummyTyre",
                "VehicleInterfaces.Roads.Interfaces.frictionCoefficientBase"},
                "mue", "mu");
convertElement({"VehicleInterfaces.Roads.CircleRoad.frictionCoefficient",
                "VehicleInterfaces.Roads.FlatRoad.frictionCoefficient"},
                "mue_fixed", "mu_fixed");

// Change modifier
convertModifiers("VehicleInterfaces.Accessories.MinimalAccessories",
                 {"accessoriesLoad"},
                 {"accessoriesLoad=if (%accessoriesLoad%<0) then (-1*%accessoriesLoad%) else %accessoriesLoad%"},
                 true);

// Changes due to conversion to Modelica Standard Library 4.0.0
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_1.mue0","brake_1.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_1.mue_pos","brake_1.mu_pos");
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_2.mue0","brake_2.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_2.mue_pos","brake_2.mu_pos");
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_3.mue0","brake_3.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_3.mue_pos","brake_3.mu_pos");
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_4.mue0","brake_4.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakes","brake_4.mue_pos","brake_4.mu_pos");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_1.mue0","brake_1.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_1.mue_pos","brake_1.mu_pos");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_2.mue0","brake_2.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_2.mue_pos","brake_2.mu_pos");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_3.mue0","brake_3.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_3.mue_pos","brake_3.mu_pos");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_4.mue0","brake_4.mu0");
convertElement("VehicleInterfaces.Brakes.MinimalBrakesUsingPedal","brake_4.mue_pos","brake_4.mu_pos");
convertElement("VehicleInterfaces.Transmissions.SingleGearManualTransmission","clutch.mue0","clutch.mu0");
convertElement("VehicleInterfaces.Transmissions.SingleGearManualTransmission","clutch.mue_pos","clutch.mu_pos");
