public static void CheckForNamedJobFlag() { if (IgorJobConfig.IsStringParamSet(NamedJobFlag)) { string JobToStart = IgorJobConfig.GetStringParam(NamedJobFlag); foreach (IgorPersistentJobConfig Job in IgorConfig.GetInstance().JobConfigs) { if (Job.JobName == JobToStart) { IgorJobConfig ConfigInst = IgorJobConfig.GetConfig(); ConfigInst.Persistent = Job; ConfigInst.Save(IgorJobConfig.IgorJobConfigPath); IgorDebug.CoreLog("Starting named job " + JobToStart + "."); return; } } IgorDebug.CoreLogError("Couldn't find named job " + JobToStart + "!"); } }
public static void SetBoolParam(string BoolParam, bool bTrue) { IgorJobConfig Inst = GetConfig(); if (Inst != null) { Inst.Persistent.JobCommandLineParams = IgorRuntimeUtils.SetBoolParam(Inst.Persistent.JobCommandLineParams, BoolParam, bTrue); Inst.Save(IgorJobConfigPath); } }
public static void SetWasMenuTriggered(bool bMenu) { IgorJobConfig Inst = GetConfig(); if (Inst != null) { Inst.bMenuTriggered = bMenu; Inst.Save(IgorJobConfigPath); } }
public static void SetIsRunning(bool bRunning) { IgorJobConfig Inst = GetConfig(); if (Inst != null) { Inst.bIsRunning = bRunning; Inst.Save(IgorJobConfigPath); } }
public static void SetLastIndexInPriority(int NewLastIndex) { IgorJobConfig Inst = GetConfig(); if (Inst != null) { Inst.LastIndexInPriority = NewLastIndex; Inst.Save(IgorJobConfigPath); } }
public static void SetStringParam(string ParamKey, string ParamValue) { IgorJobConfig Inst = GetConfig(); if (Inst != null) { Inst.Persistent.JobCommandLineParams = IgorRuntimeUtils.SetStringParam(Inst.Persistent.JobCommandLineParams, ParamKey, ParamValue); Inst.Save(IgorJobConfigPath); } }
public static IgorJobConfig GetConfig() { if (InternalOverride != null) { return(InternalOverride); } if (File.Exists(IgorJobConfigPath)) { return(IgorJobConfig.Load(IgorJobConfigPath)); } else { IgorJobConfig NewConfig = new IgorJobConfig(); NewConfig.Save(IgorJobConfigPath); return(NewConfig); } }
public static void SetJobToRunByName(string JobName) { IgorConfig Inst = GetInstance(); if (Inst != null) { foreach (IgorPersistentJobConfig CurrentJob in Inst.JobConfigs) { if (CurrentJob.JobName == JobName) { IgorJobConfig NewConfig = new IgorJobConfig(); NewConfig.Persistent = CurrentJob; NewConfig.Save(IgorJobConfig.IgorJobConfigPath); IgorJobConfig.SetLastPriority(-1); IgorJobConfig.SetLastIndexInPriority(-1); return; } } } }