コード例 #1
0
        private void NewSystemCreated(SystemBase system)
        {
            string systemType      = system.HvacSystemType;
            int    systemTypeAsInt = Convert.ToInt32(systemType);

            switch (systemTypeAsInt)
            {
            case 1:
                LeftSideBarChild child = new LeftSideBarChild(system.Name, "VRF", system.StatusIcon, system);
                child.IsSelected = true;
                _vrfSystemsObservableCollection.Add(child);
                break;

            case 2:
                child            = new LeftSideBarChild(system.Name, "Heat Exchanger", system.StatusIcon, system);
                child.IsSelected = true;
                _heatExchangerObservableCollection.Add(child);
                break;

            case 6:

                child            = new LeftSideBarChild(system.Name, "Central Controller", system.StatusIcon, system);
                child.IsSelected = true;
                _centralContollerObservableCollection.Add(child);
                break;
            }
            updateLeftSideBarItems();
            _eventAggregator.GetEvent <SystemSelectedItemSubscriber>().Publish((SystemBase)system);
        }
コード例 #2
0
 public RoomUIController(SystemBase system, BasicTriListWithSmartObject device, RoomBase room, bool startInTechMode)
     : base(system, device, room)
 {
     _startInTechMode  = startInTechMode;
     _userPage         = new UserPageViewController(this);
     _techPage         = new TechPageViewController(this);
     _hiddenFlipButton = new UIButton(this, Digitals.HeaderHiddenButton, Serials.PageName)
     {
         HoldTime = TimeSpan.FromSeconds(0.5)
     };
     _hiddenFlipButton.ButtonEvent += (button, args) =>
     {
         if (args.EventType != ButtonEventType.Held)
         {
             return;
         }
         if (_userPage.Visible)
         {
             _techPage.Show();
             SetHeaderTitle("Tech Control Panel");
         }
         else
         {
             _userPage.Show();
             if (Room == null)
             {
                 return;
             }
             SetHeaderTitle(Room.Name);
         }
     };
 }
コード例 #3
0
 public static NativeArray <ArrayType> GetBufferArray
 <BufferType, ArrayType>(this SystemBase s, Entity e)
     where BufferType : unmanaged, IBufferElementData
     where ArrayType : unmanaged
 {
     return(s.GetBuffer <BufferType>(e).Reinterpret <ArrayType>().AsNativeArray());
 }
コード例 #4
0
        public static DynamicBuffer <T> GetSingletonBuffer <T>(this SystemBase sys)
            where T : unmanaged, IBufferElementData
        {
            var ent = sys.GetSingletonEntity <T>();

            return(sys.GetBuffer <T>(ent));
        }
コード例 #5
0
 public LeftSideBarChild(string header, string menuheader, string icon, SystemBase source)
 {
     _header     = header;
     _menuHeader = menuheader;
     _icon       = icon;
     _source     = source;
 }
コード例 #6
0
    public void Init(bool isView)
    {
        m_isView = isView;
        try
        {
            Type[] types = GetSystemTypes();

            for (int i = 0; i < types.Length; i++)
            {
                SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
                m_systemList.Add(tmp);
                tmp.m_world = this;
                tmp.Init();
            }

            //初始化RecordSystemBase

            types = GetRecordSystemTypes();
            for (int i = 0; i < types.Length; i++)
            {
                Type type = typeof(RecordSystem <>);
                type = type.MakeGenericType(types[i]);

                RecordSystemBase tmp = (RecordSystemBase)Activator.CreateInstance(type);;
                m_recordList.Add(tmp);
                m_recordDict.Add(types[i].Name, tmp);
                tmp.m_world = this;
                tmp.Init();
            }
        }
        catch (Exception e)
        {
            Debug.LogError("WorldBase Init Exception:" + e.ToString());
        }
    }
コード例 #7
0
    public void Init(bool isView)
    {
        try
        {
            Type[] types = GetSystemTypes();

            for (int i = 0; i < types.Length; i++)
            {
                SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
                m_systemList.Add(tmp);
                tmp.m_world = this;
                tmp.Init();
            }

            //初始化ViweSystem
            if (isView)
            {
                types = GetViewSystemTypes();
                for (int i = 0; i < types.Length; i++)
                {
                    ViewSystemBase tmp = (ViewSystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
                    m_systemList.Add(tmp);
                    tmp.m_world = this;
                    tmp.Init();
                }
            }
        }
        catch (Exception e)
        {
            Debug.LogError("WorldBase Init Exception:" + e.ToString());
        }
    }
コード例 #8
0
ファイル: MapState.cs プロジェクト: sarkahn/dots-roguelike
 public MapStateJobContext(SystemBase sys, Entity e, bool readOnly = false)
 {
     entity = e;
     obstaclesFromEntity = sys.GetBufferFromEntity <MapObstaclesBuffer>(readOnly);
     entitiesFromEntity  = sys.GetBufferFromEntity <MapEntitiesBuffer>(readOnly);
     sizeFromEntity      = sys.GetComponentDataFromEntity <MapSize>(readOnly);
 }
コード例 #9
0
        public void Refresh(SystemBase system)
        {
            if (system != null)
            {
                var cProj = new List <Controller>();
                // cProj = Project.CurrentProject.ControllerList.FindAll(x => x.ControlSystemID.Equals(system.Id));
                ModelDetail.Clear();
                ControlGroup _group = null;
                //if (cProj.Count <= 0)
                //{
                _group = Project.CurrentProject.ControlGroupList.Find(x => x.ControlSystemID.Equals(system.Id));
                if (_group != null)
                {
                    cProj = Project.CurrentProject.ControllerList.FindAll(x => x.ControlGroupID.Equals(_group.Id));
                }
                //  }

                foreach (var sys in cProj)
                {
                    ModelDetail.Add(new MaterialList
                    {
                        Model       = sys.Model,
                        Description = sys.Description,
                        Qty         = sys.Quantity
                    });
                }
            }
        }
コード例 #10
0
        public MpcUIController(SystemBase system, RoomBase defaultRoom)
            : base(system, system.ControlSystem.MPC3x201TouchscreenSlot, defaultRoom)
        {
            var mpc = system.ControlSystem.MPC3x201TouchscreenSlot;

            mpc.Register();

            _sourceButtons = new ButtonCollection
            {
                { 1, new UIButton(this, 5) },
                { 2, new UIButton(this, 6) }
            };

            _chanButtons = new ButtonCollection
            {
                { 1, new UIButton(this, 7) },
                { 2, new UIButton(this, 10) }
            };

            _audioButtons = new ButtonCollection
            {
                { 1, new UIButton(this, 8) },
                { 2, new UIButton(this, 9) }
            };

            _sourceButtons.ButtonEvent += SourceButtonsOnButtonEvent;
            _chanButtons.ButtonEvent   += ChanButtonsOnButtonEvent;
            _audioButtons.ButtonEvent  += AudioButtonsOnButtonEvent;
            _powerBtn              = new UIButton(this, 10);
            _powerBtn.ButtonEvent += PowerBtnOnButtonEvent;
            _level = new MpcVolume(mpc);
            ((ASystem)system).Dsp.HasIntitialized += DspOnHasIntitialized;
        }
コード例 #11
0
ファイル: ADisplay.cs プロジェクト: microdave007/JaneStreetAV
 public ADisplay(SystemBase system, DisplayDeviceBase displayDevice, DisplayConfig config)
     : base(system, displayDevice)
 {
     _config  = config;
     Name     = _config.Name;
     Position = config.Position;
 }
コード例 #12
0
    public ECSGroupManager(WorldBase world)
    {
        for (int i = 0; i < world.m_systemList.Count; i++)
        {
            SystemBase system = world.m_systemList[i];
            int        key    = StringArrayToInt(system.Filter);
            if (allGroupDic.ContainsKey(key))
            {
                //Debug.Log("System :"+ system.GetType().FullName+ "  Filter :" + string.Join(",", system.Filter) + " Dic :"+string.Join(",",allGroupDic[key].Components));
                continue;
            }
            ECSGroup group = new ECSGroup(key, system.Filter);
            allGroupDic.Add(key, group);
            groupToEntityDic.Add(group, new List <EntityBase>());
        }
        for (int i = 0; i < world.m_recordList.Count; i++)
        {
            RecordSystemBase system = world.m_recordList[i];

            int key = StringArrayToInt(system.Filter);
            if (allGroupDic.ContainsKey(key))
            {
                //Debug.Log("System :" + system.GetType().FullName + "  Filter :" + string.Join(",", system.Filter) + " Dic :" + string.Join(",", allGroupDic[key].Components));
                continue;
            }

            ECSGroup group = new ECSGroup(key, system.Filter);
            allGroupDic.Add(key, group);
            groupToEntityDic.Add(group, new List <EntityBase>());
        }
    }
コード例 #13
0
ファイル: UIControllerCollection.cs プロジェクト: uxav/lib2
 internal UIControllerCollection(SystemBase system, IEnumerable <UIController> controllers)
 {
     System = system;
     foreach (var uiController in controllers)
     {
         _controllers.Add(uiController.Id, uiController);
     }
 }
コード例 #14
0
 public void AddSystem(SystemBase system)
 {
     systems.AddLast(system);
     systemIds.Add(system, system.Id);
     entitiesBySystem.DefineNew(system.Id);
     system.AssignToScene(scene);
     OnSystemAdded(new SystemEventArgs(system));
 }
コード例 #15
0
 internal void SendToSystem(Message message, SystemBase system, bool isBlocking)
 {
     system.EnqueueMessage(message);
     if (isBlocking)
     {
         system.ReceiveBlockingMessage(message);
     }
 }
コード例 #16
0
    // Coroutine that loads up the Event Manager, that certain scripts use to carry out events
    IEnumerator LoadUpEvent(Action OnExisting)
    {
        SystemBase sb = CreateSubsystem <EventManager>();

        yield return(new WaitWhile(() => sb != null));

        OnExisting.SafeInvoke();
        SetLoadState(LoadStates.Connecting);
    }
コード例 #17
0
        protected BaseUIController(SystemBase system, BasicTriListWithSmartObject device, RoomBase room)
            : base(system, device, room)
        {
            try
            {
                var assembly   = Assembly.GetExecutingAssembly();
                var streamName =
                    assembly.GetManifestResourceNames()
                    .FirstOrDefault(n => n.Contains(".sgd") && n.Contains(device.Name)) ??
                    assembly.GetManifestResourceNames()
                    .FirstOrDefault(
                        n => n.Contains(".sgd") && n.Contains("XPanel") && device is XpanelForSmartGraphics) ??
                    assembly.GetManifestResourceNames()
                    .FirstOrDefault(
                        n => n.Contains(".sgd") && n.Contains("CrestronApp") && device is CrestronApp) ??
                    assembly.GetManifestResourceNames()
                    .FirstOrDefault(n => n.Contains(".sgd"));
                CloudLog.Info("Loading Smartgraphics for {0} ID {1}, File: {2}", GetType().Name, Id, streamName);
                var stream = assembly.GetManifestResourceStream(streamName);
                LoadSmartObjects(stream);
            }
            catch
            {
                CloudLog.Error("Could not load SGD file for {0}", this);
            }

            _roomNameLabel          = new UILabel(this, Serials.RoomName);
            _roomContactNumberLabel = new UILabel(this, Serials.RoomContactNumber);

            _bootPage = new BootPageViewController(this, Digitals.PageBoot, null);

            var tswX60BaseClass = device as TswX60BaseClass;

            if (tswX60BaseClass != null)
            {
                tswX60BaseClass.ExtenderSystem2ReservedSigs.Use();
            }

            _restartingView = new ASubPage(this, Device.BooleanInput[Digitals.SubPageRestarting], string.Empty, TimeSpan.Zero);
            _restartingText = new UILabel(this, Serials.RestartingText)
            {
                Text = "System Restarting"
            };

            _homeButton = new UIButton(this, Digitals.HomeButton);
            _backButton = new UIButton(this, Digitals.BackButton)
            {
                VisibleJoin = Device.BooleanInput[Digitals.BackButtonVisible]
            };
            _backButton.Show();

            _homeButton.ButtonEvent += HomeButtonOnButtonEvent;

            _textEntryView = new TextFieldEntryViewController(this);

            _actionSheets[0] = new ActionSheetDefault(this);
        }
コード例 #18
0
        //Acc End IA
        private void OnSelectedSystemTab(SystemBase system)
        {
            LeftSideBarChild toSelect = AllSystems.FirstOrDefault(a => a.Children.FirstOrDefault(b => b.Source.Id == system.Id) != null)?.Children.FirstOrDefault(b => b.Source.Id == system.Id);

            if (toSelect != null)
            {
                toSelect.IsSelected = true;
            }
        }
コード例 #19
0
        public override void Unload()
        {
            // Unloading
            SystemBase.HookUnload();
            FPSCounter?.Unload();

            // Field Nulling
            FPSCounter = null;
        }
コード例 #20
0
    // Coroutine that loads up the Audio Manager for all the in game audio
    IEnumerator LoadUpAudio(Action OnExisting)
    {
        SystemBase sb = CreateSubsystem <AudioManager>();

        yield return(new WaitWhile(() => sb != null));

        OnExisting.SafeInvoke();
        StartCoroutine(LoadUpEvent(OnExisting));
    }
コード例 #21
0
    // Coroutine that gathers objectPool
    IEnumerator LoadUpObjectPool(Action OnExisting)
    {
        SystemBase sb = CreateSubsystem <ObjectPool>();

        yield return(new WaitWhile(() => sb != null));

        OnExisting.SafeInvoke();
        StartCoroutine(LoadUpPTM(OnExisting));
    }
コード例 #22
0
        public static NativeArray <ArrayType> GetSingletonBufferArray
        <BufferType, ArrayType>(this SystemBase s)
            where BufferType : unmanaged, IBufferElementData
            where ArrayType : unmanaged
        {
            var e = s.GetSingletonEntity <BufferType>();

            return(s.GetBufferArray <BufferType, ArrayType>(e));
        }
コード例 #23
0
 public TerminalJobContext(SystemBase sys, Entity e, bool readOnly = false)
 {
     tilesFromEntity    = sys.GetBufferFromEntity <TerminalTilesBuffer>(readOnly);
     sizeFromEntity     = sys.GetComponentDataFromEntity <TerminalSize>(readOnly);
     tileSizeFromEntity = sys.GetComponentDataFromEntity <TileSize>(readOnly);
     posFromEntity      = sys.GetComponentDataFromEntity <Translation>(readOnly);
     termFromEntity     = sys.GetComponentDataFromEntity <Terminal>(readOnly);
     entity             = e;
 }
コード例 #24
0
 public void RemoveSystem(SystemBase system)
 {
     system.Stop();
     system.Unload();
     systems.Remove(system);
     systemIds.Remove(system);
     entitiesBySystem.Remove(system.Id);
     OnSystemRemoved(new SystemEventArgs(system));
 }
コード例 #25
0
        internal void ClearAllEntitiesFromSystem(SystemBase system)
        {
            var entitiesCopy = new List <Entity>(entitiesBySystem[system.Id]);

            foreach (Entity entity in entitiesCopy)
            {
                UnregisterEntityFromSystem(entity, system);
            }
        }
コード例 #26
0
ファイル: MessageMap.cs プロジェクト: OkashiKami/Odyssey
        public bool IsRegistered <TDerivedIndex>(SystemBase item)
        {
            Type indexType = typeof(TDerivedIndex);

            if (!IsAssociated(indexType))
            {
                return(false);
            }
            return(collectionMap[indexType].Contains(item));
        }
コード例 #27
0
    protected void AddSystem(SystemBase system)
    {
        var type = system.GetType();

        if (dSystems.ContainsKey(type))
        {
            throw new Exception($"Duplicate system {type}");
        }
        dSystems.Add(type, system);
    }
コード例 #28
0
ファイル: CalendarMeetings.cs プロジェクト: uxav/lib2-devices
        public void StartTimer(SystemBase system)
        {
            if (_started)
            {
                return;
            }

            _started = true;

            system.TimeChanged += SystemOnTimeChanged;
        }
コード例 #29
0
        public static void SendSystemMessage(int systemID, ActionParameter parameter)
        {
            if (!systems.ContainsKey(systemID))
            {
                return;
            }

            SystemBase _system = systems[systemID];

            _system.Add(parameter);
            _system.Set();
        }
コード例 #30
0
    void InitSystem()
    {
        Type[] types = GetSystemTypes();

        for (int i = 0; i < types.Length; i++)
        {
            SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName);
            m_systemList.Add(tmp);
            tmp.m_world = this;
            tmp.Init();
        }
    }