commit b611213384a0f6e9e0c23551c5a34a43484119af Author: Harald Wolff-Thobaben Date: Fri Aug 20 21:04:05 2021 +0200 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/.idea/.idea.ln.motion.interfaces/.idea/.gitignore b/.idea/.idea.ln.motion.interfaces/.idea/.gitignore new file mode 100644 index 0000000..c4c7d27 --- /dev/null +++ b/.idea/.idea.ln.motion.interfaces/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/projectSettingsUpdater.xml +/.idea.ln.motion.interfaces.iml +/contentModel.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/.idea.ln.motion.interfaces/.idea/encodings.xml b/.idea/.idea.ln.motion.interfaces/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.ln.motion.interfaces/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.ln.motion.interfaces/.idea/indexLayout.xml b/.idea/.idea.ln.motion.interfaces/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.ln.motion.interfaces/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.ln.motion.interfaces/.idea/vcs.xml b/.idea/.idea.ln.motion.interfaces/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.ln.motion.interfaces/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build.ln b/build.ln new file mode 100644 index 0000000..afa2528 --- /dev/null +++ b/build.ln @@ -0,0 +1,17 @@ +{ + "templates": [ + "dotnet" + ], + "env": { + "NUGET_SOURCE": "https://nexus.niclas-thobaben.de/repository/l--n.de/", + "CONFIGURATION": "Release" + }, + "stages": [ + { + "name": "prepare", + "commands": [ + "dotnet prepare */*.csproj" + ] + } + ] +} \ No newline at end of file diff --git a/ln.motion.interfaces.sln b/ln.motion.interfaces.sln new file mode 100644 index 0000000..bde89ff --- /dev/null +++ b/ln.motion.interfaces.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ln.motion.interfaces", "ln.motion.interfaces\ln.motion.interfaces.csproj", "{A4A61C31-9EF4-4D4E-BFF1-E17C54AEF30C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A4A61C31-9EF4-4D4E-BFF1-E17C54AEF30C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4A61C31-9EF4-4D4E-BFF1-E17C54AEF30C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4A61C31-9EF4-4D4E-BFF1-E17C54AEF30C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4A61C31-9EF4-4D4E-BFF1-E17C54AEF30C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/ln.motion.interfaces/Ax.cs b/ln.motion.interfaces/Ax.cs new file mode 100644 index 0000000..c06f3f2 --- /dev/null +++ b/ln.motion.interfaces/Ax.cs @@ -0,0 +1,25 @@ +namespace ln.motion.interfaces +{ + public abstract class Ax + { + public virtual float CurrentSpeed { get; } + public virtual float CurrentPosition { get; } + public virtual AxValues CurrentValues => new AxValues() {Speed = CurrentSpeed, Position = CurrentPosition}; + + public virtual float TargetSpeed { get; set; } + public virtual float TargetPosition { get; set; } + + public virtual AxValues TargetValues + { + get => new AxValues() {Speed = TargetSpeed, Position = TargetPosition}; + set + { + TargetPosition = value.Position; + TargetSpeed = value.Speed; + } + } + + public virtual bool IsEnabled { get; } + public virtual bool IsFaulted { get; } + } +} \ No newline at end of file diff --git a/ln.motion.interfaces/AxValues.cs b/ln.motion.interfaces/AxValues.cs new file mode 100644 index 0000000..19229c6 --- /dev/null +++ b/ln.motion.interfaces/AxValues.cs @@ -0,0 +1,8 @@ +namespace ln.motion.interfaces +{ + public struct AxValues + { + public float Speed; + public float Position; + } +} \ No newline at end of file diff --git a/ln.motion.interfaces/DrivesInterface.cs b/ln.motion.interfaces/DrivesInterface.cs new file mode 100644 index 0000000..16192d8 --- /dev/null +++ b/ln.motion.interfaces/DrivesInterface.cs @@ -0,0 +1,23 @@ +namespace ln.motion.interfaces +{ + public abstract class DrivesInterface + { + public abstract void Initialize(); + + public abstract bool IsOnline { get; } + + public abstract bool GetAxCurrentValues(out AxValues[] axValuesArray); + public abstract bool GetAxTargetValues(out AxValues[] axValuesArray); + public abstract bool SetAxTargetValues(AxValues[] axValuesArray); + + public virtual bool SetAxTargetValues(int ax, AxValues axValues) + { + if (GetAxTargetValues(out AxValues[] axValuesArray)) + { + axValuesArray[ax] = axValues; + return SetAxTargetValues(axValuesArray); + } + return false; + } + } +} \ No newline at end of file diff --git a/ln.motion.interfaces/Kinematic.cs b/ln.motion.interfaces/Kinematic.cs new file mode 100644 index 0000000..bff2486 --- /dev/null +++ b/ln.motion.interfaces/Kinematic.cs @@ -0,0 +1,13 @@ +using System.Numerics; + +namespace ln.motion.interfaces +{ + public abstract class Kinematic + { + public Kinematic() + { + } + public abstract bool Direct(AxValues[] axValuesArray, out Matrix4x4 position); + public abstract bool Inverse(Matrix4x4 position, AxValues[] axValues); + } +} \ No newline at end of file diff --git a/ln.motion.interfaces/ln.motion.interfaces.csproj b/ln.motion.interfaces/ln.motion.interfaces.csproj new file mode 100644 index 0000000..beb0cd3 --- /dev/null +++ b/ln.motion.interfaces/ln.motion.interfaces.csproj @@ -0,0 +1,11 @@ + + + + net5.0 + 0.1.0 + harald@l--n.de + l--n.de + 0.1.0 + + +