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); }
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); } }; }
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()); }
public static DynamicBuffer <T> GetSingletonBuffer <T>(this SystemBase sys) where T : unmanaged, IBufferElementData { var ent = sys.GetSingletonEntity <T>(); return(sys.GetBuffer <T>(ent)); }
public LeftSideBarChild(string header, string menuheader, string icon, SystemBase source) { _header = header; _menuHeader = menuheader; _icon = icon; _source = source; }
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()); } }
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()); } }
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); }
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 }); } } }
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; }
public ADisplay(SystemBase system, DisplayDeviceBase displayDevice, DisplayConfig config) : base(system, displayDevice) { _config = config; Name = _config.Name; Position = config.Position; }
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>()); } }
internal UIControllerCollection(SystemBase system, IEnumerable <UIController> controllers) { System = system; foreach (var uiController in controllers) { _controllers.Add(uiController.Id, uiController); } }
public void AddSystem(SystemBase system) { systems.AddLast(system); systemIds.Add(system, system.Id); entitiesBySystem.DefineNew(system.Id); system.AssignToScene(scene); OnSystemAdded(new SystemEventArgs(system)); }
internal void SendToSystem(Message message, SystemBase system, bool isBlocking) { system.EnqueueMessage(message); if (isBlocking) { system.ReceiveBlockingMessage(message); } }
// 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); }
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); }
//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; } }
public override void Unload() { // Unloading SystemBase.HookUnload(); FPSCounter?.Unload(); // Field Nulling FPSCounter = null; }
// 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)); }
// Coroutine that gathers objectPool IEnumerator LoadUpObjectPool(Action OnExisting) { SystemBase sb = CreateSubsystem <ObjectPool>(); yield return(new WaitWhile(() => sb != null)); OnExisting.SafeInvoke(); StartCoroutine(LoadUpPTM(OnExisting)); }
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)); }
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; }
public void RemoveSystem(SystemBase system) { system.Stop(); system.Unload(); systems.Remove(system); systemIds.Remove(system); entitiesBySystem.Remove(system.Id); OnSystemRemoved(new SystemEventArgs(system)); }
internal void ClearAllEntitiesFromSystem(SystemBase system) { var entitiesCopy = new List <Entity>(entitiesBySystem[system.Id]); foreach (Entity entity in entitiesCopy) { UnregisterEntityFromSystem(entity, system); } }
public bool IsRegistered <TDerivedIndex>(SystemBase item) { Type indexType = typeof(TDerivedIndex); if (!IsAssociated(indexType)) { return(false); } return(collectionMap[indexType].Contains(item)); }
protected void AddSystem(SystemBase system) { var type = system.GetType(); if (dSystems.ContainsKey(type)) { throw new Exception($"Duplicate system {type}"); } dSystems.Add(type, system); }
public void StartTimer(SystemBase system) { if (_started) { return; } _started = true; system.TimeChanged += SystemOnTimeChanged; }
public static void SendSystemMessage(int systemID, ActionParameter parameter) { if (!systems.ContainsKey(systemID)) { return; } SystemBase _system = systems[systemID]; _system.Add(parameter); _system.Set(); }
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(); } }