Skip to content

Commit

Permalink
bump to v22.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
s5suzuki committed Apr 8, 2024
1 parent 6db0d93 commit 8c40244
Show file tree
Hide file tree
Showing 28 changed files with 153 additions and 72 deletions.
38 changes: 19 additions & 19 deletions ThirdPartyNotice.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,35 @@ atomic-polyfill 1.0.3 (Apache-2.0 OR MIT)
https://github.com/embassy-rs/atomic-polyfill
---------------------------------------------------------

autd3 22.0.4 (MIT)
autd3 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3-backend-cuda 22.0.4 (MIT)
https://github.com/shinolab/autd3-backend-cuda
---------------------------------------------------------

autd3-derive 22.0.4 (MIT)
autd3-derive 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3-driver 22.0.4 (MIT)
autd3-driver 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3-firmware-emulator 22.0.4 (MIT)
autd3-firmware-emulator 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3-gain-holo 22.0.4 (MIT)
autd3-gain-holo 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3-link-simulator 22.0.4 (MIT)
autd3-link-simulator 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3-link-soem 22.0.4
autd3-link-soem 22.1.0
https://github.com/shinolab/autd3-rs

---
Expand Down Expand Up @@ -160,7 +160,7 @@ SOEM write to Beckhoff Automation GmbH, Eiserstrasse 5, D-33415 Verl, Germany

---------------------------------------------------------

autd3-link-twincat 22.0.4
autd3-link-twincat 22.1.0
https://github.com/shinolab/autd3-rs

---
Expand Down Expand Up @@ -216,40 +216,40 @@ autd3-link-visualizer 22.0.4 (MIT)
https://github.com/shinolab/autd3-link-visualizer
---------------------------------------------------------

autd3-modulation-audio-file 22.0.4 (MIT)
autd3-modulation-audio-file 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3-protobuf 22.0.4 (MIT)
autd3-protobuf 22.1.0 (MIT)
https://github.com/shinolab/autd3-rs
---------------------------------------------------------

autd3capi 22.0.4 (MIT)
autd3capi 22.1.0 (MIT)
---------------------------------------------------------

autd3capi-backend-cuda 22.0.4 (MIT)
autd3capi-backend-cuda 22.1.0 (MIT)
---------------------------------------------------------

autd3capi-def 22.0.4 (MIT)
autd3capi-def 22.1.0 (MIT)
https://github.com/shinolab/autd3
---------------------------------------------------------

autd3capi-gain-holo 22.0.4 (MIT)
autd3capi-gain-holo 22.1.0 (MIT)
---------------------------------------------------------

autd3capi-link-simulator 22.0.4 (MIT)
autd3capi-link-simulator 22.1.0 (MIT)
---------------------------------------------------------

autd3capi-link-soem 22.0.4 (MIT)
autd3capi-link-soem 22.1.0 (MIT)
---------------------------------------------------------

autd3capi-link-twincat 22.0.4 (MIT)
autd3capi-link-twincat 22.1.0 (MIT)
---------------------------------------------------------

autd3capi-link-visualizer 22.0.4 (MIT)
autd3capi-link-visualizer 22.1.0 (MIT)
---------------------------------------------------------

autd3capi-modulation-audio-file 22.0.4 (MIT)
autd3capi-modulation-audio-file 22.1.0 (MIT)
---------------------------------------------------------

autocfg 1.2.0 (Apache-2.0 OR MIT)
Expand Down
2 changes: 1 addition & 1 deletion derive/AUTD3Sharp.Derive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<Platforms>AnyCPU</Platforms>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>22.0.4</Version>
<Version>22.1.0</Version>
<Authors>Shun Suzuki</Authors>
<Company>Shinolab</Company>
<Description>AUTD3 derive helper for AUTD3Sharp</Description>
Expand Down
2 changes: 1 addition & 1 deletion example/cs/RemoteSOEM/RemoteSOEM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/cs/RemoveTwinCAT/RemoveTwinCAT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/cs/SOEM/SOEM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/cs/Samples/Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion example/cs/Simulator/Simulator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/cs/TwinCAT/TwinCAT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/fs/RemoteSOEM/RemoteSOEM.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/fs/RemoveTwinCAT/RemoveTwinCAT.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/fs/SOEM/SOEM.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/fs/Samples/Samples.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<ItemGroup />

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion example/fs/Simulator/Simulator.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion example/fs/TwinCAT/TwinCAT.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AUTD3Sharp" Version="22.0.4" />
<PackageReference Include="AUTD3Sharp" Version="22.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/AUTD3Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<Platforms>AnyCPU</Platforms>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>22.0.4</Version>
<Version>22.1.0</Version>
<Authors>Shun Suzuki</Authors>
<Company>Shinolab</Company>
<Description>AUTD3 library wrapper for .Net</Description>
Expand Down
2 changes: 1 addition & 1 deletion src/AUTD3Sharp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dependencies>
<group targetFramework=".NETStandard2.1">
<dependency id="NETStandard.Library" version="2.0.3" exclude="Build,Analyzers" />
<dependency id="AUTD3Sharp.Derive" version="22.0.4" >
<dependency id="AUTD3Sharp.Derive" version="22.1.0" >
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</dependency>
Expand Down
61 changes: 46 additions & 15 deletions src/Driver/Datagram/Debug.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,68 @@
#if UNITY_2020_2_OR_NEWER
#nullable enable
#endif

using AUTD3Sharp.NativeMethods;
using AUTD3Sharp.Driver.Datagram;

using System.Runtime.InteropServices;
using System;
using System.Linq;

namespace AUTD3Sharp
{
public class DebugType
{
internal byte _ty;
internal ushort _value;

private DebugType(byte ty, ushort value)
{
_ty = ty;
_value = value;
}

public static DebugType None() => new DebugType(0x00, 0x0000);
public static DebugType BaseSignal() => new DebugType(0x01, 0x0000);
public static DebugType Thermo() => new DebugType(0x02, 0x0000);
public static DebugType ForceFan() => new DebugType(0x03, 0x0000);
public static DebugType Sync() => new DebugType(0x10, 0x0000);
public static DebugType ModSegment() => new DebugType(0x20, 0x0000);
public static DebugType ModIdx(ushort idx) => new DebugType(0x21, idx);
public static DebugType StmSegment() => new DebugType(0x50, 0x0000);
public static DebugType StmIdx(ushort idx) => new DebugType(0x51, idx);
public static DebugType IsStmMode() => new DebugType(0x52, 0x0000);
public static DebugType PwmOut(Transducer tr) => new DebugType(0xE0, (ushort)tr.Idx);
public static DebugType Direct(bool v) => new DebugType(0xF0, v ? (ushort)0x0001 : (ushort)0x0000);
}


/// <summary>
/// Datagram to configure debug output
/// </summary>
public sealed class ConfigureDebugOutputIdx : IDatagram
public sealed class ConfigureDebugSettings : IDatagram
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate byte DebugOutputDelegate(IntPtr context, GeometryPtr geometryPtr, uint devIdx);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate DebugSettings DebugSettingsDelegate(IntPtr context, GeometryPtr geometryPtr, uint devIdx);

private readonly DebugOutputDelegate _f;
private readonly DebugSettingsDelegate _f;

public ConfigureDebugOutputIdx(Func<Device, Transducer?> f)
public ConfigureDebugSettings(Func<Device, DebugType[]> f)
{
_f = (context, geometryPtr, devIdx) =>
{
var tr = f(new Device((int)devIdx, NativeMethodsBase.AUTDDevice(geometryPtr, devIdx)));
return (byte)(tr?.Idx ?? 0xFF);
var v = f(new Device((int)devIdx, NativeMethodsBase.AUTDDevice(geometryPtr, devIdx)));
var res = new DebugSettings();
unsafe
{
res.ty[0] = v[0]._ty;
res.ty[1] = v[1]._ty;
res.ty[2] = v[2]._ty;
res.ty[3] = v[3]._ty;
res.value[0] = v[0]._value;
res.value[1] = v[1]._value;
res.value[2] = v[2]._value;
res.value[3] = v[3]._value;
}
return res;
};
}

DatagramPtr IDatagram.Ptr(Geometry geometry) => NativeMethodsBase.AUTDDatagramConfigureDebugOutputIdx(Marshal.GetFunctionPointerForDelegate(_f), IntPtr.Zero, geometry.Ptr);
DatagramPtr IDatagram.Ptr(Geometry geometry) => NativeMethodsBase.AUTDDatagramConfigureDebugSettings(Marshal.GetFunctionPointerForDelegate(_f), IntPtr.Zero, geometry.Ptr);
}
}

#if UNITY_2020_2_OR_NEWER
#nullable restore
#endif
2 changes: 1 addition & 1 deletion src/Gain/Holo/Constraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static EmissionConstraint Clamp(EmitIntensity min, EmitIntensity max) =>
/// </summary>
public static EmissionConstraint Clamp(byte min, byte max) => Clamp(new EmitIntensity(min), new EmitIntensity(max));

[ExcludeFromCodeCoverage] public override bool Equals(object? obj) => obj is EmissionConstraint other && Equals(other);
[ExcludeFromCodeCoverage] public readonly override bool Equals(object? obj) => obj is EmissionConstraint other && Equals(other);
[ExcludeFromCodeCoverage] public readonly bool Equals(EmissionConstraint other) => NativeMethodsGainHolo.AUTDGainHoloConstraintEq(Ptr, other.Ptr);
[ExcludeFromCodeCoverage] public readonly override int GetHashCode() => Ptr.GetHashCode();
[ExcludeFromCodeCoverage] public static bool operator ==(EmissionConstraint lhs, EmissionConstraint rhs) => lhs.Equals(rhs);
Expand Down
21 changes: 19 additions & 2 deletions src/Link/Audit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,26 @@ public bool SilencerFixedCompletionStepsMode(int idx)
return NativeMethodsBase.AUTDLinkAuditFpgaSilencerFixedCompletionStepsMode(_ptr, (uint)idx);
}

public byte DebugOutputIdx(int idx)
public byte[] DebugTypes(int idx)
{
return NativeMethodsBase.AUTDLinkAuditFpgaDebugOutputIdx(_ptr, (uint)idx);
var ty = new byte[4];
unsafe
{
fixed (byte* p = &ty[0])
NativeMethodsBase.AUTDLinkAuditFpgaDebugTypes(_ptr, (uint)idx, p);
}
return ty;
}

public ushort[] DebugValues(int idx)
{
var value = new ushort[4];
unsafe
{
fixed (ushort* p = &value[0])
NativeMethodsBase.AUTDLinkAuditFpgaDebugValues(_ptr, (uint)idx, p);
}
return value;
}

public void AssertThermalSensor(int idx)
Expand Down
11 changes: 7 additions & 4 deletions src/NativeMethods/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public static unsafe partial class NativeMethodsBase
[DllImport(__DllName, EntryPoint = "AUTDDatagramClear", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern DatagramPtr AUTDDatagramClear();

[DllImport(__DllName, EntryPoint = "AUTDDatagramConfigureDebugOutputIdx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern DatagramPtr AUTDDatagramConfigureDebugOutputIdx(IntPtr f, IntPtr context, GeometryPtr geometry);
[DllImport(__DllName, EntryPoint = "AUTDDatagramConfigureDebugSettings", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern DatagramPtr AUTDDatagramConfigureDebugSettings(IntPtr f, IntPtr context, GeometryPtr geometry);

[DllImport(__DllName, EntryPoint = "AUTDDatagramConfigureForceFan", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern DatagramPtr AUTDDatagramConfigureForceFan(IntPtr f, IntPtr context, GeometryPtr geometry);
Expand Down Expand Up @@ -287,8 +287,11 @@ public static unsafe partial class NativeMethodsBase
[return: MarshalAs(UnmanagedType.U1)]
public static extern bool AUTDLinkAuditFpgaSilencerFixedCompletionStepsMode(LinkPtr audit, uint idx);

[DllImport(__DllName, EntryPoint = "AUTDLinkAuditFpgaDebugOutputIdx", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern byte AUTDLinkAuditFpgaDebugOutputIdx(LinkPtr audit, uint idx);
[DllImport(__DllName, EntryPoint = "AUTDLinkAuditFpgaDebugTypes", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void AUTDLinkAuditFpgaDebugTypes(LinkPtr audit, uint idx, byte* ty);

[DllImport(__DllName, EntryPoint = "AUTDLinkAuditFpgaDebugValues", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void AUTDLinkAuditFpgaDebugValues(LinkPtr audit, uint idx, ushort* value);

[DllImport(__DllName, EntryPoint = "AUTDLinkAuditFpgaStmFrequencyDivision", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern uint AUTDLinkAuditFpgaStmFrequencyDivision(LinkPtr audit, Segment segment, uint idx);
Expand Down
7 changes: 7 additions & 0 deletions src/NativeMethods/Def.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ public unsafe partial struct ResultController
public IntPtr err;
}

[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct DebugSettings
{
public fixed byte ty[4];
public fixed ushort value[4];
}

[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct LinkBuilderPtr
{
Expand Down
Loading

0 comments on commit 8c40244

Please sign in to comment.