Exemplo n.º 1
0
        public ContentResult getSubTree() // (string chunkName)
        {
            string answerString = "";

            try
            {
                string isMergedString = Request.Form["isMerged"];
                bool isMerged = false;
                if (isMergedString == "true")
                    isMerged = true;
                string porpName = Request.Form["propertyName"];
                var ft = new HugoBotWebApplication.Discretistation.FileHandler();

                string pathToChunk = Session["correntPathToIndex"].ToString() + "/" + porpName;
                byte[] chuckAsByteArr = ft.GetChunk(pathToChunk);

                var answer = Data.loadKarmaSubTree(chuckAsByteArr, isMerged);
                answerString = JsonConvert.SerializeObject(answer, Formatting.Indented);
            }
            catch(Exception ex)
            {
                var xs = 124124;
            }

            return Content(answerString);
        }
Exemplo n.º 2
0
        public void loadFiles()
        {
            StatesConverter cnvLabels;
            EntitiesData datEnts;

            try
            {
                var ft = new HugoBotWebApplication.Discretistation.FileHandler(); 
                string pathWithClass = Session["correntPathToIndex"].ToString();
                var ansFromGetChunks = ft.GetChunks(pathWithClass); // we don't use this data, this is just init for chunk creation
                TestMemory._chunkesLargerThanZero = new List<string>(ansFromGetChunks);

                // ask for index file
                pathWithClass += "/index";
                indexFileAsByteArr = ft.GetChunk(pathWithClass); // ask for index file

                // ask for entities file
                string datasetGUID = ((Dataset)Session["dataset"]).Path;
                byte[] entitiesByteArr = ft.GetFile(datasetGUID + "/entities");

                // ask for states file
                string pathWithDiscConfig = (string)Session["discConfig"];
                string pathToState = pathWithDiscConfig + "/states";
                byte[] statesByteArr = ft.GetStates(pathToState);

                // load states file
                cnvLabels = new StatesConverter(statesByteArr);

                // load enetites file
                datEnts = new EntitiesData(entitiesByteArr);


                // create curResultsObject
                LoadLegoResultsDataset(indexFileAsByteArr, cnvLabels, datEnts);

                // assiggn curResult to class that not goint to be deleted after uploading
                TestMemory.curResults = this.curResults;

                TestMemory.index = getIndex();
            }
            catch(Exception ex)
            {
                var axax = 1;
            }
        }
Exemplo n.º 3
0
        public object[] getIndex()
        {
            List<object> l = new List<object>();

            try
            {
                string correntPath = Session["correntPathToIndex"].ToString();

                var ft = new HugoBotWebApplication.Discretistation.FileHandler();

                var ansFromGetChunks = ft.GetChunks(correntPath);

                correntPath += "/index";
                var indexBeforeParse = ft.GetChunk(correntPath);

                l = FileConvertor.parseByteArrToIndex(indexBeforeParse);
            }
            catch { }
            return l.ToArray();
        }