@{ /****************************************************************************** // MARECHAI: Master repository of computing history artifacts information // ---------------------------------------------------------------------------- // // Filename : View.razor // Author(s) : Natalia Portillo // // --[ Description ] ---------------------------------------------------------- // // Shows a machine information // // --[ License ] -------------------------------------------------------------- // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // ---------------------------------------------------------------------------- // Copyright © 2003-2020 Natalia Portillo *******************************************************************************/ // TODO: Resolutions } @page "/machine/{Id:int}" @using Marechai.Database @inherits OwningComponentBase @inject IStringLocalizer L @inject IWebHostEnvironment Host @if (!_loaded) {

@L["Loading..."]

return; } @if (_machine is null) {

@L["Machine not found in database"]

return; }

@if (_machine.CompanyLogo != null && File.Exists(Path.Combine(Host.WebRootPath, "assets/logos", _machine.CompanyLogo + ".svg"))) { }

@{ var counter = 0; } @if (_machine.Introduced.HasValue && _machine.Introduced.Value.Year == 1000) {
PROTOTYPE
} @_machine.CompanyName @_machine.Name @if (_machine.Introduced.HasValue && _machine.Introduced.Value.Year != 1000) { } @if (_machine.FamilyId != null) { } @if (_machine.Model != null) { } @if (_machine.Processors.Count > 0) { } @if (_machine.Memory != null && _machine.Memory.Count > 0) { } @if (_machine.Gpus.Count > 0) { } @if (_machine.SoundSynthetizers.Count > 0) { } @if (_machine.Storage.Count > 0) { }
Introduction date
@_machine.Introduced.Value.ToLongDateString()
Family
@_machine.FamilyName
Model
@_machine.Model
Processors
@{ counter = 0; } @foreach (var processor in _machine.Processors) { counter++; }
@if (processor.Speed > 0) { @(processor.GprSize > 0 ? $"{processor.Name} @ {processor.Speed}Mhz ({processor.GprSize} bits)" : $"{processor.Name} @ {processor.Speed}Mhz") } else { @($"{processor.Name}") }
@if (processor.ModelCode != null && processor.ModelCode != processor.Name) { } @if (processor.Introduced != null) { } @if (processor.InstructionSet != null) { } @if (processor.Speed > 0) { } @if (processor.Gprs > 0 || processor.Fprs > 0 || processor.SimdRegisters > 0) { } @if (processor.Cores > 1) { } @if (processor.ThreadsPerCore > 1) { } @if (processor.DataBus > 0 || processor.AddrBus > 0) { } @if (processor.L1Instruction > 0 || processor.L1Data > 0 || processor.L2 > 0 || processor.L2 > 0) { } @if (processor.Package != null) { } @if (processor.Process != null || processor.ProcessNm > 0) { } @if (processor.DieSize > 0) { } @if (processor.Transistors > 0) { }
Model @processor.ModelCode
Manufacturer @processor.CompanyName
Introduction date @($"{processor.Introduced:yyyy}")
Instruction set @processor.InstructionSet
Nominal speed @processor.Speed MHz
Registers @if (processor.Gprs > 0) { } @if (processor.Fprs > 0) { } @if (processor.SimdRegisters > 0) { }
@processor.Gprs general purpose registers of @processor.GprSize bits @if (processor.FprSize > 0 && processor.Fprs == 0) { @($", that can be used as floating point registers of {processor.FprSize}") } @if (processor.SimdSize > 0 && processor.SimdRegisters == 0) { @($", that can be used as SIMD registers of {processor.FprSize}") }
@processor.Fprs floating-point registers of @processor.FprSize bits @if (processor.SimdSize > 0 && processor.SimdRegisters == 0) { @($", that can be used as SIMD registers of {processor.FprSize}") }
@processor.SimdRegisters SIMDregisters of @processor.SimdSize bits
Multi-core @processor.Cores cores
SMT @processor.ThreadsPerCore threads @if (processor.Cores > 1) { @(" per core") }
Bus @if (processor.DataBus > 0) { } @if (processor.AddrBus > 0) { }
@processor.DataBus-bit data
@processor.AddrBus-bit address
Cache @if (processor.L1Instruction > 0) { } @if (processor.L1Data > 0) { } @if (processor.L2 > 0) { } @if (processor.L3 > 0) { }
@(processor.L1Data < 0 ? $"{processor.L1Instruction}KiB combined instruction-data L1" : $"{processor.L1Instruction}KiB instruction L1")
@($"{processor.L1Data}KiB data L1")
@($"{processor.L2}KiB L2")
@($"{processor.L3}KiB L3")
Package @processor.Package
Manufacturing process @if (processor.Process != null && processor.ProcessNm > 0) { @processor.Process @("@") @(processor.ProcessNm > 100 ? $"{processor.ProcessNm / 100}µm" : $"{processor.ProcessNm}nm") } else if (processor.ProcessNm > 0) { @(processor.ProcessNm > 100 ? $"{processor.ProcessNm / 100}µm" : $"{processor.ProcessNm}nm") } else { @processor.Process }
Die size @processor.DieSize mm²
Transistors @processor.Transistors
Memory
@foreach (var memory in _machine.Memory) { string memValue; if (memory.Size > 1073741824) { memValue = $"{memory.Size / 1073741824} GiB"; } else if (memory.Size > 1048576) { memValue = $"{memory.Size / 1048576} MiB"; } else if (memory.Size > 1024) { memValue = $"{memory.Size / 1024} KiB"; } else if (memory.Size > 0) { memValue = $"{memory.Size} bytes"; } else { memValue = "Unknown size"; } string speedValue; if (memory.Speed > 1000000000) { speedValue = $"{memory.Speed / 1000000000} GHz"; } else if (memory.Speed > 1000000) { speedValue = $"{memory.Speed / 1000000} MHz"; } else if (memory.Speed > 1000) { speedValue = $"{memory.Speed / 1000} KHz"; } else if (memory.Speed > 0) { speedValue = $"{memory.Speed} Hz"; } else { speedValue = "unknown speed"; } }
@memValue of @memory.Usage memory (@memory.Type at @speedValue)
Graphics processing units
@{ counter = 0; } @foreach (var gpu in _machine.Gpus) { if (gpu.Id == -2) { } else { } counter++; }
Framebuffer
This computer directly draws pixels from software to a memory region that's converted to video output by a DAC or similar without using any specific graphics processing unit.
@($"{gpu.Name}")
@if (gpu.ModelCode != null && gpu.ModelCode != gpu.Name) { } @if (gpu.Introduced != null) { } @if (gpu.Package != null) { } @if (gpu.Process != null || gpu.ProcessNm > 0) { } @if (gpu.DieSize > 0) { } @if (gpu.Transistors > 0) { }
Model @gpu.ModelCode
Manufacturer @gpu.Company
Introduction date @($"{gpu.Introduced:yyyy}")
Package @gpu.Package
Manufacturing process @if (gpu.Process != null && gpu.ProcessNm > 0) { @gpu.Process @("@") @(gpu.ProcessNm > 100 ? $"{gpu.ProcessNm / 100}µm" : $"{gpu.ProcessNm}nm") } else if (gpu.ProcessNm > 0) { @(gpu.ProcessNm > 100 ? $"{gpu.ProcessNm / 100}µm" : $"{gpu.ProcessNm}nm") } else { @gpu.Process }
Die size @gpu.DieSize mm²
Transistors @gpu.Transistors
Sound synthetizers
@{ counter = 0; } @foreach (var sound in _machine.SoundSynthetizers) { @if (sound.Id == -2) { } else { } counter++; }
Software
This computer directly sends data to a DAC or similar connected to the audio output.
@($"{sound.Name}")
@if (sound.ModelCode != null && sound.ModelCode != sound.Name) { } @if (sound.CompanyId != null) { } @if (sound.Introduced != null) { } @if (sound.Voices != 0 || sound.SquareWave != 0 || sound.WhiteNoise != 0) { } @if (sound.Depth != 0 || sound.Frequency > 0) { } @if (sound.Type != 0) { }
Model @sound.ModelCode
Manufacturer @sound.CompanyName
Introduction date @($"{sound.Introduced:yyyy}")
Generators @if (sound.Voices != 0) { } @if (sound.SquareWave != 0) { } @if (sound.WhiteNoise != 0) { }
@sound.Voices voices
@sound.SquareWave square wave
@sound.WhiteNoise white noise
Sample rate @if (sound.Depth != 0 && sound.Frequency > 0) { } else if (sound.Depth != 0) { } else { }
@sound.Depth bits at @(sound.Frequency > 1000 ? $"{sound.Frequency / 1000}KHz" : $"{sound.Frequency}Hz")
@sound.Depth bits
@(sound.Frequency > 1000 ? $"{sound.Frequency / 1000}KHz" : $"{sound.Frequency}Hz")
Synthetizer type @sound.Type
Storage
@foreach (var storage in _machine.Storage) { string capString = null; if (storage.Capacity != 0) { if (storage.Type == StorageType.CompactCassette) { capString = $"{storage.Capacity} bps"; } else { if (storage.Capacity > 1073741824) { capString = $"{storage.Capacity / 1073741824} GiB"; } else if (storage.Capacity > 1048576) { capString = $"{storage.Capacity / 1048576} MiB"; } else if (storage.Capacity > 1024) { capString = $"{storage.Capacity / 1024} KiB"; } else if (storage.Capacity > 0) { capString = $"{storage.Capacity} bytes"; } else { capString = null; } } } @if (storage.Interface != StorageInterface.Unknown) { if (storage.Type == StorageType.Empty) { } else { if (capString != null) { } else { } } } else { if (capString != null) { } else { } } }
Available @storage.Interface interface.@storage.Type connected thru a @storage.Interface interface with a nominal capacity of @capString@storage.Type connected thru a @storage.Interface interface@storage.Type with a nominal capacity of @capString@storage.Type
@if (File.Exists(Path.Combine(Host.WebRootPath, "assets/photos/computers", _machine.Id + ".jpg"))) { } @code { [Parameter] public int Id { get; set; } MachineViewModel _machine; bool _loaded; protected override async Task OnInitializedAsync() { _machine = await Service.GetMachine(Id); _loaded = true; } }