public float GetReporterNumberValue(RobotBase operatingRobotBase)
    {
        string reporterStringValue = this.GetReporterStringValue(operatingRobotBase);

        if (string.IsNullOrEmpty(reporterStringValue))
        {
            return(0);
        }

        if (reporterStringValue.Equals(ReporterStringValueCache))
        {
            return(ReporterNumberValueCache);
        }
        else
        {
            ReporterNumberValueCache = BlockUtility.ConvertStringToFloat(reporterStringValue);
            ReporterStringValueCache = reporterStringValue; //save value to cache
            return(ReporterNumberValueCache);
        }
    }
Example #2
0
        public void SetFirstAttributeToUpper()
        {
            // setting only the first attribute to upper case.
            foreach (ObjectId id in selectionSetIds)
            {
                BlockReference br = BlockUtility.GetBlockReference(id);

                if (br != null)
                {
                    int attributeCount = br.AttributeCollection.Count;

                    if (attributeCount > 0)
                    {
                        string av = BlockUtility.GetAV(id, 0);
                        av = av.ToUpper();
                        BlockUtility.SetAV(id, 0, av);
                    }
                }
            }
        }
Example #3
0
        public void SetAllAttributesToUpper()
        {
            // go through the entire SelectionSet Object ID collection
            foreach (ObjectId id in selectionSetIds)
            {
                BlockReference br = BlockUtility.GetBlockReference(id);

                if (br != null)
                {
                    int attributeCount = br.AttributeCollection.Count;

                    for (int i = 0; i < attributeCount; i++)
                    {
                        string av = BlockUtility.GetAV(id, i);
                        av = av.ToUpper();
                        BlockUtility.SetAV(id, i, av);
                    }
                }
            }
        }
Example #4
0
 public bool DrillBlock(Block block, Vector3 position, int level)
 {
     if (block != null && BlockUtility.IsInBlock(block, position))
     {
         if (block.Level <= level)
         {
             return(DropBlock(block) == DropResult.OK);
         }
         else
         {
             SplitBlock(block);
             for (int i = 0; i < 8; i++)
             {
                 if (DrillBlock(block.subBlocks[i], position, level))
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
        public PageBlockUtility(BlockUtility block)
        {
            InitializeComponent();
            this.block  = block;
            DataContext = this.block;

            foreach (var g in Enum.GetNames(typeof(UtilityGroup)))
            {
                groupCombobox.Items.Add(g);
            }

            groupCombobox.SelectedIndex = (int)block.Group;

            foreach (var a in Enum.GetNames(typeof(ListAction)))
            {
                listActionCombobox.Items.Add(a);
            }

            listActionCombobox.SelectedIndex = (int)block.ListAction;

            foreach (var a in Enum.GetNames(typeof(VarAction)))
            {
                varActionCombobox.Items.Add(a);
            }

            varActionCombobox.SelectedIndex = (int)block.VarAction;

            foreach (var c in Enum.GetNames(typeof(Encoding)))
            {
                conversionFromCombobox.Items.Add(c);
            }

            conversionFromCombobox.SelectedIndex = (int)block.ConversionFrom;

            foreach (var c in Enum.GetNames(typeof(Encoding)))
            {
                conversionToCombobox.Items.Add(c);
            }

            conversionToCombobox.SelectedIndex = (int)block.ConversionTo;

            foreach (var a in Enum.GetNames(typeof(FileAction)))
            {
                fileActionCombobox.Items.Add(a);
            }

            fileActionCombobox.SelectedIndex = (int)block.FileAction;

            foreach (var a in Enum.GetNames(typeof(FolderAction)))
            {
                folderActionCombobox.Items.Add(a);
            }

            folderActionCombobox.SelectedIndex = (int)block.FolderAction;

            foreach (var c in Enum.GetNames(typeof(Comparer)))
            {
                removeComparerCombobox.Items.Add(c);
            }

            removeComparerCombobox.SelectedIndex = (int)block.ListElementComparer;
        }
Example #6
0
 public int FindSubArea(Vector3 pos)
 {
     return(BlockUtility.FindSubArea(this, pos));
 }
Example #7
0
 public bool IsInBlock(Vector3 pos)
 {
     return(BlockUtility.IsInBlock(this, pos));
 }