Ejemplo n.º 1
0
        private void OnJoinFederationHelloWorld(object sender, EventArgs e)
        {
            try
            {
                // Join to federation
                sampleFederateAmbassador = new XrtiFederateAmbassador(rtiAmbassador);
                mobileServices           = new MobileFederateServices(new DoubleValuedLogicalTimeFactory(), new DoubleValuedLogicalTimeIntervalFactory());
                IFederateHandle federateHandle = rtiAmbassador.JoinFederationExecution(peerName, federationName, sampleFederateAmbassador, mobileServices);

                EvokeCallbackMenuItem.Enabled         = true;
                EvokeCallbacksMenuItem.Enabled        = true;
                SetTimeConstrainedMenuItem.Enabled    = true;
                SetTimeRegulatingMenuItem.Enabled     = true;
                TimeAdvanceRequestMinMenuItem.Enabled = true;
                TimeAdvanceRequestMenuItem.Enabled    = true;
                Example1MenuItem.Enabled = true;
                Example2MenuItem.Enabled = true;
                Example3MenuItem.Enabled = true;
            }
            catch (Exception exception)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error(exception.Message);
                }
                MessageBox.Show(exception.Message);
            }
        }
Ejemplo n.º 2
0
 public void JoinFederation()
 {
     try
     {
         // Join to federation
         IFederateHandle federateHandle = rtiAmbassador.JoinFederationExecution("USA", federationName, federateAmbassador, mobileServices);
     }
     catch (Exception e)
     {
         if (log.IsErrorEnabled)
         {
             log.Error(e.Message);
         }
         Assert.Fail("Failed while testing a valid join request: " + e.Message);
     }
 }