Beispiel #1
0
        public override void Process(ProcessCapability capability)
        {
            if (Resource == null)
            {
                return;
            }

            if (_currentCapability != capability)
            {
                // Switch the capability; if we fail to do so, remove all other capabilities from the available ones and
                // trigger a reconfiguration
                if (Robot.SwitchCapability(capability))
                {
                    _currentCapability = capability;
                }
                else
                {
                    AvailableCapabilities.RemoveAll(c => c != _currentCapability);
                    CheckConstraints();
                    return;
                }
            }

            // Apply the capability; if we fail to do so, remove it from the available ones and trigger a reconfiguration
            if (!Robot.ApplyCapability())
            {
                AvailableCapabilities.Remove(capability);
                CheckConstraints();
            }
            else
            {
                if (Resource.State.Count() == Resource.Task.Capabilities.Length)
                {
                    throw new InvalidOperationException();
                }

                Resource.OnCapabilityApplied();
            }
        }
Beispiel #2
0
		public override void Process(ProcessCapability capability)
		{
			if (Resource == null)
				return;

			if (_currentCapability != capability)
			{
				// Switch the capability; if we fail to do so, remove all other capabilities from the available ones and
				// trigger a reconfiguration
				if (Robot.SwitchCapability(capability))
					_currentCapability = capability;
				else
				{
					AvailableCapabilities.RemoveAll(c => c != _currentCapability);
					CheckConstraints();
					return;
				}
			}

			// Apply the capability; if we fail to do so, remove it from the available ones and trigger a reconfiguration
			if (!Robot.ApplyCapability())
			{
				AvailableCapabilities.Remove(capability);
				CheckConstraints();
			}
			else
			{
				if (Resource.State.Count() == Resource.Task.Capabilities.Length)
					throw new InvalidOperationException();

				Resource.OnCapabilityApplied();
			}
		}
Beispiel #3
0
 public virtual void Process(ProcessCapability capability)
 {
 }
Beispiel #4
0
		public virtual void Process(ProcessCapability capability)
		{
		}