Пример #1
0
        public Bot(params string[] startUrl)
        {
            m_aloneOnWork = true;
            m_stopwatchRobots = new Stopwatch();
            m_stopwatch = new Stopwatch();
            m_dataBase = new WebStatDataContext();
            m_tbot = new RobotTable { IsDroppingDataInTables = false, IsWorkingOnTableUnvisited = false, IsWorking = true, TotalLinkVisited = 0 };
            m_dataBase.RobotTable.InsertOnSubmit(m_tbot);
            m_dataBase.SubmitChanges();

            m_htmlDataBase = new HtmlDataBase();
            m_random = new Random();
            m_stat = new List<Html>();

            WaitForTableUnvisited();
            if (m_htmlDataBase.CountUnvisitedSite() > 0)
            {
                m_tbot.IsWorkingOnTableUnvisited = true;
                m_dataBase.SubmitChanges();

                m_htmlDataBase.DropUnvisitedSiteInDataBase();

                m_tbot.IsWorkingOnTableUnvisited = false;
                m_dataBase.SubmitChanges();
            }
            else
            {
                for (int i = 0; i < startUrl.Count(); i++)
                {
                    WebLink.LinkToVisit.Add(startUrl[i]);
                }
            }
        }
Пример #2
0
        public void TestValidBoardPosition()
        {
            RobotTable table    = new RobotTable(10, 10);
            Point      position = new Point(1, 1);
            var        result   = table.IsTablePositionExist(position);

            Assert.IsTrue(result);
        }
Пример #3
0
        private void GetAllFeFromSlab(int[] ObjNumbers,
                                      IProgress <ProgressModelObject <double> > progress)
        {
            IRobotApplication RobApp;

            RobApp = Services.RobotAppService.iapp;
            RobotTable      t;
            RobotTableFrame tf;

            var str = RobApp.Project.Structure;
            var fe  = "";
            var ObjNumbersString = "";

            foreach (var objNumber in ObjNumbers)
            {
                var slab = (RobotObjObject)str.Objects.Get(objNumber);
                fe += slab.FiniteElems + " ";
                ObjNumbersString += objNumber + " ";
            }


            var selectFe = str.Selections.Create(IRobotObjectType.I_OT_PANEL);

            selectFe.FromText(fe);

            progress.Report(new ProgressModelObject <double> {
                ProgressToString = "Creating FE table...", Progress = 1 * plus
            });
            t  = RobApp.Project.ViewMngr.CreateTable(IRobotTableType.I_TT_FINITE_ELEMENTS, IRobotTableDataType.I_TDT_FE);
            tf = RobApp.Project.ViewMngr.GetTable(RobApp.Project.ViewMngr.TableCount);

            progress.Report(new ProgressModelObject <double> {
                ProgressToString = "Filtering FE table for slab number...", Progress = 2 * plus
            });



            t.Select(IRobotSelectionType.I_ST_PANEL, ObjNumbersString);
            t.Select(IRobotSelectionType.I_ST_FINITE_ELEMENT, fe);

            RobotTable a = tf.Get(2);

            progress.Report(new ProgressModelObject <double> {
                ProgressToString = "Creating temp file to store FE table...", Progress = 3 * plus
            });
            temp = TempFileManager.CreateTmpFile();
            progress.Report(new ProgressModelObject <double> {
                ProgressToString = "Writting rows to temp file...", Progress = 4 * plus
            });

            a.Printable.SaveToFile(temp, IRobotOutputFileFormat.I_OFF_TEXT);
        }