コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NStackPanel stack = new NStackPanel();

            NStackPanel controlStack = new NStackPanel();

            controlStack.Direction = ENHVDirection.LeftToRight;
            stack.Add(controlStack);

            m_LinearGauge                 = new NLinearGauge();
            m_LinearGauge.Orientation     = ENLinearGaugeOrientation.Vertical;
            m_LinearGauge.PreferredSize   = defaultLinearVerticalGaugeSize;
            m_LinearGauge.BackgroundFill  = new NStockGradientFill(NColor.DarkGray, NColor.Black);
            m_LinearGauge.CapEffect       = new NGelCapEffect();
            m_LinearGauge.Border          = base.CreateBorder();
            m_LinearGauge.Padding         = new NMargins(20);
            m_LinearGauge.BorderThickness = new NMargins(6);

            controlStack.Add(m_LinearGauge);

            NMarkerValueIndicator markerIndicator = new NMarkerValueIndicator();

            m_LinearGauge.Indicators.Add(markerIndicator);

            InitSections(m_LinearGauge);

            // create the radial gauge
            m_RadialGauge = new NRadialGauge();
            m_RadialGauge.PreferredSize = defaultRadialGaugeSize;
            NEdgeDialRim dialRim = new NEdgeDialRim();

            dialRim.OuterBevelWidth           = 2.0;
            dialRim.InnerBevelWidth           = 2.0;
            dialRim.MiddleBevelWidth          = 2.0;
            m_RadialGauge.Dial                = new NDial(ENDialShape.CutCircle, dialRim);
            m_RadialGauge.Dial.BackgroundFill = new NStockGradientFill(NColor.DarkGray, NColor.Black);
            m_RadialGauge.InnerRadius         = 15;

            NGlassCapEffect glassCapEffect = new NGlassCapEffect();

            glassCapEffect.LightDirection = new NAngle(130, NUnit.Degree);
            glassCapEffect.EdgeOffset     = 0;
            glassCapEffect.EdgeDepth      = 0.30;
            m_RadialGauge.CapEffect       = glassCapEffect;

            controlStack.Add(m_RadialGauge);

            NNeedleValueIndicator needleIndicator = new NNeedleValueIndicator();

            m_RadialGauge.Indicators.Add(needleIndicator);
            m_RadialGauge.SweepAngle = new NAngle(180, NUnit.Degree);

            InitSections(m_RadialGauge);

            m_DataFeedTimer       = new NTimer();
            m_DataFeedTimer.Tick += new Function(OnDataFeedTimerTick);
            m_DataFeedTimer.Start();

            return(stack);
        }
コード例 #2
0
        protected override void OnRegistered()
        {
            base.OnRegistered();

            m_Timer       = new NTimer();
            m_Timer.Tick += OnTimerTick;
            m_Timer.Start();
        }
コード例 #3
0
        protected override void AttachToEvents()
        {
            base.AttachToEvents();

            m_PreviousTickTime = DateTime.Now;
            m_Timer            = new NTimer();
            m_Timer.Interval   = 10;
            m_Timer.Tick      += new EventHandler(OnTimerTick);
            m_Timer.Start();
        }
コード例 #4
0
        protected override NWidget CreateExampleContent()
        {
            NStackPanel stack = new NStackPanel();

            stack.HorizontalPlacement = Layout.ENHorizontalPlacement.Left;

            m_NumericDisplay1 = CreateNumericLedDisplay();
            stack.Add(m_NumericDisplay1);

            m_NumericDisplay2 = CreateNumericLedDisplay();
            stack.Add(m_NumericDisplay2);

            m_NumericDisplay3 = CreateNumericLedDisplay();
            stack.Add(m_NumericDisplay3);

            m_DataFeedTimer       = new NTimer();
            m_DataFeedTimer.Tick += new Function(OnDataFeedTimerTick);
            m_DataFeedTimer.Start();

            return(stack);
        }
コード例 #5
0
        protected override NWidget CreateExampleContent()
        {
            NStackPanel stack = new NStackPanel();

            stack.HorizontalPlacement = Layout.ENHorizontalPlacement.Left;

            NStackPanel controlStack = new NStackPanel();

            stack.Add(controlStack);

            // create the radial gauge
            m_RadialGauge            = new NRadialGauge();
            m_RadialGauge.SweepAngle = new NAngle(270, NUnit.Degree);
            m_RadialGauge.BeginAngle = new NAngle(-225, NUnit.Degree);

            m_RadialGauge.PreferredSize = defaultRadialGaugeSize;

            m_RadialGauge.CapEffect           = new NGlassCapEffect();
            m_RadialGauge.Dial                = new NDial(ENDialShape.CutCircle, new NEdgeDialRim());
            m_RadialGauge.Dial.BackgroundFill = new NStockGradientFill(NColor.DarkGray, NColor.Black);

            // configure scale
            NGaugeAxis axis = new NGaugeAxis();

            m_RadialGauge.Axes.Add(axis);

            NLinearScale scale = (NLinearScale)axis.Scale;

            scale.SetPredefinedScale(ENPredefinedScaleStyle.Presentation);
            scale.Labels.Style.TextStyle.Font = new NFont("Arimo", 10, ENFontStyle.Bold);
            scale.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White);
            scale.Labels.Style.Angle          = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 90.0);
            scale.MinorTickCount     = 4;
            scale.Ruler.Stroke.Width = 0;
            scale.Ruler.Fill         = new NColorFill(NColor.DarkGray);

            // add radial gauge indicators
            m_ValueIndicator                 = new NNeedleValueIndicator();
            m_ValueIndicator.Fill            = new NStockGradientFill(ENGradientStyle.Horizontal, ENGradientVariant.Variant1, NColor.White, NColor.Red);
            m_ValueIndicator.Stroke.Color    = NColor.Red;
            m_ValueIndicator.Width           = 15;
            m_ValueIndicator.OffsetFromScale = -10;
            m_RadialGauge.Indicators.Add(m_ValueIndicator);

            NStackPanel verticalStack = new NStackPanel();

            verticalStack.Direction = Layout.ENHVDirection.TopToBottom;
            verticalStack.Padding   = new NMargins(80, 200, 80, 0);

            m_NumericLedDisplay = new NNumericLedDisplay();

            m_NumericLedDisplay.Value          = 0.0;
            m_NumericLedDisplay.CellCountMode  = ENDisplayCellCountMode.Fixed;
            m_NumericLedDisplay.CellCount      = 7;
            m_NumericLedDisplay.BackgroundFill = new NColorFill(NColor.Black);

            m_NumericLedDisplay.Border          = NBorder.CreateSunken3DBorder(new NUIThemeColorMap(ENUIThemeScheme.WindowsClassic));
            m_NumericLedDisplay.BorderThickness = new NMargins(6);
            m_NumericLedDisplay.Margins         = new NMargins(5);
            m_NumericLedDisplay.Padding         = new NMargins(5);
            NGelCapEffect gelCap = new NGelCapEffect();

            gelCap.Shape = ENCapEffectShape.RoundedRect;
            m_NumericLedDisplay.CapEffect       = gelCap;
            m_NumericLedDisplay.PreferredHeight = 60;

            verticalStack.Add(m_NumericLedDisplay);

            m_RadialGauge.Content = verticalStack;

            // add radial gauge
            controlStack.Add(m_RadialGauge);

            m_DataFeedTimer       = new NTimer();
            m_DataFeedTimer.Tick += new Function(OnDataFeedTimerTick);
            m_DataFeedTimer.Start();

            return(stack);
        }