Files
marechai/cicm_web/Views/Machine/View.cshtml

719 lines
34 KiB
Plaintext
Raw Normal View History

2018-04-14 07:13:11 +01:00
@{
/******************************************************************************
// Canary Islands Computer Museum Website
// ----------------------------------------------------------------------------
//
// Filename : Index.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ 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 <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2018 Natalia Portillo
*******************************************************************************/
// TODO: Resolutions
2018-04-14 07:13:11 +01:00
ViewData["Title"] = "Computer";
}
@using System.IO
@using Cicm.Database.Schemas
@using MemoryByMachine = cicm_web.Models.MemoryByMachine
@using StorageByMachine = cicm_web.Models.StorageByMachine
@model cicm_web.Models.Machine
2018-04-14 07:13:11 +01:00
<p align=center>
@if(Model.Company.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.Company.LastLogo.Guid + ".svg")))
{
<picture>
<source type="image/svg+xml"
srcset="/assets/logos/@(Model.Company.LastLogo.Guid).svg">
<source type="image/webp"
srcset="/assets/logos/webp/1x/@(Model.Company.LastLogo.Guid).webp,
/assets/logos/webp/1x/@(Model.Company.LastLogo.Guid).webp 2x,
/assets/logos/webp/1x/@(Model.Company.LastLogo.Guid).webp 3x">
<img srcset="/assets/logos/png/1x/@(Model.Company.LastLogo.Guid).png,
/assets/logos/png/1x/@(Model.Company.LastLogo.Guid).png 2x,
/assets/logos/png/1x/@(Model.Company.LastLogo.Guid).webp 3x"
src="/assets/logos/png/1x@(Model.Company.LastLogo.Guid).png")
alt=""
height="auto"
width="auto"
style="max-height: 256px; max-width: 256px" />
</picture>
}
</p>
2018-04-14 07:13:11 +01:00
@if(Model.Year == 1000)
{
<b>
<div style="text-align: center;">PROTOTYPE</div>
2018-04-14 07:13:11 +01:00
</b>
}
<b>
<a asp-controller=Company
asp-action=View
asp-route-id=@Model.Company.Id>
@Model.Company.Name</a> @Model.Model</b>
<table width=100%>
2018-04-14 07:13:11 +01:00
@if(Model.Year != 1000)
{
<tr>
<th scope=row
width="37%">
<div align=right>
Year
</div>
</th>
<td width="63%">
<a asp-controller="Computer"
asp-action="ByYear"
asp-route-id="@Model.Year">
@Model.Year</a>
2018-04-14 07:13:11 +01:00
</td>
</tr>
}
@if(Model.Processors != null && Model.Processors.Length > 0)
2018-04-14 07:13:11 +01:00
{
<tr>
<th scope=row>
<div align=right>
Processors
</div>
</th>
<td>
<table>
@for(int i = 0; i < Model.Processors.Length; i++)
{
if(Model.Processors[i] != null)
{
<tr>
<td>
@if(Model.Processors[i].Speed > 0) { @(Model.Processors[i].Processor.GprSize > 0 ? $"{Model.Processors[i].Processor.Name} @ {Model.Processors[i].Speed}Mhz ({Model.Processors[i].Processor.GprSize} bits)" : $"{Model.Processors[i].Processor.Name} @ {Model.Processors[i].Speed}Mhz") }
else
{ @($"{Model.Processors[i].Processor.Name}") }
<a aria-controls="@($"cpuInfo{i}")"
aria-expanded="false"
class="btn btn-link"
data-toggle="collapse"
href="@($"#cpuInfo{i}")">
+info
</a>
<div class="collapse"
id="@($"cpuInfo{i}")">
<div class="card card-body">
<table>
@if(Model.Processors[i].Processor.ModelCode != null && Model.Processors[i].Processor.ModelCode != Model.Processors[i].Processor.Name)
{
<tr>
<td>Model</td>
<td>@Model.Processors[i].Processor.ModelCode</td>
</tr>
}
<tr>
<td>Manufacturer</td>
<td>
<a asp-controller=Company
asp-action=View
asp-route-id=@Model.Processors[i].Processor.Company.Id>
@Model.Processors[i].Processor.Company.Name</a>
</td>
</tr>
@if(Model.Processors[i].Processor.Introduced != DateTime.MinValue)
{
<tr>
<td>Introduction date</td>
<td>@($"{Model.Processors[i].Processor.Introduced:yyyy}")</td>
</tr>
}
@if(Model.Processors[i].Processor.InstructionSet != null)
{
<tr>
<td>Instruction set</td>
<td>@Model.Processors[i].Processor.InstructionSet.Name</td>
</tr>
}
@if(Model.Processors[i].Processor.Speed > 0)
{
<tr>
<td>Nominal speed</td>
<td>@Model.Processors[i].Processor.Speed MHz</td>
</tr>
}
@if(Model.Processors[i].Processor.Gpr > 0 || Model.Processors[i].Processor.Fpr > 0 || Model.Processors[i].Processor.Simd > 0)
{
<tr>
<td>Registers</td>
<td>
<table>
@if(Model.Processors[i].Processor.Gpr > 0)
{
<tr>
<td>
@Model.Processors[i].Processor.Gpr general purpose registers of @Model.Processors[i].Processor.GprSize bits
@if(Model.Processors[i].Processor.FprSize > 0 && Model.Processors[i].Processor.Fpr == 0) { @($", that can be used as floating point registers of {Model.Processors[i].Processor.FprSize}") }
@if(Model.Processors[i].Processor.SimdSize > 0 && Model.Processors[i].Processor.Simd == 0) { @($", that can be used as SIMD registers of {Model.Processors[i].Processor.FprSize}") }
</td>
</tr>
}
@if(Model.Processors[i].Processor.Fpr > 0)
{
<tr>
<td>
@Model.Processors[i].Processor.Fpr floating-point registers of @Model.Processors[i].Processor.FprSize bits
@if(Model.Processors[i].Processor.SimdSize > 0 && Model.Processors[i].Processor.Simd == 0) { @($", that can be used as SIMD registers of {Model.Processors[i].Processor.FprSize}") }
</td>
</tr>
}
@if(Model.Processors[i].Processor.Simd > 0)
{
<tr>
<td>
@Model.Processors[i].Processor.Simd <abbr title="Single instruction, multiple data">SIMD</abbr>registers of @Model.Processors[i].Processor.SimdSize bits
</td>
</tr>
}
</table>
</td>
</tr>
}
@if(Model.Processors[i].Processor.Cores > 1)
{
<tr>
<td>Multi-core</td>
<td>@Model.Processors[i].Processor.Cores cores</td>
</tr>
}
@if(Model.Processors[i].Processor.Cores > 1)
{
<tr>
<td>
<abbr title="Simultanoeus multithreading">SMT</abbr>
</td>
<td>
@Model.Processors[i].Processor.ThreadsPerCore threads
@if(Model.Processors[i].Processor.Cores > 1) { @(" per core") }
</td>
</tr>
}
@if(Model.Processors[i].Processor.DataBus > 0 || Model.Processors[i].Processor.AddressBus > 0)
{
<tr>
<td>Bus</td>
<td>
<table>
@if(Model.Processors[i].Processor.DataBus > 0)
{
<tr>
<td>
@Model.Processors[i].Processor.DataBus-bit data
</td>
</tr>
}
@if(Model.Processors[i].Processor.AddressBus > 0)
{
<tr>
<td>
@Model.Processors[i].Processor.AddressBus-bit address
</td>
</tr>
}
</table>
</td>
</tr>
}
@if(Model.Processors[i].Processor.L1Instruction > 0 || Model.Processors[i].Processor.L1Data > 0 || Model.Processors[i].Processor.L2 > 0 || Model.Processors[i].Processor.L2 > 0)
{
<tr>
<td>Cache</td>
<td>
<table>
@if(Model.Processors[i].Processor.L1Instruction > 0)
{
<tr>
<td>
@(Model.Processors[i].Processor.L1Data < 0 ? $"{Model.Processors[i].Processor.L1Instruction}KiB combined instruction-data L1" : $"{Model.Processors[i].Processor.L1Instruction}KiB instruction L1")
</td>
</tr>
}
@if(Model.Processors[i].Processor.L1Data > 0)
{
<tr>
<td>
@($"{Model.Processors[i].Processor.L1Data}KiB data L1")
</td>
</tr>
}
@if(Model.Processors[i].Processor.L2 > 0)
{
<tr>
<td>
@($"{Model.Processors[i].Processor.L2}KiB L2")
</td>
</tr>
}
@if(Model.Processors[i].Processor.L3 > 0)
{
<tr>
<td>
@($"{Model.Processors[i].Processor.L3}KiB L3")
</td>
</tr>
}
</table>
</td>
</tr>
}
@if(Model.Processors[i].Processor.Package != null)
{
<tr>
<td>Package</td>
<td>@Model.Processors[i].Processor.Package</td>
</tr>
}
@if(Model.Processors[i].Processor.Process != null || Model.Processors[i].Processor.ProcessNm > 0)
{
<tr>
<td>Manufacturing process</td>
<td>
@if(Model.Processors[i].Processor.Process != null && Model.Processors[i].Processor.ProcessNm > 0)
{
@Model.Processors[i].Processor.Process
@("@")
@(Model.Processors[i].Processor.ProcessNm > 100 ? $"{Model.Processors[i].Processor.ProcessNm / 100}µm" : $"{Model.Processors[i].Processor.ProcessNm}nm")
}
else if(Model.Processors[i].Processor.ProcessNm > 0) { @(Model.Processors[i].Processor.ProcessNm > 100 ? $"{Model.Processors[i].Processor.ProcessNm / 100}µm" : $"{Model.Processors[i].Processor.ProcessNm}nm") }
else
{ @Model.Processors[i].Processor.Process }
</td>
</tr>
}
@if(Model.Processors[i].Processor.DieSize > 0)
{
<tr>
<td>Die size</td>
<td>@Model.Processors[i].Processor.DieSize mm&sup2;</td>
</tr>
}
@if(Model.Processors[i].Processor.Transistors > 0)
{
<tr>
<td>Transistors</td>
<td>@Model.Processors[i].Processor.Transistors</td>
</tr>
}
</table>
</div>
</div>
</td>
</tr>
}
}
</table>
</td>
2018-04-14 07:13:11 +01:00
</tr>
}
@if(Model.Memories != null && Model.Memories.Length > 0)
{
<tr>
<th scope=row>
<div align=right>
Memory
</div>
</th>
<td>
<table>
@foreach(MemoryByMachine memory in Model.Memories)
{
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"; }
<tr>
<td>@memValue of @memory.Usage memory (@memory.Type at @speedValue)</td>
</tr>
}
</table>
</td>
</tr>
}
@if(Model.Gpus != null && Model.Gpus.Length > 0)
2018-04-27 15:29:53 +01:00
{
<tr>
<th scope=row>
<div align=right>
Graphics processing units
2018-04-27 15:29:53 +01:00
</div>
</th>
<td>
<table>
@for(int i = 0; i < Model.Gpus.Length; i++)
{
if(Model.Gpus[i] != null)
{
if(Model.Gpus[i].Gpu.Id == -2)
{
<td>
Framebuffer
<a aria-controls="@($"gpuInfo{i}")"
aria-expanded="false"
class="btn btn-link"
data-toggle="collapse"
href="@($"#gpuInfo{i}")">
+info
</a>
<div class="collapse"
id="@($"gpuInfo{i}")">
<div class="card card-body">
This computer directly draws pixels from software to a memory region that's converted to video output by a <abbr title="Digital to Analog Converter">DAC</abbr> or similar without using any specific graphics processing unit.
</div>
</div>
</td>
}
else
{
<td>
@($"{Model.Gpus[i].Gpu.Name}")
<a aria-controls="@($"gpuInfo{i}")"
aria-expanded="false"
class="btn btn-link"
data-toggle="collapse"
href="@($"#gpuInfo{i}")">
+info
</a>
<div class="collapse"
id="@($"gpuInfo{i}")">
<div class="card card-body">
<table>
@if(Model.Gpus[i].Gpu.ModelCode != null && Model.Gpus[i].Gpu.ModelCode != Model.Gpus[i].Gpu.Name)
2018-04-27 15:29:53 +01:00
{
<tr>
<td>Model</td>
<td>@Model.Gpus[i].Gpu.ModelCode</td>
</tr>
2018-04-27 15:29:53 +01:00
}
<tr>
<td>Manufacturer</td>
<td>
<a asp-controller=Company
asp-action=View
asp-route-id=@Model.Gpus[i].Gpu.Company.Id>
@Model.Gpus[i].Gpu.Company.Name</a>
</td>
</tr>
@if(Model.Gpus[i].Gpu.Introduced != DateTime.MinValue)
{
<tr>
<td>Introduction date</td>
<td>@($"{Model.Gpus[i].Gpu.Introduced:yyyy}")</td>
</tr>
}
@if(Model.Gpus[i].Gpu.Package != null)
{
<tr>
<td>Package</td>
<td>@Model.Gpus[i].Gpu.Package</td>
</tr>
}
@if(Model.Gpus[i].Gpu.Process != null || Model.Gpus[i].Gpu.ProcessNm > 0)
{
<tr>
<td>Manufacturing process</td>
<td>
@if(Model.Gpus[i].Gpu.Process != null && Model.Gpus[i].Gpu.ProcessNm > 0)
{
@Model.Gpus[i].Gpu.Process
@("@")
@(Model.Gpus[i].Gpu.ProcessNm > 100 ? $"{Model.Gpus[i].Gpu.ProcessNm / 100}µm" : $"{Model.Gpus[i].Gpu.ProcessNm}nm")
}
else if(Model.Gpus[i].Gpu.ProcessNm > 0) { @(Model.Gpus[i].Gpu.ProcessNm > 100 ? $"{Model.Gpus[i].Gpu.ProcessNm / 100}µm" : $"{Model.Gpus[i].Gpu.ProcessNm}nm") }
else
{ @Model.Gpus[i].Gpu.Process }
</td>
</tr>
}
@if(Model.Gpus[i].Gpu.DieSize > 0)
{
<tr>
<td>Die size</td>
<td>@Model.Gpus[i].Gpu.DieSize mm&sup2;</td>
</tr>
}
@if(Model.Gpus[i].Gpu.Transistors > 0)
{
<tr>
<td>Transistors</td>
<td>@Model.Gpus[i].Gpu.Transistors</td>
</tr>
}
</table>
</div>
</div>
</td>
}
}
else
{
<td>Unknown data</td>
}
}
</table>
</td>
2018-04-27 15:29:53 +01:00
</tr>
}
@if(Model.SoundSynths != null && Model.SoundSynths.Length > 0)
{
<tr>
<th scope=row>
<div align=right>
Sound synthetizers
</div>
</th>
<td>
<table>
@for(int i = 0; i < Model.SoundSynths.Length; i++)
{
if(Model.SoundSynths[i] != null)
{
if(Model.SoundSynths[i].SoundSynth.Id == -2)
{
<td>
Software
<a aria-controls="@($"synthInfo{i}")"
aria-expanded="false"
class="btn btn-link"
data-toggle="collapse"
href="@($"#synthInfo{i}")">
+info
</a>
<div class="collapse"
id="@($"synthInfo{i}")">
<div class="card card-body">
This computer directly sends data to a <abbr title="Digital to Analog Converter">DAC</abbr> or similar connected to the audio output.
</div>
</div>
</td>
}
else
{
<td>
@($"{Model.Gpus[i].Gpu.Name}")
<a aria-controls="@($"synthInfo{i}")"
aria-expanded="false"
class="btn btn-link"
data-toggle="collapse"
href="@($"#synthInfo{i}")">
+info
</a>
<div class="collapse"
id="@($"synthInfo{i}")">
<div class="card card-body">
<table>
@if(Model.SoundSynths[i].SoundSynth.ModelCode != null && Model.SoundSynths[i].SoundSynth.ModelCode != Model.SoundSynths[i].SoundSynth.Name)
{
<tr>
<td>Model</td>
<td>@Model.SoundSynths[i].SoundSynth.ModelCode</td>
</tr>
}
@if(Model.SoundSynths[i].SoundSynth.Company != null)
{
<tr>
<td>Manufacturer</td>
<td>
<a asp-controller=Company
asp-action=View
asp-route-id=@Model.SoundSynths[i].SoundSynth.Company.Id>
@Model.SoundSynths[i].SoundSynth.Company.Name</a>
</td>
</tr>
}
@if(Model.SoundSynths[i].SoundSynth.Introduced != DateTime.MinValue)
{
<tr>
<td>Introduction date</td>
<td>@($"{Model.Gpus[i].Gpu.Introduced:yyyy}")</td>
</tr>
}
@if(Model.SoundSynths[i].SoundSynth.Voices != 0 || Model.SoundSynths[i].SoundSynth.SquareWave != 0 || Model.SoundSynths[i].SoundSynth.WhiteNoise != 0)
{
<tr>
<td>Generators</td>
<td>
<table>
@if(Model.SoundSynths[i].SoundSynth.Voices != 0)
{
<tr>
<td>@Model.SoundSynths[i].SoundSynth.Voices voices</td>
</tr>
}
@if(Model.SoundSynths[i].SoundSynth.SquareWave != 0)
{
<tr>
<td>@Model.SoundSynths[i].SoundSynth.SquareWave square wave</td>
</tr>
}
@if(Model.SoundSynths[i].SoundSynth.WhiteNoise != 0)
{
<tr>
<td>@Model.SoundSynths[i].SoundSynth.WhiteNoise white noise</td>
</tr>
}
</table>
</td>
</tr>
}
@if(Model.SoundSynths[i].SoundSynth.Depth != 0 || Model.SoundSynths[i].SoundSynth.Frequency > 0)
{
<tr>
<td>Sample rate</td>
<td>
<table>
@if(Model.SoundSynths[i].SoundSynth.Depth != 0 && Model.SoundSynths[i].SoundSynth.Frequency > 0)
{
<tr>
<td>@Model.SoundSynths[i].SoundSynth.Depth bits at @(Model.SoundSynths[i].SoundSynth.Frequency > 1000 ? $"{Model.SoundSynths[i].SoundSynth.Frequency / 1000}KHz" : $"{Model.SoundSynths[i].SoundSynth.Frequency}Hz")</td>
</tr>
}
else if(Model.SoundSynths[i].SoundSynth.Depth != 0)
{
<tr>
<td>@Model.SoundSynths[i].SoundSynth.Depth bits</td>
</tr>
}
else
{
<tr>
<td>@(Model.SoundSynths[i].SoundSynth.Frequency > 1000 ? $"{Model.SoundSynths[i].SoundSynth.Frequency / 1000}KHz" : $"{Model.SoundSynths[i].SoundSynth.Frequency}Hz")</td>
</tr>
}
</table>
</td>
</tr>
}
@if(Model.SoundSynths[i].SoundSynth.Type != 0)
{
<tr>
<td>Synthetizer type</td>
<td>
@Model.SoundSynths[i].SoundSynth.Type
</td>
</tr>
}
</table>
</div>
</div>
</td>
}
}
else
{
<td>Unknown data</td>
}
}
</table>
</td>
</tr>
}
@if(Model.Storage != null && Model.Storage.Length > 0)
2018-04-14 07:13:11 +01:00
{
<tr>
<th scope=row>
<div align=right>
Storage
2018-04-14 07:13:11 +01:00
</div>
</th>
<td>
<table>
@foreach(StorageByMachine storage in Model.Storage)
2018-04-14 07:13:11 +01:00
{
string capString = null;
2018-04-14 07:13:11 +01:00
if(storage.Capacity != 0)
2018-04-14 07:13:11 +01:00
{
if(storage.Type == StorageType.CompactCassette) { capString = $"{storage.Capacity} bps"; }
2018-04-14 07:13:11 +01:00
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; }
2018-04-14 07:13:11 +01:00
}
}
<tr>
@if(storage.Interface != StorageInterface.Unknown)
2018-04-14 07:13:11 +01:00
{
if(storage.Type == StorageType.Empty)
{
<td>Available @storage.Interface interface.</td>
}
else
2018-04-14 07:13:11 +01:00
{
if(capString != null)
2018-04-14 07:13:11 +01:00
{
<td>@storage.Type connected thru a @storage.Interface interface with a nominal capacity of @capString</td>
2018-04-14 07:13:11 +01:00
}
else
{
<td>@storage.Type connected thru a @storage.Interface interface</td>
2018-04-14 07:13:11 +01:00
}
}
}
else
{
if(capString != null)
{
<td>@storage.Type with a nominal capacity of @capString</td>
}
else
{
<td>@storage.Type</td>
}
2018-04-14 07:13:11 +01:00
}
</tr>
2018-04-14 07:13:11 +01:00
}
</table>
</td>
2018-04-14 07:13:11 +01:00
</tr>
}
</table>
@if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/photos/computers", Model.Id + ".jpg")))
{
<img src="@System.IO.Path.Combine("/assets/photos/computers", Model.Id + ".jpg")"
alt="">
}