@{ /****************************************************************************** // Canary Islands Computer Museum Website // ---------------------------------------------------------------------------- // // Filename : Index.cshtml // Author(s) : Natalia Portillo // // --[ Description ] ---------------------------------------------------------- // // Index page (and news) // // --[ 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-2018 Natalia Portillo *******************************************************************************/ // TODO: Resolutions ViewData["Title"] = "Computer"; } @using System.IO @using Cicm.Database @using Cicm.Database.Models @model Cicm.Database.Models.Machine

@if(Model.Company.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.Company.LastLogo.Guid + ".svg"))) { }

@{ int counter = 0; } @if(Model.Introduced.HasValue && Model.Introduced.Value.Year == 1000) {
PROTOTYPE
} @Model.Company.Name @Model.Name @if(Model.Introduced.HasValue && Model.Introduced.Value.Year != 1000) { } @if(Model.Family != null) { } @if(Model.Model != null) { } @if(Model.Processors.Count > 0) { } @if(Model.Memory != null && Model.Memory.Count > 0) { } @if(Model.Gpus.Count > 0) { } @if(Model.Sound.Count > 0) { } @if(Model.Storage.Count > 0) { }
Introduction date
@Model.Introduced.Value.ToLongDateString()
Family
@Model.Family.Name
Model
@Model.Model
Processors
@{ counter = 0; } @foreach(ProcessorsByMachine processorByMachine in Model.Processors) { counter++; }
@if(processorByMachine.Speed > 0) { @(processorByMachine.Processor.GprSize > 0 ? $"{processorByMachine.Processor.Name} @ {processorByMachine.Speed}Mhz ({processorByMachine.Processor.GprSize} bits)" : $"{processorByMachine.Processor.Name} @ {processorByMachine.Speed}Mhz") } else { @($"{processorByMachine.Processor.Name}") }
@if(processorByMachine.Processor.ModelCode != null && processorByMachine.Processor.ModelCode != processorByMachine.Processor.Name) { } @if(processorByMachine.Processor.Introduced != DateTime.MinValue) { } @if(processorByMachine.Processor.InstructionSet != null) { } @if(processorByMachine.Processor.Speed > 0) { } @if(processorByMachine.Processor.Gprs > 0 || processorByMachine.Processor.Fprs > 0 || processorByMachine.Processor.SimdRegisters > 0) { } @if(processorByMachine.Processor.Cores > 1) { } @if(processorByMachine.Processor.Cores > 1) { } @if(processorByMachine.Processor.DataBus > 0 || processorByMachine.Processor.AddrBus > 0) { } @if(processorByMachine.Processor.L1Instruction > 0 || processorByMachine.Processor.L1Data > 0 || processorByMachine.Processor.L2 > 0 || processorByMachine.Processor.L2 > 0) { } @if(processorByMachine.Processor.Package != null) { } @if(processorByMachine.Processor.Process != null || processorByMachine.Processor.ProcessNm > 0) { } @if(processorByMachine.Processor.DieSize > 0) { } @if(processorByMachine.Processor.Transistors > 0) { }
Model @processorByMachine.Processor.ModelCode
Manufacturer @processorByMachine.Processor.Company.Name
Introduction date @($"{processorByMachine.Processor.Introduced:yyyy}")
Instruction set @processorByMachine.Processor.InstructionSet.Name
Nominal speed @processorByMachine.Processor.Speed MHz
Registers @if(processorByMachine.Processor.Gprs > 0) { } @if(processorByMachine.Processor.Fprs > 0) { } @if(processorByMachine.Processor.SimdRegisters > 0) { }
@processorByMachine.Processor.Gprs general purpose registers of @processorByMachine.Processor.GprSize bits @if(processorByMachine.Processor.FprSize > 0 && processorByMachine.Processor.Fprs == 0) { @($", that can be used as floating point registers of {processorByMachine.Processor.FprSize}") } @if(processorByMachine.Processor.SimdSize > 0 && processorByMachine.Processor.SimdRegisters == 0) { @($", that can be used as SIMD registers of {processorByMachine.Processor.FprSize}") }
@processorByMachine.Processor.Fprs floating-point registers of @processorByMachine.Processor.FprSize bits @if(processorByMachine.Processor.SimdSize > 0 && processorByMachine.Processor.SimdRegisters == 0) { @($", that can be used as SIMD registers of {processorByMachine.Processor.FprSize}") }
@processorByMachine.Processor.SimdRegisters SIMDregisters of @processorByMachine.Processor.SimdSize bits
Multi-core @processorByMachine.Processor.Cores cores
SMT @processorByMachine.Processor.ThreadsPerCore threads @if(processorByMachine.Processor.Cores > 1) { @(" per core") }
Bus @if(processorByMachine.Processor.DataBus > 0) { } @if(processorByMachine.Processor.AddrBus > 0) { }
@processorByMachine.Processor.DataBus-bit data
@processorByMachine.Processor.AddrBus-bit address
Cache @if(processorByMachine.Processor.L1Instruction > 0) { } @if(processorByMachine.Processor.L1Data > 0) { } @if(processorByMachine.Processor.L2 > 0) { } @if(processorByMachine.Processor.L3 > 0) { }
@(processorByMachine.Processor.L1Data < 0 ? $"{processorByMachine.Processor.L1Instruction}KiB combined instruction-data L1" : $"{processorByMachine.Processor.L1Instruction}KiB instruction L1")
@($"{processorByMachine.Processor.L1Data}KiB data L1")
@($"{processorByMachine.Processor.L2}KiB L2")
@($"{processorByMachine.Processor.L3}KiB L3")
Package @processorByMachine.Processor.Package
Manufacturing process @if(processorByMachine.Processor.Process != null && processorByMachine.Processor.ProcessNm > 0) { @processorByMachine.Processor.Process @("@") @(processorByMachine.Processor.ProcessNm > 100 ? $"{processorByMachine.Processor.ProcessNm / 100}µm" : $"{processorByMachine.Processor.ProcessNm}nm") } else if(processorByMachine.Processor.ProcessNm > 0) { @(processorByMachine.Processor.ProcessNm > 100 ? $"{processorByMachine.Processor.ProcessNm / 100}µm" : $"{processorByMachine.Processor.ProcessNm}nm") } else { @processorByMachine.Processor.Process }
Die size @processorByMachine.Processor.DieSize mm²
Transistors @processorByMachine.Processor.Transistors
Memory
@foreach(MemoryByMachine memory in Model.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(GpusByMachine gpuByMachine in Model.Gpus) { if(gpuByMachine.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.
@($"{gpuByMachine.Gpu.Name}")
@if(gpuByMachine.Gpu.ModelCode != null && gpuByMachine.Gpu.ModelCode != gpuByMachine.Gpu.Name) { } @if(gpuByMachine.Gpu.Introduced != DateTime.MinValue) { } @if(gpuByMachine.Gpu.Package != null) { } @if(gpuByMachine.Gpu.Process != null || gpuByMachine.Gpu.ProcessNm > 0) { } @if(gpuByMachine.Gpu.DieSize > 0) { } @if(gpuByMachine.Gpu.Transistors > 0) { }
Model @gpuByMachine.Gpu.ModelCode
Manufacturer @gpuByMachine.Gpu.Company.Name
Introduction date @($"{gpuByMachine.Gpu.Introduced:yyyy}")
Package @gpuByMachine.Gpu.Package
Manufacturing process @if(gpuByMachine.Gpu.Process != null && gpuByMachine.Gpu.ProcessNm > 0) { @gpuByMachine.Gpu.Process @("@") @(gpuByMachine.Gpu.ProcessNm > 100 ? $"{gpuByMachine.Gpu.ProcessNm / 100}µm" : $"{gpuByMachine.Gpu.ProcessNm}nm") } else if(gpuByMachine.Gpu.ProcessNm > 0) { @(gpuByMachine.Gpu.ProcessNm > 100 ? $"{gpuByMachine.Gpu.ProcessNm / 100}µm" : $"{gpuByMachine.Gpu.ProcessNm}nm") } else { @gpuByMachine.Gpu.Process }
Die size @gpuByMachine.Gpu.DieSize mm²
Transistors @gpuByMachine.Gpu.Transistors
Sound synthetizers
@{ counter = 0; } @foreach(SoundByMachine soundByMachine in Model.Sound) { @if(soundByMachine.SoundSynth.Id == -2) { } else { } counter++; }
Software
This computer directly sends data to a DAC or similar connected to the audio output.
@($"{soundByMachine.SoundSynth.Name}")
@if(soundByMachine.SoundSynth.ModelCode != null && soundByMachine.SoundSynth.ModelCode != soundByMachine.SoundSynth.Name) { } @if(soundByMachine.SoundSynth.Company != null) { } @if(soundByMachine.SoundSynth.Introduced != DateTime.MinValue) { } @if(soundByMachine.SoundSynth.Voices != 0 || soundByMachine.SoundSynth.SquareWave != 0 || soundByMachine.SoundSynth.WhiteNoise != 0) { } @if(soundByMachine.SoundSynth.Depth != 0 || soundByMachine.SoundSynth.Frequency > 0) { } @if(soundByMachine.SoundSynth.Type != 0) { }
Model @soundByMachine.SoundSynth.ModelCode
Manufacturer @soundByMachine.SoundSynth.Company.Name
Introduction date @($"{soundByMachine.SoundSynth.Introduced:yyyy}")
Generators @if(soundByMachine.SoundSynth.Voices != 0) { } @if(soundByMachine.SoundSynth.SquareWave != 0) { } @if(soundByMachine.SoundSynth.WhiteNoise != 0) { }
@soundByMachine.SoundSynth.Voices voices
@soundByMachine.SoundSynth.SquareWave square wave
@soundByMachine.SoundSynth.WhiteNoise white noise
Sample rate @if(soundByMachine.SoundSynth.Depth != 0 && soundByMachine.SoundSynth.Frequency > 0) { } else if(soundByMachine.SoundSynth.Depth != 0) { } else { }
@soundByMachine.SoundSynth.Depth bits at @(soundByMachine.SoundSynth.Frequency > 1000 ? $"{soundByMachine.SoundSynth.Frequency / 1000}KHz" : $"{soundByMachine.SoundSynth.Frequency}Hz")
@soundByMachine.SoundSynth.Depth bits
@(soundByMachine.SoundSynth.Frequency > 1000 ? $"{soundByMachine.SoundSynth.Frequency / 1000}KHz" : $"{soundByMachine.SoundSynth.Frequency}Hz")
Synthetizer type @soundByMachine.SoundSynth.Type
Storage
@foreach(StorageByMachine storage in Model.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(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/photos/computers", Model.Id + ".jpg"))) { }