• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LibZano.Frame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LibZano.Frame的典型用法代码示例。如果您正苦于以下问题:C# Frame类的具体用法?C# Frame怎么用?C# Frame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Frame类属于LibZano命名空间,在下文中一共展示了Frame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            uint zano;
            Library.Initialise("Example-GetAltitude.1.0.0");
            zano = Library.Obtain("192.168.0.1", 10001);

            bool isConnected = false;
            Frame frame = new Frame();

            Library.Connect(zano);

            while (true)
            {
                if (isConnected)
                {
                    Frames.FlightAltitudeGet(zano);
                }

                Library.Tick();

                while (Library.Receive(ref frame) == 1)
                {
                    switch (frame.Reference)
                    {
                        case Symbols.kFlightAltitudeGet:
                        {
                            int altitude = frame.Get(Symbols.kAltitude);
                            Console.WriteLine(String.Format("Altitude is {0} mm", altitude));
                        }
                        break;
                    }
                }

                Library.Status status;

                while ((status = Library.GetStatus()) != Library.Status.None)
                {
                    switch (status)
                    {
                        case Library.Status.DeviceDisconnectionDisconnected:
                        case Library.Status.DeviceConnectionNotConnected:
                        case Library.Status.DeviceConnectionHeldStill:
                        {
                            isConnected = false;
                            Library.Connect(zano);
                        }
                        break;
                        case Library.Status.DeviceConnectionConnected:
                        {
                            isConnected = true;
                        }
                        break;
                    }
                }

                Thread.Sleep(10);
            }
        }
开发者ID:torquing,项目名称:libZanoDotNet,代码行数:58,代码来源:Program.cs


示例2: Accelerometer


//.........这里部分代码省略.........
                Z.Listen(Symbols.kSensorsGyroGet, "receive_gyro");
                Z.Listen(Symbols.kSensorsRawAccelerationGet, "receive_accelerometer");

                Views.Accelerometer.Instance.Begin();
                Move("axis");
            });

            OnTrigger("axis.retry", args =>
            {
                G.DidSave = false;
                for (int i = 0; i < 6; i++)
                {
                    G.FilteredReadings[i] = 0;
                    G.FilteredComplete[i] = false;
                    G.FilteredValue[i] = 0;
                }
            });

            OnTrigger("axis.save, save.not_sent, connect.save", args =>
            {
                // Compile the readings into maximum and minimum readings
                G.ResultsXMin = U.MinToShort(G.FilteredValue[U.AxisToIndex(1, 0, 0)], G.FilteredValue[U.AxisToIndex(-1, 0, 0)]);
                G.ResultsXMax = U.MaxToShort(G.FilteredValue[U.AxisToIndex(1, 0, 0)], G.FilteredValue[U.AxisToIndex(-1, 0, 0)]);
                G.ResultsYMin = U.MinToShort(G.FilteredValue[U.AxisToIndex(0, 1, 0)], G.FilteredValue[U.AxisToIndex(0, -1, 0)]);
                G.ResultsYMax = U.MaxToShort(G.FilteredValue[U.AxisToIndex(0, 1, 0)], G.FilteredValue[U.AxisToIndex(0, -1, 0)]);
                G.ResultsZMin = U.MinToShort(G.FilteredValue[U.AxisToIndex(0, 0, 1)], G.FilteredValue[U.AxisToIndex(0, 0, -1)]);
                G.ResultsZMax = U.MaxToShort(G.FilteredValue[U.AxisToIndex(0, 0, 1)], G.FilteredValue[U.AxisToIndex(0, 0, -1)]);

                G.ResultsXAvg = (short)(-1 * ((G.ResultsXMin + G.ResultsXMax) / 2));
                G.ResultsYAvg = (short)(-1 * ((G.ResultsYMin + G.ResultsYMax) / 2));
                G.ResultsZAvg = (short)(-1 * ((G.ResultsZMin + G.ResultsZMax) / 2));

                // Copied from ConfigAccelOffsetSet
                Frame sendFrame = new Frame(Z.Handle);
                sendFrame.Reference = Symbols.kConfigAccelOffsetSet;
                sendFrame.Type = Frame.kSendFrame;
                unchecked
                {
                    sendFrame.Names[0] = Symbols.kX;
                    sendFrame.Values[0] = (int)G.ResultsXAvg;
                    sendFrame.Names[1] = Symbols.kY;
                    sendFrame.Values[1] = (int)G.ResultsYAvg;
                    sendFrame.Names[2] = Symbols.kZ;
                    sendFrame.Values[2] = (int)G.ResultsZAvg;
                    sendFrame.Names[3] = Symbols.kXmin;
                    sendFrame.Values[3] = (int)G.ResultsXMin;
                    sendFrame.Names[4] = Symbols.kYmin;
                    sendFrame.Values[4] = (int)G.ResultsYMin;
                    sendFrame.Names[5] = Symbols.kZmin;
                    sendFrame.Values[5] = (int)G.ResultsZMin;
                    sendFrame.Names[6] = Symbols.kXmax;
                    sendFrame.Values[6] = (int)G.ResultsXMax;
                    sendFrame.Names[7] = Symbols.kYmax;
                    sendFrame.Values[7] = (int)G.ResultsYMax;
                    sendFrame.Names[8] = Symbols.kZmax;
                    sendFrame.Values[8] = (int)G.ResultsZMax;
                }

                LibZano.Calibration.Set(ref Z.SerialNumber, ref sendFrame);
                Library.Send(ref sendFrame);

                Frames.ConfigSave(Z.Handle);

                StringBuilder sn = new StringBuilder(16);

                Library.SerialNumber serialNb = new Library.SerialNumber();
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:67,代码来源:Accelerometer.cs


示例3: CameraResolutionSet

 ///<command>
 ///	<name>camera.resolution.set</name>
 ///	<symbol>kCameraResolutionSet</symbol>
 ///	<scope>camera.resolution</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="byte" symbol="kResolution">Resolution</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="byte" symbol="kResult">Result</response>
 ///	</responses>
 ///	<see>camera.resolution.get</see>
 ///</command>
 public static void CameraResolutionSet(uint handle, byte resolution)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kCameraResolutionSet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kResolution;
         sendFrame.Values[0] = (int) resolution;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:25,代码来源:LibZano.cs


示例4: CameraImageprocessingSharpnessGet

 ///<command>
 ///	<name>camera.imageprocessing.sharpness.get</name>
 ///	<symbol>kCameraImageprocessingSharpnessGet</symbol>
 ///	<scope>camera.imageprocessing.sharpness</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="byte" symbol="kValue">Value</response>
 ///	</responses>
 ///	<see>camera.imageprocessing.sharpness.set</see>
 ///</command>
 public static void CameraImageprocessingSharpnessGet(uint handle)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kCameraImageprocessingSharpnessGet;
     sendFrame.Type = Frame.kSendFrame;
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:19,代码来源:LibZano.cs


示例5: CameraContrastSet

 ///<command>
 ///	<name>camera.contrast.set</name>
 ///	<symbol>kCameraContrastSet</symbol>
 ///	<scope>camera.contrast</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="byte" symbol="kContrast">Contrast</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="byte" symbol="kResult">Result</response>
 ///	</responses>
 ///	<see>camera.contrast.get</see>
 ///</command>
 public static void CameraContrastSet(uint handle, byte contrast)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kCameraContrastSet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kContrast;
         sendFrame.Values[0] = (int) contrast;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:25,代码来源:LibZano.cs


示例6: TrackedSendFrame2

 public static extern int TrackedSendFrame2(ref Frame frame1, ref Frame frame2, byte userData, uint maxCount, uint resendTime);
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:1,代码来源:LibZano.cs


示例7: Receive

 public static extern int Receive(ref Frame frame);
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:1,代码来源:LibZano.cs


示例8: SystemExpansionByteSet

 ///<command>
 ///	<name>system.expansion.byte.set</name>
 ///	<symbol>kSystemExpansionByteSet</symbol>
 ///	<scope>system.expansion.byte</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="byte" symbol="kLength">Length</arg>
 ///	</arguments>
 ///	<see>system.expansion.byte.get</see>
 ///</command>
 public static void SystemExpansionByteSet(uint handle, byte length)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kSystemExpansionByteSet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kLength;
         sendFrame.Values[0] = (int) length;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:22,代码来源:LibZano.cs


示例9: SystemCalibratecompassSet

 ///<command>
 ///	<name>system.calibratecompass.set</name>
 ///	<symbol>kSystemCalibratecompassSet</symbol>
 ///	<scope>system.calibratecompass</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///	</arguments>
 ///</command>
 public static void SystemCalibratecompassSet(uint handle)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kSystemCalibratecompassSet;
     sendFrame.Type = Frame.kSendFrame;
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:15,代码来源:LibZano.cs


示例10: SystemBandwidthSet

 ///<command>
 ///	<name>system.bandwidth.set</name>
 ///	<symbol>kSystemBandwidthSet</symbol>
 ///	<scope>system.bandwidth</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="ushort" symbol="kValue">Value</arg>
 ///	</arguments>
 ///	<see>system.bandwidth.get</see>
 ///</command>
 public static void SystemBandwidthSet(uint handle, ushort value)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kSystemBandwidthSet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kValue;
         sendFrame.Values[0] = (int) value;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:22,代码来源:LibZano.cs


示例11: SensorsTemperatureGet

 ///<command>
 ///	<name>sensors.temperature.get</name>
 ///	<symbol>kSensorsTemperatureGet</symbol>
 ///	<scope>sensors.temperature</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="short" symbol="kTemperature">Temperature</response>
 ///	</responses>
 ///</command>
 public static void SensorsTemperatureGet(uint handle)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kSensorsTemperatureGet;
     sendFrame.Type = Frame.kSendFrame;
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:18,代码来源:LibZano.cs


示例12: MessagesGet

 ///<command>
 ///	<name>messages.get</name>
 ///	<symbol>kMessagesGet</symbol>
 ///	<scope>messages</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="byte" symbol="kIndex">Index</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="byte" symbol="kIndex">Index</response>
 ///		<response type="byte" symbol="kCount">Count</response>
 ///		<response type="ushort" symbol="kLength">Length</response>
 ///	</responses>
 ///</command>
 public static void MessagesGet(uint handle, byte index)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kMessagesGet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kIndex;
         sendFrame.Values[0] = (int) index;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:26,代码来源:LibZano.cs


示例13: MediaRecv

 ///<command>
 ///	<name>media.recv</name>
 ///	<symbol>kMediaRecv</symbol>
 ///	<scope>media</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="ushort" symbol="kType">Type</response>
 ///		<response type="uint" symbol="kTime">Time</response>
 ///		<response type="uint" symbol="kFrame">Frame</response>
 ///		<response type="uint" symbol="kLength">Length</response>
 ///		<response type="uint" symbol="kOffset">Offset</response>
 ///		<response type="ushort" symbol="kFragmentSize">FragmentSize</response>
 ///	</responses>
 ///	<see>media.get</see>
 ///</command>
 public static void MediaRecv(uint handle)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kMediaRecv;
     sendFrame.Type = Frame.kSendFrame;
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:24,代码来源:LibZano.cs


示例14: MediaGet

 ///<command>
 ///	<name>media.get</name>
 ///	<symbol>kMediaGet</symbol>
 ///	<scope>media</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="ushort" symbol="kType">Type</arg>
 ///		<arg type="uint" symbol="kFrame">Frame</arg>
 ///	</arguments>
 ///	<see>media.recv</see>
 ///</command>
 public static void MediaGet(uint handle, ushort type, uint frame)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kMediaGet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kType;
         sendFrame.Values[0] = (int) type;
         sendFrame.Names[1] = Symbols.kFrame;
         sendFrame.Values[1] = (int) frame;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:25,代码来源:LibZano.cs


示例15: WaypointStop

 ///<command>
 ///	<name>waypoint.stop</name>
 ///	<symbol>kWaypointStop</symbol>
 ///	<scope>waypoint</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///	</arguments>
 ///	<see>waypoint.add</see>
 ///	<see>waypoint.get</see>
 ///	<see>waypoint.mode</see>
 ///	<see>waypoint.pause</see>
 ///	<see>waypoint.set</see>
 ///	<see>waypoint.start</see>
 ///</command>
 public static void WaypointStop(uint handle)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kWaypointStop;
     sendFrame.Type = Frame.kSendFrame;
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:21,代码来源:LibZano.cs


示例16: CameraBandingfilterSet

 ///<command>
 ///	<name>camera.bandingfilter.set</name>
 ///	<symbol>kCameraBandingfilterSet</symbol>
 ///	<scope>camera.bandingfilter</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="byte" symbol="kFilter">Filter</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="byte" symbol="kResult">Result</response>
 ///	</responses>
 ///	<see>camera.bandingfilter.get</see>
 ///</command>
 public static void CameraBandingfilterSet(uint handle, byte filter)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kCameraBandingfilterSet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kFilter;
         sendFrame.Values[0] = (int) filter;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:25,代码来源:LibZano.cs


示例17: CameraAgcExposureWeightGet

 ///<command>
 ///	<name>camera.agc.exposure.weight.get</name>
 ///	<symbol>kCameraAgcExposureWeightGet</symbol>
 ///	<scope>camera.agc.exposure.weight</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="byte" symbol="kValue">Value</response>
 ///	</responses>
 ///	<see>camera.agc.exposure.weight.set</see>
 ///</command>
 public static void CameraAgcExposureWeightGet(uint handle)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kCameraAgcExposureWeightGet;
     sendFrame.Type = Frame.kSendFrame;
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:19,代码来源:LibZano.cs


示例18: Send

 public static extern int Send(ref Frame frame);
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:1,代码来源:LibZano.cs


示例19: SystemExpansionConfigSet

 ///<command>
 ///	<name>system.expansion.config.set</name>
 ///	<symbol>kSystemExpansionConfigSet</symbol>
 ///	<scope>system.expansion.config</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="byte" symbol="kSpeed">Speed</arg>
 ///	</arguments>
 ///</command>
 public static void SystemExpansionConfigSet(uint handle, byte speed)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kSystemExpansionConfigSet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kSpeed;
         sendFrame.Values[0] = (int) speed;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:21,代码来源:LibZano.cs


示例20: CameraBrightnessSet

 ///<command>
 ///	<name>camera.brightness.set</name>
 ///	<symbol>kCameraBrightnessSet</symbol>
 ///	<scope>camera.brightness</scope>
 ///	<arguments>
 ///		<arg type="uint">Drone Handle</arg>
 ///		<arg type="byte" symbol="kBrightness">Brightness</arg>
 ///	</arguments>
 ///	<responses>
 ///		<response type="byte" symbol="kResult">Result</response>
 ///	</responses>
 ///	<see>camera.brightness.get</see>
 ///</command>
 public static void CameraBrightnessSet(uint handle, byte brightness)
 {
     Frame sendFrame = new Frame(handle);
     sendFrame.Reference = Symbols.kCameraBrightnessSet;
     sendFrame.Type = Frame.kSendFrame;
     unchecked
     {
         sendFrame.Names[0] = Symbols.kBrightness;
         sendFrame.Values[0] = (int) brightness;
     }
     Library.Send(ref sendFrame);
 }
开发者ID:torquing,项目名称:ZanoFineTuning,代码行数:25,代码来源:LibZano.cs



注:本文中的LibZano.Frame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Library.ErrorMsg类代码示例发布时间:2022-05-26
下一篇:
C# Main.UsbSetupPacket类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap