//called when data for any output pin is requested
		public void Evaluate(int SpreadMax)
		{
			if (FPinInContext[0] != FState)
			{
				FState = FPinInContext[0];
				FState.Initialised += new EventHandler(FState_Initialised);
			}

			if (FState == null)
			{
				Close();
				return;
			}

			if (FStarted)
				GiveOutputs();
			else
			{
				FPinOutID.SliceCount = 0;
				FPinOutPresent.SliceCount = 0;
			}
		}
Example #2
0
		//called when data for any output pin is requested
		public void Evaluate(int SpreadMax)
		{
			if (FPinInContext[0] != FState)
			{
				FState = FPinInContext[0];

				if (FState != null)
				{
					//we've made a connection

					//add a listener for intialisation
					FState.Initialised += new EventHandler(FState_Initialise);

					//if already initialised before we connected
					if (FState.Running)
						Initialise();
				}
			}

			FPinOutStatus[0] = FStatus;
		}
Example #3
0
		//called when data for any output pin is requested
		public void Evaluate(int SpreadMax)
		{
			if (FPinInContext[0] != FState)
				FState = FPinInContext[0];

			if (FState == null)
			{
				Close();
				return;
			}

			if (FState.Running && !FStarted && FState.Context != null)
			{
				try
				{
					//initialise
					FUserGenerator = new UserGenerator(FState.Context);
					FUserGenerator.NewUser += new EventHandler<NewUserEventArgs>(FUserGenerator_NewUser);
					FUserGenerator.LostUser += new EventHandler<UserLostEventArgs>(FUserGenerator_LostUser);
					FUserGenerator.UserReEnter += new EventHandler<UserReEnterEventArgs>(FUserGenerator_UserReEnter);
					FUserGenerator.UserExit += new EventHandler<UserExitEventArgs>(FUserGenerator_UserExit);
					FUserGenerator.StartGenerating();

					FPinOutMask[0] = FImageMask.Link;
					FImageMask.Image.Initialise(new Size(640, 480), TColourFormat.L16);

					FState.Update += new EventHandler(FState_Update);

					FStarted = true;
					FPinOutStatus[0] = "OK";
				}
				catch (StatusException e)
				{
					Close();
					FPinOutStatus[0] = e.Message;
				}
			}

			if (FStarted)
				GiveOutputs();
			else
			{
				FPinOutID.SliceCount = 0;
				FPinOutPresent.SliceCount = 0;
			}
		}