public MediaConfiguration(ComponentParameters parameters) : base(parameters) { InitializeComponent(); this.Fill(); }
private void ConfigureClick(object sender, EventArgs e) { Button configButton = sender as Button; ComponentType type = FindType <Button>(_configLookup, configButton); IComponent component = _comboLookup[type].SelectedItem as IComponent; ComponentParameters parameters; if (_params.ContainsKey(component) == false) { parameters = new ComponentParameters(); } else { parameters = _params[component]; } ConfigurationBase panel = component.CreateConfiguration(parameters) as ConfigurationBase; ConfigurationHost host = new ConfigurationHost(component, panel); if (host.ShowDialog(this) != DialogResult.Cancel) { // Ok _params[component] = host.Parameters; } }
public override ComponentParameters Save() { ComponentParameters p = _params.Clone(); //p[ DummySetting ] = this.pathTextBox.Text; //p.SetValue<bool>( ReadOnlySetting, this.readOnlyCheckBox.Checked ); return p; }
public override ComponentParameters Save() { ComponentParameters p = _params.Clone(); p[PathSetting] = this.pathTextBox.Text; return(p); }
protected ConfigurationBase( ComponentParameters parameters ) : this() { Debug.Assert( parameters != null ); _params = parameters; _defaults = parameters.Clone(); }
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { INotificationCallback callBack = context.GetExtension <INotificationCallback>(); if (callBack != null) { callBack.SendClientNotification(new ComponentProcessMessage().CreateServerMessage( Batch.Get(context).Id, Group.Get(context).Id, Job.Get(context).Id, "Job started")); } Thread thread = new Thread(DoProcess) { IsBackground = true }; AsyncNodeResult result = new AsyncNodeResult(callback, state) { ComponentList = ComponentParameters.Get(context), StartNode = StartParameter.Get(context), Job = (ProcessJob)Job.Get(context), Batch = Batch.Get(context), Group = Group.Get(context), JobCallback = context.GetExtension <INotificationCallback>(), RunningThread = thread, }; context.UserState = result; thread.Start(result); return(result); }
public MediaConfiguration( ComponentParameters parameters ) : base(parameters) { InitializeComponent(); this.Fill(); }
protected ConfigurationBase(ComponentParameters parameters) : this() { Debug.Assert(parameters != null); _params = parameters; _defaults = parameters.Clone(); }
public MemoryStickDevice( IEmulationInstance emulator, ComponentParameters parameters, string hostPath, bool writeProtected, long capacity ) { Debug.Assert( emulator != null ); Debug.Assert( parameters != null ); Debug.Assert( hostPath != null ); Debug.Assert( Directory.Exists( hostPath ) == true ); Debug.Assert( capacity > 0 ); _emulator = emulator; _parameters = parameters; _hostPath = hostPath; _writeProtected = writeProtected; DirectoryInfo info = new DirectoryInfo( hostPath ); _root = new MediaFolder( this, null, info ); _capacity = capacity; long used = _root.Cache(); _available = _capacity - used; if( _available < 0 ) { // User gave a capacity that is too small for the size, fix it up while( _capacity < used ) _capacity *= 2; Log.WriteLine( Verbosity.Critical, Feature.Media, "MemoryStickDevice: user gave capacity {0} but {1} is used; changing capacity to {2}", capacity, used, _capacity ); } // Would be nice to do something with this that was official-like (serial number?) _description = string.Format( "Memory Stick ({0}MB){1}", _capacity / 1024 / 1024, ( _writeProtected == true ? " read-only" : "" ) ); }
private void okButton_Click(object sender, EventArgs e) { _result = _panel.Save(); this.DialogResult = DialogResult.OK; this.Close(); }
public ConfigurationHost(IComponent component, ConfigurationBase panel) : this() { Debug.Assert(component != null); Debug.Assert(panel != null); _component = component; _panel = panel; _result = panel.Parameters; int xpad = this.ClientSize.Width - containerPanel.Size.Width; int ypad = this.ClientSize.Height - containerPanel.Size.Height; this.ClientSize = new Size( xpad + _panel.Size.Width, ypad + _panel.Size.Height); containerPanel.Controls.Add(_panel); _panel.Dock = DockStyle.Fill; okButton.Focus(); this.Text = string.Format("{0} Configuration", _component.Name); }
public async Task <IActionResult> GetComponents([FromQuery] ComponentParameters componentParameters) { var(components, metadata) = await _componentService.GetManyAsync(componentParameters); Response.Headers.Add("X-Pagination", JsonConvert.SerializeObject(metadata)); return(Ok(components)); }
/// <inheritdoc /> public void CreateFederationUpstream(string vhost, string name, ComponentParameters parameters) { var resource = "api/parameters/federation-upstream/{vhost}/{name}"; Execute(resource, Method.PUT, parameters, new Dictionary <string, string> { { "vhost", vhost }, { "name", name } }); }
public UmdDevice( IEmulationInstance emulator, ComponentParameters parameters, string hostPath ) : this(emulator, parameters) { Debug.Assert( hostPath != null ); Debug.Assert( File.Exists( hostPath ) == true ); this.Load( hostPath, false ); }
public UmdDevice(IEmulationInstance emulator, ComponentParameters parameters, string hostPath) : this(emulator, parameters) { Debug.Assert(hostPath != null); Debug.Assert(File.Exists(hostPath) == true); this.Load(hostPath, false); }
public MediaConfiguration(ComponentType mediaType, ComponentParameters parameters) : base(parameters) { InitializeComponent(); _mediaType = mediaType; this.Fill(); }
public MediaConfiguration( ComponentType mediaType, ComponentParameters parameters ) : base(parameters) { InitializeComponent(); _mediaType = mediaType; this.Fill(); }
public MGLDriver( IEmulationInstance emulator, ComponentParameters parameters ) { this.Emu = emulator; this.MemorySystem = this.Emu.Cpu.Memory.MemorySystem; _parameters = parameters; _caps = new MGLCapabilities(); this.Properties = new DisplayProperties(); _statisticsSource = new MGLStatisticsSource( this ); Diag.Instance.Counters.RegisterSource( _statisticsSource ); }
public MGLDriver(IEmulationInstance emulator, ComponentParameters parameters) { this.Emu = emulator; this.MemorySystem = this.Emu.Cpu.Memory.MemorySystem; _parameters = parameters; _caps = new MGLCapabilities(); this.Properties = new DisplayProperties(); _statisticsSource = new MGLStatisticsSource(this); Diag.Instance.Counters.RegisterSource(_statisticsSource); }
public UmdDevice(IEmulationInstance emulator, ComponentParameters parameters) { //Debug.Assert( emulator != null ); Debug.Assert(parameters != null); _emulator = emulator; _parameters = parameters; _state = MediaState.Ejected; _lbnLookup = new Dictionary <long, MediaFile>(1024); }
public async Task <PagedList <Component> > GetAllComponentsAsync(Guid userId, ComponentParameters componentParameters) { var result = await FindByCondition(x => x.User.Id.Equals(userId)) .FilterBy(componentParameters) .Search(componentParameters.SearchTerm) .Sort(componentParameters.OrderBy) .Include(x => x.Device) .ToListAsync(); return(PagedList <Component> .ToPagedList(result, componentParameters.PageNumber, componentParameters.PageSize)); }
public UmdDevice( IEmulationInstance emulator, ComponentParameters parameters ) { //Debug.Assert( emulator != null ); Debug.Assert( parameters != null ); _emulator = emulator; _parameters = parameters; _state = MediaState.Ejected; _lbnLookup = new Dictionary<long, MediaFile>( 1024 ); }
public async Task <(IEnumerable <ComponentDto>, Metadata)> GetManyAsync(ComponentParameters componentParameters) { var components = await _repositoryManager.Component.GetAllComponentsAsync(CurrentUserId, componentParameters); if (components == null) { _logger.LogWarning("There are no components in db!"); } return(_mapper.Map <IEnumerable <ComponentDto> >(components), components?.Metadata); }
private void LoadConfigs(List <Settings> settingsList) { foreach (Settings settings in settingsList) { string componentName = settings.GetValue <string>("componentName"); IComponent component = FindComponent(componentName); if (component == null) { continue; } ComponentParameters p = settings.GetValue <ComponentParameters>("parameters"); _params.Add(component, p); } }
public UmdDevice(IEmulationInstance emulator, ComponentParameters parameters, string hostPath, long capacity) { Debug.Assert(emulator != null); Debug.Assert(parameters != null); Debug.Assert(hostPath != null); Debug.Assert(Directory.Exists(hostPath) == true); Debug.Assert(capacity > 0); _emulator = emulator; _parameters = parameters; _capacity = capacity; this.Load(hostPath, false); }
public UmdDevice( IEmulationInstance emulator, ComponentParameters parameters, string hostPath, long capacity ) { Debug.Assert( emulator != null ); Debug.Assert( parameters != null ); Debug.Assert( hostPath != null ); Debug.Assert( Directory.Exists( hostPath ) == true ); Debug.Assert( capacity > 0 ); _emulator = emulator; _parameters = parameters; _capacity = capacity; this.Load( hostPath, false ); }
public IComponentInstance CreateInstance(IEmulationInstance emulator, ComponentParameters parameters) { string path = parameters.GetValue <string>(MediaConfiguration.PathSetting, null); if ((path == null) || (path.Length == 0) || (Directory.Exists(path) == false)) { // Error! return(null); } long capacity = parameters.GetValue <long>(MediaConfiguration.CapacitySetting, 1024 * 1024 * 1800); return(new UmdDevice(emulator, parameters, path, capacity)); }
public Bios(IEmulationInstance emulator, ComponentParameters parameters) { Debug.Assert(emulator != null); Debug.Assert(parameters != null); _emulator = emulator; _parameters = parameters; Diag.Instance.Database = new DebugDatabase(); _kernel = new Kernel(this); _loader = new Loader(this); _gameSetEvent = new AutoResetEvent(false); this.GatherModulesAndFunctions(); }
public Bios( IEmulationInstance emulator, ComponentParameters parameters ) { Debug.Assert( emulator != null ); Debug.Assert( parameters != null ); _emulator = emulator; _parameters = parameters; Diag.Instance.Database = new DebugDatabase(); _kernel = new Kernel( this ); _loader = new Loader( this ); _gameSetEvent = new AutoResetEvent( false ); this.GatherModulesAndFunctions(); }
public IComponentInstance CreateInstance(IEmulationInstance emulator, ComponentParameters parameters) { string path = parameters.GetValue <string>(MediaConfiguration.PathSetting, null); if ((path == null) || (path.Length == 0) || (Directory.Exists(path) == false)) { // Error! return(null); } bool readOnly = parameters.GetValue <bool>(MediaConfiguration.ReadOnlySetting, false); long capacity = parameters.GetValue <long>(MediaConfiguration.CapacitySetting, ( long )1024 * 1024 * 1024 * 2); return(new MemoryStickDevice(emulator, parameters, path, readOnly, capacity)); }
public FMODDriver(IEmulationInstance emulator, ComponentParameters parameters) { FMOD.RESULT result; uint version = 0; this.Emu = emulator; this._parameters = parameters; result = FMOD.Factory.System_Create(ref this.AudioSystem); Debug.Assert(result == FMOD.RESULT.OK); result = this.AudioSystem.getVersion(ref version); Debug.Assert(result == FMOD.RESULT.OK); Debug.Assert(version >= FMOD.VERSION.number); result = this.AudioSystem.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null); Debug.Assert(result == FMOD.RESULT.OK); }
public FMODDriver(IEmulationInstance emulator, ComponentParameters parameters) { FMOD.RESULT result; uint version = 0; this.Emu = emulator; this._parameters = parameters; result = FMOD.Factory.System_Create(ref this.AudioSystem); Debug.Assert(result == FMOD.RESULT.OK); result = this.AudioSystem.getVersion(ref version); Debug.Assert(result == FMOD.RESULT.OK); Debug.Assert(version >= FMOD.VERSION.number); result = this.AudioSystem.init(32, FMOD.INITFLAG.NORMAL, (IntPtr)null); Debug.Assert(result == FMOD.RESULT.OK); }
public IComponentInstance CreateInstance(IEmulationInstance emulator, ComponentParameters parameters) { string path = parameters.GetValue <string>(MediaConfiguration.PathSetting, null); if ((path == null) || (path.Length == 0) || (File.Exists(path) == false)) { // Path not found - this is just a generic UMD if ((path != null) && (path.Length > 0)) { Log.WriteLine(Verbosity.Critical, Feature.Media, "IsoFileSystem: unable to create instance, path {0} not found", path); } return(new UmdDevice(emulator, parameters)); } return(new UmdDevice(emulator, parameters, path)); }
public Cpu(IEmulationInstance emulator, ComponentParameters parameters) { Debug.Assert(emulator != null); Debug.Assert(parameters != null); _caps = new CpuCapabilities(); _stats = new RuntimeStatistics(); _emulator = emulator; _params = parameters; _lastSyscall = -1; _syscalls = new BiosFunction[1024]; #if STATS _timer = new PerformanceTimer(); _timeSinceLastIpsPrint = 0.0; #endif _clock = new Clock(); _memory = new Memory(); // Order matters as the lookup is linear and stupid... should be changed somehow //_memory->DefineSegment( MemoryType::PhysicalMemory, "Main Memory", 0x08000000, 0x01FFFFFF ); //_memory->DefineSegment( MemoryType::PhysicalMemory, "Hardware Vectors", 0x1FC00000, 0x000FFFFF ); //_memory->DefineSegment( MemoryType::PhysicalMemory, "Scratchpad", 0x00010000, 0x00003FFF ); //_memory->DefineSegment( MemoryType::PhysicalMemory, "Frame Buffer", 0x04000000, 0x001FFFFF ); //_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 1", 0x1C000000, 0x03BFFFFF ); //_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 2", 0x1FD00000, 0x002FFFFF ); _core0 = new Core(this, 0, "Allegrex", CoreAttributes.HasCp2); _core1 = new Core(this, 1, "Media Engine", CoreAttributes.Default); _codeCache = new CodeCache(); _context = new GenerationContext(); _context.Cpu = this; _context.Core0 = _core0; _context.Memory = _memory; _executionMode = ExecutionMode.Run; _firstExecute = true; }
public override ComponentParameters Save() { ComponentParameters p = _params.Clone(); p[PathSetting] = this.pathTextBox.Text; p.SetValue <bool>(ReadOnlySetting, this.readOnlyCheckBox.Checked); long capacity = -1; try { capacity = Convert.ToInt64(this.capacityComboBox.Text); } catch { } if (capacity > 0) { p.SetValue <long>(CapacitySetting, capacity); } return(p); }
public static IQueryable <Component> FilterBy(this IQueryable <Component> queryable, ComponentParameters componentParameters) { var filters = componentParameters.GetFilters(); foreach (var filter in filters) { queryable = filter switch { "Name" => queryable.Where(x => x.Name.Equals(componentParameters.Name)), "Category" => queryable.Where(x => x.Category.Equals(componentParameters.Category)), "Status" => queryable.Where(x => x.Status.Equals(componentParameters.Status)), "Serial" => queryable.Where(x => x.Serial.Equals(componentParameters.Serial)), "Manufacturer" => queryable.Where(x => x.Manufacturer.Equals(componentParameters.Manufacturer)), "OfficeAddress" => queryable.Where(x => x.OfficeAddress.Equals(componentParameters.OfficeAddress)), _ => queryable }; } return(queryable); }
public MemoryStickDevice(IEmulationInstance emulator, ComponentParameters parameters, string hostPath, bool writeProtected, long capacity) { Debug.Assert(emulator != null); Debug.Assert(parameters != null); Debug.Assert(hostPath != null); Debug.Assert(Directory.Exists(hostPath) == true); Debug.Assert(capacity > 0); _emulator = emulator; _parameters = parameters; _hostPath = hostPath; _writeProtected = writeProtected; DirectoryInfo info = new DirectoryInfo(hostPath); _root = new MediaFolder(this, null, info); _capacity = capacity; long used = _root.Cache(); _available = _capacity - used; if (_available < 0) { // User gave a capacity that is too small for the size, fix it up while (_capacity < used) { _capacity *= 2; } Log.WriteLine(Verbosity.Critical, Feature.Media, "MemoryStickDevice: user gave capacity {0} but {1} is used; changing capacity to {2}", capacity, used, _capacity); } // Would be nice to do something with this that was official-like (serial number?) _description = string.Format("Memory Stick ({0}MB){1}", _capacity / 1024 / 1024, (_writeProtected == true ? " read-only" : "")); }
public ConfigurationHost( IComponent component, ConfigurationBase panel ) : this() { Debug.Assert( component != null ); Debug.Assert( panel != null ); _component = component; _panel = panel; _result = panel.Parameters; int xpad = this.ClientSize.Width - containerPanel.Size.Width; int ypad = this.ClientSize.Height - containerPanel.Size.Height; this.ClientSize = new Size( xpad + _panel.Size.Width, ypad + _panel.Size.Height ); containerPanel.Controls.Add( _panel ); _panel.Dock = DockStyle.Fill; okButton.Focus(); this.Text = string.Format( "{0} Configuration", _component.Name ); }
public IComponentInstance CreateInstance( IEmulationInstance emulator, ComponentParameters parameters ) { return new Cpu( emulator, parameters ); }
private void okButton_Click( object sender, EventArgs e ) { _result = _panel.Save(); this.DialogResult = DialogResult.OK; this.Close(); }
public IList <ComponentIssue> Test(ComponentParameters parameters) { return(null); }
public IList<ComponentIssue> Test( ComponentParameters parameters ) { return new List<ComponentIssue>(); }
public IComponentConfiguration CreateConfiguration(ComponentParameters parameters) { return(new FileSystem.Configuration.MediaConfiguration(ComponentType.GameMedia, parameters)); }
public IComponentConfiguration CreateConfiguration( ComponentParameters parameters ) { return null; }
public IComponentInstance CreateInstance( IEmulationInstance emulator, ComponentParameters parameters ) { return new Noxa.Emulation.Psp.Bios.ManagedHLE.Bios( emulator, parameters ); }
public IComponentConfiguration CreateConfiguration( ComponentParameters parameters ) { return new FileSystem.Configuration.MediaConfiguration( ComponentType.UserMedia, parameters ); }
public IComponentInstance CreateInstance( IEmulationInstance emulator, ComponentParameters parameters ) { string path = parameters.GetValue<string>( MediaConfiguration.PathSetting, null ); if( ( path == null ) || ( path.Length == 0 ) || ( Directory.Exists( path ) == false ) ) { // Error! return null; } bool readOnly = parameters.GetValue<bool>( MediaConfiguration.ReadOnlySetting, false ); long capacity = parameters.GetValue<long>( MediaConfiguration.CapacitySetting, ( long )1024 * 1024 * 1024 * 2 ); return new MemoryStickDevice( emulator, parameters, path, readOnly, capacity ); }
public IComponentInstance CreateInstance( IEmulationInstance emulator, ComponentParameters parameters ) { string path = parameters.GetValue<string>( MediaConfiguration.PathSetting, null ); if( ( path == null ) || ( path.Length == 0 ) || ( Directory.Exists( path ) == false ) ) { // Error! return null; } long capacity = parameters.GetValue<long>( MediaConfiguration.CapacitySetting, 1024 * 1024 * 1800 ); return new UmdDevice( emulator, parameters, path, capacity ); }
public IComponentInstance CreateInstance(IEmulationInstance emulator, ComponentParameters parameters) { return(new Noxa.Emulation.Psp.Bios.ManagedHLE.Bios(emulator, parameters)); }
public void RestoreDefaults() { _params = _defaults.Clone(); this.Fill(); }
public Cpu( IEmulationInstance emulator, ComponentParameters parameters ) { Debug.Assert( emulator != null ); Debug.Assert( parameters != null ); _caps = new CpuCapabilities(); _stats = new RuntimeStatistics(); _emulator = emulator; _params = parameters; _lastSyscall = -1; _syscalls = new BiosFunction[ 1024 ]; #if STATS _timer = new PerformanceTimer(); _timeSinceLastIpsPrint = 0.0; #endif _clock = new Clock(); _memory = new Memory(); // Order matters as the lookup is linear and stupid... should be changed somehow //_memory->DefineSegment( MemoryType::PhysicalMemory, "Main Memory", 0x08000000, 0x01FFFFFF ); //_memory->DefineSegment( MemoryType::PhysicalMemory, "Hardware Vectors", 0x1FC00000, 0x000FFFFF ); //_memory->DefineSegment( MemoryType::PhysicalMemory, "Scratchpad", 0x00010000, 0x00003FFF ); //_memory->DefineSegment( MemoryType::PhysicalMemory, "Frame Buffer", 0x04000000, 0x001FFFFF ); //_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 1", 0x1C000000, 0x03BFFFFF ); //_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 2", 0x1FD00000, 0x002FFFFF ); _core0 = new Core( this, 0, "Allegrex", CoreAttributes.HasCp2 ); _core1 = new Core( this, 1, "Media Engine", CoreAttributes.Default ); _codeCache = new CodeCache(); _context = new GenerationContext(); _context.Cpu = this; _context.Core0 = _core0; _context.Memory = _memory; _executionMode = ExecutionMode.Run; _firstExecute = true; }
public IComponentInstance CreateInstance( IEmulationInstance emulator, ComponentParameters parameters ) { string path = parameters.GetValue<string>( MediaConfiguration.PathSetting, null ); if( ( path == null ) || ( path.Length == 0 ) || ( File.Exists( path ) == false ) ) { // Path not found - this is just a generic UMD if( ( path != null ) && ( path.Length > 0 ) ) Log.WriteLine( Verbosity.Critical, Feature.Media, "IsoFileSystem: unable to create instance, path {0} not found", path ); return new UmdDevice( emulator, parameters ); } return new UmdDevice( emulator, parameters, path ); }
public IList<ComponentIssue> Test(ComponentParameters parameters) { // TODO: test to make sure required OpenGL extensions are present return new List<ComponentIssue>(); }
public IComponentConfiguration CreateConfiguration( ComponentParameters parameters ) { return new Iso.Configuration.MediaConfiguration( parameters ); }