Beispiel #1
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var start = info.GetInt32("Start");
                var count = info.GetInt32("Count");

                return(ContiguousIntegerRange.FromStartAndCount(start, count));
            }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                MultivariateContentMemento s = null != o ? (MultivariateContentMemento)o : new MultivariateContentMemento();

                s.OriginalDataTableName     = info.GetString("Name");
                s.SpectrumIsRow             = info.GetBoolean("SpectrumIsRow");
                s.SpectralIndices           = (IAscendingIntegerCollection)info.GetValue("SpectralIndices", s);
                s.ConcentrationIndices      = (IAscendingIntegerCollection)info.GetValue("ConcentrationIndices", s);
                s.MeasurementIndices        = (IAscendingIntegerCollection)info.GetValue("MeasurementIndices", s);
                s._PreferredNumberOfFactors = info.GetInt32("PreferredNumberOfFactors");

                // new in version 1
                info.GetArray("SpectralPreprocessingRegions", out int[] regions);
                s._spectralPreprocessing.Regions         = regions;
                s._spectralPreprocessing.Method          = (SpectralPreprocessingMethod)info.GetEnum("SpectralPreprocessingMethod", typeof(SpectralPreprocessingMethod));
                s._spectralPreprocessing.DetrendingOrder = info.GetInt32("SpectralPreprocessingDetrending");
                s._spectralPreprocessing.EnsembleScale   = info.GetBoolean("SpectralPreprocessingEnsembleScale");

                // new in version 2
                s._ClassNameOfAnalysisClass = info.GetString("ClassNameOfAnalysisClass");

                // added fix after version 2 : forgotten to serialize crossPRESSCalculationType
                if (info.GetNodeName() == "CrossPRESSCalculationType")
                {
                    s._crossPRESSCalculationType = (CrossPRESSCalculationType)info.GetValue("CrossPRESSCalculationType", s);
                }
                else
                {
                    s._crossPRESSCalculationType = CrossPRESSCalculationType.ExcludeGroupsOfSimilarMeasurements;
                }

                return(s);
            }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                MultivariateContentMemento s = null != o ? (MultivariateContentMemento)o : new MultivariateContentMemento();

                s.OriginalDataTableName     = info.GetString("Name");
                s.SpectrumIsRow             = info.GetBoolean("SpectrumIsRow");
                s.SpectralIndices           = (IAscendingIntegerCollection)info.GetValue("SpectralIndices", s);
                s.ConcentrationIndices      = (IAscendingIntegerCollection)info.GetValue("ConcentrationIndices", s);
                s.MeasurementIndices        = (IAscendingIntegerCollection)info.GetValue("MeasurementIndices", s);
                s._PreferredNumberOfFactors = info.GetInt32("PreferredNumberOfFactors");

                // new in version 1
                if (info.CurrentElementName == "SpectralPreprocessingRegions")
                {
                    info.GetArray("SpectralPreprocessingRegions", out int[] regions);
                    s._spectralPreprocessing.Regions         = regions;
                    s._spectralPreprocessing.Method          = (SpectralPreprocessingMethod)info.GetEnum("SpectralPreprocessingMethod", typeof(SpectralPreprocessingMethod));
                    s._spectralPreprocessing.DetrendingOrder = info.GetInt32("SpectralPreprocessingDetrending");
                    s._spectralPreprocessing.EnsembleScale   = info.GetBoolean("SpectralPreprocessingEnsembleScale");
                }

                // neccessary since version 2
                s.Analysis = new PLS2WorksheetAnalysis();

                return(s);
            }
Beispiel #4
0
            protected virtual InverseTickSpacing SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                InverseTickSpacing s = null != o ? (InverseTickSpacing)o : new InverseTickSpacing();

                s._orgGrace      = info.GetDouble("MinGrace");
                s._endGrace      = info.GetDouble("MaxGrace");
                s._snapOrgToTick = (BoundaryTickSnapping)info.GetEnum("SnapOrgToTick", typeof(BoundaryTickSnapping));
                s._snapEndToTick = (BoundaryTickSnapping)info.GetEnum("SnapEndToTick", typeof(BoundaryTickSnapping));

                s._targetNumberOfMajorTicks = info.GetInt32("TargetNumberOfMajorTicks");
                s._targetNumberOfMinorTicks = info.GetInt32("TargetNumberOfMinorTicks");
                s._userDefinedMajorSpan     = info.GetNullableDouble("UserDefinedMajorSpan");
                s._userDefinedMinorTicks    = info.GetNullableInt32("UserDefinedMinorTicks");

                s._transformationOffset              = info.GetDouble("TransformationOffset");
                s._transformationDivider             = info.GetDouble("TransformationDivider");
                s._transformationOperationIsMultiply = info.GetBoolean("TransformationIsMultiply");

                s.ChildSetMember(ref s._suppressedMajorTicks, (SuppressedTicks)info.GetValue("SuppressedMajorTicks", s));
                s.ChildSetMember(ref s._suppressedMinorTicks, (SuppressedTicks)info.GetValue("SuppressedMinorTicks", s));
                s.ChildSetMember(ref s._additionalMajorTicks, (AdditionalTicks)info.GetValue("AdditionalMajorTicks", s));
                s.ChildSetMember(ref s._additionalMinorTicks, (AdditionalTicks)info.GetValue("AdditionalMinorTicks", s));

                if (s._suppressedMajorTicks == null)
                {
                    s._suppressedMajorTicks = new SuppressedTicks()
                    {
                        ParentObject = s
                    }
                }
                ;
                if (s._suppressedMinorTicks == null)
                {
                    s._suppressedMinorTicks = new SuppressedTicks()
                    {
                        ParentObject = s
                    }
                }
                ;

                if (s._additionalMajorTicks == null)
                {
                    s._additionalMajorTicks = new AdditionalTicks()
                    {
                        ParentObject = s
                    }
                }
                ;
                if (s._additionalMinorTicks == null)
                {
                    s._additionalMinorTicks = new AdditionalTicks()
                    {
                        ParentObject = s
                    }
                }
                ;

                return(s);
            }
        }
Beispiel #5
0
            protected virtual DropLinePlotStyle SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                DropLinePlotStyle s = null != o ? (DropLinePlotStyle)o : new DropLinePlotStyle(info);

                s._independentSkipFrequency         = info.GetBoolean("IndependentSkipFreq");
                s._skipFrequency                    = info.GetInt32("SkipFreq");
                s._ignoreMissingDataPoints          = info.GetBoolean("IgnoreMissingDataPoints");
                s._independentOnShiftingGroupStyles = info.GetBoolean("IndependentOnShiftingGroupStyles");

                s._dropTargets = (CSPlaneIDList)info.GetValue("DropLine", s);
                s._additionalDropTargetIsEnabled = info.GetBoolean("HasAdditionalDropTarget");
                if (s._additionalDropTargetIsEnabled)
                {
                    s._additionalDropTargetPerpendicularAxis    = info.GetInt32("AdditionalDropTargetAxis");
                    s._additionalDropTargetUsePhysicalBaseValue = info.GetBoolean("AdditionalDropTargetUsePhysicalValue");
                    s._additionalDropTargetBaseValue            = (Altaxo.Data.AltaxoVariant)info.GetValue("AdditionalDropTargetBaseValue", s);
                }

                s.ChildSetMember(ref s._pen, (PenX)info.GetValue("Pen", s) ?? new PenX(NamedColors.Black, 1));
                s._independentColor = info.GetBoolean("IndependentColor");

                s._independentSymbolSize = info.GetBoolean("IndependentSymbolSize");
                s._symbolSize            = info.GetDouble("SymbolSize");

                s._lineWidth1Offset = info.GetDouble("LineWidth1Offset");
                s._lineWidth1Factor = info.GetDouble("LineWidth1Factor");

                s._gapAtStartOffset = info.GetDouble("GapAtStartOffset");
                s._gapAtStartFactor = info.GetDouble("GapAtStartFactor");
                s._gapAtEndOffset   = info.GetDouble("GapAtEndOffset");
                s._gapAtEndFactor   = info.GetDouble("GapAtEndFactor");
                return(s);
            }
Beispiel #6
0
            protected virtual DropLinePlotStyle SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                DropLinePlotStyle s = null != o ? (DropLinePlotStyle)o : new DropLinePlotStyle(info);

                s._independentSkipFreq           = info.GetBoolean("IndependentSkipFreq");
                s._skipFreq                      = info.GetInt32("SkipFreq");
                s._dropTargets                   = (CSPlaneIDList)info.GetValue("DropLine", s);
                s._additionalDropTargetIsEnabled = info.GetBoolean("HasAdditionalDropTarget");
                if (s._additionalDropTargetIsEnabled)
                {
                    s._additionalDropTargetPerpendicularAxis    = info.GetInt32("AdditionalDropTargetAxis");
                    s._additionalDropTargetUsePhysicalBaseValue = info.GetBoolean("AdditionalDropTargetUsePhysicalValue");
                    s._additionalDropTargetBaseValue            = (Altaxo.Data.AltaxoVariant)info.GetValue("AdditionalDropTargetBaseValue", s);
                }

                s._pen = (PenX3D)info.GetValue("Pen", s);
                s._independentColor = info.GetBoolean("IndependentColor");

                s._independentSymbolSize = info.GetBoolean("IndependentSymbolSize");
                s._symbolSize            = info.GetDouble("SymbolSize");

                s._lineWidth1Offset = info.GetDouble("LineWidth1Offset");
                s._lineWidth1Factor = info.GetDouble("LineWidth1Factor");

                s._lineWidth2Offset = info.GetDouble("LineWidth2Offset");
                s._lineWidth2Factor = info.GetDouble("LineWidth2Factor");

                s._gapAtStartOffset = info.GetDouble("GapAtStartOffset");
                s._gapAtStartFactor = info.GetDouble("GapAtStartFactor");
                s._gapAtEndOffset   = info.GetDouble("GapAtEndOffset");
                s._gapAtEndFactor   = info.GetDouble("GapAtEndFactor");
                return(s);
            }
Beispiel #7
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                int independentVariable = info.GetInt32("IndependentVariable");
                int dependentVariable   = info.GetInt32("DependentVariable");

                double[] parameter;
                info.GetArray("ParameterValues", out parameter);

                object fo = info.GetValue("FitFunction");

                if (fo is Altaxo.Serialization.Xml.AssemblyAndTypeSurrogate)
                {
                    fo = ((Altaxo.Serialization.Xml.AssemblyAndTypeSurrogate)fo).CreateInstance();
                }

                FitFunctionToScalarFunctionDDWrapper s;

                if (o == null)
                {
                    s = new FitFunctionToScalarFunctionDDWrapper(fo as IFitFunction, dependentVariable, independentVariable, parameter);
                }
                else
                {
                    s = (FitFunctionToScalarFunctionDDWrapper)o;
                    s = (FitFunctionToScalarFunctionDDWrapper)o;
                    s._independentVariable = independentVariable;
                    s._dependentVariable   = dependentVariable;
                    s._parameter           = parameter;
                    s._fitFunction         = fo as IFitFunction;
                }

                return(s);
            }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = null != o ? (AsciiDocumentAnalysisOptions)o : new AsciiDocumentAnalysisOptions();

                //  info.GetBaseValueEmbedded(s,typeof(GraphDocument).BaseType,parent);
                s._numberOfLinesToAnalyze = info.GetInt32("NumberOfLinesToAnalyze");

                int count;

                count = info.OpenArray("NumberFormatsToTest");
                for (int i = 0; i < count; ++i)
                {
                    var lcid = info.GetInt32("e");
                    s._numberFormatsToTest.Add(System.Globalization.CultureInfo.GetCultureInfo(lcid));
                }
                info.CloseArray(count);

                count = info.OpenArray("DateTimeFormatsToTest");
                for (int i = 0; i < count; ++i)
                {
                    var lcid = info.GetInt32("e");
                    s._dateTimeFormatsToTest.Add(System.Globalization.CultureInfo.GetCultureInfo(lcid));
                }
                info.CloseArray(count);

                return(s);
            }
Beispiel #9
0
            protected virtual LinearTickSpacing SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                LinearTickSpacing s = null != o ? (LinearTickSpacing)o : new LinearTickSpacing();

                s._zeroLever     = info.GetDouble("ZeroLever");
                s._orgGrace      = info.GetDouble("MinGrace");
                s._endGrace      = info.GetDouble("MaxGrace");
                s._snapOrgToTick = (BoundaryTickSnapping)info.GetEnum("SnapOrgToTick", typeof(BoundaryTickSnapping));
                s._snapEndToTick = (BoundaryTickSnapping)info.GetEnum("SnapEndToTick", typeof(BoundaryTickSnapping));

                s._targetNumberOfMajorTicks = info.GetInt32("TargetNumberOfMajorTicks");
                s._targetNumberOfMinorTicks = info.GetInt32("TargetNumberOfMinorTicks");
                s._userDefinedMajorSpan     = info.GetNullableDouble("UserDefinedMajorSpan");
                s._userDefinedMinorTicks    = info.GetNullableInt32("UserDefinedMinorTicks");

                s._transformationOffset              = info.GetDouble("TransformationOffset");
                s._transformationDivider             = info.GetDouble("TransformationDivider");
                s._transformationOperationIsMultiply = info.GetBoolean("TransformationIsMultiply");

                s.SuppressedMajorTicks = (SuppressedTicks)info.GetValue("SuppressedMajorTicks", s);
                s.SuppressedMinorTicks = (SuppressedTicks)info.GetValue("SuppressedMinorTicks", s);
                s.AdditionalMajorTicks = (AdditionalTicks)info.GetValue("AdditionalMajorTicks", s);
                s.AdditionalMinorTicks = (AdditionalTicks)info.GetValue("AdditionalMinorTicks", s);

                return(s);
            }
Beispiel #10
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var start = info.GetInt32("Start");
                var count = info.GetInt32("Count");

                return(RangeOfRowIndices.FromStartAndCount(start, count));
            }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var first  = info.GetInt32("First");
                var period = info.GetInt32("PeriodLength");
                var items  = info.GetInt32("ItemsPerPeriod");

                return(new PeriodicRowIndexSegments(info, first, period, items));
            }
Beispiel #12
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                IntegerRangeAsCollection s = null != o ? (IntegerRangeAsCollection)o : new IntegerRangeAsCollection();

                s._start = info.GetInt32("Start");
                s._count = info.GetInt32("Count");

                return(s);
            }
Beispiel #13
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                PlotRange s = null != o ? (PlotRange)o : new PlotRange(0, 0);

                s._lowerBound = info.GetInt32("LowerBound");
                s._upperBound = info.GetInt32("UpperBound");

                return(s);
            }
Beispiel #14
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var first = info.GetInt32("First");
                var last  = info.GetInt32("Last");

                return(new RangeOfRowIndices {
                    _firstRowIndexInclusive = first, _lastRowIndexInclusive = last
                });
            }
Beispiel #15
0
            protected virtual DataTableTransposeOptions SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = (o == null ? new DataTableTransposeOptions() : (DataTableTransposeOptions)o);

                s.DataColumnsMoveToPropertyColumns      = info.GetInt32("NumberOfDataColumnsMovingToPropertyColumns");
                s.PropertyColumnsMoveToDataColumns      = info.GetInt32("NumberOfPropertyColumnsMovingToDataColumns");
                s.StoreDataColumnNamesInFirstDataColumn = info.GetBoolean("StoreDataColumnNamesInFirstDataColumn");
                s.UseFirstDataColumnForColumnNaming     = info.GetBoolean("UseFirstDataColumnForColumnNaming");
                s.ColumnNamingPreString = info.GetString("ColumnNamingPreString");
                return(s);
            }
Beispiel #16
0
            protected virtual AngularScale SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                AngularScale s = null != o ? (AngularScale)o : new AngularScale();

                s._useDegree                 = info.GetBoolean("UseDegree");
                s._majorTickDivider          = info.GetInt32("MajorTickDiv");
                s._minorTickDivider          = info.GetInt32("MinorTickDiv");
                s._scaleOrigin               = info.GetInt32("Org90");
                s._usePositiveNegativeAngles = info.GetBoolean("PosNegAngles");
                // set cached values is called by the enclosing function
                return(s);
            }
Beispiel #17
0
            public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = null != o ? (XYNonlinearFitFunctionPlotData)o : new XYNonlinearFitFunctionPlotData();

                s.Function = (Altaxo.Calc.IScalarFunctionDD)info.GetValue("Function", s);
                s._fitDocumentIdentifier = info.GetString("FitDocumentIdentifier");
                s.ChildSetMember(ref s._fitDocument, (NonlinearFitDocument)info.GetValue("FitDocument", s));
                s._fitElementIndex        = info.GetInt32("FitElementIndex");
                s._dependentVariableIndex = info.GetInt32("DependentVariableIndex");

                return(s);
            }
Beispiel #18
0
            public virtual XYColumnPlotData SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                XYColumnPlotData s = null != o ? (XYColumnPlotData)o : new XYColumnPlotData();

                s._xColumn = (ReadableColumnProxy)info.GetValue("XColumn", parent);
                s._yColumn = (ReadableColumnProxy)info.GetValue("YColumn", parent);

                s._xBoundaries = (IPhysicalBoundaries)info.GetValue("XBoundaries", parent);
                s._yBoundaries = (IPhysicalBoundaries)info.GetValue("YBoundaries", parent);

                s._plotRangeStart  = info.GetInt32("RangeStart");
                s._plotRangeLength = info.GetInt32("RangeLength");

                return(s);
            }
Beispiel #19
0
            public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                FitElement s = o != null ? (FitElement)o : new FitElement();

                s.FitFunction = (IFitFunction)info.GetValue("FitFunction", s);

                int numRows  = info.GetInt32("NumberOfRows");
                int firstRow = info.GetInt32("FirstRow");

                s._rangeOfRows = PositiveIntegerRange.NewFromFirstAndCount(firstRow, numRows);

                int arraycount = info.OpenArray();

                s._independentVariables = new NumericColumnProxy[arraycount];
                for (int i = 0; i < arraycount; ++i)
                {
                    s._independentVariables[i] = (NumericColumnProxy)info.GetValue(s);
                }
                info.CloseArray(arraycount);

                arraycount            = info.OpenArray();
                s._dependentVariables = new NumericColumnProxy[arraycount];
                for (int i = 0; i < arraycount; ++i)
                {
                    s._dependentVariables[i] = (NumericColumnProxy)info.GetValue(s);
                }
                info.CloseArray(arraycount);


                arraycount         = info.OpenArray();
                s._errorEvaluation = new IVarianceScaling[arraycount];
                for (int i = 0; i < arraycount; ++i)
                {
                    s._errorEvaluation[i] = (IVarianceScaling)info.GetValue(s);
                }
                info.CloseArray(arraycount);

                info.GetArray("ParameterNames", out s._parameterNames);
                for (int i = 0; i < s._parameterNames.Length; ++i)
                {
                    if (s._parameterNames[i] == string.Empty)
                    {
                        s._parameterNames[i] = null; // serialization can not distinguish between an empty string and a null string
                    }
                }
                s._parameterNameStart = info.GetString("ParameterNameStart");
                return(s);
            }
Beispiel #20
0
            public virtual object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                PolynomialFit s = o != null ? (PolynomialFit)o : new PolynomialFit();

                s._order = info.GetInt32("Order");
                return(s);
            }
Beispiel #21
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                LinearScale s = null != o ? (LinearScale)o : new LinearScale();

                s._baseOrg = (double)info.GetDouble("BaseOrg");
                s._baseEnd = (double)info.GetDouble("BaseEnd");

                s._majorSpan  = (double)info.GetDouble("MajorSpan");
                s._minorTicks = (int)info.GetInt32("MinorTicks");

                s._axisOrgByMajor = (double)info.GetDouble("OrgByMajor");
                s._axisEndByMajor = (double)info.GetDouble("EndByMajor");

                bool AxisOrgFixed = (bool)info.GetBoolean("OrgFixed");
                bool AxisEndFixed = (bool)info.GetBoolean("EndFixed");

                s._dataBounds = (FiniteNumericalBoundaries)info.GetValue("Bounds", s);

                s.SetCachedValues();
                // restore the event chain
                s._dataBounds.BoundaryChanged += new BoundaryChangedHandler(s.OnBoundariesChanged);

                s._rescaling = new NumericAxisRescaleConditions();
                s._rescaling.SetOrgAndEnd(AxisOrgFixed ? BoundaryRescaling.Fixed : BoundaryRescaling.Auto, s.Org, AxisEndFixed ? BoundaryRescaling.Fixed:BoundaryRescaling.Auto, s.End);

                return(s);
            }
Beispiel #22
0
            protected virtual AutoUpdateSettings SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = (o == null ? new AutoUpdateSettings() : (AutoUpdateSettings)o);

                s.EnableAutoUpdates       = info.GetBoolean("EnableAutoUpdates");
                s.DownloadUnstableVersion = info.GetBoolean("DownloadUnstableVersion");
                s.DownloadIntervalInDays  = info.GetInt32("DownloadIntervalInDays");
                s.ShowDownloadWindow      = info.GetBoolean("ShowDownloadWindow");

                s.InstallAtStartup              = info.GetBoolean("InstallAtStartup");
                s.InstallAtShutdown             = info.GetBoolean("InstallAtShutDown");
                s.ConfirmInstallation           = info.GetBoolean("ConfirmInstallation");
                s.ShowInstallationWindow        = info.GetBoolean("ShowInstallationWindow");
                s.InstallationWindowClosingTime = info.GetInt32("InstallationWindowClosingTime");
                return(s);
            }
Beispiel #23
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                FitFunctionScript s = null != o ? (FitFunctionScript)o : new FitFunctionScript();


                s._fitFunctionCategory     = info.GetString("Category");
                s._fitFunctionName         = info.GetString("Name");
                s._fitFunctionCreationTime = info.GetDateTime("CreationTime");
                s._fitFunctionDescription  = info.GetString("Description");

                // deserialize the base class
                info.GetBaseValueEmbedded(s, typeof(AbstractScript), parent);

                s._NumberOfParameters = info.GetInt32("NumberOfParameters");
                s._IsUsingUserDefinedParameterNames = info.GetBoolean("UserDefinedParameters");
                if (s._IsUsingUserDefinedParameterNames)
                {
                    info.GetArray("UserDefinedParameterNames", out s._UserDefinedParameterNames);
                }
                info.GetArray("IndependentVariableNames", out s._IndependentVariablesNames);
                info.GetArray("DependentVariableNames", out s._DependentVariablesNames);

                XmlSerializationSurrogate2 surr = new XmlSerializationSurrogate2();

                surr._deserializedObject      = s;
                info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.info_DeserializationFinished);

                return(s);
            }
Beispiel #24
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                Log10Scale s = null != o ? (Log10Scale)o : new Log10Scale();

                s._log10Org = (double)info.GetDouble("Log10Org");
                s._log10End = (double)info.GetDouble("Log10End");

                s._decadesPerMajorTick = (int)info.GetInt32("DecadesPerMajor");

                bool AxisOrgFixed = (bool)info.GetBoolean("OrgFixed");
                bool AxisEndFixed = (bool)info.GetBoolean("EndFixed");

                s._dataBounds = (PositiveFiniteNumericalBoundaries)info.GetValue("Bounds", typeof(PositiveFiniteNumericalBoundaries));

                s._dataBounds.BoundaryChanged += new BoundaryChangedHandler(s.OnBoundariesChanged);


                s._rescaling = new LogarithmicAxisRescaleConditions();
                s._rescaling.SetOrgAndEnd(AxisOrgFixed ? BoundaryRescaling.Fixed : BoundaryRescaling.Auto, s.Org, AxisEndFixed ? BoundaryRescaling.Fixed:BoundaryRescaling.Auto, s.End);

                LogarithmicAxisRescaleConditions rescaling = new LogarithmicAxisRescaleConditions();

                rescaling.SetOrgAndEnd(AxisOrgFixed ? BoundaryRescaling.Fixed : BoundaryRescaling.Auto, s.Org, AxisEndFixed ? BoundaryRescaling.Fixed:BoundaryRescaling.Auto, s.End);
                s._rescaling = rescaling;

                return(s);
            }
Beispiel #25
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                LinePlotStyle s = (LinePlotStyle)o ?? new LinePlotStyle(info);

                s._independentSkipFrequency = info.GetBoolean("IndependentSkipFreq");
                s._skipFrequency            = info.GetInt32("SkipFreq");

                s._ignoreMissingDataPoints          = info.GetBoolean("IgnoreMissingDataPoints");
                s._independentOnShiftingGroupStyles = info.GetBoolean("IndependentOnShiftingGroupStyles");

                s._connectCircular = info.GetBoolean("ConnectCircular");
                s._connectionStyle = (ILineConnectionStyle)info.GetValue("Connection", s);

                s._linePen = (PenX)info.GetValue("Pen", s);
                if (null != s._linePen)
                {
                    s._linePen.ParentObject = s;
                }

                s._independentDashStyle = info.GetBoolean("IndependentDashStyle");
                s._independentColor     = info.GetBoolean("IndependentColor");

                s._independentSymbolSize = info.GetBoolean("IndependentSymbolSize");
                s._symbolSize            = info.GetDouble("SymbolSize");

                s._useSymbolGap    = info.GetBoolean("UseSymbolGap");
                s._symbolGapOffset = info.GetDouble("SymbolGapOffset");
                s._symbolGapFactor = info.GetDouble("SymbolGapFactor");

                return(s);
            }
Beispiel #26
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                IUnit[] fixedUnits;
                IUnit[] additionalUnits;

                {
                    var count = info.OpenArray("FixedUnits");
                    fixedUnits = new IUnit[count];
                    for (int i = 0; i < count; ++i)
                    {
                        fixedUnits[i] = (IUnit)info.GetValue("e", null);
                    }
                    info.CloseArray(count);
                }

                {
                    var count = info.OpenArray("AdditionalUnits");
                    additionalUnits = new IUnit[count];
                    for (int i = 0; i < count; ++i)
                    {
                        additionalUnits[i] = (IUnit)info.GetValue("e", null);
                    }
                    info.CloseArray(count);
                }

                var defaultUnit = (IPrefixedUnit)info.GetValue("DefaultUnit", null);

                int displayDigits = info.GetInt32("NumberOfDisplayedDigits");

                return(new QuantityWithUnitGuiEnvironment(fixedUnits, additionalUnits)
                {
                    NumberOfDisplayedDigits = displayDigits,
                    DefaultUnit = defaultUnit
                });
            }
Beispiel #27
0
 public void Deserialize(MamlExportOptions s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
 {
     s.SplitLevel      = info.GetInt32("SplitLevel");
     s.ImageFolderName = info.GetString("ImageFolderName");
     s.EnableRemoveOldContentsOfImageFolder = info.GetBoolean("EnableRemoveOldContentsOfImageFolder");
     s.EnableAutoOutline              = info.GetBoolean("EnableAutoOutline");
     s.EnableHtmlEscape               = info.GetBoolean("EnableHtmlEscape");
     s.EnableLinkToPreviousSection    = info.GetBoolean("EnableLinkToPreviousSection");
     s.LinkToPreviousSectionLabelText = info.GetString("LinkToPreviousSectionLabelText");
     s.EnableLinkToNextSection        = info.GetBoolean("EnableLinkToNextSection");
     s.LinkToNextSectionLabelText     = info.GetString("LinkToNextSectionLabelText");
     s.ExpandChildDocuments           = info.GetBoolean("ExpandChildDocuments");
     s.BodyTextFontFamily             = info.GetString("BodyTextFontFamily");
     s.BodyTextFontSize               = info.GetDouble("BodyTextFontSize");
     s.IsIntendedForHtmlHelp1File     = info.GetBoolean("IsIntendedForHtmlHelp1File");
     s.OpenHelpFileBuilder            = info.GetBoolean("OpenHelpFileBuilder");
     s.OutputFileName    = info.GetString("OutputFileName");
     s.ContentFolderName = info.GetString("ContentFolderName");
     s.EnableRemoveOldContentsOfContentFolder = info.GetBoolean("EnableRemoveOldContentsOfContentFolder");
     s.ContentFileNameBase = info.GetString("ContentFileNameBase");
     if (info.CurrentElementName == "RenumerateFigures")
     {
         s.RenumerateFigures = info.GetBoolean("RenumerateFigures");
     }
 }
Beispiel #28
0
            protected virtual CSLineID SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                CSLineID s = (o == null ? new CSLineID() : (CSLineID)o);

                s._parallelAxisNumber = info.GetInt32("Axis");

                s._logicalValueFirstOther     = info.GetDouble("Logical1");
                s._usePhysicalValueFirstOther = info.GetBoolean("UsePhysical1");
                if (s._usePhysicalValueFirstOther)
                {
                    s._physicalValueFirstOther = (AltaxoVariant)info.GetValue("Physical1", s);
                }

                bool is3D = info.GetBoolean("Is3D");

                if (is3D)
                {
                    s._logicalValueSecondOther     = info.GetDouble("Logical1");
                    s._usePhysicalValueSecondOther = info.GetBoolean("UsePhysical2");
                    if (s._usePhysicalValueSecondOther)
                    {
                        s._physicalValueSecondOther = (AltaxoVariant)info.GetValue("Physical2", s);
                    }
                }

                return(s);
            }
Beispiel #29
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                FitFunctionScript s = null != o ? (FitFunctionScript)o : new FitFunctionScript();

                // deserialize the base class
                info.GetBaseValueEmbedded(s, typeof(AbstractScript), parent);

                s._fitFunctionCategory              = info.GetString("Category");
                s._fitFunctionName                  = info.GetString("Name");
                s._fitFunctionCreationTime          = info.GetDateTime("CreationTime");
                s._NumberOfParameters               = info.GetInt32("NumberOfParameters");
                s._IsUsingUserDefinedParameterNames = info.GetBoolean("UserDefinedParameters");
                if (s._IsUsingUserDefinedParameterNames)
                {
                    info.GetArray("UserDefinedParameterNames", out s._UserDefinedParameterNames);
                }
                info.GetArray("IndependentVariableNames", out s._IndependentVariablesNames);
                info.GetArray("DependentVariableNames", out s._DependentVariablesNames);

                var surr = new XmlSerializationSurrogate1
                {
                    _deserializedObject = s
                };

                info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.info_DeserializationFinished);

                if (s._IsUsingUserDefinedParameterNames && s._NumberOfParameters != s._UserDefinedParameterNames.Length)
                {
                    s.Compile(); // dirty quick fix in the case that the userdefined parameters where not updated before serialization
                }
                return(s);
            }
Beispiel #30
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                var s = new CSLineID
                {
                    _parallelAxisNumber = info.GetInt32("Axis"),

                    _logicalValueFirstOther     = info.GetDouble("Logical1"),
                    _usePhysicalValueFirstOther = info.GetBoolean("UsePhysical1")
                };

                if (s._usePhysicalValueFirstOther)
                {
                    s._physicalValueFirstOther = (AltaxoVariant)info.GetValue("Physical1", s);
                }

                bool is3D = info.GetBoolean("Is3D");

                if (is3D)
                {
                    s._logicalValueSecondOther     = info.GetDouble("Logical1");
                    s._usePhysicalValueSecondOther = info.GetBoolean("UsePhysical2");
                    if (s._usePhysicalValueSecondOther)
                    {
                        s._physicalValueSecondOther = (AltaxoVariant)info.GetValue("Physical2", s);
                    }
                }

                return(s);
            }