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); }
public StatScript(StatScript statScript) { this.Key = statScript.Key; this.Name = statScript.Name; this.DateCompleted = statScript.DateCompleted; this.DataURL = statScript.DataURL; this.ScriptURL = statScript.ScriptURL; this.OutputURL = statScript.OutputURL; this.StatType = statScript.StatType; this.RExecutablePath = statScript.RExecutablePath; this.PyExecutablePath = statScript.PyExecutablePath; this.JuliaExecutablePath = statScript.JuliaExecutablePath; this.DefaultRootFullFilePath = statScript.DefaultRootFullFilePath; this.DefaultRootWebStoragePath = statScript.DefaultRootWebStoragePath; this.DefaultWebDomain = statScript.DefaultWebDomain; this.StatisticalResult = statScript.StatisticalResult; this.IsComplete = statScript.IsComplete; this.IsDevelopment = statScript.IsDevelopment; this.ErrorMessage = statScript.ErrorMessage; }
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; } } }
public void Update(StatScript stat) { _statscripts[stat.Key] = stat; }
public void Add(StatScript stat) { stat.Key = Guid.NewGuid().ToString(); _statscripts[stat.Key] = stat; }