Beispiel #1
0
        public string GetStatus()
        {
            StringBuilder sb = new StringBuilder();

            if (CurrentMachine == null)
            {
                sb.AppendFormat("[{0}]: End of Cycle.", Data.MasterCounter);
            }
            else if (CurrentMachine is MachineEquation)
            {
                sb.AppendFormat("[{0}]: Executing ecuation.", Data.MasterCounter);
            }
            else if (CurrentMachine is MachineRelation)
            {
                sb.AppendFormat("[{0}]: Testing Relation.", Data.MasterCounter);
            }
            else
            {
                sb.AppendFormat("[{0}] {1}: {2}", Data.MasterCounter, SubMachine.Name, SubMachine.StepState.ToString());
                if (SubMachine.StepState == SimulationState.ExecutingSubMachine)
                {
                    MachineStatus ms = SubMachine.SubMachine;
                    do
                    {
                        sb.AppendFormat(" > {0}: {1}", SubMachine.SubMachine.Name, SubMachine.SubMachine.StepState);
                        ms = ms.SubMachine;
                    } while (ms != null && ms.StepState == SimulationState.ExecutingSubMachine);
                }
            }
            return(sb.ToString());
        }
Beispiel #2
0
        public string GetCurrentState(string defaultText = "")
        {
            MachineStatus machine = SubMachine;

            while (machine != null && machine.SubMachine != null)
            {
                machine = machine.SubMachine;
            }
            if (machine != null && machine.CurrentState != null)
            {
                return(machine.CurrentState.Name);
            }
            else if (machine != null)
            {
                return(machine.Name);
            }
            else
            {
                return(defaultText);
            }
        }
 public SubMachineStatus(MachineStatus owner, IMachine mach, BasicObjectsTree tree, bool markStart = true)
     : base(owner.Data, mach, tree, markStart)
 {
     Owner = owner;
 }