public void Init() { FileInfo logFile = new System.IO.FileInfo("Log4Net.config"); if (logFile.Exists) { // Log4Net is configured using a DOMConfigurator. log4net.Config.XmlConfigurator.Configure(logFile); } else { // Set up a simple configuration that logs on the console. log4net.Config.BasicConfigurator.Configure(); } // Log an baseInfo level message if (log.IsDebugEnabled) { if (string.IsNullOrEmpty(System.Threading.Thread.CurrentThread.Name)) System.Threading.Thread.CurrentThread.Name = "Main(" + System.Threading.Thread.CurrentThread.ManagedThreadId + ")"; log.Debug(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType + " Tests Start"); } descriptorManager = new DescriptorManager(); channelManager = new ChannelsManager(); channelManager.StartNewConnection(new Uri("memory:1")); helper = new InteractionManager(descriptorManager, channelManager); Dictionary<TransportationType, ChannelType> channelMapping = new Dictionary<TransportationType, ChannelType>(); channelMapping.Add(TransportationType.HLA_RELIABLE, ChannelType.MEMORY); channelMapping.Add(TransportationType.HLA_BEST_EFFORT, ChannelType.MEMORY); helper.SetTransportMapping(channelMapping); myListener = new MyTestBootstrapObjectListener(); helper.AddInteractionListener(myListener); }
/// <summary> /// Constructor. /// </summary> /// <param name="dm"> a Descriptor Manager</param> /// <param name="channelMangr"> The channel manager of all interaction managed by this interaction manager</param> public InteractionManager(DescriptorManager dm, ChannelsManager channelMngr) { descriptorManager = dm; RegisterAssemblyHelpers(Assembly.GetExecutingAssembly()); // TODO ANGEL: Gualtrapa. Borrame!!!!!!!! //RegisterHelloWorldHelperClass(); if (descriptorManager != null) { //descriptorManager.AddDescriptors(Sxta.Rti1516ResourcesNames.BootstrapObjectModel); RegisterHelperClass(Sxta.Rti1516ResourcesNames.BootstrapObjectModel); } channelManager = channelMngr; channelManager.ChannelDataAvailable += new OnDataAvailable(this.OnDataAvailable); channelManager.NewChannelAvailable += new OnDataAvailable(this.OnChannelAvailable); serializer = new HlaEncodingSerializer(1, null, serializerManager); channel2TransportationMap.Add(TransportationType.HLA_RELIABLE, ChannelType.TCP); channel2TransportationMap.Add(TransportationType.HLA_BEST_EFFORT, ChannelType.UDP); channel2TransportationMap.Add(new TransportationType("multicast"), ChannelType.MULTICAST); channel2TransportationMap.Add(new TransportationType("memory"), ChannelType.MEMORY); }
public void Init() { app = new MainApplication(new string[2] { @"-config=Resources\TestConfig1.xml", @"-dialog=false" }); // Log Debug level message if (log.IsDebugEnabled) log.Debug("Test " + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType + " Start"); channelMngr = new ChannelsManager(); }
/// <summary> /// Constructor for Memory channels. /// </summary> /// <exception cref="System.IO.IOException"> if an error occurs /// </exception> public MemoryMessageChannel(ChannelsManager mngr) : this() { channelManager = mngr; }