com.shinolab.autd3-sdk.core 0.2.0 → 0.4.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
@@ -5,7 +5,7 @@ The following is a list of those components and the full text of their licenses.
5
5
 
6
6
  ## Overview
7
7
 
8
- - MIT License (25)
8
+ - MIT License (23)
9
9
  - Apache License 2.0 (3)
10
10
  - Unicode License v3 (1)
11
11
 
@@ -603,38 +603,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
603
603
 
604
604
  Used by:
605
605
 
606
- - tokio-macros 2.7.0 — https://github.com/tokio-rs/tokio
607
-
608
- ```
609
- MIT License
610
-
611
- Copyright (c) 2019 Yoshua Wuyts
612
- Copyright (c) Tokio Contributors
613
-
614
- Permission is hereby granted, free of charge, to any person obtaining a copy
615
- of this software and associated documentation files (the "Software"), to deal
616
- in the Software without restriction, including without limitation the rights
617
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
618
- copies of the Software, and to permit persons to whom the Software is
619
- furnished to do so, subject to the following conditions:
620
-
621
- The above copyright notice and this permission notice shall be included in all
622
- copies or substantial portions of the Software.
623
-
624
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
625
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
626
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
627
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
628
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
629
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
630
- SOFTWARE.
631
-
632
- ```
633
-
634
- ## MIT License
635
-
636
- Used by:
637
-
638
606
  - safe_arch 1.0.0 — https://github.com/Lokathor/safe_arch
639
607
 
640
608
  ```
@@ -654,9 +622,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
654
622
 
655
623
  Used by:
656
624
 
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
625
+ - autd3-ffi-abi 0.4.0 — https://github.com/shinolab/autd3-sdk
626
+ - autd3-ffi-core 0.4.0 — https://github.com/shinolab/autd3-sdk
627
+ - autd3-rs-core 0.4.0 — https://github.com/shinolab/autd3-sdk
628
+ - autd3-cpu-wire 0.4.0 — https://github.com/shinolab/autd3-sdk
660
629
  - chrono 0.4.45 — https://github.com/chronotope/chrono
661
630
  - wide 1.5.0 — https://github.com/Lokathor/wide
662
631
 
@@ -686,38 +655,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
686
655
 
687
656
  Used by:
688
657
 
689
- - tokio 1.52.3 — https://github.com/tokio-rs/tokio
690
-
691
- ```
692
- MIT License
693
-
694
- Copyright (c) Tokio Contributors
695
-
696
- Permission is hereby granted, free of charge, to any person obtaining a copy
697
- of this software and associated documentation files (the "Software"), to deal
698
- in the Software without restriction, including without limitation the rights
699
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
700
- copies of the Software, and to permit persons to whom the Software is
701
- furnished to do so, subject to the following conditions:
702
-
703
- The above copyright notice and this permission notice shall be included in all
704
- copies or substantial portions of the Software.
705
-
706
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
707
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
708
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
709
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
710
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
711
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
712
- SOFTWARE.
713
-
714
- ```
715
-
716
- ## MIT License
717
-
718
- Used by:
719
-
720
- - pin-project-lite 0.2.17 — https://github.com/taiki-e/pin-project-lite
721
658
  - proc-macro2 1.0.106 — https://github.com/dtolnay/proc-macro2
722
659
  - quote 1.0.46 — https://github.com/dtolnay/quote
723
660
  - syn 2.0.118 — https://github.com/dtolnay/syn
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.4.0",
4
9
  "displayName": "AUTD3 Core",
5
10
  "description": "AUTD3 core types, geometry and units (Unity binding).",
6
11
  "unity": "6000.0",