Ejemplo n.º 1
0
        protected List <SpeckleObject> ModelToSpeckleObjects(GSATargetLayer layer, bool resultsOnly, bool embedResults, string[] cases = null, string[] resultsToSend = null)
        {
            gsaCache.Clear();

            //Clear out all sender objects that might be there from the last test preparation
            Initialiser.GSASenderObjects.Clear();

            //Compile all GWA commands with application IDs
            var senderProcessor = new SenderProcessor(TestDataDirectory, gsaInterfacer, gsaCache, layer, embedResults, cases, resultsToSend);

            var keywords = senderProcessor.GetKeywords(layer);
            var data     = gsaInterfacer.GetGwaData(keywords, false);

            for (int i = 0; i < data.Count(); i++)
            {
                gsaCache.Upsert(
                    data[i].Keyword,
                    data[i].Index,
                    data[i].GwaWithoutSet,
                    //This needs to be revised as this logic is in the kit too
                    applicationId: (string.IsNullOrEmpty(data[i].ApplicationId)) ? ("gsa/" + data[i].Keyword + "_" + data[i].Index.ToString()) : data[i].ApplicationId,
                    gwaSetCommandType: data[i].GwaSetType,
                    streamId: data[i].StreamId
                    );
            }

            senderProcessor.GsaInstanceToSpeckleObjects(layer, out var speckleObjects, resultsOnly);

            return(speckleObjects);
        }
Ejemplo n.º 2
0
        protected List <SpeckleObject> ModelToSpeckleObjects(GSATargetLayer layer, bool resultsOnly, bool embedResults, string[] cases, string[] resultsToSend = null)
        {
            //((IGSACache) appResources.Cache).Clear();
            ((IGSACache)Initialiser.AppResources.Cache).Clear();

            //Clear out all sender objects that might be there from the last test preparation
            Initialiser.GsaKit.GSASenderObjects.Clear();

            //Compile all GWA commands with application IDs
            var senderProcessor = new SenderProcessor(TestDataDirectory, Initialiser.AppResources, layer, embedResults, cases, resultsToSend);

            var keywords = senderProcessor.GetKeywords(layer);
            var data     = Initialiser.AppResources.Proxy.GetGwaData(keywords, false);

            for (int i = 0; i < data.Count(); i++)
            {
                var applicationId = string.IsNullOrEmpty(data[i].ApplicationId) ? null : data[i].ApplicationId;
                Initialiser.AppResources.Cache.Upsert(
                    data[i].Keyword,
                    data[i].Index,
                    data[i].GwaWithoutSet,
                    applicationId: applicationId,
                    gwaSetCommandType: data[i].GwaSetType,
                    streamId: data[i].StreamId
                    );
            }

            senderProcessor.GsaInstanceToSpeckleObjects(layer, out var speckleObjects, resultsOnly);

            return(speckleObjects);
        }