diff --git a/VectoCommon/VectoCommon/VectoCommon.csproj b/VectoCommon/VectoCommon/VectoCommon.csproj index aee18349db665a9187b59f5fc38aaf0f4311f596..c521e767330f368e838681b8c36a8f7c0fc4a92d 100644 --- a/VectoCommon/VectoCommon/VectoCommon.csproj +++ b/VectoCommon/VectoCommon/VectoCommon.csproj @@ -25,7 +25,8 @@ <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdaper/DeclarationDataAdapter.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdaper/DeclarationDataAdapter.cs index d67903002400e8e7bb10e5ccc7074600944b0f94..30224927faf4623b8b07b129b28335249114d7b0 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdaper/DeclarationDataAdapter.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdaper/DeclarationDataAdapter.cs @@ -191,7 +191,7 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper retVal.Gears = gears.Select((gear, i) => { var gearLossMap = TransmissionLossMap.Create(gear.LossMap, gear.Ratio, string.Format("Gear {0}", i + 1)); var gearFullLoad = gear.FullLoadCurve == null - ? engine.FullLoadCurve + ? null : FullLoadCurveReader.Create(gear.FullLoadCurve, true); var fullLoadCurve = IntersectFullLoadCurves(engine.FullLoadCurve, gearFullLoad); @@ -265,7 +265,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper return retVal; } - private void WarnDeclarationMode(string inputData) { Log.Warn("{0} not in Declaration Mode!", inputData); @@ -276,7 +275,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdaper return SetCommonRetarderData(retarder, vehicle); } - public static List<CrossWindCorrectionCurveReader.CrossWindCorrectionEntry> GetDeclarationAirResistanceCurve( VehicleCategory vehicleCategory, SquareMeter aerodynamicDragAera) { diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs index ddcf7e06248995ea94fab57f191d53999907543c..e14ca9ddf30d5993fc780057ce8804587762111e 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs @@ -70,7 +70,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl protected internal DrivingBehaviorEntry BrakeTrigger { get; set; } - public IResponse Request(Second absTime, Meter ds, MeterPerSecond targetVelocity, Radian gradient) { if (CurrentDrivingMode == DrivingMode.DrivingModeBrake) { @@ -118,7 +117,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return Driver.DrivingActionHalt(absTime, dt, targetVelocity, gradient); } - private void UpdateDrivingAction(Meter currentDistance, Meter ds) { var nextAction = GetNextDrivingAction(currentDistance, ds); @@ -166,7 +164,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl Log.Debug("Next Driving Action: {0}", NextDrivingAction); } - protected DrivingBehaviorEntry GetNextDrivingAction(Meter minDistance, Meter ds) { var currentSpeed = Driver.DataBus.VehicleSpeed; @@ -225,7 +222,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl //===================================== - public interface IDriverMode { DefaultDriverStrategy DriverStrategy { get; set; } @@ -266,7 +262,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl return response; } - // if we accelerate in the current simulation interval the ActionDistance of the next action // changes and we might pass the ActionDistance - check again... if (response.Acceleration <= 0) { @@ -292,7 +287,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl //DriverStrategy.BrakeTrigger = DriverStrategy.NextDrivingAction; } - Log.Debug("Exceeding next ActionDistance at {0}. Reducing max Distance from {2} to {1}", DriverStrategy.NextDrivingAction.ActionDistance, newds, ds); return new ResponseDrivingCycleDistanceExceeded() { @@ -355,15 +349,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl response = Driver.DrivingActionAccelerate(absTime, ds, targetVelocity, gradient); } response.Switch(). - Case<ResponseGearShift>(() => { - response = Driver.DrivingActionRoll(absTime, ds, velocity, gradient); - response.Switch(). - Case<ResponseUnderload>(() => { - // overload may happen if driver limits acceleration when rolling downhill - response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient); - }). - Case<ResponseSpeedLimitExceeded>(() => { response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient); }); - }). Case<ResponseUnderload>(r => { if (DriverStrategy.OverspeedAllowed(gradient, targetVelocity)) { response = Driver.DrivingActionCoast(absTime, ds, velocity, gradient); @@ -374,6 +359,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient); } }); + + response.Switch(). + Case<ResponseGearShift>(r => { + response = Driver.DrivingActionRoll(absTime, ds, velocity, gradient); + response.Switch(). + Case<ResponseUnderload>(() => { + // overload may happen if driver limits acceleration when rolling downhill + response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient); + }). + Case<ResponseSpeedLimitExceeded>(() => { response = Driver.DrivingActionBrake(absTime, ds, velocity, gradient); }); + }); } else { if (DataBus.VehicleSpeed.IsSmallerOrEqual(0.SI<MeterPerSecond>())) { // the clutch is disengaged, and the vehicle stopped - we can't perform a roll action. wait for the clutch to be engaged