Example #1
0
        public DateTimeAxisRescaleController(DateTimeAxisRescaleConditions doc, DateTimeScale ax)
        {
            _doc  = doc;
            _axis = ax;

            SetElements(true);
        }
Example #2
0
        private void SetupOldAxis(int idx, Altaxo.Graph.Scales.Deprecated.Scale axis, bool isLinked, double orgA, double orgB, double endA, double endB)
        {
            Scale transScale = null;

            if (axis is Altaxo.Graph.Scales.Deprecated.TextScale)
            {
                transScale = new TextScale();
            }
            else if (axis is Altaxo.Graph.Scales.Deprecated.DateTimeScale)
            {
                transScale = new DateTimeScale();
            }
            else if (axis is Altaxo.Graph.Scales.Deprecated.Log10Scale)
            {
                transScale = new Log10Scale();
            }
            else if (axis is Altaxo.Graph.Scales.Deprecated.AngularScale)
            {
                transScale = (axis as Altaxo.Graph.Scales.Deprecated.AngularScale).UseDegrees ? new AngularDegreeScale() : (Scale) new AngularRadianScale();
            }
            else if (axis is Altaxo.Graph.Scales.Deprecated.LinearScale)
            {
                transScale = new LinearScale();
            }
            else
            {
                throw new ArgumentException("Axis type unknown");
            }

            if (transScale.RescalingObject is IUnboundNumericScaleRescaleConditions)
            {
                (transScale.RescalingObject as IUnboundNumericScaleRescaleConditions).SetUserParameters(BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.OrgAsVariant, BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.EndAsVariant);
            }

            if (transScale.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions &&
                axis.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)
            {
                ((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)transScale.RescalingObject).CopyFrom((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)axis.RescalingObject);
            }

            if (isLinked)
            {
#pragma warning disable CS0618 // Type or member is obsolete
                var ls = new LinkedScale(transScale, idx);
#pragma warning restore CS0618 // Type or member is obsolete
                ls.SetLinkParameter(orgA, orgB, endA, endB);
                transScale = ls;
            }

            _scales[idx] = transScale;
        }