mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Update DB to version 22: Machine families, machine model separate from name.
This commit is contained in:
@@ -44,7 +44,7 @@ namespace cicm_web.Models
|
||||
|
||||
List<Machine> items = new List<Machine>();
|
||||
|
||||
return dbItems.Select(Machine.TransformItem).OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return dbItems.Select(Machine.TransformItem).OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static Machine[] GetItemsFromCompany(int id)
|
||||
@@ -54,7 +54,7 @@ namespace cicm_web.Models
|
||||
if(result == null || result.Value == false || dbItems == null) return null;
|
||||
|
||||
// TODO: Company chosen by DB
|
||||
return dbItems.Where(t => t.Company == id).Select(Machine.TransformItem).OrderBy(t => t.Model).ToArray();
|
||||
return dbItems.Where(t => t.Company == id).Select(Machine.TransformItem).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static Machine GetItem(int id)
|
||||
@@ -76,7 +76,7 @@ namespace cicm_web.Models
|
||||
List<MachineMini> items = new List<MachineMini>();
|
||||
foreach(Cicm.Database.Schemas.Machine dbItem in dbItems) items.Add(MachineMini.TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsStartingWithLetter(char letter)
|
||||
@@ -87,10 +87,10 @@ namespace cicm_web.Models
|
||||
|
||||
List<MachineMini> items = new List<MachineMini>();
|
||||
foreach(Cicm.Database.Schemas.Machine dbItem in dbItems)
|
||||
if(dbItem.Model.StartsWith(new string(letter, 1), StringComparison.InvariantCultureIgnoreCase))
|
||||
if(dbItem.Name.StartsWith(new string(letter, 1), StringComparison.InvariantCultureIgnoreCase))
|
||||
items.Add(MachineMini.TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsFromYear(int year)
|
||||
@@ -104,7 +104,7 @@ namespace cicm_web.Models
|
||||
if(dbItem.Introduced.Year == year)
|
||||
items.Add(MachineMini.TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsWithCompany(int id, string companyName)
|
||||
@@ -119,8 +119,8 @@ namespace cicm_web.Models
|
||||
{
|
||||
Company = new Company {Id = id, Name = companyName},
|
||||
Id = t.Id,
|
||||
Model = t.Model
|
||||
}).OrderBy(t => t.Model).ToArray();
|
||||
Name = t.Name
|
||||
}).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsFromCompany(int id)
|
||||
@@ -130,8 +130,7 @@ namespace cicm_web.Models
|
||||
if(result == null || result.Value == false || dbItems == null) return null;
|
||||
|
||||
// TODO: Company chosen by DB
|
||||
return dbItems.Where(t => t.Company == id).Select(MachineMini.TransformItem).OrderBy(t => t.Model)
|
||||
.ToArray();
|
||||
return dbItems.Where(t => t.Company == id).Select(MachineMini.TransformItem).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace cicm_web.Models
|
||||
if(result == null || result.Value == false || dbItems == null) return null;
|
||||
|
||||
// TODO: Company chosen by DB
|
||||
return dbItems.Where(t => t.Company == id).Select(Machine.TransformItem).OrderBy(t => t.Model).ToArray();
|
||||
return dbItems.Where(t => t.Company == id).Select(Machine.TransformItem).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static Machine GetItem(int id)
|
||||
@@ -74,7 +74,7 @@ namespace cicm_web.Models
|
||||
List<MachineMini> items = new List<MachineMini>();
|
||||
foreach(Cicm.Database.Schemas.Machine dbItem in dbItems) items.Add(MachineMini.TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsStartingWithLetter(char letter)
|
||||
@@ -85,10 +85,10 @@ namespace cicm_web.Models
|
||||
|
||||
List<MachineMini> items = new List<MachineMini>();
|
||||
foreach(Cicm.Database.Schemas.Machine dbItem in dbItems)
|
||||
if(dbItem.Model.StartsWith(new string(letter, 1), StringComparison.InvariantCultureIgnoreCase))
|
||||
if(dbItem.Name.StartsWith(new string(letter, 1), StringComparison.InvariantCultureIgnoreCase))
|
||||
items.Add(MachineMini.TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsFromYear(int year)
|
||||
@@ -102,7 +102,7 @@ namespace cicm_web.Models
|
||||
if(dbItem.Introduced.Year == year)
|
||||
items.Add(MachineMini.TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsWithCompany(int id, string companyName)
|
||||
@@ -117,8 +117,8 @@ namespace cicm_web.Models
|
||||
{
|
||||
Company = new Company {Id = id, Name = companyName},
|
||||
Id = t.Id,
|
||||
Model = t.Model
|
||||
}).OrderBy(t => t.Model).ToArray();
|
||||
Name = t.Name
|
||||
}).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsFromCompany(int id)
|
||||
@@ -128,8 +128,7 @@ namespace cicm_web.Models
|
||||
if(result == null || result.Value == false || dbItems == null) return null;
|
||||
|
||||
// TODO: Company chosen by DB
|
||||
return dbItems.Where(t => t.Company == id).Select(MachineMini.TransformItem).OrderBy(t => t.Model)
|
||||
.ToArray();
|
||||
return dbItems.Where(t => t.Company == id).Select(MachineMini.TransformItem).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,11 +38,13 @@ namespace cicm_web.Models
|
||||
public class Machine
|
||||
{
|
||||
public Company Company;
|
||||
public MachineFamily Family;
|
||||
public GpuByMachine[] Gpus;
|
||||
public int Id;
|
||||
public DateTime Introduced;
|
||||
public MemoryByMachine[] Memories;
|
||||
public string Model;
|
||||
public string Name;
|
||||
public ProcessorByMachine[] Processors;
|
||||
public SoundByMachine[] SoundSynths;
|
||||
public StorageByMachine[] Storage;
|
||||
@@ -56,7 +58,7 @@ namespace cicm_web.Models
|
||||
|
||||
List<Machine> items = new List<Machine>();
|
||||
|
||||
return dbItems.Select(TransformItem).OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return dbItems.Select(TransformItem).OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static Machine[] GetItemsFromCompany(int id)
|
||||
@@ -66,7 +68,7 @@ namespace cicm_web.Models
|
||||
if(result == null || result.Value == false || dbItems == null) return null;
|
||||
|
||||
// TODO: Company chosen by DB
|
||||
return dbItems.Where(t => t.Company == id).Select(TransformItem).OrderBy(t => t.Model).ToArray();
|
||||
return dbItems.Where(t => t.Company == id).Select(TransformItem).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static Machine GetItem(int id)
|
||||
@@ -82,13 +84,15 @@ namespace cicm_web.Models
|
||||
Company = Company.GetItem(dbItem.Company),
|
||||
Gpus = GpuByMachine.GetAllItems(dbItem.Id),
|
||||
Id = dbItem.Id,
|
||||
Model = dbItem.Model,
|
||||
Name = dbItem.Name,
|
||||
Introduced = dbItem.Introduced,
|
||||
Type = dbItem.Type,
|
||||
Processors = ProcessorByMachine.GetAllItems(dbItem.Id),
|
||||
SoundSynths = SoundByMachine.GetAllItems(dbItem.Id),
|
||||
Memories = MemoryByMachine.GetAllItems(dbItem.Id),
|
||||
Storage = StorageByMachine.GetAllItems(dbItem.Id)
|
||||
Storage = StorageByMachine.GetAllItems(dbItem.Id),
|
||||
Family = MachineFamily.GetItem(dbItem.Family),
|
||||
Model = dbItem.Model
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -97,7 +101,7 @@ namespace cicm_web.Models
|
||||
{
|
||||
public Company Company;
|
||||
public int Id;
|
||||
public string Model;
|
||||
public string Name;
|
||||
|
||||
public static MachineMini[] GetAllItems()
|
||||
{
|
||||
@@ -109,7 +113,7 @@ namespace cicm_web.Models
|
||||
List<MachineMini> items = new List<MachineMini>();
|
||||
foreach(Cicm.Database.Schemas.Machine dbItem in dbItems) items.Add(TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsStartingWithLetter(char letter)
|
||||
@@ -120,10 +124,10 @@ namespace cicm_web.Models
|
||||
|
||||
List<MachineMini> items = new List<MachineMini>();
|
||||
foreach(Cicm.Database.Schemas.Machine dbItem in dbItems)
|
||||
if(dbItem.Model.StartsWith(new string(letter, 1), StringComparison.InvariantCultureIgnoreCase))
|
||||
if(dbItem.Name.StartsWith(new string(letter, 1), StringComparison.InvariantCultureIgnoreCase))
|
||||
items.Add(TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsFromYear(int year)
|
||||
@@ -137,7 +141,7 @@ namespace cicm_web.Models
|
||||
if(dbItem.Introduced.Year == year)
|
||||
items.Add(TransformItem(dbItem));
|
||||
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Model).ToArray();
|
||||
return items.OrderBy(t => t.Company.Name).ThenBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsWithCompany(int id, string companyName)
|
||||
@@ -152,8 +156,8 @@ namespace cicm_web.Models
|
||||
{
|
||||
Company = new Company {Id = id, Name = companyName},
|
||||
Id = t.Id,
|
||||
Model = t.Model
|
||||
}).OrderBy(t => t.Model).ToArray();
|
||||
Name = t.Name
|
||||
}).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
public static MachineMini[] GetItemsFromCompany(int id)
|
||||
@@ -163,12 +167,12 @@ namespace cicm_web.Models
|
||||
if(result == null || result.Value == false || dbItems == null) return null;
|
||||
|
||||
// TODO: Company chosen by DB
|
||||
return dbItems.Where(t => t.Company == id).Select(TransformItem).OrderBy(t => t.Model).ToArray();
|
||||
return dbItems.Where(t => t.Company == id).Select(TransformItem).OrderBy(t => t.Name).ToArray();
|
||||
}
|
||||
|
||||
internal static MachineMini TransformItem(Cicm.Database.Schemas.Machine dbItem)
|
||||
{
|
||||
return new MachineMini {Company = Company.GetItem(dbItem.Company), Id = dbItem.Id, Model = dbItem.Model};
|
||||
return new MachineMini {Company = Company.GetItem(dbItem.Company), Id = dbItem.Id, Name = dbItem.Name};
|
||||
}
|
||||
}
|
||||
}
|
||||
47
cicm_web/Models/MachineFamily.cs
Normal file
47
cicm_web/Models/MachineFamily.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
/******************************************************************************
|
||||
// Canary Islands Computer Museum Website
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : GpuByMachine.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Gpu by machine model
|
||||
//
|
||||
// --[ 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
|
||||
*******************************************************************************/
|
||||
|
||||
namespace cicm_web.Models
|
||||
{
|
||||
public class MachineFamily
|
||||
{
|
||||
public int Id;
|
||||
public string Name;
|
||||
|
||||
public static MachineFamily GetItem(int familyId)
|
||||
{
|
||||
Cicm.Database.Schemas.MachineFamily result = Program.Database?.Operations.GetMachineFamily(familyId);
|
||||
|
||||
if(result == null || result.Id != familyId) return null;
|
||||
|
||||
return new MachineFamily {Name = result.Name, Id = familyId};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,56 +87,56 @@ namespace cicm_web.Models
|
||||
imageUrl = "assets/photos/computers/";
|
||||
targetView = "Computer";
|
||||
computer = Computer.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{computer.Company.Name} - {computer.Model}";
|
||||
subtext = $"{computer.Company.Name} - {computer.Name}";
|
||||
break;
|
||||
case NewsType.NewConsoleInDb:
|
||||
text = "New videoconsole added to the database.";
|
||||
imageUrl = "assets/photos/consoles/";
|
||||
targetView = "Console";
|
||||
console = Console.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{console.Company.Name} - {console.Model}";
|
||||
subtext = $"{console.Company.Name} - {console.Name}";
|
||||
break;
|
||||
case NewsType.NewComputerInCollection:
|
||||
text = "New computer added to the museum's collection.";
|
||||
imageUrl = "assets/photos/computers/";
|
||||
targetView = "CollectionComputer";
|
||||
owncomputer = OwnedComputer.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{owncomputer.Computer.Company.Name} - {owncomputer.Computer.Model}";
|
||||
subtext = $"{owncomputer.Computer.Company.Name} - {owncomputer.Computer.Name}";
|
||||
break;
|
||||
case NewsType.NewConsoleInCollection:
|
||||
text = "New videoconsole added to the museum's collection.";
|
||||
imageUrl = "assets/photos/consoles/";
|
||||
targetView = "CollectionConsole";
|
||||
ownconsole = OwnedConsole.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{ownconsole.Console.Company.Name} - {ownconsole.Console.Model}";
|
||||
subtext = $"{ownconsole.Console.Company.Name} - {ownconsole.Console.Name}";
|
||||
break;
|
||||
case NewsType.UpdatedComputerInDb:
|
||||
text = "Updated computer from the database.";
|
||||
imageUrl = "assets/photos/computers/";
|
||||
targetView = "Computer";
|
||||
computer = Computer.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{computer.Company.Name} - {computer.Model}";
|
||||
subtext = $"{computer.Company.Name} - {computer.Name}";
|
||||
break;
|
||||
case NewsType.UpdatedConsoleInDb:
|
||||
text = "Updated videoconsole from the database.";
|
||||
imageUrl = "assets/photos/consoles/";
|
||||
targetView = "Console";
|
||||
console = Console.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{console.Company.Name} - {console.Model}";
|
||||
subtext = $"{console.Company.Name} - {console.Name}";
|
||||
break;
|
||||
case NewsType.UpdatedComputerInCollection:
|
||||
text = "Updated computer from museum's collection.";
|
||||
imageUrl = "assets/photos/computers/";
|
||||
targetView = "CollectionComputer";
|
||||
owncomputer = OwnedComputer.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{owncomputer.Computer.Company.Name} - {owncomputer.Computer.Model}";
|
||||
subtext = $"{owncomputer.Computer.Company.Name} - {owncomputer.Computer.Name}";
|
||||
break;
|
||||
case NewsType.UpdatedConsoleInCollection:
|
||||
text = "Updated videoconsole from museum's collection.";
|
||||
imageUrl = "assets/photos/consoles/";
|
||||
targetView = "CollectionConsole";
|
||||
ownconsole = OwnedConsole.GetItem(dbItem.AffectedId);
|
||||
subtext = $"{ownconsole.Console.Company.Name} - {ownconsole.Console.Model}";
|
||||
subtext = $"{ownconsole.Console.Company.Name} - {ownconsole.Console.Name}";
|
||||
break;
|
||||
case NewsType.NewMoneyDonation:
|
||||
text = "New money donation.";
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
<a asp-controller="Machine"
|
||||
asp-action="View"
|
||||
asp-route-id="@computer.Id">
|
||||
@computer.Model</a>
|
||||
@computer.Name</a>
|
||||
<br />
|
||||
}
|
||||
</div>
|
||||
@@ -412,7 +412,7 @@
|
||||
<a asp-controller="Machine"
|
||||
asp-action="View"
|
||||
asp-route-id="@console.Id">
|
||||
@console.Model</a>
|
||||
@console.Name</a>
|
||||
<br />
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<a asp-controller="Machine"
|
||||
asp-action="View"
|
||||
asp-route-id="@computer.Id">
|
||||
@computer.Company.Name @computer.Model</a>
|
||||
@computer.Company.Name @computer.Name</a>
|
||||
<br />
|
||||
}
|
||||
</p>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<a asp-controller="Machine"
|
||||
asp-action="View"
|
||||
asp-route-id="@computer.Id">
|
||||
@computer.Company.Name @computer.Model</a>
|
||||
@computer.Company.Name @computer.Name</a>
|
||||
<br />
|
||||
}
|
||||
</p>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<a asp-controller="Machine"
|
||||
asp-action="View"
|
||||
asp-route-id="@console.Id">
|
||||
@console.Company.Name @console.Model</a>
|
||||
@console.Company.Name @console.Name</a>
|
||||
<br />
|
||||
}
|
||||
</p>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<a asp-controller="Machine"
|
||||
asp-action="View"
|
||||
asp-route-id="@console.Id">
|
||||
@console.Company.Name @console.Model</a>
|
||||
@console.Company.Name @console.Name</a>
|
||||
<br />
|
||||
}
|
||||
</p>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<a asp-controller=Company
|
||||
asp-action=View
|
||||
asp-route-id=@Model.Company.Id>
|
||||
@Model.Company.Name</a> @Model.Model</b>
|
||||
@Model.Company.Name</a> @Model.Name</b>
|
||||
<table width=100%>
|
||||
|
||||
@if(Model.Introduced.Year != 1000)
|
||||
@@ -90,6 +90,37 @@
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if(Model.Family != null)
|
||||
{
|
||||
<tr>
|
||||
<th scope=row
|
||||
width="37%">
|
||||
<div align=right>
|
||||
Family
|
||||
</div>
|
||||
</th>
|
||||
<td width="63%">
|
||||
<a asp-controller="Computer"
|
||||
asp-action="ByFamily"
|
||||
asp-route-id="@Model.Family.Id">
|
||||
@Model.Family.Name</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if(Model.Model != null)
|
||||
{
|
||||
<tr>
|
||||
<th scope=row
|
||||
width="37%">
|
||||
<div align=right>
|
||||
Model
|
||||
</div>
|
||||
</th>
|
||||
<td width="63%">
|
||||
@Model.Model
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if(Model.Processors != null && Model.Processors.Length > 0)
|
||||
{
|
||||
<tr>
|
||||
@@ -504,143 +535,145 @@
|
||||
<table>
|
||||
@for(int i = 0; i < Model.SoundSynths.Length; i++)
|
||||
{
|
||||
if(Model.SoundSynths[i] != null)
|
||||
{
|
||||
if(Model.SoundSynths[i].SoundSynth.Id == -2)
|
||||
<tr>
|
||||
@if(Model.SoundSynths[i] != null)
|
||||
{
|
||||
<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.
|
||||
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>
|
||||
</div>
|
||||
</td>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>
|
||||
@($"{Model.SoundSynths[i].SoundSynth.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>
|
||||
@($"{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>
|
||||
<td>Unknown data</td>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<td>Unknown data</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</td>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<Version>3.0.99.226</Version>
|
||||
<Version>3.0.99.232</Version>
|
||||
<Company>Canary Islands Computer Museum</Company>
|
||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||
<Product>Canary Islands Computer Museum Website</Product>
|
||||
|
||||
Reference in New Issue
Block a user