Exemplo n.º 1
0
        public AltoSystem()
        {
            _scheduler = new Scheduler();

            _memBus             = new MemoryBus();
            _mem                = new Memory.Memory();
            _keyboard           = new Keyboard();
            _diskController     = new DiskController(this);
            _displayController  = new DisplayController(this);
            _mouseAndKeyset     = new MouseAndKeyset();
            _ethernetController = new EthernetController(this);
            _orbitController    = new OrbitController(this);
            _audioDAC           = new AudioDAC(this);
            _organKeyboard      = new OrganKeyboard(this);
            _tridentController  = new TridentController(this);

            _cpu = new AltoCPU(this);

            // Attach memory-mapped devices to the bus
            _memBus.AddDevice(_mem);
            _memBus.AddDevice(_keyboard);
            _memBus.AddDevice(_mouseAndKeyset);
            _memBus.AddDevice(_audioDAC);
            _memBus.AddDevice(_organKeyboard);

            Reset();
        }
Exemplo n.º 2
0
        public async Task SyncControllerTest_Mkdir_Exist()
        {
            InsertSearchData();
            var context = new ControllerContext
            {
                HttpContext = new DefaultHttpContext()
            };

            var fakeStorage = new FakeIStorage(new List <string> {
                "/", "/test_dir"
            },
                                               new List <string> {
                _createAnImage.DbPath
            });
            var storageSelector = new FakeSelectorStorage(fakeStorage);

            var controller =
                new DiskController(_query, storageSelector,
                                   new FakeIWebSocketConnectionsService(), new FakeINotificationQuery())
            {
                ControllerContext = context
            };

            var result = await controller.Mkdir("/test_dir") as JsonResult;

            var list = result.Value as List <SyncViewModel>;

            Assert.AreEqual(FileIndexItem.ExifStatus.OperationNotSupported, list.FirstOrDefault().Status);
        }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        currentObject      = null;
        _lastFramePosition = transform.position;

        grabbing       = false;
        triggerPress   = false;
        triggerHold    = false;
        triggerRelease = false;
        diskObj        = transform.parent.GetComponent <PlayerController>().objDisk;
        diskController = diskObj.GetComponent <DiskController>();  /// 4/18/2018 --- Cam: Direct DiskObject reference

        ////////
        ///  Added by Cam -- 3/26/2018
        ///

        // Determine which hand this object is.
        // if (string.Compare(gameObject.name, "leftHand") == 1)
        // {
        //     isLeftHand = true;
        // }
        // else isLeftHand = false;

        // anchor = transform.GetChild[0].transform;

        //
        ///////
    }
Exemplo n.º 4
0
        public async Task SyncControllerTest_Mkdir_Good_SocketUpdate()
        {
            InsertSearchData();
            var context = new ControllerContext
            {
                HttpContext = new DefaultHttpContext()
            };

            var socket      = new FakeIWebSocketConnectionsService();
            var fakeStorage = new FakeIStorage(new List <string> {
                "/"
            },
                                               new List <string> {
                _createAnImage.DbPath
            });
            var storageSelector = new FakeSelectorStorage(fakeStorage);

            var controller =
                new DiskController(_query, storageSelector,
                                   socket, new FakeINotificationQuery())
            {
                ControllerContext = context
            };

            await controller.Mkdir("/test_dir");

            var value = socket.FakeSendToAllAsync.FirstOrDefault(p =>
                                                                 !p.StartsWith("[system]"));

            Assert.IsNotNull(value);
            Assert.IsTrue(value.Contains("/test_dir"));
        }
Exemplo n.º 5
0
        public async Task SyncControllerTest_Rename_Good_SocketUpdate()
        {
            InsertSearchData();

            var context = new ControllerContext
            {
                HttpContext = new DefaultHttpContext()
            };
            var socket = new FakeIWebSocketConnectionsService();

            var fakeStorage = new FakeIStorage(new List <string> {
                "/"
            },
                                               new List <string> {
                _createAnImage.DbPath
            });
            var storageSelector = new FakeSelectorStorage(fakeStorage);

            var controller =
                new DiskController(_query, storageSelector,
                                   socket, new FakeINotificationQuery())
            {
                ControllerContext = context
            };

            await controller.Rename(_createAnImage.DbPath, "/test.jpg");

            Assert.AreEqual(1, socket.FakeSendToAllAsync.Count(p => !p.Contains("[system]")));
            Assert.IsTrue(socket.FakeSendToAllAsync[0].Contains("/test.jpg"));

            await _query.RemoveItemAsync(await _query.GetObjectByFilePathAsync("/test.jpg"));
        }
Exemplo n.º 6
0
        public async Task SyncControllerTest_Rename_WithCurrentStatusDisabled()
        {
            InsertSearchData();

            var context = new ControllerContext
            {
                HttpContext = new DefaultHttpContext()
            };

            var fakeStorage = new FakeIStorage(new List <string> {
                "/"
            },
                                               new List <string> {
                _createAnImage.DbPath
            });
            var storageSelector = new FakeSelectorStorage(fakeStorage);

            var controller =
                new DiskController(_query, storageSelector,
                                   new FakeIWebSocketConnectionsService(), new FakeINotificationQuery())
            {
                ControllerContext = context
            };

            var result = await controller.Rename(_createAnImage.DbPath, "/test.jpg", true, false) as JsonResult;

            var list = result.Value as List <FileIndexItem>;

            Assert.AreEqual(FileIndexItem.ExifStatus.Ok, list[0].Status);
            Assert.AreEqual(FileIndexItem.ExifStatus.NotFoundSourceMissing, list[1].Status);

            await _query.RemoveItemAsync(await _query.GetObjectByFilePathAsync("/test.jpg"));
        }
Exemplo n.º 7
0
    /// <summary>
    /// Set the disks on this stick transparent with a fade-out effect
    /// </summary>
    /// <param name="trans">If true it will fade-out in a transparency, il will go back to opaque otherwise</param>
    /// <param name="dragged">Set as the disk to not set transparent. For example the disk being dragged on the stick should not be transparent</param>
    public void SetDisksTransparent(bool trans, DiskController dragged)
    {
        // Stop any fade in action
        StopAllCoroutines();

        // Set glowing of the stick
        glowing.enabled = trans;

        // Iterate through all disks on the disk
        foreach (var disk in _disks)
        {
            if (dragged == null || dragged.name != disk.name)
            {
                // Iterate through all childer of the disk (like the back sprite)
                foreach (var render in disk.GetComponentsInChildren <SpriteRenderer>())
                {
                    if (trans)
                    {
                        // Use coroutine to not interrupt the frame rate
                        StartCoroutine(FadeOut(render));
                    }
                    else
                    {
                        render.color = new Color(1, 1, 1, 1);
                    }
                }
            }
        }
    }
Exemplo n.º 8
0
    public void RemoveDiskFromRodStack()
    {
        DiskController poppedDisk = diskStack.Pop();

        if (poppedDisk.currentRod == this)
        {
            poppedDisk.currentRod = null;
        }
    }
Exemplo n.º 9
0
    /// <summary>
    /// Pile the disk to the stick
    /// </summary>
    /// <param name="disk">The disk to pile</param>
    public void AddDisk(DiskController disk)
    {
        if (CanAddDisk(disk))
        {
            disk.currentStick = this;

            _disks.Push(disk);
        }
    }
Exemplo n.º 10
0
    void OnCollisionEnter(Collision collision)
    {
        GameObject     gameObj = collision.gameObject;
        DiskController disk    = gameObj.GetComponent <DiskController>();

        if (disk != null)
        {
            TakeDamage(disk.damage);
        }
    }
Exemplo n.º 11
0
        protected override void ProcessRecord()
        {
            var zip = CompressionController.FindDnnZip(ZipFolder, Version, Type);

            if (string.IsNullOrEmpty(zip))
            {
                throw new System.Exception(string.Format("Cannot find DNN install zip for version {0} in folder {1}", Version, ZipFolder));
            }
            DiskController.CreateIisFolder(TargetFolder);
            CompressionController.UnzipFile(Path.Combine(ZipFolder, zip), TargetFolder);
        }
Exemplo n.º 12
0
Arquivo: VM.cs Projeto: claassen/RIVM
        private IOPort[] CreateIODevices(string diskFile)
        {
            IOPort[] ioPorts = new IOPort[SystemMemoryMap.IO_PORT_END - SystemMemoryMap.IO_PORT_START + 1];

            var disk = new DiskController(diskFile);

            ioPorts[0] = new IOPort(() => disk.ControlRegister, (val) => disk.ControlRegister = val);
            ioPorts[1] = new IOPort(() => disk.AddressRegister, (val) => disk.AddressRegister = val);
            ioPorts[2] = new IOPort(() => disk.IOByteCountRegister, (val) => disk.IOByteCountRegister = val);
            ioPorts[3] = new IOPort(() => disk.DataRegister, (val) => disk.DataRegister = val);

            return(ioPorts);
        }
Exemplo n.º 13
0
 /// <summary>
 /// Remove the top disk from the stick
 /// </summary>
 /// <returns>The removed disk</returns>
 public DiskController RemoveTopDisk()
 {
     // No disk -> return null
     if (_disks.Count == 0)
     {
         return(null);
     }
     else
     {
         DiskController disk = _disks.Pop();
         disk.currentStick = null;
         return(disk);
     }
 }
Exemplo n.º 14
0
 public VolumeInfo(VolumeInfo info)
 {
     this.DriveLetter         = info.DriveLetter;
     this.Format              = info.Format;
     this.Label               = info.Label;
     this.DiskSizeMB          = info.DiskSizeMB;
     this.IsSystemVolume      = info.IsSystemVolume;
     this.DriveType           = info.DriveType;
     this.DataStoreUrl        = info.DataStoreUrl;
     this.TargetDiskSizeMB    = info.TargetDiskSizeMB;
     this.FreeSpaceMB         = info.FreeSpaceMB;
     this.UsedSpaceMB         = info.UsedSpaceMB;
     this.DiskCtrl            = info.DiskCtrl;
     this.DiskType            = info.DiskType;
     this.VolumeSignature     = info.VolumeSignature;
     this.ReverseDataStoreUrl = info.ReverseDataStoreUrl;
 }
Exemplo n.º 15
0
        public async Task SyncControllerTest_Rename_NotFoundInIndex()
        {
            var context = new ControllerContext
            {
                HttpContext = new DefaultHttpContext()
            };
            var fakeStorage     = new FakeIStorage();
            var storageSelector = new FakeSelectorStorage(fakeStorage);

            var controller = new DiskController(_query, storageSelector,
                                                new FakeIWebSocketConnectionsService(), new FakeINotificationQuery());

            controller.ControllerContext = context;

            var result = await controller.Rename("/notfound-image.jpg", "/test.jpg") as NotFoundObjectResult;

            Assert.AreEqual(404, result.StatusCode);
        }
Exemplo n.º 16
0
    /// <summary>
    /// Check if a disk can be added to the current stick
    /// </summary>
    /// <param name="disk">The disk that should be dropped in the stick</param>
    /// <returns>True if the disk can be dropped, false otherwise</returns>
    public bool CanAddDisk(DiskController disk)
    {
        // No disk -> allow dropping
        if (_disks.Count == 0)
        {
            return(true);
        }

        // Allow dropping only if the Disk on top has a size bigger than the one is being dropped
        if (_disks.Peek().Size >= disk.Size)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Exemplo n.º 17
0
 public bool CanAddDisk(DiskController disk)
 {
     if (diskStack.Contains(disk))
     {
         return(false);
     }
     else if (GetDiskCount() == 0)
     {
         //disk stack is 0
         return(true);
     }
     else if (disk.size < GetTopDisk().size)
     {
         //disk is smaller
         return(true);
     }
     //disk is bigger
     return(false);
 }
Exemplo n.º 18
0
        public AltoSystem()
        {
            _scheduler = new Scheduler();

            _memBus             = new MemoryBus();
            _mem                = new Memory.Memory();
            _keyboard           = new Keyboard();
            _diskController     = new DiskController(this);
            _displayController  = new DisplayController(this);
            _mouse              = new Mouse();
            _ethernetController = new EthernetController(this);
            _musicInterface     = new Music(this);

            _cpu = new AltoCPU(this);

            // Attach memory-mapped devices to the bus
            _memBus.AddDevice(_mem);
            _memBus.AddDevice(_keyboard);
            _memBus.AddDevice(_mouse);
            _memBus.AddDevice(_musicInterface);

            Reset();
        }
Exemplo n.º 19
0
 public void AddDiskToRodStack(DiskController disk)
 {
     diskStack.Push(disk);
 }
Exemplo n.º 20
0
    void Start()
    {
        // Instantiate body parts
        leftHand    = Instantiate(prefLHand);
        rightHand   = Instantiate(prefRHand);
        playerHead  = Instantiate(prefHead);
        playerTorso = playerHead.transform.GetChild(0).gameObject;
        playerColor = playerHead.GetComponent <Renderer>().material.GetColor("_ColorTint");

        spawnPoint           = transform.position; // Set initial position as spawnPoint.
        gameController       = GameObject.Find("GameController");
        gameControllerScript = gameController.GetComponent <GameControllerScript>();
        playerTorso          = playerHead.transform.GetChild(0).gameObject;
        playerTorso.transform.SetParent(gameObject.transform);
        //instantiate body 'object'
        body = new Body();
        //instantiate disk and put it in the body's left hand
        objDisk = Instantiate(prefDisk);
        //objDisk.transform.SetParent(gameObject.transform.GetChild(body.LEFTHAND).transform);
        objDisk.transform.localPosition = Vector3.zero;
        //grab disk's controller
        diskController                 = objDisk.GetComponent <DiskController>();
        diskController.owner           = this.gameObject;
        diskController.ownerController = this.gameObject.GetComponent <PlayerController>();
        leftHand.GetComponent <HandGrabbing>().isLocal  = isLocalPlayer;
        rightHand.GetComponent <HandGrabbing>().isLocal = isLocalPlayer;
        CmdInstantiateBodyParts();
        leftHand.transform.parent          = gameObject.transform;
        rightHand.transform.parent         = gameObject.transform;
        playerHead.transform.parent        = gameObject.transform;
        leftHand.transform.localPosition   = InputTracking.GetLocalPosition(xrHead);
        rightHand.transform.localPosition  = InputTracking.GetLocalPosition(xrHead);
        playerHead.transform.localPosition = InputTracking.GetLocalPosition(xrHead);
        print("XRDevice: " + (XRDevice.isPresent ? XRDevice.model : "Not Present"));
        if (isServer)
        {
            //Server is put on one side of the room and flipped around
            if (isLocalPlayer)
            {
                transform.position         = new Vector3(0f, 0f, -5f);
                objDisk.transform.position = new Vector3(0f, 1f, -4f);
                networkDiskNextPosition    = objDisk.transform.position;

                gameControllerScript.hostPlayer         = this.gameObject;
                gameControllerScript.hostController     = this;
                gameControllerScript.hostDisk           = objDisk;
                gameControllerScript.hostDiskController = diskController;
            }
            else
            {
                transform.position = new Vector3(0f, 0f, 5f);
                transform.Rotate(Vector3.up * 180);
                objDisk.transform.position = new Vector3(0f, 1f, 4f);
                networkDiskNextPosition    = objDisk.transform.position;

                gameControllerScript.clientPlayer         = this.gameObject;
                gameControllerScript.clientController     = this;
                gameControllerScript.clientDisk           = objDisk;
                gameControllerScript.clientDiskController = diskController;
            }
        }
        else
        {
            //If client, put player on other side
            if (isLocalPlayer)
            {
                transform.position = new Vector3(0f, 0f, 5f);
                transform.Rotate(Vector3.up * 180);
                objDisk.transform.position = new Vector3(0f, 1f, 4f);

                gameControllerScript.clientPlayer         = this.gameObject;
                gameControllerScript.clientController     = this;
                gameControllerScript.clientDisk           = objDisk;
                gameControllerScript.clientDiskController = diskController;
            }
            else
            {
                transform.position         = new Vector3(0f, 0f, -5f);
                objDisk.transform.position = new Vector3(0f, 1f, -4f);

                gameControllerScript.hostPlayer         = this.gameObject;
                gameControllerScript.hostController     = this;
                gameControllerScript.hostDisk           = objDisk;
                gameControllerScript.hostDiskController = diskController;
            }
        }
        if (isLocalPlayer && !isServer)
        {
            otherPlayerController = gameControllerScript.hostController;
            gameControllerScript.hostController.otherPlayerController = gameControllerScript.clientController;
        }
        if (!isLocalPlayer && isServer)
        {
            otherPlayerController = gameControllerScript.hostController;
            gameControllerScript.hostController.otherPlayerController = gameControllerScript.clientController;
        }
        //Set OTHER player a different color
        if (isLocalPlayer)
        {
            if (!XRDevice.isPresent)
            {
                transform.Translate(Vector3.up * 1.5f);
            }

            Material[] tempMats = playerHead.GetComponent <MeshRenderer>().materials;
            tempMats[0] = otherPlayerBaseColor;
            tempMats[1] = otherPlayerHeadColor;
            playerHead.GetComponent <MeshRenderer>().materials = tempMats;
            tempMats    = playerTorso.transform.GetComponent <MeshRenderer>().materials;
            tempMats[0] = otherPlayerBaseColor;
            tempMats[1] = otherplayerTorsoColor;
            playerTorso.transform.GetComponent <MeshRenderer>().materials = tempMats;

            //playerHead.GetComponent<MeshRenderer>().enabled = false;
            //playerTorso.GetComponent<MeshRenderer>().enabled = false;
            leftHand.GetComponent <MeshRenderer>().material  = otherPlayerColor;
            rightHand.GetComponent <MeshRenderer>().material = otherPlayerColor;
            objDisk.GetComponent <MeshRenderer>().material   = otherDiskColor;
            objDisk.GetComponent <Light>().color             = otherLightColor;
        }
    }
Exemplo n.º 21
0
 private void LoadResources()
 {
     diskController = Singleton <DiskController> .instance;
     diskController.initController();
 }
Exemplo n.º 22
0
 public void SetDiskController(DiskController controller)
 {
     diskController = controller;
 }