|
|
|
@ -17,6 +17,7 @@ namespace CriticalPathAnalyzer.Client.Tool {
|
|
|
|
|
private static PegAddress? _endPegAddress;
|
|
|
|
|
|
|
|
|
|
private static Guid _currentRequestGuid = Guid.NewGuid();
|
|
|
|
|
private static AnalyzePathResponse _response;
|
|
|
|
|
|
|
|
|
|
public static void Init(ILogicLogger logger) {
|
|
|
|
|
_logger = logger;
|
|
|
|
@ -74,6 +75,15 @@ namespace CriticalPathAnalyzer.Client.Tool {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void DisplayLoop() {
|
|
|
|
|
if (_response == null) {
|
|
|
|
|
_logger.Error("Got no response - cannot display loop");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
PathHighLighter.RemoveHighLighting();
|
|
|
|
|
PathHighLighter.HighlightWires(_response.LoopingClusters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void CalculateCriticalPath() {
|
|
|
|
|
if (_startPegAddress == null || _endPegAddress == null) {
|
|
|
|
|
_logger.Error("Invalid pegs");
|
|
|
|
@ -88,17 +98,19 @@ namespace CriticalPathAnalyzer.Client.Tool {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Highlight(AnalyzePathResponse response) {
|
|
|
|
|
public static void HandleResponse(AnalyzePathResponse response) {
|
|
|
|
|
if (_currentRequestGuid != response.RequestGuid) {
|
|
|
|
|
// Not matching Guid, old or wrong request, discard.
|
|
|
|
|
_logger.Warn("Got response to wrong request, discarding");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_logger.Info($"Critical path length is: {response.CriticalPathLength}");
|
|
|
|
|
_response = response;
|
|
|
|
|
|
|
|
|
|
_logger.Info($"Critical path length is: {_response.CriticalPathLength}");
|
|
|
|
|
|
|
|
|
|
PathHighLighter.RemoveHighLighting();
|
|
|
|
|
PathHighLighter.HighlightWires(response);
|
|
|
|
|
PathHighLighter.HighlightWires(_response.Clusters);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|