Пример #1
0
        public string GetClientStatusDescription(MOG_Command command)
        {
            MOG_CommandServerCS commandServer = (MOG_CommandServerCS)MOG_ControllerSystem.GetCommandManager();

            // Describe the current command of this connection
            string description = "";

            // Check if we have a ProjectName specified?
            if (command.GetProject().Length > 0)
            {
                // Add on our ProjectName
                description += "PROJECT: " + command.GetProject();
            }

            // Check if we have a ProjectName specified?
            if (command.GetBranch().Length > 0)
            {
                // Add on our ProjectName
                description += "     BRANCH: " + command.GetBranch();
            }

            // Check if we have a UserName specified?
            if (command.GetUserName().Length > 0)
            {
                // Add on our ProjectName
                description += "     USER: "******"     TAB: " + viewsCommand.GetTab();
                }
                // Check if we have a Platform specified?
                if (viewsCommand.GetPlatform().Length > 0)
                {
                    description += "     PLATFORM: " + viewsCommand.GetPlatform();
                }
                // Check if we have a Tab specified?
                if (viewsCommand.GetUserName().Length > 0)
                {
                    description += "     INBOX: " + viewsCommand.GetUserName();
                }
            }

            return(description);
        }
Пример #2
0
        internal bool IsJobPackaging(MOG_Command pCommand)
        {
            // Check if this job has already begun any packaging commands yet?
            if (mProcessedPackageCommands.Count > 0)
            {
                // Check if this package command is related to any already processed packaging commands within this job?
                foreach (MOG_Command command in mProcessedPackageCommands)
                {
                    // Check if the CommandType matches?
                    // Check if the AssetFilename matches?
                    // Check if the Platforms matches?
                    // Check if the Branch matches?
                    if (command.GetCommandType() == pCommand.GetCommandType() &&
                        String.Compare(command.GetAssetFilename().GetOriginalFilename(), pCommand.GetAssetFilename().GetOriginalFilename(), true) == 0 &&
                        String.Compare(command.GetPlatform(), pCommand.GetPlatform(), true) == 0 &&
                        String.Compare(command.GetBranch(), pCommand.GetBranch(), true) == 0)
                    {
                        // Indicate that this job is packaging a similar network package command
                        return(true);
                    }
                }

                // In addition lets check all pending merge commands to make sure we don't have a deadlock situation coming down the road
                IDictionaryEnumerator enumerator = mPackageCommandList.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    MOG_Command command = (MOG_Command)(enumerator.Value);

                    // Check if the CommandType matches?
                    // Check if the AssetFilename matches?
                    // Check if the Platforms matches?
                    // Check if the Branch matches?
                    if (command.GetCommandType() == pCommand.GetCommandType() &&
                        String.Compare(command.GetAssetFilename().GetOriginalFilename(), pCommand.GetAssetFilename().GetOriginalFilename(), true) == 0 &&
                        String.Compare(command.GetPlatform(), pCommand.GetPlatform(), true) == 0 &&
                        String.Compare(command.GetBranch(), pCommand.GetBranch(), true) == 0)
                    {
                        // Indicate that this job will soon be packaging a similar network package command
                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #3
0
        bool CheckExclusiveCommands(MOG_Command pCommand)
        {
            // Scan mActiveSlaves looking for one that matches this command
            for (int s = 0; s < mActiveSlaves.Count; s++)
            {
                // Make sure that this slave contains a valid command?
                MOG_Command pSlave = (MOG_Command)mActiveSlaves[s];
                if (pSlave.GetCommand() != null)
                {
                    // Check if the CommandType matches?
                    // Check if the AssetFilename matches?
                    // Check if the Platforms matches?
                    // Check if the Branch matches?
                    // Check if the JobLabel matches?
                    if (pSlave.GetCommand().GetCommandType() == pCommand.GetCommandType() &&
                        String.Compare(pSlave.GetCommand().GetAssetFilename().GetOriginalFilename(), pCommand.GetAssetFilename().GetOriginalFilename(), true) == 0 &&
                        String.Compare(pSlave.GetCommand().GetPlatform(), pCommand.GetPlatform(), true) == 0 &&
                        String.Compare(pSlave.GetCommand().GetBranch(), pCommand.GetBranch(), true) == 0)
// JohnRen - Checking the JobLabel breaks exclusivity because 2 users could have initiated the same item and could collide
//						String.Compare(pSlave.GetCommand().GetJobLabel(), pCommand.GetJobLabel(), true) == 0)
                    {
                        return(true);
                    }
                }
            }

            // Check if this command is a network packaging command?
            if (pCommand.GetCommandType() == MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageMerge)
            {
                // Check if there was an earlier network package merge similar to this command?
                // Enumerate through all the jobs
                foreach (MOG_JobInfo job in mJobOrder)
                {
                    // Make sure this is a valid job?  and
                    // Make sure this is another job unrelated to this command?
                    if (job != null &&
                        string.Compare(job.GetJobLabel(), pCommand.GetJobLabel(), true) != 0)
                    {
                        // Ask this job if it is packaging a similar command?
                        if (job.IsJobPackaging(pCommand))
                        {
                            // We never want to allow a second network package merge to begin until the earlier one has finished posting
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
 public void LoadCommand(MOG_Command command)
 {
     tbComputer.Text    = command.GetComputerName();
     tbDate.Text        = MogUtils_StringVersion.VersionToString(command.GetCommandTimeStamp());
     tbIp.Text          = command.GetComputerIP();
     tbID.Text          = command.GetCommandID().ToString();
     tbProject.Text     = command.GetProject();
     tbType.Text        = command.GetCommandType().ToString();
     tbUser.Text        = command.GetUserName();
     tbBranch.Text      = command.GetBranch();
     tbJobId.Text       = command.GetJobLabel();
     tbBlocking.Text    = command.IsBlocking().ToString();
     tbSlaveID.Text     = command.mAssignedSlaveID.ToString();
     tbCompleted.Text   = command.IsCompleted().ToString();
     tbValidSlaves.Text = command.GetValidSlaves();
     if (command.GetAssetFilename() != null)
     {
         tbAssetName.Text = command.GetAssetFilename().GetAssetFullName();
     }
 }
Пример #5
0
        bool IsDuplicateCommand(MOG_Command pCommand1, MOG_Command pCommand2)
        {
            // Check if the CommandType matches?
            // Check if the AssetFilename matches?
            // Check if the Platforms matches?
            // Check if the Branch matches?
            // Check if the JobLabel matches?
            // Check if the ValidSlaves matches?
            if (pCommand1.GetCommandType() == pCommand2.GetCommandType() &&
                String.Compare(pCommand1.GetAssetFilename().GetOriginalFilename(), pCommand2.GetAssetFilename().GetOriginalFilename(), true) == 0 &&
                String.Compare(pCommand1.GetPlatform(), pCommand2.GetPlatform(), true) == 0 &&
                String.Compare(pCommand1.GetBranch(), pCommand2.GetBranch(), true) == 0 &&
                String.Compare(pCommand1.GetJobLabel(), pCommand2.GetJobLabel(), true) == 0 &&
                String.Compare(pCommand1.GetValidSlaves(), pCommand2.GetValidSlaves(), true) == 0)
            {
                return(true);
            }

            return(false);
        }
Пример #6
0
        public string GetClientStatusDescription(MOG_Command command)
        {
            // Describe the current command of this connection
            string description = "";


            // Check if this was a registered slave reporting?
            switch (command.GetCommandType())
            {
            case MOG_COMMAND_TYPE.MOG_COMMAND_RegisterSlave:
                description = "Idle";

                // Get the contained command this slave is working on
                MOG_Command slaveTask = command.GetCommand();
                if (slaveTask != null)
                {
                    // Check if we have a ProjectName specified?
                    if (slaveTask.GetProject().Length > 0)
                    {
                        // Add on our ProjectName
                        description = "PROJECT: " + slaveTask.GetProject();
                    }

                    // Check if there is an encoded platform in this command?
                    if (slaveTask.GetPlatform().Length > 0)
                    {
                        // Get the slave's active platform
                        description += "     PLATFORM: " + slaveTask.GetPlatform();
                    }

                    // Check if we have a UserName specified?
                    if (slaveTask.GetUserName().Length > 0)
                    {
                        // Add on our ProjectName
                        description += "     USER: "******"     COMMAND: " + slaveTask.ToString();

                    // Make sure we are in the same project
                    if (string.Compare(slaveTask.GetProject(), MOG_ControllerProject.GetProjectName(), true) == 0)
                    {
                        // Check if we have an asset specified?
                        if (slaveTask.GetAssetFilename().GetAssetName().Length > 0)
                        {
                            // Build the slave's description
                            description += "     ASSET: " + slaveTask.GetAssetFilename().GetAssetName();
                        }
                    }
                }
                break;

            default:
                // Check if we have a ProjectName specified?
                if (command.GetProject().Length > 0)
                {
                    // Add on our ProjectName
                    description += "PROJECT: " + command.GetProject();
                }
                // Check if we have a ProjectName specified?
                if (command.GetBranch().Length > 0)
                {
                    // Add on our ProjectName
                    description += "     BRANCH: " + command.GetBranch();
                }
                // Check if we have a UserName specified?
                if (command.GetUserName().Length > 0)
                {
                    // Add on our ProjectName
                    description += "     USER: "******"     TAB: " + command.GetTab();
                }
                // Check if we have a Platform specified?
                if (command.GetPlatform().Length > 0)
                {
                    description += "     PLATFORM: " + command.GetPlatform();
                }
                // Check if we have a Tab specified?
                if (command.GetUserName().Length > 0)
                {
                    description += "     INBOX: " + command.GetUserName();
                }
                break;
            }

            return(description);
        }