-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
72 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,26 @@ | ||
using AUTD3Sharp; | ||
using AUTD3Sharp.Gain; | ||
using AUTD3Sharp.Modulation; | ||
using AUTD3Sharp.Derive; | ||
using AUTD3Sharp.Utils; | ||
using static AUTD3Sharp.Units; | ||
|
||
namespace Samples; | ||
|
||
[Gain] | ||
partial class MyFocus(Vector3d point) | ||
{ | ||
private Dictionary<int, Drive[]> Calc(Geometry geometry) | ||
{ | ||
return Transform(geometry, (dev, tr) => | ||
{ | ||
var tp = tr.Position; | ||
var dist = (tp - point).L2Norm; | ||
var phase = Phase.FromRad(dist * dev.Wavenumber); | ||
return new Drive { Phase = phase, Intensity = EmitIntensity.Max }; | ||
}); | ||
} | ||
} | ||
|
||
internal static class CustomTest | ||
internal static class TransTest | ||
{ | ||
public static async Task Test<T>(Controller<T> autd) | ||
{ | ||
var config = Silencer.Default(); | ||
await autd.SendAsync(config); | ||
|
||
var m = new Sine(150 * Hz); | ||
var g = new MyFocus(autd.Geometry.Center + new Vector3d(0, 0, 150)); | ||
|
||
var g = new Custom( | ||
(dev, tr) => (dev.Idx, tr.Idx) switch | ||
{ | ||
(0, 0) => new Drive(new Phase(0), EmitIntensity.Max), | ||
(0, 248) => new Drive(new Phase(0), EmitIntensity.Max), | ||
_ => Drive.Null | ||
} | ||
); | ||
await autd.SendAsync((m, g)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using AUTD3Sharp; | ||
using AUTD3Sharp.Modulation; | ||
using AUTD3Sharp.Derive; | ||
using AUTD3Sharp.Utils; | ||
using static AUTD3Sharp.Units; | ||
|
||
namespace Samples; | ||
|
||
[Gain] | ||
partial class MyFocus(Vector3d point) | ||
{ | ||
private Dictionary<int, Drive[]> Calc(Geometry geometry) | ||
{ | ||
return Transform(geometry, (dev, tr) => | ||
{ | ||
var tp = tr.Position; | ||
var dist = (tp - point).L2Norm; | ||
var phase = Phase.FromRad(dist * dev.Wavenumber); | ||
return new Drive { Phase = phase, Intensity = EmitIntensity.Max }; | ||
}); | ||
} | ||
} | ||
|
||
internal static class UserDefinedTest | ||
{ | ||
public static async Task Test<T>(Controller<T> autd) | ||
{ | ||
var config = Silencer.Default(); | ||
await autd.SendAsync(config); | ||
|
||
var m = new Sine(150 * Hz); | ||
var g = new MyFocus(autd.Geometry.Center + new Vector3d(0, 0, 150)); | ||
|
||
await autd.SendAsync((m, g)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters