diff --git a/Marechai/Pages/Machines/View.razor b/Marechai/Pages/Machines/View.razor index 513ae0f3..727ec35e 100644 --- a/Marechai/Pages/Machines/View.razor +++ b/Marechai/Pages/Machines/View.razor @@ -135,281 +135,285 @@ @{ counter = 0; } @foreach (var processor in _machine.Processors) { + int currentCounter = counter; + - @if (processor.Speed > 0) - { - @(processor.GprSize > 0 ? string.Format(L["{0} @ {1}MHz ({2} bits)"], processor.Name, processor.Speed, processor.GprSize) : string.Format(L["{0} @ {1}MHz"], processor.Name, processor.Speed)) - } - 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) - { - - - - - } -
@L["Model"]@processor.ModelCode
@L["Manufacturer"] - - @processor.CompanyName -
@L["Introduction date"]@($"{processor.Introduced:yyyy}")
@L["Instruction set"]@processor.InstructionSet
@L["Nominal speed"]@string.Format(L["{0} MHz"], processor.Speed)
Registers - - @if (processor.Gprs > 0) - { - - - - } - @if (processor.Fprs > 0) - { - - - - } - @if (processor.SimdRegisters > 0) - { - - - - } -
- @if (processor.FprSize > 0 && - processor.Fprs == 0 && - processor.SimdSize > 0 && - processor.SimdRegisters == 0) - { - @(string.Format(L["{0} general purpose registers of {1} bits that can be used as floating point registers of {2} bits and SIMD registers of {3} bits."], - processor.Gprs, processor.GprSize, processor.FprSize, processor.SimdSize)) - } - else if (processor.FprSize > 0 && - processor.Fprs == 0) - { - @(string.Format(L["{0} general purpose registers of {1} bits that can be used as floating point registers of {2} bits."], - processor.Gprs, processor.GprSize, processor.FprSize)) - } - else if (processor.FprSize == 0 && - processor.SimdSize > 0 && - processor.SimdRegisters == 0) - { - @(string.Format(L["{0} general purpose registers of {1} bits that can be used as SIMD registers of {2} bits."], - processor.Gprs, processor.GprSize, processor.SimdSize)) - } - else - { - @(string.Format(L["{0} general purpose registers of {1} bits."], processor.Gprs, processor.GprSize)) - } -
- @if (processor.SimdSize > 0 && - processor.SimdRegisters == 0) - { - @(string.Format(L["{0} floating point registers of {1} bits that can be used as SIMD registers of {2} bits."], - processor.Fprs, processor.FprSize, processor.SimdSize)) - } - else - { - @(string.Format(L["{0} floating point registers of {1} bits."], - processor.Fprs, processor.FprSize)) - } -
- - @string.Format(L["{0} SIMD registers of {1} bits."], processor.SimdRegisters, processor.SimdSize) - -
-
@L["Multi-core"]@string.Format(L["{0} cores."], processor.Cores)
- SMT - - @string.Format(processor.Cores > 1 ? L["{0} threads per core."] : L["{0} threads."], processor.ThreadsPerCore) -
@L["Bus"] - - @if (processor.DataBus > 0) - { - - - - } - @if (processor.AddrBus > 0) - { - - - - } -
- @string.Format(L["{0}-bit data."], processor.DataBus) -
- @string.Format(L["{0}-bit address."], processor.AddrBus) -
-
@L["Cache"] - - @if (processor.L1Instruction > 0) - { - - - - } - @if (processor.L1Data > 0) - { - - - - } - @if (processor.L2 > 0) - { - - - - } - @if (processor.L3 > 0) - { - - - - } -
- @string.Format(processor.L1Data < 0 ? L["{0}KiB combined instruction-data L1"] : L["{0}KiB instruction L1"], processor.L1Instruction) -
- @string.Format(L["{0}KiB data L1"], processor.L1Data) -
- @string.Format(L["{0}KiB L2"], processor.L2) -
- @string.Format(L["{0}KiB L3"], processor.L3) -
-
@L["Package"]@processor.Package
@L["Manufacturing process"] - @if (processor.Process != null && - processor.ProcessNm > 0) + + + @if (processor.Speed > 0) { - if (processor.ProcessNm > 100) - { - @(string.Format(L["{0} @ {1}µm"], processor.Process, processor.ProcessNm / 100)) - } - else - { - @(string.Format(L["{0} @ {1}nm"], processor.Process, processor.ProcessNm)) - } - } - else if (processor.ProcessNm > 0) - { - if (processor.ProcessNm > 100) - { - @(string.Format(L["{0}µm"], processor.ProcessNm / 100)) - } - else - { - @(string.Format(L["{0}nm"], processor.ProcessNm)) - } + @(processor.GprSize > 0 ? string.Format(L["{0} @ {1}MHz ({2} bits)"], processor.Name, processor.Speed, processor.GprSize) : string.Format(L["{0} @ {1}MHz"], processor.Name, processor.Speed)) } else { - @processor.Process + @($"{processor.Name}") } -
@L["Die size"]@string.Format(L["{0} mm²"], processor.DieSize)
@L["Transistors"]@processor.Transistors
-
-
+ + @L["+info"] + + + + + @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) + { + + + + + } +
@L["Model"]@processor.ModelCode
@L["Manufacturer"] + + @processor.CompanyName +
@L["Introduction date"]@($"{processor.Introduced:yyyy}")
@L["Instruction set"]@processor.InstructionSet
@L["Nominal speed"]@string.Format(L["{0} MHz"], processor.Speed)
@L["Registers"] + + @if (processor.Gprs > 0) + { + + + + } + @if (processor.Fprs > 0) + { + + + + } + @if (processor.SimdRegisters > 0) + { + + + + } +
+ @if (processor.FprSize > 0 && + processor.Fprs == 0 && + processor.SimdSize > 0 && + processor.SimdRegisters == 0) + { + @(string.Format(L["{0} general purpose registers of {1} bits that can be used as floating point registers of {2} bits and SIMD registers of {3} bits."], + processor.Gprs, processor.GprSize, processor.FprSize, processor.SimdSize)) + } + else if (processor.FprSize > 0 && + processor.Fprs == 0) + { + @(string.Format(L["{0} general purpose registers of {1} bits that can be used as floating point registers of {2} bits."], + processor.Gprs, processor.GprSize, processor.FprSize)) + } + else if (processor.FprSize == 0 && + processor.SimdSize > 0 && + processor.SimdRegisters == 0) + { + @(string.Format(L["{0} general purpose registers of {1} bits that can be used as SIMD registers of {2} bits."], + processor.Gprs, processor.GprSize, processor.SimdSize)) + } + else + { + @(string.Format(L["{0} general purpose registers of {1} bits."], processor.Gprs, processor.GprSize)) + } +
+ @if (processor.SimdSize > 0 && + processor.SimdRegisters == 0) + { + @(string.Format(L["{0} floating point registers of {1} bits that can be used as SIMD registers of {2} bits."], + processor.Fprs, processor.FprSize, processor.SimdSize)) + } + else + { + @(string.Format(L["{0} floating point registers of {1} bits."], + processor.Fprs, processor.FprSize)) + } +
+ + @string.Format(L["{0} SIMD registers of {1} bits."], processor.SimdRegisters, processor.SimdSize) + +
+
@L["Multi-core"]@string.Format(L["{0} cores."], processor.Cores)
+ SMT + + @string.Format(processor.Cores > 1 ? L["{0} threads per core."] : L["{0} threads."], processor.ThreadsPerCore) +
@L["Bus"] + + @if (processor.DataBus > 0) + { + + + + } + @if (processor.AddrBus > 0) + { + + + + } +
+ @string.Format(L["{0}-bit data."], processor.DataBus) +
+ @string.Format(L["{0}-bit address."], processor.AddrBus) +
+
@L["Cache"] + + @if (processor.L1Instruction > 0) + { + + + + } + @if (processor.L1Data > 0) + { + + + + } + @if (processor.L2 > 0) + { + + + + } + @if (processor.L3 > 0) + { + + + + } +
+ @string.Format(processor.L1Data < 0 ? L["{0}KiB combined instruction-data L1"] : L["{0}KiB instruction L1"], processor.L1Instruction) +
+ @string.Format(L["{0}KiB data L1"], processor.L1Data) +
+ @string.Format(L["{0}KiB L2"], processor.L2) +
+ @string.Format(L["{0}KiB L3"], processor.L3) +
+
@L["Package"]@processor.Package
@L["Manufacturing process"] + @if (processor.Process != null && + processor.ProcessNm > 0) + { + if (processor.ProcessNm > 100) + { + @(string.Format(L["{0} @ {1}µm"], processor.Process, processor.ProcessNm / 100)) + } + else + { + @(string.Format(L["{0} @ {1}nm"], processor.Process, processor.ProcessNm)) + } + } + else if (processor.ProcessNm > 0) + { + if (processor.ProcessNm > 100) + { + @(string.Format(L["{0}µm"], processor.ProcessNm / 100)) + } + else + { + @(string.Format(L["{0}nm"], processor.ProcessNm)) + } + } + else + { + @processor.Process + } +
@L["Die size"]@string.Format(L["{0} mm²"], processor.DieSize)
@L["Transistors"]@processor.Transistors
+
+ @@ -497,29 +501,35 @@ @{ counter = 0; } @foreach (var gpu in _machine.Gpus) { + int currentCounter = counter; + if (gpu.Id == -2) { - @L["Framebuffer"] - -
-
+ + + @L["Framebuffer"] + + @L["+info"] + + + @L["This machine 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."] -
-
+ + } else { - @($"{gpu.Name}") - -
-
+ + + @($"{gpu.Name}") + + @L["+info"] + + + @if (gpu.ModelCode != null && gpu.ModelCode != gpu.Name) @@ -601,8 +611,8 @@ }
-
-
+ + } counter++; @@ -624,30 +634,36 @@ @{ counter = 0; } @foreach (var sound in _machine.SoundSynthesizers) { + int currentCounter = counter; + @if (sound.Id == -2) { - @L["Software"] - -
-
+ + + @L["Software"] + + @L["+info"] + + + @L["This machine directly sends data to a DAC or similar connected to the audio output."] -
-
+ + } else { - @($"{sound.Name}") - -
-
+ + + @($"{sound.Name}") + + @L["+info"] + + + @if (sound.ModelCode != null && sound.ModelCode != sound.Name) @@ -762,8 +778,8 @@ }
-
-
+ + } @@ -867,11 +883,35 @@ MachineViewModel _machine; bool _loaded; + bool[] _processorVisible; + bool[] _gpuVisible; + bool[] _soundVisible; protected override async Task OnInitializedAsync() { _machine = await Service.GetMachine(Id); + _processorVisible = new bool[_machine.Processors.Count]; + _gpuVisible = new bool[_machine.Gpus.Count]; + _soundVisible = new bool[_machine.SoundSynthesizers.Count]; + _loaded = true; } -} \ No newline at end of file +} + + \ No newline at end of file