示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 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());
         }
     }
 }
示例#4
0
 public void LogCommentInfo(_Platform platform, string text)
 {
     platform.IEX.LogComment(text, isBold: false, size: "10", colour: "Blue");
     Tracer.Write(Tracer.TraceLevel.INFO, text, "TEST");
 }
示例#5
0
 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");
 }
示例#6
0
        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);
        }
示例#7
0
 public void LogCommentFailure(_Platform platform, string text)
 {
     platform.IEX.LogComment(text, isBold: true, size: "10", colour: "Red");
     Tracer.Write(Tracer.TraceLevel.ERROR, text, "TEST");
 }
示例#8
0
 public void LogCommentWarning(_Platform platform, string text)
 {
     platform.IEX.LogComment(text, isBold: true, size: "10", colour: "Orange");
     Tracer.Write(Tracer.TraceLevel.WARN, text, "TEST");
 }
示例#9
0
 public void LogCommentImportant(_Platform platform, string text)
 {
     platform.IEX.LogComment(text, isBold: true, size: "10", colour: "Purple");
     Tracer.Write(Tracer.TraceLevel.MIL, text, "TEST");
 }