public static void ReadProductions() { string productionListString = RemoteDataManager.ExecuteRequest("getOpenJobs"); List <Dictionary <string, string> > productionDict = JsonDeserializer.Deserialize(productionListString); if (productionDict.Count > 0) { ProductionParser.ParseList(productionDict); } }
public static List <AnimatedMotif> ReadAnimatedMotifs() { List <AnimatedMotif> result = new List <AnimatedMotif>(); string animatedMotifListString = RemoteDataManager.ExecuteRequest("getOpenMotifList"); List <Dictionary <string, string> > motifDict = JsonDeserializer.Deserialize(animatedMotifListString); if (motifDict.Count > 0) { result = MotifParser.ParseAnimatedMotifList(motifDict); } return(result); }
public static Dictionary <string, string> GetRemoteAudio(AudioData AudioData) { Dictionary <string, string> param = new Dictionary <string, string> { { "audioID", AudioData.ID.ToString() }, }; string audioResultString = RemoteDataManager.ExecuteRequest("getAudioById", param); List <Dictionary <string, string> > audioDictString = JsonDeserializer.Deserialize(audioResultString); if (audioDictString.Count == 0) { return(null); } else { //DEBUG: Check indexing return(audioDictString[audioDictString.Count - 1]); } }
public static List <Job> ReadJobs(Production production) { List <Job> result = new List <Job>(); Dictionary <string, string> param = new Dictionary <string, string> { { "productionID", production.ID.ToString() }, { "is_preview", Convert.ToInt32(production.IsPreview).ToString() } }; string productionListString = RemoteDataManager.ExecuteRequest("getJobsByProductionID", param); List <Dictionary <string, string> > jobDict = JsonDeserializer.Deserialize(productionListString); if (jobDict.Count > 0) { result = JobParser.ParseList(production, jobDict); } result = new List <Job>(result.OrderBy(item => item.Position)); return(result); }
public static void ManageHeartbeat() { Dictionary <string, string> param = new Dictionary <string, string> { { "MachineName", GlobalValues.LocalRenderMachine.Name }, { "CurrentTime", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") }, { "Message", "none" }, { "IsActive", GlobalValues.IsActive.ToString() }, { "LicenseKey", Settings.LicenseKey } }; string heartBeatString = RemoteDataManager.ExecuteRequest("sendHeartbeat", param); if (heartBeatString.Length == 0) { GlobalValues.ActiveRenderMachine.Name = GlobalValues.LocalRenderMachine.Name; GlobalValues.ActiveRenderMachine.Id = GlobalValues.LocalRenderMachine.Id; GlobalValues.HasLicense = false; } else { try { GlobalValues.HasLicense = heartBeatString.Split(new char[] { ':' })[1].Substring(0, 1) == "1"; } catch { GlobalValues.HasLicense = false; } List <Dictionary <string, string> > heartbeatDict = JsonDeserializer.Deserialize(heartBeatString); //set local machine data if (heartbeatDict.Any(item => item["machinename"] == GlobalValues.LocalRenderMachine.Name)) { if (heartbeatDict.First(item => item["machinename"] == GlobalValues.LocalRenderMachine.Name)["status"] == "offline") { GlobalValues.ActiveRenderMachine.Name = GlobalValues.LocalRenderMachine.Name; GlobalValues.ActiveRenderMachine.Id = GlobalValues.LocalRenderMachine.Id; return; } else { GlobalValues.LocalRenderMachine.Id = Convert.ToInt32(heartbeatDict.First(item => item["machinename"] == GlobalValues.LocalRenderMachine.Name)["id"]); } } Dictionary <string, string> activeMachineDict; if (heartbeatDict.Any(item => item["force_active"] == "1")) { activeMachineDict = heartbeatDict.Where(item => item["force_active"] == "1").OrderBy(item => item["priority"]).First(); } else { activeMachineDict = heartbeatDict.OrderBy(item => item["priority"]).First(); } GlobalValues.ActiveRenderMachine.Name = activeMachineDict["machinename"]; GlobalValues.ActiveRenderMachine.Id = Convert.ToInt32(activeMachineDict["id"]); } }
public static string UpdateProductStatistics(Dictionary <string, string> param) { string result = RemoteDataManager.ExecuteRequest("updateProductStatistics", param); return(result); }