Ejemplo n.º 1
0
        public override void  frameLabel(FrameLabel tag)
        {
            if (frame.label != null)
            {
                error("duplicate label " + tag.label);
            }

            frame.label = tag;
        }
Ejemplo n.º 2
0
        static uint WriteImpl(MemoryPool memory, FrameLabel label)
        {
            var labelMemory = memory.AllocatePadded(Constants.IntPtrSize * 4, Constants.IntPtrSize);

            using (var labelWriter = GetWriter(labelMemory))
            {
                labelWriter.Write((UInt32)FrameItemType.FrameLabel);

                var labelNameAddress = Write(memory, label.Name);
                labelWriter.Write((UInt32)labelNameAddress);
                labelWriter.Write((UInt32)label.Flags);
                labelWriter.Write((UInt32)label.FrameId);
            }
            return(labelMemory.StartAddress);
        }
Ejemplo n.º 3
0
		public override void  frameLabel(FrameLabel tag)
		{
			if (frame.label != null)
			{
				error("duplicate label " + tag.label);
			}
			
			frame.label = tag;
		}
Ejemplo n.º 4
0
        private bool bInitAmpereMeter()
        {
            bool bRes=false;
            Debug.WriteLine("++Form1::bInitAmpereMeter()");
            // digital Amperemeter
            NumericalFrame nfrm7Seg4IndFrame = new NumericalFrame(new Rectangle(10, 10, 200, 80));
            this.DigitalCurrentBaseUI.Frame.Add(nfrm7Seg4IndFrame); // DigitalCurrentBaseUI.Frame[0] - 7-segment indicator
            nfrm7Seg4IndFrame.BackRenderer.CenterColor = Color.Black;
            nfrm7Seg4IndFrame.BackRenderer.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;

            for(int i = 0; i < m_ciNumOfAmpDigits; i++)
            {
                DigitalPanel7Segment seg = new DigitalPanel7Segment(nfrm7Seg4IndFrame);
                nfrm7Seg4IndFrame.Indicator.Panels.Add(seg);
                seg.BackColor = Color.Black;
                seg.MainColor = Color.White; // blue when discharging, green-yellow when charging
                seg.EnableBorder = false;
            };

            // analog amperemeter
            CircularFrame cfrmAnalogAMeterDialFrm = new CircularFrame(new Point(10, 10), this.AnalogCurrentBaseUI.Width);
            // add it to nextui container
            this.AnalogCurrentBaseUI.Frame.Add(cfrmAnalogAMeterDialFrm); // DigitalCurrentBaseUI.Frame[0] - analog meter
            // now modify circular frame in place
            cfrmAnalogAMeterDialFrm.BackRenderer.CenterColor = Color.AliceBlue;
            cfrmAnalogAMeterDialFrm.BackRenderer.EndColor = Color.Gray;
            cfrmAnalogAMeterDialFrm.FrameRenderer.Outline = NextUI.Renderer.FrameRender.FrameOutline.None;

            // now create circular bar for circular frame
            CircularScaleBar ccbrAnalogAMeterScaleBar = new CircularScaleBar(cfrmAnalogAMeterDialFrm);
            ccbrAnalogAMeterScaleBar.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;
            ccbrAnalogAMeterScaleBar.ScaleBarSize = 4;
            ccbrAnalogAMeterScaleBar.FillColor = Color.White;
            ccbrAnalogAMeterScaleBar.StartValue = -50.0F; // for numerical scale only
            ccbrAnalogAMeterScaleBar.EndValue = +50.0F; // for numerical scale only
            ccbrAnalogAMeterScaleBar.StartAngle = 70; //50;
            ccbrAnalogAMeterScaleBar.SweepAngle = 40; // alignmet of moddle mark to vertical
            // major ticks
            ccbrAnalogAMeterScaleBar.MajorTickNumber = 11; // 10 A/div, difference is 10 + 1 end tick
            // alternatibvely we may supply custom labels ±
            ccbrAnalogAMeterScaleBar.CustomLabel = new string[] { "-50", "-40", "-30", "-20", "-10","-0+", "+10","+20", "+30","+40","+50"  };
            ccbrAnalogAMeterScaleBar.TickMajor.EnableGradient = false;
            ccbrAnalogAMeterScaleBar.TickMajor.EnableBorder = false;
            ccbrAnalogAMeterScaleBar.TickMajor.FillColor = Color.Honeydew; // color of outer ring and ticks
            ccbrAnalogAMeterScaleBar.TickMajor.Height = 15;
            ccbrAnalogAMeterScaleBar.TickMajor.Width = 7;
            ccbrAnalogAMeterScaleBar.TickMajor.Type = TickBase.TickType.Rectangle;
            ccbrAnalogAMeterScaleBar.TickMajor.TickPosition = TickBase.Position.Inner;
            //            ccbrAnalogAMeterScaleBar.TickMajor.TickPosition = TickBase.Position.Outer;
            // minor ticks
            ccbrAnalogAMeterScaleBar.MinorTicknumber = 5; // 2 A/div
            ccbrAnalogAMeterScaleBar.TickMinor.EnableGradient = false;
            ccbrAnalogAMeterScaleBar.TickMinor.EnableBorder = false;
            ccbrAnalogAMeterScaleBar.TickMinor.FillColor = Color.White;
            ccbrAnalogAMeterScaleBar.TickMinor.TickPosition = TickBase.Position.Inner;
            //            ccbrAnalogAMeterScaleBar.TickMinor.TickPosition = TickBase.Position.Outer;
            // scale numeric labels
            ccbrAnalogAMeterScaleBar.TickLabel.TextDirection = CircularLabel.Direction.Horizontal;
            ccbrAnalogAMeterScaleBar.TickLabel.OffsetFromScale = 35;
            ccbrAnalogAMeterScaleBar.TickLabel.LabelFont = new Font(FontFamily.GenericMonospace, 12, FontStyle.Bold);
            ccbrAnalogAMeterScaleBar.TickLabel.FontColor = Color.Black;
            // add circular bar to circular frame
            cfrmAnalogAMeterDialFrm.ScaleCollection.Add(ccbrAnalogAMeterScaleBar);

            // now construct circular pointer
            CircularPointer cptrAnalogAMeterPtr = new CircularPointer(cfrmAnalogAMeterDialFrm);
            cptrAnalogAMeterPtr.CapPointer.Visible = true;
            cptrAnalogAMeterPtr.CapOnTop = false;
            cptrAnalogAMeterPtr.BasePointer.Length = 150;
            cptrAnalogAMeterPtr.BasePointer.FillColor = Color.Black;
            cptrAnalogAMeterPtr.BasePointer.PointerShapeType = Pointerbase.PointerType.Type1;
            cptrAnalogAMeterPtr.BasePointer.OffsetFromCenter = -30;
            // add circ pointer to frame
            ccbrAnalogAMeterScaleBar.Pointer.Add(cptrAnalogAMeterPtr);
            // construct big A label
            System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            Stream Alabel_bmp_Stream = myAssembly.GetManifestResourceStream("batt_mon_app.A.png");
            Bitmap A_label_image = new Bitmap(Alabel_bmp_Stream);
            Point ptVlablePoint = new Point(cfrmAnalogAMeterDialFrm.Rect.Width/2 - A_label_image.Width/2, (3*cfrmAnalogAMeterDialFrm.Rect.Height)/4 - A_label_image.Height);
            FrameLabel fbimage = new FrameLabel(ptVlablePoint, cfrmAnalogAMeterDialFrm);
            fbimage.BackGrdImage = A_label_image;
            // add label to frame
            cfrmAnalogAMeterDialFrm.FrameLabelCollection.Add(fbimage);
            Debug.WriteLine("--Form1::bInitAmpereMeter()=" + bRes.ToString());
            return bRes;
        }
Ejemplo n.º 5
0
        private bool bInitThermometer()
        {
            bool bRes = false;

            Debug.WriteLine("++Form1::bInitThermometer()");
// digital thermometer; format -xx.x deg C
            NumericalFrame nfrm7Seg4tIndFrame = new NumericalFrame(new Rectangle(10, 10, 140, 60));

            this.DigitalTempBaseUI.Frame.Add(nfrm7Seg4tIndFrame); // DigitalTempBaseUI.Frame[0] - 7-segment indicator
            nfrm7Seg4tIndFrame.BackRenderer.CenterColor      = Color.Black;
            nfrm7Seg4tIndFrame.BackRenderer.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;

            for (int i = 0; i < m_ciNumOfTemperDigits; i++)
            {
                DigitalPanel7Segment seg = new DigitalPanel7Segment(nfrm7Seg4tIndFrame);
                nfrm7Seg4tIndFrame.Indicator.Panels.Add(seg);
                seg.BackColor    = Color.Black;
                seg.MainColor    = Color.GreenYellow; // blue when below freezing, orange-yellow when above freezing
                seg.EnableBorder = false;
            }
            ;

// construct analog temperature gauge, -20C to +60C, no arrow, rotating sector with gradient color instead
// ------------------------------------------------------------------------------------------------------------------------------
            CircularFrame leftdownframe = new CircularFrame(new Point(10, 20), 200);

            this.AnalogTempBaseUI.Frame.Add(leftdownframe);
            leftdownframe.BackRenderer.CenterColor = Color.Chocolate;
            leftdownframe.BackRenderer.EndColor    = Color.CornflowerBlue;
            leftdownframe.FrameRenderer.Outline    = NextUI.Renderer.FrameRender.FrameOutline.None;
            leftdownframe.Type = CircularFrame.FrameType.HalfCircle1;
// circilar scale bar
            CircularScaleBar leftdownbar = new CircularScaleBar(leftdownframe);

            leftdownbar.FillGradientType    = NextUI.Renderer.RendererGradient.GradientType.Solid;
            leftdownbar.ScaleBarSize        = 2;
            leftdownbar.TickMajor.FillColor = Color.White;
            leftdownbar.TickMinor.FillColor = Color.Cornsilk;
            leftdownbar.StartValue          = -20.0F; // deg C
            leftdownbar.EndValue            = +60.0F; // deg C
            leftdownbar.MajorTickNumber     = 9;
            leftdownbar.SweepAngle          = 180;    // 180; //
            leftdownbar.StartAngle          = 0;
// if custom label is not supplied, then auto generated values will be used
            leftdownbar.CustomLabel               = new string[] { "-20°", "-10°", "±0°", " ", "+20°", " ", "+40°", " ", "+60°" };
            leftdownbar.TickLabel.TextDirection   = CircularLabel.Direction.Horizontal; // will place words cold and hot horizontally
            leftdownbar.TickLabel.OffsetFromScale = 32;                                 // how far away labels are positioned from scale
            leftdownbar.TickLabel.LabelFont       = new Font(FontFamily.GenericMonospace, 10, FontStyle.Bold);
            leftdownbar.TickLabel.FontColor       = Color.White;
            leftdownframe.ScaleCollection.Add(leftdownbar);
// circular range
            CircularRange leftdownrange = new CircularRange(leftdownframe);

            leftdownrange.RangePosition = RangeBase.Position.Inner;
            leftdownrange.StartWidth    = 15;
            leftdownrange.EndWidth      = 15;
            leftdownrange.StartValue    = -20.0F;
            leftdownrange.EndValue      = 0.0F;
            leftdownrange.FillColor     = Color.Red;
            leftdownrange.EndColor      = Color.LightSkyBlue;
            leftdownrange.EnableBorder  = true;
            leftdownrange.BorderColor   = Color.White;
            leftdownrange.Opaque        = 255;
            leftdownbar.Range.Add(leftdownrange);
// construct big °C label
            System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            Stream     tlabel_bmp_Stream          = myAssembly.GetManifestResourceStream("batt_mon_app.degC.png");
            Bitmap     t_label_image = new Bitmap(tlabel_bmp_Stream);
            Point      ptVlablePoint = new Point(leftdownframe.Rect.Width / 2 - t_label_image.Width / 2, (3 * leftdownframe.Rect.Height) / 4 - 2 * t_label_image.Height);
            FrameLabel fbimage       = new FrameLabel(ptVlablePoint, leftdownframe);

            fbimage.BackGrdImage = t_label_image;
// add label to frame
            leftdownframe.FrameLabelCollection.Add(fbimage);

            Debug.WriteLine("--Form1::bInitThermometer()=" + bRes.ToString());
            return(bRes);
        }
Ejemplo n.º 6
0
		public override void  frameLabel(FrameLabel tag)
		{
			tagw.writeString(tag.label);
			if (tag.anchor && SwfVersion >= 6)
			{
				tagw.writeUI8(1);
			}
			encodeTag(tag);
		}
Ejemplo n.º 7
0
        private bool bInitAmpereMeter()
        {
            bool bRes = false;

            Debug.WriteLine("++Form1::bInitAmpereMeter()");
// digital Amperemeter
            NumericalFrame nfrm7Seg4IndFrame = new NumericalFrame(new Rectangle(10, 10, 200, 80));

            this.DigitalCurrentBaseUI.Frame.Add(nfrm7Seg4IndFrame); // DigitalCurrentBaseUI.Frame[0] - 7-segment indicator
            nfrm7Seg4IndFrame.BackRenderer.CenterColor      = Color.Black;
            nfrm7Seg4IndFrame.BackRenderer.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;

            for (int i = 0; i < m_ciNumOfAmpDigits; i++)
            {
                DigitalPanel7Segment seg = new DigitalPanel7Segment(nfrm7Seg4IndFrame);
                nfrm7Seg4IndFrame.Indicator.Panels.Add(seg);
                seg.BackColor    = Color.Black;
                seg.MainColor    = Color.White; // blue when discharging, green-yellow when charging
                seg.EnableBorder = false;
            }
            ;

// analog amperemeter
            CircularFrame cfrmAnalogAMeterDialFrm = new CircularFrame(new Point(10, 10), this.AnalogCurrentBaseUI.Width);

// add it to nextui container
            this.AnalogCurrentBaseUI.Frame.Add(cfrmAnalogAMeterDialFrm); // DigitalCurrentBaseUI.Frame[0] - analog meter
// now modify circular frame in place
            cfrmAnalogAMeterDialFrm.BackRenderer.CenterColor = Color.AliceBlue;
            cfrmAnalogAMeterDialFrm.BackRenderer.EndColor    = Color.Gray;
            cfrmAnalogAMeterDialFrm.FrameRenderer.Outline    = NextUI.Renderer.FrameRender.FrameOutline.None;

// now create circular bar for circular frame
            CircularScaleBar ccbrAnalogAMeterScaleBar = new CircularScaleBar(cfrmAnalogAMeterDialFrm);

            ccbrAnalogAMeterScaleBar.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;
            ccbrAnalogAMeterScaleBar.ScaleBarSize     = 4;
            ccbrAnalogAMeterScaleBar.FillColor        = Color.White;
            ccbrAnalogAMeterScaleBar.StartValue       = -50.0F; // for numerical scale only
            ccbrAnalogAMeterScaleBar.EndValue         = +50.0F; // for numerical scale only
            ccbrAnalogAMeterScaleBar.StartAngle       = 70;     //50;
            ccbrAnalogAMeterScaleBar.SweepAngle       = 40;     // alignmet of moddle mark to vertical
// major ticks
            ccbrAnalogAMeterScaleBar.MajorTickNumber = 11;      // 10 A/div, difference is 10 + 1 end tick
// alternatibvely we may supply custom labels ±
            ccbrAnalogAMeterScaleBar.CustomLabel = new string[] { "-50", "-40", "-30", "-20", "-10", "-0+", "+10", "+20", "+30", "+40", "+50" };
            ccbrAnalogAMeterScaleBar.TickMajor.EnableGradient = false;
            ccbrAnalogAMeterScaleBar.TickMajor.EnableBorder   = false;
            ccbrAnalogAMeterScaleBar.TickMajor.FillColor      = Color.Honeydew; // color of outer ring and ticks
            ccbrAnalogAMeterScaleBar.TickMajor.Height         = 15;
            ccbrAnalogAMeterScaleBar.TickMajor.Width          = 7;
            ccbrAnalogAMeterScaleBar.TickMajor.Type           = TickBase.TickType.Rectangle;
            ccbrAnalogAMeterScaleBar.TickMajor.TickPosition   = TickBase.Position.Inner;
//            ccbrAnalogAMeterScaleBar.TickMajor.TickPosition = TickBase.Position.Outer;
// minor ticks
            ccbrAnalogAMeterScaleBar.MinorTicknumber          = 5; // 2 A/div
            ccbrAnalogAMeterScaleBar.TickMinor.EnableGradient = false;
            ccbrAnalogAMeterScaleBar.TickMinor.EnableBorder   = false;
            ccbrAnalogAMeterScaleBar.TickMinor.FillColor      = Color.White;
            ccbrAnalogAMeterScaleBar.TickMinor.TickPosition   = TickBase.Position.Inner;
//            ccbrAnalogAMeterScaleBar.TickMinor.TickPosition = TickBase.Position.Outer;
// scale numeric labels
            ccbrAnalogAMeterScaleBar.TickLabel.TextDirection   = CircularLabel.Direction.Horizontal;
            ccbrAnalogAMeterScaleBar.TickLabel.OffsetFromScale = 35;
            ccbrAnalogAMeterScaleBar.TickLabel.LabelFont       = new Font(FontFamily.GenericMonospace, 12, FontStyle.Bold);
            ccbrAnalogAMeterScaleBar.TickLabel.FontColor       = Color.Black;
// add circular bar to circular frame
            cfrmAnalogAMeterDialFrm.ScaleCollection.Add(ccbrAnalogAMeterScaleBar);

// now construct circular pointer
            CircularPointer cptrAnalogAMeterPtr = new CircularPointer(cfrmAnalogAMeterDialFrm);

            cptrAnalogAMeterPtr.CapPointer.Visible           = true;
            cptrAnalogAMeterPtr.CapOnTop                     = false;
            cptrAnalogAMeterPtr.BasePointer.Length           = 150;
            cptrAnalogAMeterPtr.BasePointer.FillColor        = Color.Black;
            cptrAnalogAMeterPtr.BasePointer.PointerShapeType = Pointerbase.PointerType.Type1;
            cptrAnalogAMeterPtr.BasePointer.OffsetFromCenter = -30;
// add circ pointer to frame
            ccbrAnalogAMeterScaleBar.Pointer.Add(cptrAnalogAMeterPtr);
// construct big A label
            System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            Stream     Alabel_bmp_Stream          = myAssembly.GetManifestResourceStream("batt_mon_app.A.png");
            Bitmap     A_label_image = new Bitmap(Alabel_bmp_Stream);
            Point      ptVlablePoint = new Point(cfrmAnalogAMeterDialFrm.Rect.Width / 2 - A_label_image.Width / 2, (3 * cfrmAnalogAMeterDialFrm.Rect.Height) / 4 - A_label_image.Height);
            FrameLabel fbimage       = new FrameLabel(ptVlablePoint, cfrmAnalogAMeterDialFrm);

            fbimage.BackGrdImage = A_label_image;
// add label to frame
            cfrmAnalogAMeterDialFrm.FrameLabelCollection.Add(fbimage);
            Debug.WriteLine("--Form1::bInitAmpereMeter()=" + bRes.ToString());
            return(bRes);
        }
Ejemplo n.º 8
0
        private bool bInitVoltmeter()
        {
            bool bRes=false;
            Debug.WriteLine("++Form1::bInitVoltmeter()");
            // Numerical frame 3 - n+3 range digital 7-segment thin line counter
            // rectangular frame - place in the bottom quarter, in the center, autosize
            NumericalFrame nfrm7SegIndFrame = new NumericalFrame(new Rectangle(10, 10, 180, 80));
            this.DigitalVoltmBaseUI.Frame.Add(nfrm7SegIndFrame); // DigitalVoltmBaseUI.Frame[0] - 7-segment indicator
            nfrm7SegIndFrame.BackRenderer.CenterColor = Color.Black;
            nfrm7SegIndFrame.BackRenderer.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;

            for(int i = 0; i < m_ciNumOfVoltmDigits; i++)
            {
                DigitalPanel7Segment seg = new DigitalPanel7Segment(nfrm7SegIndFrame);
                nfrm7SegIndFrame.Indicator.Panels.Add(seg);
                seg.BackColor = Color.Black;
                seg.MainColor = Color.Red;
                seg.EnableBorder = false;
            };

            nfrm7SegIndFrame.Indicator.Panels[m_ciNumOfVoltmDigits - 3].MainColor = Color.Yellow; // highest digit
            nfrm7SegIndFrame.Indicator.Panels[m_ciNumOfVoltmDigits - 2].MainColor = Color.Yellow;
            nfrm7SegIndFrame.Indicator.Panels[m_ciNumOfVoltmDigits - 1].MainColor = Color.Yellow; // lowest digit
            //
            //------------------------------------------------------------------------------------------------------
            // construct one big analog voltmeter meter 10-16 V //
            // circular frame - place in the top half, in the center, autosize
            CircularFrame cfrmAnalogVMeterDialFrm = new CircularFrame(new Point(10, 10), this.AnalogVoltmBaseUI.Width);
            // add it to nextui container
            this.AnalogVoltmBaseUI.Frame.Add(cfrmAnalogVMeterDialFrm); // AnalogVoltmBaseUI.Frame[0] - analog meter
            // now modify circular frame in place
            cfrmAnalogVMeterDialFrm.BackRenderer.CenterColor = Color.AliceBlue;
            cfrmAnalogVMeterDialFrm.BackRenderer.EndColor = Color.Gray;
            cfrmAnalogVMeterDialFrm.FrameRenderer.Outline = NextUI.Renderer.FrameRender.FrameOutline.None;

            // now create circular bar for circular frame
            CircularScaleBar ccbrAnalogVMeterScaleBar = new CircularScaleBar(cfrmAnalogVMeterDialFrm);
            ccbrAnalogVMeterScaleBar.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;
            ccbrAnalogVMeterScaleBar.ScaleBarSize = 4;
            ccbrAnalogVMeterScaleBar.FillColor = Color.White;
            ccbrAnalogVMeterScaleBar.StartValue = 10.0F; // for numerical scale only
            ccbrAnalogVMeterScaleBar.EndValue = 15.0F; // for numerical scale only
            ccbrAnalogVMeterScaleBar.StartAngle = 70; //50;
            ccbrAnalogVMeterScaleBar.SweepAngle = 70;
            // major ticks
            ccbrAnalogVMeterScaleBar.MajorTickNumber = 6; // 1 V/div, difference is 6 + 1 end tick
            ccbrAnalogVMeterScaleBar.TickMajor.EnableGradient = false;
            ccbrAnalogVMeterScaleBar.TickMajor.EnableBorder = false;
            ccbrAnalogVMeterScaleBar.TickMajor.FillColor = Color.Honeydew; // color of outer ring and ticks
            ccbrAnalogVMeterScaleBar.TickMajor.Height = 15;
            ccbrAnalogVMeterScaleBar.TickMajor.Width = 7;
            ccbrAnalogVMeterScaleBar.TickMajor.Type = TickBase.TickType.Rectangle;
            ccbrAnalogVMeterScaleBar.TickMajor.TickPosition = TickBase.Position.Inner;
            // minor ticks
            ccbrAnalogVMeterScaleBar.MinorTicknumber = 5; // 0.2 V/div
            ccbrAnalogVMeterScaleBar.TickMinor.EnableGradient = false;
            ccbrAnalogVMeterScaleBar.TickMinor.EnableBorder = false;
            ccbrAnalogVMeterScaleBar.TickMinor.FillColor = Color.White;
            ccbrAnalogVMeterScaleBar.TickMinor.TickPosition = TickBase.Position.Inner;
            // scale numeric labels
            ccbrAnalogVMeterScaleBar.TickLabel.TextDirection = CircularLabel.Direction.Horizontal;
            ccbrAnalogVMeterScaleBar.TickLabel.OffsetFromScale = 35;
            ccbrAnalogVMeterScaleBar.TickLabel.LabelFont = new Font(FontFamily.GenericMonospace, 12, FontStyle.Bold);
            ccbrAnalogVMeterScaleBar.TickLabel.FontColor = Color.Black;
            // add circular bar to circular frame
            cfrmAnalogVMeterDialFrm.ScaleCollection.Add(ccbrAnalogVMeterScaleBar);

            // now construct circular pointer
            CircularPointer cptrAnalogVMeterPtr = new CircularPointer(cfrmAnalogVMeterDialFrm);
            cptrAnalogVMeterPtr.CapPointer.Visible = true;
            cptrAnalogVMeterPtr.CapOnTop = false;
            cptrAnalogVMeterPtr.BasePointer.Length = 150;
            cptrAnalogVMeterPtr.BasePointer.FillColor = Color.Black;
            cptrAnalogVMeterPtr.BasePointer.PointerShapeType = Pointerbase.PointerType.Type1;
            cptrAnalogVMeterPtr.BasePointer.OffsetFromCenter = -30;
            // add circ pointer to frame
            ccbrAnalogVMeterScaleBar.Pointer.Add(cptrAnalogVMeterPtr);

            // construct big V label
            System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            Stream Vlabel_bmp_Stream = myAssembly.GetManifestResourceStream("batt_mon_app.V.png");
            Bitmap V_label_image = new Bitmap(Vlabel_bmp_Stream);
            Point ptVlablePoint = new Point(cfrmAnalogVMeterDialFrm.Rect.Width/2 - V_label_image.Width/2-10, (3*cfrmAnalogVMeterDialFrm.Rect.Height)/4 - V_label_image.Height);
            FrameLabel fbimage = new FrameLabel(ptVlablePoint, cfrmAnalogVMeterDialFrm);
            fbimage.BackGrdImage = V_label_image;
            // add label to frame
            cfrmAnalogVMeterDialFrm.FrameLabelCollection.Add(fbimage);

            #if VOLTMETERTIMER
            // start voltmeter timer
            m_VMeterTimer = new System.Windows.Forms.Timer();
            m_VMeterTimer.Interval=100;
            m_VMeterTimer.Tick += new EventHandler(Vmeter_timer_Funkt);
            Debug.WriteLine("Form1() bInitVoltmeter() Vmeter timer is up; rate="+(1000/m_VMeterTimer.Interval).ToString() + " Hz");
            m_VMeterTimer.Start();
            #endif
            Debug.WriteLine("--Form1::bInitVoltmeter()=" + bRes.ToString());
            return bRes;
        }
Ejemplo n.º 9
0
 public override void  frameLabel(FrameLabel tag)
 {
     tags.Add(tag);
 }
Ejemplo n.º 10
0
        private bool bInitVoltmeter()
        {
            bool bRes = false;

            Debug.WriteLine("++Form1::bInitVoltmeter()");
// Numerical frame 3 - n+3 range digital 7-segment thin line counter
// rectangular frame - place in the bottom quarter, in the center, autosize
            NumericalFrame nfrm7SegIndFrame = new NumericalFrame(new Rectangle(10, 10, 180, 80));

            this.DigitalVoltmBaseUI.Frame.Add(nfrm7SegIndFrame); // DigitalVoltmBaseUI.Frame[0] - 7-segment indicator
            nfrm7SegIndFrame.BackRenderer.CenterColor      = Color.Black;
            nfrm7SegIndFrame.BackRenderer.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;

            for (int i = 0; i < m_ciNumOfVoltmDigits; i++)
            {
                DigitalPanel7Segment seg = new DigitalPanel7Segment(nfrm7SegIndFrame);
                nfrm7SegIndFrame.Indicator.Panels.Add(seg);
                seg.BackColor    = Color.Black;
                seg.MainColor    = Color.Red;
                seg.EnableBorder = false;
            }
            ;

            nfrm7SegIndFrame.Indicator.Panels[m_ciNumOfVoltmDigits - 3].MainColor = Color.Yellow; // highest digit
            nfrm7SegIndFrame.Indicator.Panels[m_ciNumOfVoltmDigits - 2].MainColor = Color.Yellow;
            nfrm7SegIndFrame.Indicator.Panels[m_ciNumOfVoltmDigits - 1].MainColor = Color.Yellow; // lowest digit
//
//------------------------------------------------------------------------------------------------------
// construct one big analog voltmeter meter 10-16 V //
// circular frame - place in the top half, in the center, autosize
            CircularFrame cfrmAnalogVMeterDialFrm = new CircularFrame(new Point(10, 10), this.AnalogVoltmBaseUI.Width);

// add it to nextui container
            this.AnalogVoltmBaseUI.Frame.Add(cfrmAnalogVMeterDialFrm); // AnalogVoltmBaseUI.Frame[0] - analog meter
// now modify circular frame in place
            cfrmAnalogVMeterDialFrm.BackRenderer.CenterColor = Color.AliceBlue;
            cfrmAnalogVMeterDialFrm.BackRenderer.EndColor    = Color.Gray;
            cfrmAnalogVMeterDialFrm.FrameRenderer.Outline    = NextUI.Renderer.FrameRender.FrameOutline.None;

// now create circular bar for circular frame
            CircularScaleBar ccbrAnalogVMeterScaleBar = new CircularScaleBar(cfrmAnalogVMeterDialFrm);

            ccbrAnalogVMeterScaleBar.FillGradientType = NextUI.Renderer.RendererGradient.GradientType.Solid;
            ccbrAnalogVMeterScaleBar.ScaleBarSize     = 4;
            ccbrAnalogVMeterScaleBar.FillColor        = Color.White;
            ccbrAnalogVMeterScaleBar.StartValue       = 10.0F; // for numerical scale only
            ccbrAnalogVMeterScaleBar.EndValue         = 15.0F; // for numerical scale only
            ccbrAnalogVMeterScaleBar.StartAngle       = 70;    //50;
            ccbrAnalogVMeterScaleBar.SweepAngle       = 70;
// major ticks
            ccbrAnalogVMeterScaleBar.MajorTickNumber          = 6; // 1 V/div, difference is 6 + 1 end tick
            ccbrAnalogVMeterScaleBar.TickMajor.EnableGradient = false;
            ccbrAnalogVMeterScaleBar.TickMajor.EnableBorder   = false;
            ccbrAnalogVMeterScaleBar.TickMajor.FillColor      = Color.Honeydew; // color of outer ring and ticks
            ccbrAnalogVMeterScaleBar.TickMajor.Height         = 15;
            ccbrAnalogVMeterScaleBar.TickMajor.Width          = 7;
            ccbrAnalogVMeterScaleBar.TickMajor.Type           = TickBase.TickType.Rectangle;
            ccbrAnalogVMeterScaleBar.TickMajor.TickPosition   = TickBase.Position.Inner;
// minor ticks
            ccbrAnalogVMeterScaleBar.MinorTicknumber          = 5; // 0.2 V/div
            ccbrAnalogVMeterScaleBar.TickMinor.EnableGradient = false;
            ccbrAnalogVMeterScaleBar.TickMinor.EnableBorder   = false;
            ccbrAnalogVMeterScaleBar.TickMinor.FillColor      = Color.White;
            ccbrAnalogVMeterScaleBar.TickMinor.TickPosition   = TickBase.Position.Inner;
// scale numeric labels
            ccbrAnalogVMeterScaleBar.TickLabel.TextDirection   = CircularLabel.Direction.Horizontal;
            ccbrAnalogVMeterScaleBar.TickLabel.OffsetFromScale = 35;
            ccbrAnalogVMeterScaleBar.TickLabel.LabelFont       = new Font(FontFamily.GenericMonospace, 12, FontStyle.Bold);
            ccbrAnalogVMeterScaleBar.TickLabel.FontColor       = Color.Black;
// add circular bar to circular frame
            cfrmAnalogVMeterDialFrm.ScaleCollection.Add(ccbrAnalogVMeterScaleBar);

// now construct circular pointer
            CircularPointer cptrAnalogVMeterPtr = new CircularPointer(cfrmAnalogVMeterDialFrm);

            cptrAnalogVMeterPtr.CapPointer.Visible           = true;
            cptrAnalogVMeterPtr.CapOnTop                     = false;
            cptrAnalogVMeterPtr.BasePointer.Length           = 150;
            cptrAnalogVMeterPtr.BasePointer.FillColor        = Color.Black;
            cptrAnalogVMeterPtr.BasePointer.PointerShapeType = Pointerbase.PointerType.Type1;
            cptrAnalogVMeterPtr.BasePointer.OffsetFromCenter = -30;
// add circ pointer to frame
            ccbrAnalogVMeterScaleBar.Pointer.Add(cptrAnalogVMeterPtr);

// construct big V label
            System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            Stream     Vlabel_bmp_Stream          = myAssembly.GetManifestResourceStream("batt_mon_app.V.png");
            Bitmap     V_label_image = new Bitmap(Vlabel_bmp_Stream);
            Point      ptVlablePoint = new Point(cfrmAnalogVMeterDialFrm.Rect.Width / 2 - V_label_image.Width / 2 - 10, (3 * cfrmAnalogVMeterDialFrm.Rect.Height) / 4 - V_label_image.Height);
            FrameLabel fbimage       = new FrameLabel(ptVlablePoint, cfrmAnalogVMeterDialFrm);

            fbimage.BackGrdImage = V_label_image;
// add label to frame
            cfrmAnalogVMeterDialFrm.FrameLabelCollection.Add(fbimage);

#if VOLTMETERTIMER
// start voltmeter timer
            m_VMeterTimer          = new System.Windows.Forms.Timer();
            m_VMeterTimer.Interval = 100;
            m_VMeterTimer.Tick    += new EventHandler(Vmeter_timer_Funkt);
            Debug.WriteLine("Form1() bInitVoltmeter() Vmeter timer is up; rate=" + (1000 / m_VMeterTimer.Interval).ToString() + " Hz");
            m_VMeterTimer.Start();
#endif
            Debug.WriteLine("--Form1::bInitVoltmeter()=" + bRes.ToString());
            return(bRes);
        }          // end of bInitVoltmeter()
Ejemplo n.º 11
0
    public static void cacheMovieClipInfo(JsonData value_)
    {
        string _className = (value_[(int)MovieClipType.className] as IJsonWrapper).GetString();

        if (disDict.ContainsKey(_className))
        {
            return;
        }
        MCTimeLineInfo _mcTimeLineInfo;
        JsonData       _childInfos;
        ChildInfo      _ci;
        JsonData       _childInfo;
        JsonData       _framePropertys;
        JsonData       _frameLabelInfos;
        JsonData       _frameLabelInfo;
        FrameLabel     _fl;
        int            lastFrames;

        _mcTimeLineInfo                = new MCTimeLineInfo();
        _mcTimeLineInfo.className      = _className;
        _mcTimeLineInfo.superClassName = (value_[(int)MovieClipType.superClassName] as IJsonWrapper).GetInt();
        _mcTimeLineInfo.onStage        = (value_[(int)MovieClipType.onStage] as IJsonWrapper).GetBoolean();
        _mcTimeLineInfo.totalFrames    = (value_[(int)MovieClipType.totalFrames] as IJsonWrapper).GetInt();
        _mcTimeLineInfo.childrenNeverRemoveFromStage = true;
        _mcTimeLineInfo.allChildrenSprite            = true;

        _childInfos = value_[(int)MovieClipType.childrenInfos];
        int _numChildren = _childInfos.Count;

        _mcTimeLineInfo.childrenInfos = new ChildInfo[_numChildren];
        for (int _disIndex = 0; _disIndex < _numChildren; _disIndex++)
        {
            _ci                = new ChildInfo();
            _childInfo         = _childInfos[_disIndex];
            _ci.insName        = (_childInfo[(int)ChildType.insName] as IJsonWrapper).GetString();
            _ci.blendMode      = (_childInfo[(int)ChildType.blendMode] as IJsonWrapper).GetString();
            _ci.className      = (_childInfo[(int)ChildType.className] as IJsonWrapper).GetString();
            _ci.superClassName = (_childInfo[(int)ChildType.superClassName] as IJsonWrapper).GetInt();
            if (_ci.superClassName != (int)ClassType.Sprite)
            {
                _mcTimeLineInfo.allChildrenSprite = false;
            }
            _ci.childIndex        = (_childInfo[(int)ChildType.childIndex] as IJsonWrapper).GetInt();
            _ci.parentNumChildren = _numChildren;
            _ci.beginFrame        = (_childInfo[(int)ChildType.beginFrame] as IJsonWrapper).GetInt();
            _ci.endFrame          = (_childInfo[(int)ChildType.endFrame] as IJsonWrapper).GetInt();
            //_ci.maskChildrenNumber = (_childInfo[(int) ChildType.maskChildrenNumber] as IJsonWrapper).GetInt ();
            if (_ci.beginFrame != 1 || _ci.endFrame != _mcTimeLineInfo.totalFrames)
            {
                _mcTimeLineInfo.childrenNeverRemoveFromStage = false; //Any children remove from stage.set it to false.
            }
            lastFrames = _ci.endFrame - _ci.beginFrame + 1;

            //cache frame propertys
            _framePropertys = _childInfo[(int)ChildType.framePropertys];
            if (lastFrames == 1)
            {
                _ci.propertyInFrames = new float[9, 1];
                _ci.propertyInFrames[(int)PropertyType.x, 0]        = OtherUtils.getFloat(_framePropertys[(int)PropertyType.x]) * 0.01f;
                _ci.propertyInFrames[(int)PropertyType.y, 0]        = OtherUtils.getFloat(_framePropertys[(int)PropertyType.y]) * 0.01f;
                _ci.propertyInFrames[(int)PropertyType.scaleX, 0]   = OtherUtils.getFloat(_framePropertys[(int)PropertyType.scaleX]);
                _ci.propertyInFrames[(int)PropertyType.scaleY, 0]   = OtherUtils.getFloat(_framePropertys[(int)PropertyType.scaleY]);
                _ci.propertyInFrames[(int)PropertyType.rotation, 0] = OtherUtils.getFloat(_framePropertys[(int)PropertyType.rotation]);
                _ci.propertyInFrames[(int)PropertyType.r, 0]        = OtherUtils.getFloat(_framePropertys[(int)PropertyType.r]);
                _ci.propertyInFrames[(int)PropertyType.g, 0]        = OtherUtils.getFloat(_framePropertys[(int)PropertyType.g]);
                _ci.propertyInFrames[(int)PropertyType.b, 0]        = OtherUtils.getFloat(_framePropertys[(int)PropertyType.b]);
                _ci.propertyInFrames[(int)PropertyType.a, 0]        = OtherUtils.getFloat(_framePropertys[(int)PropertyType.a]);
            }
            else
            {
                _ci.propertyInFrames = new float[9, lastFrames];
                bool _xChanged = _framePropertys[(int)PropertyType.x].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.x, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.x], lastFrames, 0.01f));
                bool _yChanged = _framePropertys[(int)PropertyType.y].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.y, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.y], lastFrames, 0.01f));
                bool _sxChanged = _framePropertys[(int)PropertyType.scaleX].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.scaleX, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.scaleX], lastFrames));
                bool _syChanged = _framePropertys[(int)PropertyType.scaleY].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.scaleY, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.scaleY], lastFrames));
                _ci.roChanged = _framePropertys[(int)PropertyType.rotation].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.rotation, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.rotation], lastFrames));
                _ci.aChanged = _framePropertys[(int)PropertyType.a].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.a, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.a], lastFrames));
                bool _rChanged = _framePropertys[(int)PropertyType.r].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.r, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.r], lastFrames));
                bool _gChanged = _framePropertys[(int)PropertyType.g].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.g, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.g], lastFrames));
                bool _bChanged = _framePropertys[(int)PropertyType.b].Count != 2;
                OtherUtils.setTo(_ci.propertyInFrames, (int)PropertyType.b, OtherUtils.propertyToList(_framePropertys[(int)PropertyType.b], lastFrames));
                if (_xChanged || _yChanged)
                {
                    _ci.xyChanged = true;
                }
                if (_sxChanged || _syChanged)
                {
                    _ci.sxyChanged = true;
                }
                if (_rChanged || _gChanged || _bChanged)
                {
                    _ci.rgbChanged = true;
                }
            }
            //cache child info by their childindex
            _mcTimeLineInfo.childrenInfos[_ci.childIndex] = _ci;
        }
        //Frame label -> actions
        _frameLabelInfos = value_[(int)MovieClipType.frameLabelInfos];
        int _frameLabelInfosCount = _frameLabelInfos.Count;

        _mcTimeLineInfo.frameLabels = new FrameLabel[_frameLabelInfosCount];
        for (int _frameLabelIndex = 0; _frameLabelIndex < _frameLabelInfosCount; _frameLabelIndex++)
        {
            _frameLabelInfo = _frameLabelInfos[_frameLabelIndex];
            _fl             = new FrameLabel();
            _fl.frame       = (_frameLabelInfo[(int)FrameType.frame] as IJsonWrapper).GetInt();
            _fl.targetPath  = (_frameLabelInfo[(int)FrameType.targetPath] as IJsonWrapper).GetString();
            _fl.name        = (FrameNameType)(_frameLabelInfo[(int)FrameType.name] as IJsonWrapper).GetInt();
            _fl.parameter   = (_frameLabelInfo[(int)FrameType.parameter] as IJsonWrapper).GetString();
            _mcTimeLineInfo.frameLabels[_frameLabelIndex] = _fl;
        }
        cacheFrameInfo(_mcTimeLineInfo);
        disDict[_mcTimeLineInfo.className] = _mcTimeLineInfo;
    }
Ejemplo n.º 12
0
		public override void  frameLabel(FrameLabel tag)
		{
			open(tag);
			out_Renamed.Write(" label='" + tag.label + "'");
			if (tag.anchor)
				out_Renamed.Write(" anchor='" + "true" + "'");
			close();
		}
Ejemplo n.º 13
0
 public virtual void  frameLabel(FrameLabel tag)
 {
 }