Ejemplo n.º 1
0
 public RangeOfNumericalValues(double lower, bool isLowerInclusive, double upper, bool isUpperInclusive, IReadableColumn column)
 {
     _lowerValue       = lower;
     _isLowerInclusive = isLowerInclusive;
     _upperValue       = upper;
     _isUpperInclusive = isUpperInclusive;
     ChildSetMember(ref _columnProxy, ReadableColumnProxyBase.FromColumn(column));
 }
Ejemplo n.º 2
0
            public void EhDeserializationFinished(Altaxo.Serialization.Xml.IXmlDeserializationInfo info, Main.IDocumentNode documentRoot, bool isFinallyCall)
            {
                bool bAllResolved = true;

                if (_xColumnPath != null)
                {
                    object xColumn = Main.AbsoluteDocumentPath.GetObject(_xColumnPath, _plotAssociation, documentRoot);
                    bAllResolved &= (null != xColumn);
                    if (xColumn is Altaxo.Data.INumericColumn)
                    {
                        _xColumnPath  = null;
                        _xColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)xColumn);
                    }
                }

                if (_yColumnPath != null)
                {
                    object yColumn = Main.AbsoluteDocumentPath.GetObject(_yColumnPath, _plotAssociation, documentRoot);
                    bAllResolved &= (null != yColumn);
                    if (yColumn is Altaxo.Data.INumericColumn)
                    {
                        _yColumnPath  = null;
                        _yColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)yColumn);
                    }
                }

                for (int i = 0; i < _vColumnPaths.Length; i++)
                {
                    if (_vColumnPaths[i] != null)
                    {
                        object vColumn = Main.AbsoluteDocumentPath.GetObject(_vColumnPaths[i], _plotAssociation, documentRoot);
                        bAllResolved &= (null != vColumn);
                        if (vColumn is Altaxo.Data.IReadableColumn)
                        {
                            _vColumnPaths[i]   = null;
                            _vColumnProxies[i] = ReadableColumnProxyBase.FromColumn((Altaxo.Data.IReadableColumn)vColumn);
                        }
                    }
                }

                if (bAllResolved || isFinallyCall)
                {
                    info.DeserializationFinished -= new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(EhDeserializationFinished);
#pragma warning disable 618
                    _plotAssociation._matrixProxy = new DataTableMatrixProxy(_xColumnProxy, _yColumnProxy, _vColumnProxies)
                    {
                        ParentObject = _plotAssociation
                    };
#pragma warning restore 618
                }
            }
        /// <summary>
        /// Creates a new instance with default values.
        /// </summary>
        public ColumnDrivenSymbolSizePlotStyle(Altaxo.Main.Properties.IReadOnlyPropertyBag context)
        {
            InternalSetScale(new LinearScale());
            InternalSetDataColumnProxy(ReadableColumnProxyBase.FromColumn(new Altaxo.Data.EquallySpacedColumn(0, 0.25)));

            var symbolSizeBase = GraphDocument.GetDefaultSymbolSize(context);

            _symbolSizeAt0     = symbolSizeBase / 2;
            _symbolSizeAt1     = symbolSizeBase * 2;
            _symbolSizeAbove   = symbolSizeBase * 2.5;
            _symbolSizeBelow   = symbolSizeBase / 4;
            _symbolSizeInvalid = 0;
            _numberOfSteps     = 0;
        }
Ejemplo n.º 4
0
        private void EhUseSelectedItemAsVColumns()
        {
            foreach (var node in _availableColumns.Where(n => n.IsSelected))
            {
                var colToAdd = node.Tag as IReadableColumn;
                if (colToAdd == null)
                {
                    continue;
                }

                // before adding this node, check that it is not already present
                var proxyToAdd = ReadableColumnProxyBase.FromColumn(colToAdd);
                if (_valueColumns.Any(n => proxyToAdd.DocumentPath.Equals(((IReadableColumnProxy)n.Tag).DocumentPath)))
                {
                    continue;
                }

                _valueColumns.Add(new SelectableListNode(colToAdd.FullName, proxyToAdd, false));
            }
        }
Ejemplo n.º 5
0
        public FitElement(DataTable table, int groupNumber, IRowSelection rowSelection, IReadableColumn xColumn, IReadableColumn yColumn)
        {
            if (null == rowSelection)
            {
                throw new ArgumentNullException(nameof(rowSelection));
            }

            ChildSetMember(ref _dataTable, new DataTableProxy(table));
            _groupNumber = groupNumber;
            ChildCloneToMember(ref _rangeOfRows, rowSelection);

            _independentVariables = new IReadableColumnProxy[1];
            ChildSetMember(ref _independentVariables[0], ReadableColumnProxyBase.FromColumn(xColumn));

            _dependentVariables = new IReadableColumnProxy[1];
            ChildSetMember(ref _dependentVariables[0], ReadableColumnProxyBase.FromColumn(yColumn));

            _errorEvaluation    = new IVarianceScaling[1];
            _errorEvaluation[0] = new ConstantVarianceScaling();
        }
Ejemplo n.º 6
0
 public IncludeTextContains(string value, bool ignoreCase, IReadableColumn column)
 {
     _value      = value;
     _ignoreCase = ignoreCase;
     ChildSetMember(ref _columnProxy, ReadableColumnProxyBase.FromColumn(column));
 }
Ejemplo n.º 7
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                bool bSurrogateUsed = false;

                XYZMeshedColumnPlotData s = null != o ? (XYZMeshedColumnPlotData)o : new XYZMeshedColumnPlotData();

                var surr = new XmlSerializationSurrogate0();

#pragma warning disable 618
                s._matrixProxy = DataTableMatrixProxy.CreateEmptyInstance(); // this instance is replaced later in the deserialization callback function and is intended to avoid null reference errors
#pragma warning restore 618

                object deserobj;
                deserobj = info.GetValue("XColumn", s);
                if (deserobj is Main.AbsoluteDocumentPath)
                {
                    surr._xColumnPath = (Main.AbsoluteDocumentPath)deserobj;
                    bSurrogateUsed    = true;
                }
                else
                {
                    surr._xColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)deserobj);
                }

                deserobj = info.GetValue("YColumn", s);
                if (deserobj is Main.AbsoluteDocumentPath)
                {
                    surr._yColumnPath = (Main.AbsoluteDocumentPath)deserobj;
                    bSurrogateUsed    = true;
                }
                else
                {
                    surr._yColumnProxy = ReadableColumnProxyBase.FromColumn((Altaxo.Data.INumericColumn)deserobj);
                }

                int count = info.OpenArray();
                surr._vColumnPaths   = new Main.AbsoluteDocumentPath[count];
                surr._vColumnProxies = new IReadableColumnProxy[count];
                for (int i = 0; i < count; i++)
                {
                    deserobj = info.GetValue("e", s);
                    if (deserobj is Main.AbsoluteDocumentPath)
                    {
                        surr._vColumnPaths[i] = (Main.AbsoluteDocumentPath)deserobj;
                        bSurrogateUsed        = true;
                    }
                    else
                    {
                        surr._vColumnProxies[i] = ReadableColumnProxyBase.FromColumn((Altaxo.Data.IReadableColumn)deserobj);
                    }
                }
                info.CloseArray(count);

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

                s._xBoundaries.ParentObject = s;
                s._yBoundaries.ParentObject = s;
                s._vBoundaries.ParentObject = s;

                if (bSurrogateUsed)
                {
                    surr._plotAssociation         = s;
                    info.DeserializationFinished += new Altaxo.Serialization.Xml.XmlDeserializationCallbackEventHandler(surr.EhDeserializationFinished);
                }

                return(s);
            }
Ejemplo n.º 8
0
 public IncludeSingleNumericalValue(double value, IReadableColumn column)
 {
     _value = value;
     ChildSetMember(ref _columnProxy, ReadableColumnProxyBase.FromColumn(column));
 }