/// <summary> /// Create new instance of Stage Root Path /// </summary> /// <param name="subset"></param> /// <param name="process"></param> /// <returns></returns> public static JitLocation CreateRoot(JitStage stage, JitProcess process = null) { return(new JitLocation { Stage = stage, SubsetCache = stage, Path = "\\", Process = process, }); }
public JitLocation ToChangeProcess(JitProcess newProcess) { return(new JitLocation { Stage = Stage, SubsetCache = SubsetCache, Path = Path, Process = newProcess, }); }
private int GetProcPriority(JitProcess proc) { if (ProcPriorities.TryGetValue(proc.ID, out var p1)) { return(p1); } if (ProcPriorities.TryGetValue(proc.Name, out var p2)) { return(p2); } throw new JitException(JitException.NoProcKey, $"{proc.Name} or {proc.ID}"); }
/// <summary> /// Get Process Key /// </summary> /// <param name="proc"></param> /// <returns></returns> public static ProcessKey GetProcessKey(JitProcess proc) { if (proc is JitProcessDummy dummy) { return(dummy.ProcessKey); } else { if (proc.Name == null) { return(proc.ID); } else { return(proc.Name); } } }
public static JitLocation Create(JitStage stage, string pathFromStage, JitProcess process = null) { JitLocation loc; if (pathFromStage == "\\") { return(CreateRoot(stage, process)); } else { loc = stage.FindSubsetProcess(CreateRoot(stage), pathFromStage); return(new JitLocation { Stage = stage, SubsetCache = loc?.Process as JitSubset, Path = pathFromStage, Process = process, }); } }
/// <summary> /// Bridge to Stage.GetWorks() /// </summary> /// <returns></returns> public IEnumerable <(JitWork Work, DateTime EnterTime)> GetWorks(JitProcess process) { return(Stage.GetWorks(ToChangeProcess(process))); }