Changeset 1882


Ignore:
Timestamp:
Aug 27, 2010, 8:46:15 PM (11 years ago)
Author:
kopal
Message:
  • some executionEngine optimizations
  • removed some unused code
Location:
trunk/CrypPlugins/WorkspaceManager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WorkspaceManager/Execution/ExecutionEngine.cs

    r1876 r1882  
    430430            //7. Send execute messages to possible executable next plugins
    431431            //runNextPlugins();
    432         }
    433 
    434         /// <summary>
    435         /// Send execute messages to possible executable next plugins
    436         /// </summary>
    437         public void runNextPlugins()
    438         {           
    439             foreach (ConnectorModel connectorModel in PluginModel.InputConnectors)
    440             {
    441                 foreach (ConnectionModel connectionModel in connectorModel.InputConnections)
    442                 {
    443                     if (!connectionModel.From.PluginModel.Startable ||
    444                         (connectionModel.From.PluginModel.Startable && connectionModel.From.PluginModel.RepeatStart))
    445                     {
    446                         if (mayExecute(connectionModel.From.PluginModel))
    447                         {
    448                             MessageExecution message_exec = new MessageExecution();
    449                             message_exec.PluginModel = connectionModel.From.PluginModel;
    450                             connectionModel.From.PluginModel.PluginProtocol.BroadcastMessageReliably(message_exec);
    451                         }
    452                     }
    453                 }
    454             }
    455         }
     432        }       
    456433     
    457434        /// <summary>
     
    460437        public void clearInputs()
    461438        {
    462             foreach (ConnectorModel connectorModel in PluginModel.InputConnectors)
     439            List<ConnectorModel> inputConnectors = PluginModel.InputConnectors;
     440            foreach (ConnectorModel connectorModel in inputConnectors)
    463441            {
    464442                if (connectorModel.HasData)
     
    468446                    connectorModel.GuiNeedsUpdate = true;
    469447
    470                     foreach (ConnectionModel connectionModel in connectorModel.InputConnections)
     448                    List<ConnectionModel> inputConnections = connectorModel.InputConnections;
     449                    foreach (ConnectionModel connectionModel in inputConnections)
    471450                    {
    472451                        connectionModel.Active = false;
     
    484463        {
    485464            //Fill the plugins inputs with data
    486             foreach (ConnectorModel connectorModel in PluginModel.InputConnectors)
     465            List<ConnectorModel> inputConnectors = PluginModel.InputConnectors;
     466            foreach (ConnectorModel connectorModel in inputConnectors)
    487467            {
    488468                try
     
    535515
    536516            //Check if all necessary inputs are set
    537             foreach (ConnectorModel connectorModel in pluginModel.InputConnectors)
     517            List<ConnectorModel> inputConnectors = pluginModel.InputConnectors;
     518            foreach (ConnectorModel connectorModel in inputConnectors)
    538519            {
    539520                if (!connectorModel.IControl &&
     
    546527
    547528            //Check if all outputs are free
    548             foreach (ConnectorModel connectorModel in pluginModel.OutputConnectors)
     529            List<ConnectorModel> outputConnectors = pluginModel.OutputConnectors;
     530            foreach (ConnectorModel connectorModel in outputConnectors)
    549531            {
    550532                if (!connectorModel.IControl)
    551533                {
    552                     foreach (ConnectionModel connectionModel in connectorModel.OutputConnections)
     534                    List<ConnectionModel> outputConnections = connectorModel.OutputConnections;
     535                    foreach (ConnectionModel connectionModel in outputConnections)
    553536                    {
    554537                        if (connectionModel.To.HasData)
  • trunk/CrypPlugins/WorkspaceManager/Model/ConnectorModel.cs

    r1876 r1882  
    228228                this.Data = Data;
    229229
    230                 foreach (ConnectionModel connectionModel in this.OutputConnections)
     230                List<ConnectionModel> outputConnections = this.OutputConnections;
     231                foreach (ConnectionModel connectionModel in outputConnections)
    231232                {
    232233                    Data = new Data();
     
    240241                //We changed an input on the PluginModels where "To"s are belonging to so
    241242                //we have to check if there are executable now
    242                 foreach (ConnectionModel connectionModel in this.OutputConnections)
     243                foreach (ConnectionModel connectionModel in outputConnections)
    243244                {
    244245                    MessageExecution msg = new MessageExecution();
     
    255256                this.GuiNeedsUpdate = true;
    256257
    257                 foreach (ConnectionModel connectionModel in this.InputConnections)
     258                List<ConnectionModel> inputConnections = this.InputConnections;
     259                foreach (ConnectionModel connectionModel in inputConnections)
    258260                {
    259261                    connectionModel.Active = false;
    260262                    connectionModel.GuiNeedsUpdate = true;
    261263                }
    262 
    263                 foreach (ConnectionModel connectionModel in this.InputConnections)
     264                foreach (ConnectionModel connectionModel in inputConnections)
    264265                {
    265266                    if (!connectionModel.From.PluginModel.Startable ||
  • trunk/CrypPlugins/WorkspaceManager/Model/ImageModel.cs

    r1849 r1882  
    1717    {
    1818        private byte[] data = null;
    19         private int height;
    20         private int width;
    21         private int stride;
    2219
    2320        /// <summary>
Note: See TracChangeset for help on using the changeset viewer.