public void ShouldAddLibraryViewToAssetBrowserRegion()
        {
            var regionViewRegistry = new MockRegionViewRegistry();
            var container          = new MockUnityResolver();
            var menuButtonView     = new MockMenuButtonView();

            MockLibraryViewPresentationModel libraryViewModel = new MockLibraryViewPresentationModel();

            container.Bag[typeof(ILibraryViewPresentationModel)] = libraryViewModel;

            MockLibraryMenuButtonViewModel menuViewModel = new MockLibraryMenuButtonViewModel();

            menuViewModel.View = menuButtonView;

            container.Bag[typeof(IMenuButtonViewModel)] = menuViewModel;

            var module = new LibraryModule(container, regionViewRegistry);

            Assert.AreEqual(0, regionViewRegistry.ViewsByRegion.Count);

            module.Initialize();

            Assert.AreEqual(1, regionViewRegistry.ViewsByRegion.Count);
            Assert.AreSame(libraryViewModel.View, regionViewRegistry.ViewsByRegion[RegionNames.AssetBrowserRegion]);
        }
Example #2
0
        /// <summary>
        /// Creates the kernel that will manage your application.
        /// </summary>
        /// <returns>The created kernel.</returns>
        private static IKernel CreateKernel()
        {
            var userModule    = new LibraryModule();
            var serviceModule = new ServiceModule("DefaultConnection");
            var kernel        = new StandardKernel(serviceModule, userModule);

            try
            {
                kernel.Bind <Func <IKernel> >().ToMethod(ctx => () => new Bootstrapper().Kernel);
                kernel.Bind <IHttpModule>().To <HttpApplicationInitializationHttpModule>();
                RegisterServices(kernel);
                return(kernel);
            }
            catch
            {
                kernel.Dispose();
                throw;
            }
        }
Example #3
0
        public void ShouldAddLibraryViewToToolsRegion()
        {
            var toolsRegion   = new MockRegion();
            var regionManager = new MockRegionManager();
            var container     = new MockUnityResolver();

            container.Bag.Add(typeof(ILibraryViewPresentationModel), new MockLibraryViewPresentationModel());

            regionManager.Regions.Add("ToolsRegion", toolsRegion);

            var module = new LibraryModule(container, regionManager);

            Assert.AreEqual(0, toolsRegion.AddedViews.Count);

            module.Initialize();

            Assert.AreEqual(1, toolsRegion.AddedViews.Count);
            Assert.IsInstanceOfType(toolsRegion.AddedViews[0], typeof(ILibraryView));
        }
Example #4
0
        public void ConfigureContainer(ContainerBuilder builder)
        {
            var containerConfiguration = new LibraryModule(_environment);

            builder.RegisterModule(containerConfiguration);
        }
Example #5
0
    // Use this for initialization
    void Awake()
    {
        //If clientunity object is already present on the scene, the new one gets destroyed
        if (FindObjectsOfType(GetType()).Length > 1)
        {
            Destroy(gameObject);
            return;
        }

        //The first ClientUnity is common for every scene
        DontDestroyOnLoad(gameObject);

        //FileInfo fileInfo = new System.IO.FileInfo(Application.dataPath + "/Resources/Update/airt-project-0.1.1-.deb");
        //FileStream fs = File.OpenRead(Application.dataPath + "/Resources/Update/airt-project-0.1.1-.deb");
        //ulong fileSize = (ulong)fileInfo.Length;
        //UnityEngine.Debug.Log("File size: " + fileSize);
        //byte[] fileBytes = new byte[4096];
        //
        //BinaryReader br = new BinaryReader(fs);
        //
        //
        //ulong bytesRead = 0;
        //while (bytesRead < fileSize)
        //{
        //    int readCount = br.Read(fileBytes, (int)0, 4096);
        //    bytesRead += 4096;
        //    UnityEngine.Debug.Log("READING");
        //}
        //UnityEngine.Debug.Log("END");
        //Drone ip
        if (GlobalSettings.Instance.getIP() == "")
        {
            //GlobalSettings.Instance.setIP("10.42.0.101");
            GlobalSettings.Instance.setIP("192.168.8.1");
        }

        //GlobalSettings.Instance.setIP("192.168.8.205");
        //GlobalSettings.Instance.setIP("158.42.154.131");
        //Every module
        client = new Client();

        stdManager             = new StandardModule();
        atreyuManager          = new AtreyuModule();
        osManager              = new OSModule(FileManager.debFilePath, FileManager.debFileName + ".deb");
        fpvManager             = new FPVModule();
        FCS_Module             = new FCSModule();
        libraryManager         = new LibraryModule();
        missionExecutorManager = new MissionExecutorModule();
        pozyxManager           = new PozyxModule();
        pointCloudManager      = new MapperModule();
        droneManager           = new DroneModule();
        recCamModule           = new RecCamModule();
        //mhandlers.Add(new MsgHandler((byte)Modules.POINTCLOUD_MODULE, (byte)PointcloudNotificationType.PCL_SINGLE, onPclData));  // data



        cli_thread = new Thread(() => client.run(mhandlers));
        cli_thread.Start();
        //We start quering atreyu state to see if the app should jump to mapping or recording, as the drone can't do anything other than mapping or recording if it is
        //is those states
        if (client.isConnected)
        {
            tryReconnect = false;
            client.SendCommand((byte)Modules.ATREYU_MODULE, (byte)AtreyuCommandType.ATREYU_QUERY_SYSTEM_STATE);
        }
        else
        {
            tryReconnect = true;
        }
        //client.sendCommand((byte)Modules.ATREYU_MODULE, (byte)AtreyuCommandType.ATREYU_QUERY_SERVER_VERSION);
    }