Пример #1
0
        internal bool ProcessCommand(MOG_Command pCommand)
        {
            bool bProcessed = false;

            // Make sure this command hasn't already been tasked out to a slave?
            if (pCommand.GetAssignedSlaveID() == 0)
            {
                // Attempt to process this command
                if (MOG_ControllerSystem.GetCommandManager().CommandProcess(pCommand))
                {
                    // Indicate the command was processed
                    bProcessed = true;

                    // Check if this command was a network package merge command?
                    if (pCommand.GetCommandType() == MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageMerge)
                    {
                        // Keep track of this command so we can watch exclusivity with other packaging commands in other jobs
                        mProcessedPackageCommands.Add(pCommand);
                    }
                }
            }

            return(bProcessed);
        }
Пример #2
0
        public void DisplayUpdateExistingConnections(MOG_Command command)
        {
            ListViewItem item;

            // Construct the command description
            string description = FilterDesiredCommand(command);

            if (description == null)
            {
                return;
            }

            // Check if this command was assigned to a slave?
            if (command.GetAssignedSlaveID() != 0)
            {
                // Find the connection by the assigned slave's network id
                item = LocateListViewItem(mainForm.lviewMonitor, command.GetAssignedSlaveID());
            }
            else
            {
                // Find the connection by network id
                item = LocateListViewItem(mainForm.lviewMonitor, command.GetNetworkID());
            }

            switch (command.GetCommandType())
            {
            // Delete connection?
            case MOG_COMMAND_TYPE.MOG_COMMAND_ConnectionKill:
            case MOG_COMMAND_TYPE.MOG_COMMAND_ShutdownClient:
            case MOG_COMMAND_TYPE.MOG_COMMAND_ShutdownSlave:
            case MOG_COMMAND_TYPE.MOG_COMMAND_ShutdownEditor:
            case MOG_COMMAND_TYPE.MOG_COMMAND_ShutdownCommandLine:
                if (item != null)
                {
                    item.Remove();
                }
                break;

            // Add connection?
            case MOG_COMMAND_TYPE.MOG_COMMAND_RegisterClient:
            case MOG_COMMAND_TYPE.MOG_COMMAND_RegisterSlave:
            case MOG_COMMAND_TYPE.MOG_COMMAND_RegisterEditor:
            case MOG_COMMAND_TYPE.MOG_COMMAND_RegisterCommandLine:
                if (item == null)
                {
                    // This is a new connection, add it
                    item = new ListViewItem();

                    // Construct the new item
                    item.Text = command.GetComputerName();
                    item.SubItems.Add(command.GetComputerIP());
                    item.SubItems.Add(command.GetNetworkID().ToString());
                    item.SubItems.Add(command.GetDescription());
                    item.SubItems.Add(command.ToString());
                    item.SubItems[(int)MONITOR_TABS.INFORMATION].Text = description;
                    item.ForeColor = Color.Black;
                    // Add the new item
                    mainForm.lviewMonitor.Items.Add(item);
                }
                break;

            default:
                // Always update the command desription
                if (item != null && item.SubItems.Count >= (int)MONITOR_TABS.INFORMATION)
                {
                    item.SubItems[(int)MONITOR_TABS.INFORMATION].Text = description;
                }
                break;
            }
        }
Пример #3
0
        public string FilterDesiredCommand(MOG_Command command)
        {
            MOG_CommandServerCS commandServer = (MOG_CommandServerCS)MOG_ControllerSystem.GetCommandManager();

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

            // Check if this command was assigned to a slave?
            MOG_Command slave;

            if (command.GetAssignedSlaveID() != 0)
            {
                // Attempt to find the registered slave associated with this command?
                slave = commandServer.LocateRegisteredSlaveByID(command.GetAssignedSlaveID());
            }
            else
            {
                // Attempt to find the registered slave associated with this command?
                slave = commandServer.LocateRegisteredSlaveByID(command.GetNetworkID());
            }
            // Check if we found a matching slave?
            if (slave != null)
            {
                // Update the status of this slave based on the command info
                switch (command.GetCommandType())
                {
                // Reset the description to Idle?
                case MOG_COMMAND_TYPE.MOG_COMMAND_ConnectionNew:
                case MOG_COMMAND_TYPE.MOG_COMMAND_RegisterSlave:
                case MOG_COMMAND_TYPE.MOG_COMMAND_ViewUpdate:
                case MOG_COMMAND_TYPE.MOG_COMMAND_Complete:
                case MOG_COMMAND_TYPE.MOG_COMMAND_Postpone:
                case MOG_COMMAND_TYPE.MOG_COMMAND_Failed:
                    // Always revert the slave into "Idle"...
                    description = "Idle";
                    break;

                default:
                    // Build the generic command description
                    description = GetGenericCommandDescription(command);
                    break;
                }
                // Since we know this was assigned to a slave, return what ever description we generated
                return(description);
            }

            // Attempt to find the registered editor by this command's computer name?
            MOG_Command editor = commandServer.LocateAssociatedEditorByClientID(command.GetNetworkID());

            if (editor != null)
            {
                switch (command.GetCommandType())
                {
                // Only allow the Following commands to build a unique description
                case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageMerge:
                case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageMerge:
                case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageRebuild:
                case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageRebuild:
                    // Build the generic command description
                    description = GetGenericCommandDescription(command);
                    break;

                default:
                    // Always revert the editor into "Idle"...
                    description = "Idle";
                    break;
                }
                // Since we know this was assigned to ab editor, return what ever description we generated
                return(description);
            }

            // Attempt to find the registered client associated with this command?
            MOG_Command client = commandServer.LocateClientByID(command.GetNetworkID());

            if (client != null)
            {
                // Use the RegisteredClient as the command so we get the standard description...
                description = GetClientStatusDescription(client);
                return(description);
            }

            // Always default everything to "Idle"...
            description = "Idle";
            return(description);
        }
        public string FilterDesiredCommand(MOG_Command command)
        {
            MOG_CommandServerCS commandServer = (MOG_CommandServerCS)MOG_ControllerSystem.GetCommandManager();
            bool match = false;

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

            // Since we haven't found our match yet, keep looking...
            if (!match)
            {
                MOG_Command slave;

                // Check if this command was assigned to a slave?
                if (command.GetAssignedSlaveID() != 0)
                {
                    // Attempt to find the registered slave associated with this command?
                    slave = commandServer.LocateRegisteredSlaveByID(command.GetAssignedSlaveID());
                }
                else
                {
                    // Attempt to find the registered slave associated with this command?
                    slave = commandServer.LocateRegisteredSlaveByID(command.GetNetworkID());
                }

                // Check if we found a matching slave?
                if (slave != null)
                {
                    switch (command.GetCommandType())
                    {
                    // Only allow the Following commands to build a unique description
                    case MOG_COMMAND_TYPE.MOG_COMMAND_AssetRipRequest:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_AssetProcessed:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_SlaveTask:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_ReinstanceAssetRevision:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Bless:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Post:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Archive:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageMerge:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageMerge:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageRebuild:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageRebuild:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_RemoveAssetFromProject:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_BuildFull:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Build:
                        match = true;
                        break;

                    case MOG_COMMAND_TYPE.MOG_COMMAND_ConnectionNew:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_RegisterSlave:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_ViewUpdate:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Complete:
                        // Always revert the slave into "Idle"...
                        description = "Idle";
                        return(description);


                    default:
                        // Don't change the existing description...
                        description = "Unknown - " + command.ToString();
                        return(description);
                    }
                }
            }

            // Since we haven't found our match yet, keep looking...
            if (!match)
            {
                // Attempt to find the registered slave associated with this command?
                MOG_Command editor = commandServer.LocateAssociatedEditorByClientID(command.GetNetworkID());
                if (editor != null)
                {
                    switch (command.GetCommandType())
                    {
                    // Only allow the Following commands to build a unique description
                    case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageMerge:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageMerge:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageRebuild:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageRebuild:
                        match = true;
                        break;

                    default:
                        // Use the RegisteredClient as the command so we get the standard description...
                        description = GetDetailedCommandDescription(editor);
                        return(description);
                    }
                }
            }

            // Since we haven't found our match yet, keep looking...
            if (!match)
            {
                // Attempt to find the registered client associated with this command?
                MOG_Command client = commandServer.LocateClientByID(command.GetNetworkID());
                if (client != null)
                {
                    switch (command.GetCommandType())
                    {
                    // Only allow the Following commands to build a unique description
                    case MOG_COMMAND_TYPE.MOG_COMMAND_AssetRipRequest:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_AssetProcessed:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_SlaveTask:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_ReinstanceAssetRevision:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Bless:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Post:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_Archive:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_RemoveAssetFromProject:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageMerge:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageMerge:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_NetworkPackageRebuild:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_LocalPackageRebuild:
                    case MOG_COMMAND_TYPE.MOG_COMMAND_BuildFull:
                        //case MOG_COMMAND_TYPE.MOG_COMMAND_Build:
                        break;

                    default:
                        // Use the RegisteredClient as the command so we get the standard description...
                        description = GetDetailedCommandDescription(client);
                        return(description);
                    }
                }
            }

            // Use the RegisteredClient as the command so we get the standard description...
            description = GetDetailedCommandDescription(command);
            return(description);
        }