Beispiel #1
0
 public void SaveNewExperiment(string dbFile, string url, string CpuName, string CpuMHz, string FPU, string Memory, string OS, string Compiler, string ProgramName, decimal BaseRefTime, decimal BaseRunTime)
 {
     using (var db = new SPECCPUDB_Mine(new LinqToDB.DataProvider.SQLite.SQLiteDataProvider(), String.Format(@"Data Source={0}", dbFile)))
     {
         long EnvID = getEnv(db, CpuName, CpuMHz, FPU, Memory, OS, Compiler);
         if (EnvID < 0)
         {
             var newEnv = new DataModel.Environment();
             newEnv.Compiler = Compiler;
             newEnv.CpuMHz = CpuMHz;
             newEnv.CpuName = CpuName;
             newEnv.FPU = FPU;
             newEnv.Memory = Memory;
             newEnv.OS = OS;
             db.Insert(newEnv);
             EnvID = getEnv(db, CpuName, CpuMHz, FPU, Memory, OS, Compiler);
         }
         long ProgID = getProg(db, ProgramName);
         if (ProgID<0)
         {
             var p = new DataModel.Program();
             p.Name = ProgramName;
             db.Insert(p);
             ProgID = getProg(db, ProgramName);
         }
         var expID = getExp(db, url, EnvID, ProgID, BaseRefTime, BaseRunTime);
         if (expID < 0)
         {
             var exp = new DataModel.Experiment();
             exp.url = url;
             exp.EnvID = EnvID;
             exp.ProgID = ProgID;
             exp.BaseRefTime = BaseRefTime;
             exp.BaseRunTime = BaseRunTime;
             db.Insert(exp);
         }
     }
 }
Beispiel #2
0
 public void SaveNewExperiment(string dbFile, string url, string CpuName, string CpuMHz, string FPU, string Memory, string OS, string Compiler, string ProgramName, decimal BaseRefTime, decimal BaseRunTime)
 {
     using (var db = new SPECCPUDB_Mine(new LinqToDB.DataProvider.SQLite.SQLiteDataProvider(), String.Format(@"Data Source={0}", dbFile)))
     {
         long EnvID = getEnv(db, CpuName, CpuMHz, FPU, Memory, OS, Compiler);
         if (EnvID < 0)
         {
             var newEnv = new DataModel.Environment();
             newEnv.Compiler = Compiler;
             newEnv.CpuMHz   = CpuMHz;
             newEnv.CpuName  = CpuName;
             newEnv.FPU      = FPU;
             newEnv.Memory   = Memory;
             newEnv.OS       = OS;
             db.Insert(newEnv);
             EnvID = getEnv(db, CpuName, CpuMHz, FPU, Memory, OS, Compiler);
         }
         long ProgID = getProg(db, ProgramName);
         if (ProgID < 0)
         {
             var p = new DataModel.Program();
             p.Name = ProgramName;
             db.Insert(p);
             ProgID = getProg(db, ProgramName);
         }
         var expID = getExp(db, url, EnvID, ProgID, BaseRefTime, BaseRunTime);
         if (expID < 0)
         {
             var exp = new DataModel.Experiment();
             exp.url         = url;
             exp.EnvID       = EnvID;
             exp.ProgID      = ProgID;
             exp.BaseRefTime = BaseRefTime;
             exp.BaseRunTime = BaseRunTime;
             db.Insert(exp);
         }
     }
 }