Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit df440576 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Merge pull request #45 in VECTO/vecto-sim from...

Merge pull request #45 in VECTO/vecto-sim from ~EMKRISPMI/vecto-sim:feature/VECTO-89-set-up-development-environment-for to develop

* commit '1a67a1e9':
  added many comments for interfaces, changed many methods to explicit interface member implementation, added wheels and needed interfaces
parents 9425212d 1a67a1e9
No related branches found
No related tags found
No related merge requests found
Showing
with 205 additions and 100 deletions
using TUGraz.VectoCore.Models.Connector.Ports.Impl;
namespace TUGraz.VectoCore.Models.Connector
{
internal class Connector<TI, TO, TP>
where TI : InPort, TP
where TO : OutPort, TP
{
protected TI InPort;
protected TO OutPort;
public void Connect(TI inPort, TO outPort)
{
InPort = inPort;
OutPort = outPort;
InPort.Connect(OutPort);
}
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IDriverDemandInPort
{
void Connect(IDriverDemandOutPort other);
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IDriverDemandInProvider
{
IDriverDemandInPort InPort();
}
}
\ No newline at end of file
using System;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IDriverDemandOutPort
{
IResponse Request(TimeSpan absTime, TimeSpan dt, MeterPerSecond velocity, double gradient);
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IDriverDemandOutProvider
{
IDriverDemandOutPort OutPort();
}
}
\ No newline at end of file
using System;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Connector.Ports
{
/// <summary>
/// Defines a connect method to connect the inport to an outport.
/// </summary>
public interface IDriverDemandInPort
{
/// <summary>
/// Connects the inport to another outport.
/// </summary>
void Connect(IDriverDemandOutPort other);
}
/// <summary>
/// Defines a request method for a DriverDemand-Out-Port.
/// </summary>
public interface IDriverDemandOutPort
{
/// <summary>
/// Requests the Outport with the given velocity [m/s] and road gradient [rad].
/// </summary>
/// <param name="absTime">[s]</param>
/// <param name="dt">[s]</param>
/// <param name="velocity">[m/s]</param>
/// <param name="gradient">[rad]</param>
IResponse Request(TimeSpan absTime, TimeSpan dt, MeterPerSecond velocity, Radian gradient);
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
/// <summary>
/// Defines a method to acquire an DriverDemand in port.
/// </summary>
public interface IDriverDemandInProvider
{
/// <summary>
/// Returns the inport to connect it to another outport.
/// </summary>
/// <returns></returns>
IDriverDemandInPort InPort();
}
/// <summary>
/// Defines a method to acquire an DriverDemand out port.
/// </summary>
public interface IDriverDemandOutProvider
{
/// <summary>
/// Returns the outport to send requests to.
/// </summary>
/// <returns></returns>
IDriverDemandOutPort OutPort();
}
}
\ No newline at end of file
using System;
namespace TUGraz.VectoCore.Models.Connector.Ports
{
/// <summary>
/// Defines a method to request the outport.
/// </summary>
public interface IDrivingCycleOutPort
{
/// <summary>
/// Requests a demand for a specific absolute time and a time interval dt.
/// </summary>
/// <param name="absTime">The absolute time of the simulation.</param>
/// <param name="dt">The current time interval.</param>
/// <returns></returns>
IResponse Request(TimeSpan absTime, TimeSpan dt);
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
/// <summary>
/// Defines a method to acquire an DriverCycle Demand out port.
/// </summary>
public interface IDrivingCycleOutProvider
{
/// <summary>
/// Returns the outport to send requests to.
/// </summary>
/// <returns></returns>
IDrivingCycleOutPort OutPort();
}
}
\ No newline at end of file
using System;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Connector.Ports
{
/// <summary>
/// Defines a connect method to connect the inport to an outport.
/// </summary>
public interface IFvInPort
{
/// <summary>
/// Connects the inport to another outport.
/// </summary>
void Connect(IFvOutPort other);
}
/// <summary>
/// Defines a request method for a Fv-Out-Port.
/// </summary>
public interface IFvOutPort
{
/// <summary>
/// Requests the Outport with the given force [N] and vehicle velocity [m/s].
/// </summary>
/// <param name="absTime">[s]</param>
/// <param name="dt">[s]</param>
/// <param name="force">[N]</param>
/// <param name="velocity">[m/s]</param>
IResponse Request(TimeSpan absTime, TimeSpan dt, Newton force, MeterPerSecond velocity);
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IInPort {}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IInShaft
{
ITnInPort InShaft();
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IOutPort {}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IOutShaft
{
ITnOutPort OutShaft();
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface IResponse {}
/// <summary>
/// Defines an interface for a Response.
/// </summary>
public interface IResponse {}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
/// <summary>
/// Defines a method to acquire an Fv in port.
/// </summary>
public interface IRoadPortInProvider
{
/// <summary>
/// Returns the inport to connect it to another outport.
/// </summary>
/// <returns></returns>
IFvInPort InPort();
}
/// <summary>
/// Defines a method to acquire an Fv out port.
/// </summary>
public interface IRoadPortOutProvider
{
/// <summary>
/// Returns the outport to send requests to.
/// </summary>
/// <returns></returns>
IFvOutPort OutPort();
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
/// <summary>
/// Defines a method to acquire an Tn in port.
/// </summary>
public interface IInShaft
{
/// <summary>
/// Returns the inport to connect it to another outport.
/// </summary>
/// <returns></returns>
ITnInPort InShaft();
}
/// <summary>
/// Defines a method to acquire an Tn out port.
/// </summary>
public interface IOutShaft
{
/// <summary>
/// Returns the outport to send requests to.
/// </summary>
/// <returns></returns>
ITnOutPort OutShaft();
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface ITnInPort : ITnPort, IInPort
{
void Connect(ITnOutPort other);
}
}
\ No newline at end of file
using System;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface ITnOutPort : ITnPort, IOutPort
{
/// <summary>
/// Requests the Outport with the given torque [Nm] and angularVelocity [rad/s].
/// </summary>
/// <param name="absTime">[s]</param>
/// <param name="dt">[s]</param>
/// <param name="torque">[Nm]</param>
/// <param name="angularVelocity">[rad/s]</param>
IResponse Request(TimeSpan absTime, TimeSpan dt, NewtonMeter torque, RadianPerSecond angularVelocity);
}
}
\ No newline at end of file
namespace TUGraz.VectoCore.Models.Connector.Ports
using System;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Models.Connector.Ports
{
public interface ITnPort {}
/// <summary>
/// Defines a connect method to connect the inport to an outport.
/// </summary>
public interface ITnInPort
{
/// <summary>
/// Connects the inport to another outport.
/// </summary>
void Connect(ITnOutPort other);
}
/// <summary>
/// Defines a request method for a Tn-Out-Port.
/// </summary>
public interface ITnOutPort
{
/// <summary>
/// Requests the Outport with the given torque [Nm] and angularVelocity [rad/s].
/// </summary>
/// <param name="absTime">[s]</param>
/// <param name="dt">[s]</param>
/// <param name="torque">[Nm]</param>
/// <param name="angularVelocity">[rad/s]</param>
IResponse Request(TimeSpan absTime, TimeSpan dt, NewtonMeter torque, RadianPerSecond angularVelocity);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment