Esempio n. 1
0
        public bool LoadGeometry(PowerGaugeGeometry geom)
        {
            GaugeMessage = geom.ErrorMessage + geom.NotifyMessage;
            if (!geom.Validate())
                return false;

            geometry = geom;

            GeometryLock = true;
            Scale1LeftMarks = geom.Scale1LeftMarks;
            Scale1RightMarks = geom.Scale1RightMarks;
            Scale1MajorMarks = geom.Scale1MajorMarks;
            Scale1Centre = geom.Scale1Centre;
            Scale1Factor = geom.Scale1Factor;
            Scale1Min = geom.Scale1Min;
            Scale1Max = geom.Scale1Max;
            Scale1RightMinorMarks = geom.Scale1RightMinorMarks;
            if (Scale1Centre.HasValue)
                Scale1LeftMinorMarks = geom.Scale1LeftMinorMarks;
            GeometryLock = false;
            RecalcGeometry();

            return true;
        }
Esempio n. 2
0
 private static void OnScale1MaxChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
 {
     PowerGauge g = o as PowerGauge;
     if (!g.GeometryLock)
     {
         PowerGaugeGeometry geom = new PowerGaugeGeometry(g);
         g.LoadGeometry(geom);
     }
 }
Esempio n. 3
0
        public PowerGauge()
        {
            IsInitialised = false;
            _Pointer1Points = new PointCollection();

            GaugeDescription = "";
            Scale1Units = "";
            DialBorderShadowDepth = 4.0;

            CalcAspectRatio();
            Scale1Min = 0;
            Scale1Max = 6000;
            Scale1MajorMarks = 7;
            Scale1LeftMarks = 3;
            Scale1RightMarks = 3;
            Scale1MinorMarks = 3;
            Scale1LeftMinorMarks = Scale1MinorMarks;
            Scale1Centre = null;
            geometry = new PowerGaugeGeometry(this);
            geometry.Validate();

            Pointer1Reposition();

            IsInitialised = true;
        }