com.shinolab.autd3-sdk.core 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Config.cs CHANGED
@@ -12,7 +12,7 @@ namespace AUTD3
12
12
 
13
13
  public readonly struct LoopBehavior
14
14
  {
15
- internal ushort Rep { get; }
15
+ public ushort Rep { get; }
16
16
 
17
17
  private LoopBehavior(ushort rep)
18
18
  {
@@ -37,16 +37,27 @@ namespace AUTD3
37
37
  {
38
38
  internal byte Mode { get; }
39
39
  internal ulong Value { get; }
40
+ internal uint MarginNs { get; }
40
41
 
41
- private TransitionMode(byte mode, ulong value)
42
+ private TransitionMode(byte mode, ulong value, uint marginNs = 0)
42
43
  {
43
44
  Mode = mode;
44
45
  Value = value;
46
+ MarginNs = marginNs;
45
47
  }
46
48
 
47
49
  public static TransitionMode SyncIdx => new TransitionMode(0x00, 0);
48
50
 
49
- public static TransitionMode SysTime(DcSysTime sysTime) => new TransitionMode(0x01, sysTime.SysTime);
51
+ public static TransitionMode SysTime(DcSysTime sysTime, TimeSpan? margin = null)
52
+ {
53
+ if (margin is not { } m) return new TransitionMode(0x01, sysTime.SysTime);
54
+ var nanos = (double)m.Ticks * 100.0;
55
+ if (nanos < 0.0 || nanos > uint.MaxValue)
56
+ {
57
+ throw new Autd3Exception("transition margin is out of range (0..=4294967295 ns)");
58
+ }
59
+ return new TransitionMode(0x01, sysTime.SysTime, (uint)nanos);
60
+ }
50
61
 
51
62
  public static TransitionMode Gpio(GpioIn gpio) => new TransitionMode(0x02, (byte)gpio);
52
63
 
@@ -54,4 +65,14 @@ namespace AUTD3
54
65
 
55
66
  public static TransitionMode Immediate => new TransitionMode(0xFF, 0);
56
67
  }
68
+
69
+ public enum Telemetry : byte
70
+ {
71
+ FifoDrop = 0x00,
72
+ Dedup = 0x01,
73
+ SeqMismatch = 0x02,
74
+ DispatchError = 0x03,
75
+ Processed = 0x04,
76
+ Failsafe = 0x05,
77
+ }
57
78
  }
package/Geometry.cs CHANGED
@@ -91,6 +91,8 @@ namespace AUTD3
91
91
 
92
92
  public int NumTransducers => (int)NativeCore.autd3_core_device_num_transducers(_geometry, _dev);
93
93
 
94
+ public bool IsEmpty => NumTransducers == 0;
95
+
94
96
  public Quaternion Rotation
95
97
  {
96
98
  get
Binary file
Binary file
@@ -654,9 +654,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
654
654
 
655
655
  Used by:
656
656
 
657
- - autd3-ffi-abi 0.2.0 — https://github.com/shinolab/autd3-sdk
658
- - autd3-ffi-core 0.2.0 — https://github.com/shinolab/autd3-sdk
659
- - autd3-rs-core 0.2.0 — https://github.com/shinolab/autd3-sdk
657
+ - autd3-ffi-abi 0.3.0 — https://github.com/shinolab/autd3-sdk
658
+ - autd3-ffi-core 0.3.0 — https://github.com/shinolab/autd3-sdk
659
+ - autd3-rs-core 0.3.0 — https://github.com/shinolab/autd3-sdk
660
660
  - chrono 0.4.45 — https://github.com/chronotope/chrono
661
661
  - wide 1.5.0 — https://github.com/Lokathor/wide
662
662
 
package/Units.cs CHANGED
@@ -54,15 +54,15 @@ namespace AUTD3
54
54
 
55
55
  public readonly struct Freq
56
56
  {
57
- internal enum FreqMode : byte
57
+ public enum FreqMode : byte
58
58
  {
59
59
  FloatExact = 0,
60
60
  IntExact = 1,
61
61
  }
62
62
 
63
- internal FreqMode Mode { get; }
63
+ public FreqMode Mode { get; }
64
64
  internal float HzValue { get; }
65
- internal uint HzIntValue { get; }
65
+ public uint HzIntValue { get; }
66
66
 
67
67
  internal Freq(FreqMode mode, float hz, uint hzInt)
68
68
  {
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "com.shinolab.autd3-sdk.core",
3
- "version": "0.2.0",
3
+ "repository": {
4
+ "type": "git",
5
+ "url": "git+https://github.com/shinolab/autd3-sdk.git",
6
+ "directory": "bindings/unity/com.shinolab.autd3-sdk.core"
7
+ },
8
+ "version": "0.3.0",
4
9
  "displayName": "AUTD3 Core",
5
10
  "description": "AUTD3 core types, geometry and units (Unity binding).",
6
11
  "unity": "6000.0",