示例#1
0
 public static Gain BesselBeam(Vector3 point, Vector3 dir, double thetaZ, byte duty = 0xFF)
 {
     var(x, y, z)    = AUTD.Adjust(point);
     var(dx, dy, dz) = AUTD.Adjust(dir, false);
     NativeMethods.AUTDGainBesselBeam(out var gainPtr, x, y, z, dx, dy, dz, thetaZ, duty);
     return(new Gain(gainPtr));
 }
示例#2
0
 public static Gain Grouped(AUTD autd, Dictionary <int, Gain> gainMap)
 {
     if (gainMap == null)
     {
         throw new ArgumentNullException(nameof(gainMap));
     }
     NativeMethods.AUTDGainGrouped(out var gainPtr, autd.AUTDControllerHandle.CntPtr);
     foreach (var id_gain in gainMap)
     {
         NativeMethods.AUTDGainGroupedAdd(gainPtr, id_gain.Key, id_gain.Value.Ptr);
     }
     return(new Gain(gainPtr));
 }
示例#3
0
        private static double[] PackFoci(Vector3[] focuses)
        {
            var size = focuses.Length;
            var foci = new double[size * 3];

            for (var i = 0; i < size; i++)
            {
                var(x, y, z)    = AUTD.Adjust(focuses[i]);
                foci[3 * i]     = x;
                foci[3 * i + 1] = y;
                foci[3 * i + 2] = z;
            }
            return(foci);
        }
示例#4
0
 public static Gain PlaneWave(Vector3 dir, byte duty = 0xFF)
 {
     var(dx, dy, dz) = AUTD.Adjust(dir, false);
     NativeMethods.AUTDGainPlaneWave(out var gainPtr, dx, dy, dz, duty);
     return(new Gain(gainPtr));
 }
示例#5
0
 public static Gain PlaneWave(Vector3 dir, double amp) => PlaneWave(dir, AUTD.ToDuty(amp));
示例#6
0
 public static Gain BesselBeam(Vector3 point, Vector3 dir, double thetaZ, double amp) => BesselBeam(point, dir, thetaZ, AUTD.ToDuty(amp));
示例#7
0
 public static Gain FocalPoint(Vector3 point, byte duty = 0xff)
 {
     var(x, y, z) = AUTD.Adjust(point);
     NativeMethods.AUTDGainFocalPoint(out var gainPtr, x, y, z, duty);
     return(new Gain(gainPtr));
 }
示例#8
0
 public static Gain FocalPoint(Vector3 point, double amp) => FocalPoint(point, AUTD.ToDuty(amp));
示例#9
0
 public static Link Emulator(ushort port, AUTD autd)
 {
     NativeMethods.AUTDLinkEmulator(out var link, port, autd.AUTDControllerHandle.CntPtr);
     return(new Link(link));
 }