Esempio n. 1
0
        protected override void Run()
        {
            ExpandType expandtype = (ExpandType)GetParameter("expandType").Value;

            if (Service.expandset == expandtype)
            {
                return;
            }

            Service.WriteText(PrinterDriver.Expand[(int)expandtype], true);
            // Sempre após o WriteTex, que inicializa variáveis
            Service.expandset     = expandtype;
            Service.columnsscaled = PrinterDriver.Columns;
            if (Service.compressset)
            {
                Service.columnsscaled = (int)Math.Truncate(Service.columnsscaled * PrinterDriver.ScaleCompres);
            }
            if ((Service.expandset == ExpandType.Width) || (Service.expandset == ExpandType.Double))
            {
                Service.columnsscaled = (int)Math.Truncate(Service.columnsscaled * PrinterDriver.ScaleExpanded);
            }
            if (PrinterDriver.AllowCR)
            {
                Service.DevPos(Service.row, 0);
            }
        }
Esempio n. 2
0
        public override bool MightHaveChildren()
        {
            // In contrast to regular variables, synthetic variables don't ever show raw view.
            ExpandType expandType = _syntheticItemType.Expand;

            return(expandType?.Items != null && expandType.Items.Length > 0);
        }
Esempio n. 3
0
        public void Expand(ExpandType expandtype)
        {
            PrinterServiceFunction function = new Expand(this);

            function.AddParameter("expandType", expandtype);
            function.RunFunction();
        }
Esempio n. 4
0
        /// <summary>
        /// Creates an expand operation.
        /// </summary>
        public ExpandOperation(PinFormat expandTo, ExpandType type)
        {
            this.type     = type;
            this.expandTo = expandTo;

            inputDesc = new PinsDescriptor(
                new PinDescriptor(PinFormatHelper.ExpandableTo(expandTo), "Data to be expanded."));
        }
Esempio n. 5
0
        /// <summary>
        /// Expands data.
        /// </summary>
        public Operand Expand([NotNull] Operand source, PinFormat outFormat, ExpandType type)
        {
            // TODO: constant expression

            Operand dest = CreateTemporary(outFormat, source.ArraySize);

            compiler.Expand(source.Name, dest.Name, source.Format, dest.Format, type);
            return(dest);
        }
Esempio n. 6
0
        public Table()
        {
            d_expand   = ExpandType.Down;
            d_children = new Plotting.Graph[0, 0];
            d_rows     = 0;
            d_columns  = 0;

            AddEvents((int)Gdk.EventMask.ExposureMask);

            Gtk.Drag.DestSet(this, 0, new Gtk.TargetEntry[] { new Gtk.TargetEntry("TableItem", Gtk.TargetFlags.App, 1) }, Gdk.DragAction.Move);
        }
Esempio n. 7
0
        public static void StartExpandMQProcess()
        {
            List <TblMetaquery> lstMQ = MetaqueryDS.GetMQForExpand();

            while (lstMQ.Count > 0)
            {
                foreach (TblMetaquery tblMetaquery in lstMQ)
                {
                    TblDatabaseManagement curDB             = tblMetaquery.TblDatabaseManagement;
                    Metaquery             metaqueryToExpand = new Metaquery(tblMetaquery.Metaquery);

                    //create first level
                    //int MaxVariablesInRelation = ProcessMQDetails.MaxVariablesInRelation;
                    int        maxVariables = curDB.MaxVariablesInRelation;
                    ExpandType expandType   = ExpandType.All;
                    if (tblMetaquery.FkResult == (int)ResultMQ.SupportFailure)
                    {
                        expandType = ExpandType.NewRelationOnly;
                    }
                    if (tblMetaquery.FkResult == (int)ResultMQ.ConfidenceFailure)
                    {
                        expandType = ExpandType.InBodyOnly;
                    }

                    List <Metaquery> list = metaqueryToExpand.Expand(maxVariables, expandType);
                    foreach (Metaquery mq in list)
                    {
                        TblMetaquery newTblMetaquery = new TblMetaquery()
                        {
                            Arity        = mq.Arity,
                            FkDatabaseId = curDB.Id,
                            FkStatusId   = (int)StatusDB.Received,
                            Metaquery    = mq.ToString()
                        };
                        MetaqueryDS.Create(newTblMetaquery);
                    }

                    if (curDB.ForExperiment || tblMetaquery.FkResult != (int)ResultMQ.HasAnswers)
                    {
                        MetaqueryDS.UpdateStatus(tblMetaquery, StatusMQ.ExpandedAndDone);
                    }
                    else
                    {
                        MetaqueryDS.UpdateStatus(tblMetaquery, StatusMQ.Expanded);
                    }
                }
                lstMQ = MetaqueryDS.GetMQForExpand();
            }

            if (IsAutoRunJobs)
            {
                StartIncreaseDBArity();
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Expands data to other.
        /// </summary>
        public T Expand <T>(PinBinder binder, ExpandType expandType) where T : PinBinder
        {
            PinFormat expandTo = FromType(typeof(T));

            if (expandTo == PinFormat.Undefined)
            {
                throw new InvalidOperationException("Invalid format to expand to.");
            }

            // May also throw.
            ExpandOperation op = new ExpandOperation(expandTo, expandType);

            op.BindInputs(binder.Pin);
            return((T)CreateFrom(op.Outputs[0]));
        }
Esempio n. 9
0
        /// <summary>
        /// Expand metaquery -- all types
        /// </summary>
        /// <param name="maxVariablesInRelation">Max of variables in relation - by the db</param>
        /// <returns>List of expanded metaquery</returns>
        public List <Metaquery> Expand(int maxVariablesInRelation, ExpandType expandType)
        {
            List <Metaquery> mqList = new List <Metaquery>();

            if (expandType == ExpandType.All)
            {
                mqList.AddRange(this.ExpandHead());
            }

            if (expandType != ExpandType.NewRelationOnly)
            {
                mqList.AddRange(this.ExpandBodyVariable(maxVariablesInRelation));
            }

            mqList.AddRange(this.ExpandBodyRelation());

            return(mqList);
        }
Esempio n. 10
0
        internal bool MightHaveChildren(IVariableInformation variable)
        {
            VisualizerInfo visualizer = VisualizerScanner.FindType(variable);
            ExpandType     expandType = visualizer?.GetExpandType();

            if (expandType != null)
            {
                if (expandType.Items != null && expandType.Items.Length > 0)
                {
                    return(true);
                }

                return(!expandType.HideRawView && variable.MightHaveChildren());
            }

            SmartPointerType smartPointerType = visualizer?.GetSmartPointerType();

            return(smartPointerType != null || variable.MightHaveChildren());
        }
Esempio n. 11
0
 /// <summary>
 /// 是否开启该功能
 /// </summary>
 /// <returns></returns>
 public static bool GetVipOpenFun(int vipLv, ExpandType expandType)
 {
     bool isOpen = false;
     VipLvInfo lvInfo = new ConfigCacheSet<VipLvInfo>().FindKey(vipLv);
     string eType = ((short)expandType).ToString();
     if (lvInfo != null)
     {
         string[] ExpandArray = lvInfo.ExpandFun.Split(',');
         foreach (string expand in ExpandArray)
         {
             if (eType == expand)
             {
                 isOpen = true;
                 break;
             }
         }
     }
     return isOpen;
 }
Esempio n. 12
0
        /// <summary>
        /// 是否开启该功能
        /// </summary>
        /// <returns></returns>
        public static bool GetVipOpenFun(int vipLv, ExpandType expandType)
        {
            bool      isOpen = false;
            VipLvInfo lvInfo = new ShareCacheStruct <VipLvInfo>().FindKey(vipLv);
            string    eType  = ((short)expandType).ToString();

            if (lvInfo != null)
            {
                string[] ExpandArray = lvInfo.ExpandFun.Split(',');
                foreach (string expand in ExpandArray)
                {
                    if (eType == expand)
                    {
                        isOpen = true;
                        break;
                    }
                }
            }
            return(isOpen);
        }
Esempio n. 13
0
        IChildAdapter CreateNatvisChildAdapter(VisualizerInfo visualizer,
                                               IVariableInformation variable)
        {
            ExpandType expandType = visualizer.GetExpandType();

            if (expandType != null)
            {
                return(_natvisCollectionFactory.Create(variable, expandType,
                                                       visualizer.NatvisScope));
            }

            SmartPointerType smartPointerType = visualizer.GetSmartPointerType();

            if (smartPointerType != null)
            {
                return(_smartPointerFactory.Create(
                           variable, smartPointerType, visualizer.NatvisScope, variable.GetChildAdapter()));
            }

            return(variable.GetChildAdapter());
        }
Esempio n. 14
0
        public void Expand(ExpandType type, PointF p, bool fixAspect)
        {
            switch (type)
            {
            case ExpandType.Bottom:
                ExpandBottom(p);
                break;

            case ExpandType.BottomLeft:
                ExpandBottomLeft(p, fixAspect);
                break;

            case ExpandType.BottomRight:
                ExpandBottomRight(p, fixAspect);
                break;

            case ExpandType.Left:
                ExpandLeft(p);
                break;

            case ExpandType.Right:
                ExpandRight(p);
                break;

            case ExpandType.Top:
                ExpandTop(p);
                break;

            case ExpandType.TopLeft:
                ExpandTopLeft(p, fixAspect);
                break;

            case ExpandType.TopRight:
                ExpandTopRight(p, fixAspect);
                break;
            }
        }
Esempio n. 15
0
 /// <summary>
 /// Expands data.
 /// </summary>
 public void Expand([NotNull] Operand source, [NotNull] Operand dest, ExpandType type)
 {
     compiler.Expand(source.Name, dest.Name, source.Format, dest.Format, type);
 }
            public INatvisEntity Create(IVariableInformation variable, ExpandType expandType,
                                        NatvisScope natvisScope)
            {
                var children = new List <INatvisEntity>();

                if (expandType?.Items == null)
                {
                    return(new NatvisCollectionEntity(children, variable,
                                                      expandType?.HideRawView ?? true));
                }

                foreach (object item in expandType.Items)
                {
                    if (item is ItemType itemType)
                    {
                        children.Add(_itemFactory.Create(variable, natvisScope, itemType));
                    }
                    else if (item is SyntheticItemType syntheticItemType)
                    {
                        children.Add(_syntheticItemFactory.Create(variable, natvisScope,
                                                                  syntheticItemType, this));
                    }
                    else if (item is ExpandedItemType expandedItemType)
                    {
                        children.Add(
                            _expandedItemFactory.Create(variable, natvisScope, expandedItemType));
                    }
                    else if (item is IndexListItemsType indexListItems)
                    {
                        children.Add(RangedNatvisEntityDecorator.First(
                                         _maxChildrenPerRangeIndexListItems,
                                         _indexListItemsFactory.Create(variable, natvisScope, indexListItems)));
                    }
                    else if (item is ArrayItemsType arrayItems)
                    {
                        children.Add(RangedNatvisEntityDecorator.First(
                                         _maxChildrenPerRangeArrayItems,
                                         _arrayItemsFactory.Create(variable, natvisScope, arrayItems)));
                    }
                    else if (item is LinkedListItemsType linkedListItems)
                    {
                        children.Add(RangedNatvisEntityDecorator.First(
                                         _maxChildrenPerRangeLinkedListItems,
                                         _linkedListItemsFactory.Create(variable, natvisScope,
                                                                        linkedListItems)));
                    }
                    else if (item is TreeItemsType treeItems)
                    {
                        children.Add(RangedNatvisEntityDecorator.First(
                                         _maxChildrenPerRangeTreeItems,
                                         _treeItemsFactory.Create(variable, natvisScope, treeItems)));
                    }
                    else if (item is CustomListItemsType customListItems &&
                             _natvisExperimentsEnabled())
                    {
                        // Use "MaxItemsPerView" attribute to limit the number of items per view.
                        // If not defined (default value is 0), use the "default" limit to avoid
                        // huge lists.
                        // TODO: Consider removing the default limit if the rendering performance
                        // is no longer an issue.
                        // The default limit in Visual Studio (Code) is 5000 -- see docs for
                        // MaxItemsPerViewType at https://code.visualstudio.com/docs/cpp/natvis.
                        int maxItemsPerView = customListItems.MaxItemsPerView > 0
                                                  ? (int)customListItems.MaxItemsPerView
                                                  : _maxChildrenPerRangeCustomListItems;

                        children.Add(RangedNatvisEntityDecorator.First(
                                         maxItemsPerView, _customListItemsFactory.Create(variable, natvisScope,
                                                                                         customListItems)));
                    }