コード例 #1
0
        protected override void OnRender(DrawingContext context)
        {
            base.OnRender(context);
            context.DrawLine(baselinePen, angleLeftLeft, angleLeftRight);
            //context.DrawText(warningFormattedText, new Point(ActualWidth/2, ActualHeight/2));
            context.DrawLine(baselinePen, angleRightLeft, angleRightRight);
            context.DrawLine(baselinePen, directionLineLeftBoundTop, directionLineLeftBoundBottom);
            context.DrawLine(baselinePen, directionLineRightBoundTop, directionLineRightBoundBottom);
            context.DrawLine(baselinePen, directionTop, directionBottom);

            RenderGauge(context, Humidity.ToString("0.00"), 2, humidityFormattedText);
            RenderGauge(context, Temperature.ToString("0.00"), 6, temperatureFormattedText);
            RenderGauge(context, Fps.ToString("0.0"), 18, fpsFormattedText);
            RenderGauge(context, Voltage.ToString("0.00"), 4, voltageFormattedText);
            RenderGauge(context, Current.ToString("0.00"), 16, currentFormattedText);
            RenderGauge(context, Thrust.ToString("0"), 10, thrustFormattedText);
            RenderGauge(context, Salinity.ToString("0.00"), 8, salinityFormattedText);
            RenderGauge(context, Depth.ToString("0.00"), 12, depthFormattedText);
            RenderGauge(context, ExtTemp.ToString("0.00"), 14, extTempFormattedText);

            RenderDepthGauge(context);
            RenderBatteryBar(context);

            if (ScreenshotAck == true)
            {
                RenderCTDValues(context, "Captured!", 2, screenshotFormattedText);
            }
            RenderCompass(context);
            RenderFalseHorizon(context);
            //RenderMap(context);
            //RenderLocation(context);
        }
コード例 #2
0
        /// <summary>
        /// Build a command to set salinity on the sonar.
        /// </summary>
        /// <param name="salinity">The salinity.</param>
        /// <returns>A <c>SET_SALINITY</c> command.</returns>
        public static Command BuildSalinityCmd(Salinity salinity)
        {
            Command.Types.SetSalinity BuildSalinity()
            {
                var inner = Command.Types.SetSalinity.CreateBuilder();

                inner.Salinity = (Command.Types.SetSalinity.Types.Salinity)salinity;
                return(inner.Build());
            }

            var outer = Command.CreateBuilder();

            outer.Type     = Command.Types.CommandType.SET_SALINITY;
            outer.Salinity = BuildSalinity();
            return(outer.Build());
        }