public _IEXResult MountGroup() { PlatformContext gatewayContext = GetGatewayContext(); _Platform GW = gatewayContext.Platform; List <_Platform> Clients = GetClientsList(); _IEXResult res = null; if (DebugMode) { foreach (_Platform client in Clients) { string temp; client.IEX.IR.SendIR("MENU", out temp, 10000); } return(null); } int Retries = 0; bool HasFailure = false; do { HasFailure = false; lock (GatewayLocker) { if (!gatewayContext.isMount && GW != null) { res = GW.EA.MountGw(_mountFlag); if (!res.CommandSucceeded) { GW.IEX.LogComment("Failed to Mount Gateway: " + res.FailureReason, isBold: true, size: "12", colour: "Red"); return(res); } } gatewayContext.isMount = true; } try { Parallel.ForEach(Clients, CL => { res = CL.EA.MountClient(_mountFlag, 1); if (!res.CommandSucceeded && HasFailure == false) { CL.IEX.LogComment("Failed to Mount Client: " + res.FailureReason, isBold: true, size: "12", colour: "Red"); HasFailure = true; } }); } catch (Exception) { HasFailure = true; } Retries++; } while (HasFailure && Retries < 3); return(res); }
public _IEXResult MountSingle() { PlatformContext gatewayContext = GetGatewayIsClientContext(); _Platform GW = gatewayContext.Platform; _IEXResult res = null; if (DebugMode) { string temp; GW.IEX.IR.SendIR("MENU", out temp, 10000); return(null); } lock (GatewayLocker) { if (!gatewayContext.isMount && GW != null) { res = GW.EA.MountGw(_mountFlag); if (!res.CommandSucceeded) { GW.IEX.LogComment("Failed to Mount Gateway: " + res.FailureReason, isBold: true, size: "12", colour: "Red"); return(res); } } gatewayContext.isMount = true; } return(res); }
private void TearDown(_Platform p) { try { p.EA.TearDown(); p.IEX.Disconnect(); platformsAlreadyTearedDown.Add(p.IEX.IEXServerNumber); int timeOut = 2000; do { Thread.Sleep(2000); timeOut += 2000; } while (timeOut < 30000 && p.IEX.IsConnected); } finally { if (p.IEX.IsConnected) { throw new Exception("Failed to Disconnect IEX Server " + p.IEX.IEXServerNumber.ToString()); } } }
public void LogCommentInfo(_Platform platform, string text) { platform.IEX.LogComment(text, isBold: false, size: "10", colour: "Blue"); Tracer.Write(Tracer.TraceLevel.INFO, text, "TEST"); }
public void LogComment(_Platform platform, string text, bool isBold = false, string size = "", string colour = "Black") { platform.IEX.LogComment(text, isBold: isBold, size: size, colour: colour); Tracer.Write(Tracer.TraceLevel.INFO, text, "TEST"); }
public void FailStep(_Platform platform, IEXGateway._IEXResult res, string reason = "", bool exitTest = true) { string msg = "[" + res.FailureCode + "] " + reason + " " + res.FailureReason; this.FailStep(platform, msg, exitTest); }
public void LogCommentFailure(_Platform platform, string text) { platform.IEX.LogComment(text, isBold: true, size: "10", colour: "Red"); Tracer.Write(Tracer.TraceLevel.ERROR, text, "TEST"); }
public void LogCommentWarning(_Platform platform, string text) { platform.IEX.LogComment(text, isBold: true, size: "10", colour: "Orange"); Tracer.Write(Tracer.TraceLevel.WARN, text, "TEST"); }
public void LogCommentImportant(_Platform platform, string text) { platform.IEX.LogComment(text, isBold: true, size: "10", colour: "Purple"); Tracer.Write(Tracer.TraceLevel.MIL, text, "TEST"); }