public static void ProteinSearch(QuerryParameters parameters) {/////////prg int location; if (CurrentJobs.current == null) { location = 0; } else { location = CurrentJobs.current.Count; } Job newJob = new Job(); newJob.qid = parameters.queryid; newJob.uid = parameters.userID; newJob.progress = "Initiating Search!";//prg CurrentJobs.Initialize(); CurrentJobs.current.Add(newJob); ////prg int q = db.queryStore(parameters); //////////////////////////////////////////////////////////////////////////////////// Worker workerObject = new Worker(); workerObject.location = location; workerObject.parameters = parameters; // Thread workerThread = new Thread(workerObject.DoWork); //workerThread.Name = "searchThread"; //workerThread.Start(); workerObject.DoWork(); // return "ok"; }//function
public void Update() { PointsPerDay = _refineDB.PointsPerTick; /* * foreach(var jobItem in _refineDB.JobBatchList) * { * * if(!_currentJobsDict.ContainsKey(jobItem.JobID)) * { * var newJobVM = new RefineJobVM(this, _staticData, jobItem, _cmdRef); * _currentJobsDict.Add(jobItem.JobID, newJobVM); * CurrentJobs.Add(newJobVM); * } * _currentJobsDict[jobItem.JobID].Update(); * }*/ for (int index = 0; index < _refineDB.JobBatchList.Count; index++) { var jobItem = _refineDB.JobBatchList[index]; Guid jobID = jobItem.JobID; if (CurrentJobs.Count <= index) { var newJobVM = new RefineJobVM(this, _staticData, jobItem, _cmdRef); _currentJobsDict.Add(jobID, newJobVM); CurrentJobs.Insert(index, newJobVM); } if (CurrentJobs[index].JobID != jobID) { var outOfOrderVM = CurrentJobs[index]; CurrentJobs.Remove(outOfOrderVM); if (_refineDB.JobBatchList.Contains(outOfOrderVM.JobItem)) { int newIndex = _refineDB.JobBatchList.IndexOf(outOfOrderVM.JobItem); CurrentJobs.Insert(newIndex, outOfOrderVM); } else { _currentJobsDict.Remove(jobID); } if (!_currentJobsDict.ContainsKey(jobID)) { var newJobVM = new RefineJobVM(this, _staticData, jobItem, _cmdRef); _currentJobsDict.Add(jobID, newJobVM); CurrentJobs.Insert(index, newJobVM); } } CurrentJobs[index].Update(); } }