예제 #1
0
        public void Initialize(int code)
        {
            //TODO:记得给合适的系统
            //调度系统
            if ((code & ((int)SubsysId.SysSupernova)) != 0)
            {
                Subsystems.Add(new SpnvSubSystem(SubsysId.SysSupernova, Properties.Resources.IDS_SUBSYSTEM_SUPERNOVADISPATCH));
            }

            //安防中心
            //if ((code & ((int)SubsysId.SysSupernova)) != 0)
            // Subsystems.Add(new SpnvSubSystem(SubsysId.SysSupernova, Properties.Resources.IDS_SUBSYSTEM_SECURITY));

            if ((code & ((int)SubsysId.SysPa)) != 0)
            {
                Subsystems.Add(new PASubSystem(SubsysId.SysPa, Properties.Resources.IDS_SUBSYSTEM_DAVINCI));
            }

            if ((code & ((int)SubsysId.SysIps)) != 0)
            {
                Subsystems.Add(new IPSSubsystem(SubsysId.SysIps, Properties.Resources.IDS_SUBSYSTEM_WIPOS));
            }


            foreach (Subsystem sys in _systems)
            {
                sys.ConfigMgr    = ConfigMgr;
                sys.SIPUAMgr     = SIPUA;
                sys.LeftHandset  = HandsetMgr.HandsetLeft;
                sys.RightHandset = HandsetMgr.HandsetRight;
            }
        }
예제 #2
0
        public SDL2(Subsystems subsystems)
        {
            _subsystems = subsystems;

            if (SDL_Init(_subsystems) < 0)
            {
                string message = $"SDL2 could not be initialized! SDL_Error: {SDL2.GetError()}";
                throw new InitializationException(message);
            }
        }
예제 #3
0
        void SelectedRooms1CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
            case NotifyCollectionChangedAction.Add:
                foreach (Room newRoom in e.NewItems)
                {
                    newRoom.Children.Where(c => c is Subsystem).ToList().ForEach(i => SubsystemItems.Add(i));
                }
                break;

            case NotifyCollectionChangedAction.Remove:
                foreach (Room oldRoom in e.OldItems)
                {
                    oldRoom.Children.Where(c => c is Subsystem).ToList().ForEach(i => SubsystemItems.Remove(i));
                }
                break;

            case NotifyCollectionChangedAction.Replace:
                foreach (Room oldRoom in e.OldItems)
                {
                    oldRoom.Children.Where(c => c is Subsystem).ToList().ForEach(i => SubsystemItems.Remove(i));
                }
                foreach (Room newRoom in e.NewItems)
                {
                    newRoom.Children.Where(c => c is Subsystem).ToList().ForEach(i => SubsystemItems.Add(i));
                }
                break;

            case NotifyCollectionChangedAction.Move:
                break;

            case NotifyCollectionChangedAction.Reset:
                SubsystemItems.Clear();
                Subsystems.Refresh();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
예제 #4
0
        static string SubsystemToString(Subsystems subsystem)
        {
            switch (subsystem)
            {
            case Subsystems.IMAGE_SUBSYSTEM_UNKNOWN:     return("for an unknown subsystem with no code");

            case Subsystems.IMAGE_SUBSYSTEM_NATIVE:      return("an application for native Windows API");

            case Subsystems.IMAGE_SUBSYSTEM_WINDOWS_GUI: return("an application for Windows GUI");

            case Subsystems.IMAGE_SUBSYSTEM_WINDOWS_CUI:
                return("an application for Windows command-line");

            case Subsystems.IMAGE_SUBSYSTEM_OS2_CUI:                 return("an application for OS/2 command-line");

            case Subsystems.IMAGE_SUBSYSTEM_POSIX_CUI:               return("an application for POSIX command-line");

            case Subsystems.IMAGE_SUBSYSTEM_NATIVE_WINDOWS:          return("a driver for Windows 9x");

            case Subsystems.IMAGE_SUBSYSTEM_WINDOWS_CE_GUI:          return("an application for Windows CE");

            case Subsystems.IMAGE_SUBSYSTEM_EFI_APPLICATION:         return("an EFI application");

            case Subsystems.IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: return("an EFI boot services driver");

            case Subsystems.IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:      return("an EFI run-time services driver");

            case Subsystems.IMAGE_SUBSYSTEM_EFI_ROM:                 return("an EFI ROM image");

            case Subsystems.IMAGE_SUBSYSTEM_XBOX:                    return("a Xbox executable");

            case Subsystems.IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION:
                return("an application for Windows Boot environment");

            default: return($"for an unknown subsystem with code {(ushort)subsystem}");
            }
        }
예제 #5
0
 private static extern int SDL_Init(
     [MarshalAs(UnmanagedType.U4)]
     Subsystems subsystems
     );
예제 #6
0
파일: Mpc.cs 프로젝트: sakya/wpfmpdclient
 /// <summary>
 /// Puts the client in idle mode for the given subsystems
 /// </summary>
 /// <remarks>You cannot send other commands to a client in idle mode</remarks>
 /// <param name="subsystems">The subsystems to listen to.</param>
 public void Idle(Subsystems subsystems)
 {
     this.getConnection().OnSubsystemsChanged += OnSubsystemsChangedHandler;
       System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(IdleThread), subsystems);
 }
 public ExampleAutonomousCommand(Subsystems.ExampleSubsystem subsystem)
 {
     Requires(subsystem);
 }
 public ExampleCommand(Subsystems.ExampleSubsystem subsystem)
 {
     Requires(subsystem);
 }
예제 #9
0
 protected override void InitializeSubsystems()
 {
     Subsystems.Add(new BattleSystem());
 }
        public void LoadFrom(SubsystemsManager model)
        {
            _subsystems = model;

            Subsystems.Clear();

            foreach (var subsystem in model.subsystems)
            {
                SubsystemViewModel vm;

                // need to factor this into an item factory
                switch (subsystem.SystemType)
                {
                case SubsystemTypeEnum.AccessoriesManager:
                    vm = new AccessoriesManagerViewModel();
                    break;

                case SubsystemTypeEnum.AttachementsManager:
                    vm = new AttachementsManagerViewModel();
                    break;

                case SubsystemTypeEnum.BMS:
                    vm = new BMSViewModel();
                    break;

                case SubsystemTypeEnum.CameraManager:
                    vm = new CameraManagerViewModel();
                    break;

                case SubsystemTypeEnum.COMM:
                    vm = new COMMViewModel();
                    break;

                case SubsystemTypeEnum.CSSM:
                    vm = new CSSMViewModel();
                    break;

                case SubsystemTypeEnum.ECS:
                    vm = new ECSViewModel();
                    break;

                case SubsystemTypeEnum.FCM:
                    vm = new FCMViewModel();
                    break;

                case SubsystemTypeEnum.Legacy:
                    vm = null;
                    break;

                case SubsystemTypeEnum.LENR:
                    vm = new LENRViewModel();
                    break;

                case SubsystemTypeEnum.LSS:
                    vm = new LSSViewModel();
                    break;

                case SubsystemTypeEnum.MES:
                    vm = new MESViewModel();
                    break;

                case SubsystemTypeEnum.MFD:
                    vm = new MFDViewModel();
                    break;

                case SubsystemTypeEnum.MTS:
                    vm = new MTSViewModel();
                    break;

                case SubsystemTypeEnum.NAS:
                    vm = new NASViewModel();
                    break;

                case SubsystemTypeEnum.RCM:
                    vm = new RCMViewModel();
                    break;

                case SubsystemTypeEnum.RCS:
                    vm = new RCSViewModel();
                    break;

                case SubsystemTypeEnum.RMS:
                    vm = new RMSViewModel();
                    break;

                case SubsystemTypeEnum.TMS:
                    vm = new TMSViewModel();
                    break;

                case SubsystemTypeEnum.VMS:
                    vm = new VMSViewModel();
                    break;

                default:
                    vm = new SubsystemViewModel();
                    break;
                }
                if (vm != null)
                {
                    vm.LoadFrom(subsystem);
                    Subsystems.Add(vm);
                }
            }
        }