示例#1
0
        public static StatScript FillInDebugStatScript(IStatScriptRepository StatScriptRep, string statType)
        {
            //used to test the post http (create) controller action in web api
            //client in DevTreks posts directly to create controller and doesn't use this at all
            StatScript testStat = new StatScript();
            int        i        = 0;

            foreach (var statscript in StatScriptRep.GetAll())
            {
                //first statscript is dep injected into repository with
                if (i == 0)
                {
                    if (statscript.IsDevelopment)
                    {
                        statscript.Key  = Guid.NewGuid().ToString();
                        statscript.Name = "TestGetAll()";
                        //devtreks has to be installed on localhost and these resources previewed
                        statscript.DataURL = "https://devtreks1.blob.core.windows.net/resources/network_carbon/resourcepack_1534/resource_7969/Regress1.csv";
                        //MAKE SURE to run DevTreks.exe to start listening to localhost:5000
                        //statscript.DataURL = "http://localhost:5000/resources/network_carbon/resourcepack_526/resource_1771/Regress1.csv";
                        statscript.OutputURL = string.Empty;

                        if (statType == StatScript.STAT_TYPE.py.ToString())
                        {
                            //pytest
                            statscript.ScriptURL = "https://devtreks1.blob.core.windows.net/resources/network_carbon/resourcepack_1534/resource_7967/PyOLSWeb1.txt";
                            //statscript.ScriptURL = */"http://localhost:5000/resources/network_carbon/resourcepack_526/resource_1767/PyOLSWeb1.txt";
                            statscript.StatType = StatScript.STAT_TYPE.py.ToString();
                        }
                        else if (statType == StatScript.STAT_TYPE.julia.ToString())
                        {
                            //juliatest
                            statscript.ScriptURL = "to do";
                            statscript.StatType  = StatScript.STAT_TYPE.julia.ToString();
                        }
                        else
                        {
                            //rtest
                            statscript.ScriptURL = "https://devtreks1.blob.core.windows.net/resources/network_carbon/resourcepack_1534/resource_7963/R1Web.txt";
                            //statscript.ScriptURL = "http://localhost:5000/resources/network_carbon/resourcepack_526/resource_1765/R1Web.txt";
                            statscript.StatType = StatScript.STAT_TYPE.r.ToString();
                        }


                        statscript.IsComplete = false;
                        testStat = new StatScript(statscript);
                    }
                    break;
                }
            }
            return(testStat);
        }
示例#2
0
        public static void FillInRepositoryStatScriptProperties(IStatScriptRepository StatScriptRep,
                                                                StatScript newStatScript)
        {
            int i = 0;

            foreach (var statscript in StatScriptRep.GetAll())
            {
                if (i == 0)
                {
                    //repository constructor adds a statscript by default
                    //which includes host scriptexecutable paths and isdevelopment property
                    newStatScript.RExecutablePath           = statscript.RExecutablePath;
                    newStatScript.PyExecutablePath          = statscript.PyExecutablePath;
                    newStatScript.JuliaExecutablePath       = statscript.JuliaExecutablePath;
                    newStatScript.DefaultRootFullFilePath   = statscript.DefaultRootFullFilePath;
                    newStatScript.DefaultRootWebStoragePath = statscript.DefaultRootWebStoragePath;
                    newStatScript.DefaultWebDomain          = statscript.DefaultWebDomain;
                    newStatScript.IsDevelopment             = statscript.IsDevelopment;
                    break;
                }
            }
        }