From 30f7523269da90695005005422bab9e3db98c13e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 5 Aug 2018 19:37:39 +0100 Subject: [PATCH] Add database module. --- .../.idea/contentModel.xml | 54 +- .idea/.idea.DiscImageChef/riderModule.iml | 1 + DiscImageChef.Database/Context.cs | 48 + .../DiscImageChef.Database.csproj | 103 ++ .../20180805182209_InitialCreate.Designer.cs | 1506 +++++++++++++++++ .../20180805182209_InitialCreate.cs | 979 +++++++++++ .../Migrations/DicContextModelSnapshot.cs | 1432 ++++++++++++++++ DiscImageChef.Database/Models/ATA.cs | 225 +++ DiscImageChef.Database/Models/BaseEntity.cs | 49 + DiscImageChef.Database/Models/BaseTypes.cs | 52 + DiscImageChef.Database/Models/CHS.cs | 41 + DiscImageChef.Database/Models/Device.cs | 163 ++ DiscImageChef.Database/Models/FireWire.cs | 59 + DiscImageChef.Database/Models/PCMCIA.cs | 72 + .../Models/SCSI/BlockDescriptor.cs | 55 + DiscImageChef.Database/Models/SCSI/Inquiry.cs | 141 ++ .../Models/SCSI/MMC/Features.cs | 306 ++++ DiscImageChef.Database/Models/SCSI/MMC/MMC.cs | 61 + .../Models/SCSI/MMC/Mode2A.cs | 166 ++ .../Models/SCSI/MMC/WriteDescriptor.cs | 51 + DiscImageChef.Database/Models/SCSI/Mode.cs | 78 + .../Models/SCSI/ModePage.cs | 55 + DiscImageChef.Database/Models/SCSI/Page.cs | 47 + DiscImageChef.Database/Models/SCSI/SCSI.cs | 84 + DiscImageChef.Database/Models/SCSI/SSC/SSC.cs | 74 + .../Models/SCSI/SSC/SequentialMedia.cs | 82 + .../Models/SCSI/SSC/SupportedDensity.cs | 69 + .../Models/SCSI/SupportedMedia.cs | 68 + .../Models/SecureDigital.cs | 59 + DiscImageChef.Database/Models/TestedMedia.cs | 243 +++ DiscImageChef.Database/Models/Usb.cs | 61 + DiscImageChef.sln | 6 + 32 files changed, 6489 insertions(+), 1 deletion(-) create mode 100644 DiscImageChef.Database/Context.cs create mode 100644 DiscImageChef.Database/DiscImageChef.Database.csproj create mode 100644 DiscImageChef.Database/Migrations/20180805182209_InitialCreate.Designer.cs create mode 100644 DiscImageChef.Database/Migrations/20180805182209_InitialCreate.cs create mode 100644 DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs create mode 100644 DiscImageChef.Database/Models/ATA.cs create mode 100644 DiscImageChef.Database/Models/BaseEntity.cs create mode 100644 DiscImageChef.Database/Models/BaseTypes.cs create mode 100644 DiscImageChef.Database/Models/CHS.cs create mode 100644 DiscImageChef.Database/Models/Device.cs create mode 100644 DiscImageChef.Database/Models/FireWire.cs create mode 100644 DiscImageChef.Database/Models/PCMCIA.cs create mode 100644 DiscImageChef.Database/Models/SCSI/BlockDescriptor.cs create mode 100644 DiscImageChef.Database/Models/SCSI/Inquiry.cs create mode 100644 DiscImageChef.Database/Models/SCSI/MMC/Features.cs create mode 100644 DiscImageChef.Database/Models/SCSI/MMC/MMC.cs create mode 100644 DiscImageChef.Database/Models/SCSI/MMC/Mode2A.cs create mode 100644 DiscImageChef.Database/Models/SCSI/MMC/WriteDescriptor.cs create mode 100644 DiscImageChef.Database/Models/SCSI/Mode.cs create mode 100644 DiscImageChef.Database/Models/SCSI/ModePage.cs create mode 100644 DiscImageChef.Database/Models/SCSI/Page.cs create mode 100644 DiscImageChef.Database/Models/SCSI/SCSI.cs create mode 100644 DiscImageChef.Database/Models/SCSI/SSC/SSC.cs create mode 100644 DiscImageChef.Database/Models/SCSI/SSC/SequentialMedia.cs create mode 100644 DiscImageChef.Database/Models/SCSI/SSC/SupportedDensity.cs create mode 100644 DiscImageChef.Database/Models/SCSI/SupportedMedia.cs create mode 100644 DiscImageChef.Database/Models/SecureDigital.cs create mode 100644 DiscImageChef.Database/Models/TestedMedia.cs create mode 100644 DiscImageChef.Database/Models/Usb.cs diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml index 3a33c3c96..a9fd63e3a 100644 --- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml +++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml @@ -2,6 +2,7 @@ + @@ -253,6 +254,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1294,7 +1344,9 @@ - + + + diff --git a/.idea/.idea.DiscImageChef/riderModule.iml b/.idea/.idea.DiscImageChef/riderModule.iml index 1a4e0d95f..4e3934535 100644 --- a/.idea/.idea.DiscImageChef/riderModule.iml +++ b/.idea/.idea.DiscImageChef/riderModule.iml @@ -1,6 +1,7 @@ + diff --git a/DiscImageChef.Database/Context.cs b/DiscImageChef.Database/Context.cs new file mode 100644 index 000000000..398319720 --- /dev/null +++ b/DiscImageChef.Database/Context.cs @@ -0,0 +1,48 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Context.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Entity framework database context. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.Database.Models; +using Microsoft.EntityFrameworkCore; + +namespace DiscImageChef.Database +{ + public class DicContext : DbContext + { + public DbSet Devices { get; set; } + public DbSet Reports { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseSqlite("Data Source=discimagechef.db"); + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/DiscImageChef.Database.csproj b/DiscImageChef.Database/DiscImageChef.Database.csproj new file mode 100644 index 000000000..71c19d2ff --- /dev/null +++ b/DiscImageChef.Database/DiscImageChef.Database.csproj @@ -0,0 +1,103 @@ + + + + Debug + AnyCPU + 2.0 + Library + DiscImageChef.Database + DiscImageChef.Database + $(Version) + false + net461 + true + 4.5.99.1693 + Claunia.com + Copyright © 2011-2018 Natalia Portillo + The Disc Image Chef + DiscImageChef.Database + $(Version) + + + $(Version)-{chash:8} built by {mname} in $(Configuration){!:, modified} + true + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + full + true + bin\Release + prompt + 4 + false + + + + + + + LICENSE.LGPL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DiscImageChef.Database/Migrations/20180805182209_InitialCreate.Designer.cs b/DiscImageChef.Database/Migrations/20180805182209_InitialCreate.Designer.cs new file mode 100644 index 000000000..dce372498 --- /dev/null +++ b/DiscImageChef.Database/Migrations/20180805182209_InitialCreate.Designer.cs @@ -0,0 +1,1506 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace DiscImageChef.Database.Migrations +{ + [DbContext(typeof(DicContext))] + [Migration("20180805182209_InitialCreate")] + partial class InitialCreate + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.1.1-rtm-30846"); + + modelBuilder.Entity("EFTest.Models.ATA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("APIOSupported"); + + b.Property("ATAPIByteCount"); + + b.Property("AdditionalPID"); + + b.Property("BufferSize"); + + b.Property("BufferType"); + + b.Property("CFAPowerMode"); + + b.Property("Capabilities"); + + b.Property("Capabilities2"); + + b.Property("Capabilities3"); + + b.Property("CommandSet"); + + b.Property("CommandSet2"); + + b.Property("CommandSet3"); + + b.Property("CommandSet4"); + + b.Property("CommandSet5"); + + b.Property("CurrentAAM"); + + b.Property("CurrentAPM"); + + b.Property("DMAActive"); + + b.Property("DMASupported"); + + b.Property("DMATransferTimingMode"); + + b.Property("DataSetMgmt"); + + b.Property("DataSetMgmtSize"); + + b.Property("DeviceFormFactor"); + + b.Property("EnabledCommandSet"); + + b.Property("EnabledCommandSet2"); + + b.Property("EnabledCommandSet3"); + + b.Property("EnabledCommandSet4"); + + b.Property("EnabledSATAFeatures"); + + b.Property("EnhancedSecurityEraseTime"); + + b.Property("ExtendedUserSectors"); + + b.Property("FirmwareRevision"); + + b.Property("FreeFallSensitivity"); + + b.Property("GeneralConfiguration"); + + b.Property("HardwareResetResult"); + + b.Property("Identify"); + + b.Property("InterseekDelay"); + + b.Property("MDMAActive"); + + b.Property("MDMASupported"); + + b.Property("MajorVersion"); + + b.Property("MasterPasswordRevisionCode"); + + b.Property("MaxDownloadMicroMode3"); + + b.Property("MaxQueueDepth"); + + b.Property("MinDownloadMicroMode3"); + + b.Property("MinMDMACycleTime"); + + b.Property("MinPIOCycleTimeFlow"); + + b.Property("MinPIOCycleTimeNoFlow"); + + b.Property("MinorVersion"); + + b.Property("Model"); + + b.Property("MultipleMaxSectors"); + + b.Property("MultipleSectorNumber"); + + b.Property("NVCacheCaps"); + + b.Property("NVCacheSize"); + + b.Property("NVCacheWriteSpeed"); + + b.Property("NVEstimatedSpinUp"); + + b.Property("PIOTransferTimingMode"); + + b.Property("PacketBusRelease"); + + b.Property("ReadCapabilitiesId"); + + b.Property("RecommendedAAM"); + + b.Property("RecommendedMDMACycleTime"); + + b.Property("RemovableStatusSet"); + + b.Property("SATACapabilities"); + + b.Property("SATACapabilities2"); + + b.Property("SATAFeatures"); + + b.Property("SCTCommandTransport"); + + b.Property("SectorsPerCard"); + + b.Property("SecurityEraseTime"); + + b.Property("SecurityStatus"); + + b.Property("ServiceBusyClear"); + + b.Property("SpecificConfiguration"); + + b.Property("StreamAccessLatency"); + + b.Property("StreamMinReqSize"); + + b.Property("StreamPerformanceGranularity"); + + b.Property("StreamTransferTimeDMA"); + + b.Property("StreamTransferTimePIO"); + + b.Property("TransportMajorVersion"); + + b.Property("TransportMinorVersion"); + + b.Property("TrustedComputing"); + + b.Property("UDMAActive"); + + b.Property("UDMASupported"); + + b.Property("WRVMode"); + + b.Property("WRVSectorCountMode2"); + + b.Property("WRVSectorCountMode3"); + + b.HasKey("Id"); + + b.HasIndex("ReadCapabilitiesId"); + + b.ToTable("ATA"); + }); + + modelBuilder.Entity("EFTest.Models.CHS", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cylinders"); + + b.Property("Heads"); + + b.Property("Sectors"); + + b.HasKey("Id"); + + b.ToTable("CHS"); + }); + + modelBuilder.Entity("EFTest.Models.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ATAId"); + + b.Property("ATAPIId"); + + b.Property("FireWireId"); + + b.Property("IsValid"); + + b.Property("Manufacturer"); + + b.Property("Model"); + + b.Property("MultiMediaCardId"); + + b.Property("PCMCIAId"); + + b.Property("Revision"); + + b.Property("SCSIId"); + + b.Property("SecureDigitalId"); + + b.Property("TimesSeen"); + + b.Property("Type"); + + b.Property("USBId"); + + b.Property("WhenAdded"); + + b.Property("WhenModified"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("ATAPIId"); + + b.HasIndex("FireWireId"); + + b.HasIndex("MultiMediaCardId"); + + b.HasIndex("PCMCIAId"); + + b.HasIndex("SCSIId"); + + b.HasIndex("SecureDigitalId"); + + b.HasIndex("USBId"); + + b.ToTable("Device"); + }); + + modelBuilder.Entity("EFTest.Models.FireWire", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Manufacturer"); + + b.Property("Product"); + + b.Property("ProductID"); + + b.Property("RemovableMedia"); + + b.Property("VendorID"); + + b.HasKey("Id"); + + b.ToTable("FireWire"); + }); + + modelBuilder.Entity("EFTest.Models.IntClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("SupportedMediaId"); + + b.Property("Value"); + + b.HasKey("Id"); + + b.HasIndex("SupportedMediaId"); + + b.ToTable("IntClass"); + }); + + modelBuilder.Entity("EFTest.Models.PCMCIA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CIS"); + + b.Property("CardCode"); + + b.Property("Compliance"); + + b.Property("Manufacturer"); + + b.Property("ManufacturerCode"); + + b.Property("ProductName"); + + b.HasKey("Id"); + + b.ToTable("PCMCIA"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.BlockDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BlockLength"); + + b.Property("Blocks"); + + b.Property("Density"); + + b.Property("ModeId"); + + b.HasKey("Id"); + + b.HasIndex("ModeId"); + + b.ToTable("BlockDescriptor"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Inquiry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ACKRequests"); + + b.Property("AERCSupported"); + + b.Property("ANSIVersion"); + + b.Property("AccessControlCoordinator"); + + b.Property("Address16"); + + b.Property("Address32"); + + b.Property("AsymmetricalLUNAccess"); + + b.Property("BasicQueueing"); + + b.Property("Data"); + + b.Property("DeviceTypeModifier"); + + b.Property("ECMAVersion"); + + b.Property("EnclosureServices"); + + b.Property("HierarchicalLUN"); + + b.Property("ISOVersion"); + + b.Property("IUS"); + + b.Property("LinkedCommands"); + + b.Property("MediumChanger"); + + b.Property("MultiPortDevice"); + + b.Property("NormalACA"); + + b.Property("PeripheralDeviceType"); + + b.Property("PeripheralQualifier"); + + b.Property("ProductIdentification"); + + b.Property("ProductRevisionLevel"); + + b.Property("Protection"); + + b.Property("QAS"); + + b.Property("RelativeAddressing"); + + b.Property("Removable"); + + b.Property("ResponseDataFormat"); + + b.Property("SPIClocking"); + + b.Property("SoftReset"); + + b.Property("StorageArrayController"); + + b.Property("SyncTransfer"); + + b.Property("TaggedCommandQueue"); + + b.Property("TerminateTaskSupported"); + + b.Property("ThirdPartyCopy"); + + b.Property("TranferDisable"); + + b.Property("VendorIdentification"); + + b.Property("WideBus16"); + + b.Property("WideBus32"); + + b.HasKey("Id"); + + b.ToTable("Inquiry"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.Features", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AACSVersion"); + + b.Property("AGIDs"); + + b.Property("BindingNonceBlocks"); + + b.Property("BlocksPerReadableUnit"); + + b.Property("BufferUnderrunFreeInDVD"); + + b.Property("BufferUnderrunFreeInSAO"); + + b.Property("BufferUnderrunFreeInTAO"); + + b.Property("CPRMVersion"); + + b.Property("CSSVersion"); + + b.Property("CanAudioScan"); + + b.Property("CanEject"); + + b.Property("CanEraseSector"); + + b.Property("CanExpandBDRESpareArea"); + + b.Property("CanFormat"); + + b.Property("CanFormatBDREWithoutSpare"); + + b.Property("CanFormatCert"); + + b.Property("CanFormatFRF"); + + b.Property("CanFormatQCert"); + + b.Property("CanFormatRRM"); + + b.Property("CanGenerateBindingNonce"); + + b.Property("CanLoad"); + + b.Property("CanMuteSeparateChannels"); + + b.Property("CanOverwriteSAOTrack"); + + b.Property("CanOverwriteTAOTrack"); + + b.Property("CanPlayCDAudio"); + + b.Property("CanPseudoOverwriteBDR"); + + b.Property("CanReadAllDualR"); + + b.Property("CanReadAllDualRW"); + + b.Property("CanReadBD"); + + b.Property("CanReadBDR"); + + b.Property("CanReadBDRE1"); + + b.Property("CanReadBDRE2"); + + b.Property("CanReadBDROM"); + + b.Property("CanReadBluBCA"); + + b.Property("CanReadCD"); + + b.Property("CanReadCDMRW"); + + b.Property("CanReadCPRM_MKB"); + + b.Property("CanReadDDCD"); + + b.Property("CanReadDVD"); + + b.Property("CanReadDVDPlusMRW"); + + b.Property("CanReadDVDPlusR"); + + b.Property("CanReadDVDPlusRDL"); + + b.Property("CanReadDVDPlusRW"); + + b.Property("CanReadDVDPlusRWDL"); + + b.Property("CanReadDriveAACSCertificate"); + + b.Property("CanReadHDDVD"); + + b.Property("CanReadHDDVDR"); + + b.Property("CanReadHDDVDRAM"); + + b.Property("CanReadLeadInCDText"); + + b.Property("CanReadOldBDR"); + + b.Property("CanReadOldBDRE"); + + b.Property("CanReadOldBDROM"); + + b.Property("CanReadSpareAreaInformation"); + + b.Property("CanReportDriveSerial"); + + b.Property("CanReportMediaSerial"); + + b.Property("CanTestWriteDDCDR"); + + b.Property("CanTestWriteDVD"); + + b.Property("CanTestWriteInSAO"); + + b.Property("CanTestWriteInTAO"); + + b.Property("CanUpgradeFirmware"); + + b.Property("CanWriteBD"); + + b.Property("CanWriteBDR"); + + b.Property("CanWriteBDRE1"); + + b.Property("CanWriteBDRE2"); + + b.Property("CanWriteBusEncryptedBlocks"); + + b.Property("CanWriteCDMRW"); + + b.Property("CanWriteCDRW"); + + b.Property("CanWriteCDRWCAV"); + + b.Property("CanWriteCDSAO"); + + b.Property("CanWriteCDTAO"); + + b.Property("CanWriteCSSManagedDVD"); + + b.Property("CanWriteDDCDR"); + + b.Property("CanWriteDDCDRW"); + + b.Property("CanWriteDVDPlusMRW"); + + b.Property("CanWriteDVDPlusR"); + + b.Property("CanWriteDVDPlusRDL"); + + b.Property("CanWriteDVDPlusRW"); + + b.Property("CanWriteDVDPlusRWDL"); + + b.Property("CanWriteDVDR"); + + b.Property("CanWriteDVDRDL"); + + b.Property("CanWriteDVDRW"); + + b.Property("CanWriteHDDVDR"); + + b.Property("CanWriteHDDVDRAM"); + + b.Property("CanWriteOldBDR"); + + b.Property("CanWriteOldBDRE"); + + b.Property("CanWritePackedSubchannelInTAO"); + + b.Property("CanWriteRWSubchannelInSAO"); + + b.Property("CanWriteRWSubchannelInTAO"); + + b.Property("CanWriteRaw"); + + b.Property("CanWriteRawMultiSession"); + + b.Property("CanWriteRawSubchannelInTAO"); + + b.Property("ChangerIsSideChangeCapable"); + + b.Property("ChangerSlots"); + + b.Property("ChangerSupportsDiscPresent"); + + b.Property("DBML"); + + b.Property("DVDMultiRead"); + + b.Property("EmbeddedChanger"); + + b.Property("ErrorRecoveryPage"); + + b.Property("FirmwareDate"); + + b.Property("LoadingMechanismType"); + + b.Property("Locked"); + + b.Property("LogicalBlockSize"); + + b.Property("MultiRead"); + + b.Property("PhysicalInterfaceStandard"); + + b.Property("PhysicalInterfaceStandardNumber"); + + b.Property("PreventJumper"); + + b.Property("SupportsAACS"); + + b.Property("SupportsBusEncryption"); + + b.Property("SupportsC2"); + + b.Property("SupportsCPRM"); + + b.Property("SupportsCSS"); + + b.Property("SupportsDAP"); + + b.Property("SupportsDeviceBusyEvent"); + + b.Property("SupportsHybridDiscs"); + + b.Property("SupportsModePage1Ch"); + + b.Property("SupportsOSSC"); + + b.Property("SupportsPWP"); + + b.Property("SupportsSWPP"); + + b.Property("SupportsSecurDisc"); + + b.Property("SupportsSeparateVolume"); + + b.Property("SupportsVCPS"); + + b.Property("SupportsWriteInhibitDCB"); + + b.Property("SupportsWriteProtectPAC"); + + b.Property("VolumeLevels"); + + b.HasKey("Id"); + + b.ToTable("Features"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.MMC", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FeaturesId"); + + b.Property("ModeSense2AId"); + + b.HasKey("Id"); + + b.HasIndex("FeaturesId"); + + b.HasIndex("ModeSense2AId"); + + b.ToTable("MMC"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.Mode2A", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccurateCDDA"); + + b.Property("BCK"); + + b.Property("BufferSize"); + + b.Property("BufferUnderRunProtection"); + + b.Property("CDDACommand"); + + b.Property("CSSandCPPMSupported"); + + b.Property("CanEject"); + + b.Property("CanLockMedia"); + + b.Property("CompositeAudioVideo"); + + b.Property("CurrentSpeed"); + + b.Property("CurrentWriteSpeed"); + + b.Property("CurrentWriteSpeedSelected"); + + b.Property("DeterministicSlotChanger"); + + b.Property("DigitalPort1"); + + b.Property("DigitalPort2"); + + b.Property("LSBF"); + + b.Property("LeadInPW"); + + b.Property("LoadingMechanismType"); + + b.Property("LockStatus"); + + b.Property("MaximumSpeed"); + + b.Property("MaximumWriteSpeed"); + + b.Property("PlaysAudio"); + + b.Property("PreventJumperStatus"); + + b.Property("RCK"); + + b.Property("ReadsBarcode"); + + b.Property("ReadsBothSides"); + + b.Property("ReadsCDR"); + + b.Property("ReadsCDRW"); + + b.Property("ReadsDVDR"); + + b.Property("ReadsDVDRAM"); + + b.Property("ReadsDVDROM"); + + b.Property("ReadsDeinterlavedSubchannel"); + + b.Property("ReadsISRC"); + + b.Property("ReadsMode2Form1"); + + b.Property("ReadsMode2Form2"); + + b.Property("ReadsPacketCDR"); + + b.Property("ReadsSubchannel"); + + b.Property("ReadsUPC"); + + b.Property("ReturnsC2Pointers"); + + b.Property("RotationControlSelected"); + + b.Property("SSS"); + + b.Property("SeparateChannelMute"); + + b.Property("SeparateChannelVolume"); + + b.Property("SupportedVolumeLevels"); + + b.Property("SupportsMultiSession"); + + b.Property("TestWrite"); + + b.Property("WritesCDR"); + + b.Property("WritesCDRW"); + + b.Property("WritesDVDR"); + + b.Property("WritesDVDRAM"); + + b.HasKey("Id"); + + b.ToTable("Mode2A"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.WriteDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Mode2AId"); + + b.Property("RotationControl"); + + b.Property("WriteSpeed"); + + b.HasKey("Id"); + + b.HasIndex("Mode2AId"); + + b.ToTable("WriteDescriptor"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Mode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BlankCheckEnabled"); + + b.Property("BufferedMode"); + + b.Property("DPOandFUA"); + + b.Property("MediumType"); + + b.Property("Speed"); + + b.Property("WriteProtected"); + + b.HasKey("Id"); + + b.ToTable("Mode"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.ModePage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ModeId"); + + b.Property("page"); + + b.Property("subpage"); + + b.Property("value"); + + b.HasKey("Id"); + + b.HasIndex("ModeId"); + + b.ToTable("ModePage"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("SCSIId"); + + b.Property("page"); + + b.Property("value"); + + b.HasKey("Id"); + + b.HasIndex("SCSIId"); + + b.ToTable("Page"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SCSI", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("InquiryId"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("ModeSenseId"); + + b.Property("MultiMediaDeviceId"); + + b.Property("ReadCapabilitiesId"); + + b.Property("SequentialDeviceId"); + + b.Property("SupportsModeSense10"); + + b.Property("SupportsModeSense6"); + + b.Property("SupportsModeSubpages"); + + b.HasKey("Id"); + + b.HasIndex("InquiryId"); + + b.HasIndex("ModeSenseId"); + + b.HasIndex("MultiMediaDeviceId"); + + b.HasIndex("ReadCapabilitiesId"); + + b.HasIndex("SequentialDeviceId"); + + b.ToTable("SCSI"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SequentialMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CanReadMediaSerial"); + + b.Property("Density"); + + b.Property("Manufacturer"); + + b.Property("MediaIsRecognized"); + + b.Property("MediumType"); + + b.Property("MediumTypeName"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("Model"); + + b.Property("SSCId"); + + b.HasKey("Id"); + + b.HasIndex("SSCId"); + + b.ToTable("SequentialMedia"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SSC", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BlockSizeGranularity"); + + b.Property("MaxBlockLength"); + + b.Property("MinBlockLength"); + + b.HasKey("Id"); + + b.ToTable("SSC"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SupportedDensity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("BitsPerMm"); + + b.Property("Capacity"); + + b.Property("DefaultDensity"); + + b.Property("Description"); + + b.Property("Duplicate"); + + b.Property("Name"); + + b.Property("Organization"); + + b.Property("PrimaryCode"); + + b.Property("SSCId"); + + b.Property("SecondaryCode"); + + b.Property("SequentialMediaId"); + + b.Property("Tracks"); + + b.Property("Width"); + + b.Property("Writable"); + + b.HasKey("Id"); + + b.HasIndex("SSCId"); + + b.HasIndex("SequentialMediaId"); + + b.ToTable("SupportedDensity"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SupportedMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("Length"); + + b.Property("MediumType"); + + b.Property("Name"); + + b.Property("Organization"); + + b.Property("SSCId"); + + b.Property("SequentialMediaId"); + + b.Property("Width"); + + b.HasKey("Id"); + + b.HasIndex("SSCId"); + + b.HasIndex("SequentialMediaId"); + + b.ToTable("SupportedMedia"); + }); + + modelBuilder.Entity("EFTest.Models.SecureDigital", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CID"); + + b.Property("CSD"); + + b.Property("ExtendedCSD"); + + b.Property("OCR"); + + b.Property("SCR"); + + b.HasKey("Id"); + + b.ToTable("SecureDigital"); + }); + + modelBuilder.Entity("EFTest.Models.StringClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("PCMCIAId"); + + b.Property("Value") + .IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("PCMCIAId"); + + b.ToTable("StringClass"); + }); + + modelBuilder.Entity("EFTest.Models.TestedMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ATAId"); + + b.Property("BlockSize"); + + b.Property("Blocks"); + + b.Property("CHSId"); + + b.Property("CanReadAACS"); + + b.Property("CanReadADIP"); + + b.Property("CanReadATIP"); + + b.Property("CanReadBCA"); + + b.Property("CanReadC2Pointers"); + + b.Property("CanReadCMI"); + + b.Property("CanReadCorrectedSubchannel"); + + b.Property("CanReadCorrectedSubchannelWithC2"); + + b.Property("CanReadDCB"); + + b.Property("CanReadDDS"); + + b.Property("CanReadDMI"); + + b.Property("CanReadDiscInformation"); + + b.Property("CanReadFullTOC"); + + b.Property("CanReadHDCMI"); + + b.Property("CanReadLayerCapacity"); + + b.Property("CanReadLeadIn"); + + b.Property("CanReadLeadInPostgap"); + + b.Property("CanReadLeadOut"); + + b.Property("CanReadMediaID"); + + b.Property("CanReadMediaSerial"); + + b.Property("CanReadPAC"); + + b.Property("CanReadPFI"); + + b.Property("CanReadPMA"); + + b.Property("CanReadPQSubchannel"); + + b.Property("CanReadPQSubchannelWithC2"); + + b.Property("CanReadPRI"); + + b.Property("CanReadRWSubchannel"); + + b.Property("CanReadRWSubchannelWithC2"); + + b.Property("CanReadRecordablePFI"); + + b.Property("CanReadSpareAreaInformation"); + + b.Property("CanReadTOC"); + + b.Property("CurrentCHSId"); + + b.Property("Density"); + + b.Property("LBA48Sectors"); + + b.Property("LBASectors"); + + b.Property("LogicalAlignment"); + + b.Property("LongBlockSize"); + + b.Property("MMCId"); + + b.Property("Manufacturer"); + + b.Property("MediaIsRecognized"); + + b.Property("MediumType"); + + b.Property("MediumTypeName"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("Model"); + + b.Property("NominalRotationRate"); + + b.Property("PhysicalBlockSize"); + + b.Property("SCSIId"); + + b.Property("SolidStateDevice"); + + b.Property("SupportsHLDTSTReadRawDVD"); + + b.Property("SupportsNECReadCDDA"); + + b.Property("SupportsPioneerReadCDDA"); + + b.Property("SupportsPioneerReadCDDAMSF"); + + b.Property("SupportsPlextorReadCDDA"); + + b.Property("SupportsPlextorReadRawDVD"); + + b.Property("SupportsRead"); + + b.Property("SupportsRead10"); + + b.Property("SupportsRead12"); + + b.Property("SupportsRead16"); + + b.Property("SupportsReadCapacity"); + + b.Property("SupportsReadCapacity16"); + + b.Property("SupportsReadCd"); + + b.Property("SupportsReadCdMsf"); + + b.Property("SupportsReadCdMsfRaw"); + + b.Property("SupportsReadCdRaw"); + + b.Property("SupportsReadDma"); + + b.Property("SupportsReadDmaLba"); + + b.Property("SupportsReadDmaLba48"); + + b.Property("SupportsReadDmaRetry"); + + b.Property("SupportsReadDmaRetryLba"); + + b.Property("SupportsReadLba"); + + b.Property("SupportsReadLba48"); + + b.Property("SupportsReadLong"); + + b.Property("SupportsReadLong16"); + + b.Property("SupportsReadLongLba"); + + b.Property("SupportsReadLongRetry"); + + b.Property("SupportsReadLongRetryLba"); + + b.Property("SupportsReadRetry"); + + b.Property("SupportsReadRetryLba"); + + b.Property("SupportsSeek"); + + b.Property("SupportsSeekLba"); + + b.Property("UnformattedBPS"); + + b.Property("UnformattedBPT"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("CHSId"); + + b.HasIndex("CurrentCHSId"); + + b.HasIndex("MMCId"); + + b.HasIndex("SCSIId"); + + b.ToTable("TestedMedia"); + }); + + modelBuilder.Entity("EFTest.Models.USB", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Descriptors"); + + b.Property("Manufacturer"); + + b.Property("Product"); + + b.Property("ProductID"); + + b.Property("RemovableMedia"); + + b.Property("VendorID"); + + b.HasKey("Id"); + + b.ToTable("USB"); + }); + + modelBuilder.Entity("EFTest.Models.UshortClass", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("InquiryId"); + + b.Property("Value"); + + b.HasKey("Id"); + + b.HasIndex("InquiryId"); + + b.ToTable("UshortClass"); + }); + + modelBuilder.Entity("EFTest.Models.ATA", b => + { + b.HasOne("EFTest.Models.TestedMedia", "ReadCapabilities") + .WithMany() + .HasForeignKey("ReadCapabilitiesId"); + }); + + modelBuilder.Entity("EFTest.Models.Device", b => + { + b.HasOne("EFTest.Models.ATA", "ATA") + .WithMany() + .HasForeignKey("ATAId"); + + b.HasOne("EFTest.Models.ATA", "ATAPI") + .WithMany() + .HasForeignKey("ATAPIId"); + + b.HasOne("EFTest.Models.FireWire", "FireWire") + .WithMany() + .HasForeignKey("FireWireId"); + + b.HasOne("EFTest.Models.SecureDigital", "MultiMediaCard") + .WithMany() + .HasForeignKey("MultiMediaCardId"); + + b.HasOne("EFTest.Models.PCMCIA", "PCMCIA") + .WithMany() + .HasForeignKey("PCMCIAId"); + + b.HasOne("EFTest.Models.SCSI.SCSI", "SCSI") + .WithMany() + .HasForeignKey("SCSIId"); + + b.HasOne("EFTest.Models.SecureDigital", "SecureDigital") + .WithMany() + .HasForeignKey("SecureDigitalId"); + + b.HasOne("EFTest.Models.USB", "USB") + .WithMany() + .HasForeignKey("USBId"); + }); + + modelBuilder.Entity("EFTest.Models.IntClass", b => + { + b.HasOne("EFTest.Models.SCSI.SupportedMedia") + .WithMany("DensityCodes") + .HasForeignKey("SupportedMediaId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.BlockDescriptor", b => + { + b.HasOne("EFTest.Models.SCSI.Mode") + .WithMany("BlockDescriptors") + .HasForeignKey("ModeId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.MMC", b => + { + b.HasOne("EFTest.Models.SCSI.MMC.Features", "Features") + .WithMany() + .HasForeignKey("FeaturesId"); + + b.HasOne("EFTest.Models.SCSI.MMC.Mode2A", "ModeSense2A") + .WithMany() + .HasForeignKey("ModeSense2AId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.WriteDescriptor", b => + { + b.HasOne("EFTest.Models.SCSI.MMC.Mode2A") + .WithMany("WriteSpeedPerformanceDescriptors") + .HasForeignKey("Mode2AId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.ModePage", b => + { + b.HasOne("EFTest.Models.SCSI.Mode") + .WithMany("ModePages") + .HasForeignKey("ModeId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Page", b => + { + b.HasOne("EFTest.Models.SCSI.SCSI") + .WithMany("EVPDPages") + .HasForeignKey("SCSIId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SCSI", b => + { + b.HasOne("EFTest.Models.SCSI.Inquiry", "Inquiry") + .WithMany() + .HasForeignKey("InquiryId"); + + b.HasOne("EFTest.Models.SCSI.Mode", "ModeSense") + .WithMany() + .HasForeignKey("ModeSenseId"); + + b.HasOne("EFTest.Models.SCSI.MMC.MMC", "MultiMediaDevice") + .WithMany() + .HasForeignKey("MultiMediaDeviceId"); + + b.HasOne("EFTest.Models.TestedMedia", "ReadCapabilities") + .WithMany() + .HasForeignKey("ReadCapabilitiesId"); + + b.HasOne("EFTest.Models.SCSI.SSC.SSC", "SequentialDevice") + .WithMany() + .HasForeignKey("SequentialDeviceId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SequentialMedia", b => + { + b.HasOne("EFTest.Models.SCSI.SSC.SSC") + .WithMany("TestedMedia") + .HasForeignKey("SSCId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SupportedDensity", b => + { + b.HasOne("EFTest.Models.SCSI.SSC.SSC") + .WithMany("SupportedDensities") + .HasForeignKey("SSCId"); + + b.HasOne("EFTest.Models.SCSI.SSC.SequentialMedia") + .WithMany("SupportedDensities") + .HasForeignKey("SequentialMediaId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SupportedMedia", b => + { + b.HasOne("EFTest.Models.SCSI.SSC.SSC") + .WithMany("SupportedMediaTypes") + .HasForeignKey("SSCId"); + + b.HasOne("EFTest.Models.SCSI.SSC.SequentialMedia") + .WithMany("SupportedMediaTypes") + .HasForeignKey("SequentialMediaId"); + }); + + modelBuilder.Entity("EFTest.Models.StringClass", b => + { + b.HasOne("EFTest.Models.PCMCIA") + .WithMany("AdditionalInformation") + .HasForeignKey("PCMCIAId"); + }); + + modelBuilder.Entity("EFTest.Models.TestedMedia", b => + { + b.HasOne("EFTest.Models.ATA") + .WithMany("RemovableMedias") + .HasForeignKey("ATAId"); + + b.HasOne("EFTest.Models.CHS", "CHS") + .WithMany() + .HasForeignKey("CHSId"); + + b.HasOne("EFTest.Models.CHS", "CurrentCHS") + .WithMany() + .HasForeignKey("CurrentCHSId"); + + b.HasOne("EFTest.Models.SCSI.MMC.MMC") + .WithMany("TestedMedia") + .HasForeignKey("MMCId"); + + b.HasOne("EFTest.Models.SCSI.SCSI") + .WithMany("RemovableMedias") + .HasForeignKey("SCSIId"); + }); + + modelBuilder.Entity("EFTest.Models.UshortClass", b => + { + b.HasOne("EFTest.Models.SCSI.Inquiry") + .WithMany("VersionDescriptors") + .HasForeignKey("InquiryId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DiscImageChef.Database/Migrations/20180805182209_InitialCreate.cs b/DiscImageChef.Database/Migrations/20180805182209_InitialCreate.cs new file mode 100644 index 000000000..9b8c739af --- /dev/null +++ b/DiscImageChef.Database/Migrations/20180805182209_InitialCreate.cs @@ -0,0 +1,979 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : 20180805163101_InitialCreate.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Initial database status. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DiscImageChef.Database.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable("CHS", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Cylinders = table.Column(nullable: false), + Heads = table.Column(nullable: false), + Sectors = table.Column(nullable: false) + }, constraints: table => { table.PrimaryKey("PK_CHS", x => x.Id); }); + + migrationBuilder.CreateTable("Features", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AACSVersion = table.Column(nullable: true), + AGIDs = table.Column(nullable: true), + BindingNonceBlocks = table.Column(nullable: true), + BlocksPerReadableUnit = table.Column(nullable: true), + BufferUnderrunFreeInDVD = table.Column(nullable: false), + BufferUnderrunFreeInSAO = table.Column(nullable: false), + BufferUnderrunFreeInTAO = table.Column(nullable: false), + CanAudioScan = table.Column(nullable: false), + CanEject = table.Column(nullable: false), + CanEraseSector = table.Column(nullable: false), + CanExpandBDRESpareArea = table.Column(nullable: false), + CanFormat = table.Column(nullable: false), + CanFormatBDREWithoutSpare = table.Column(nullable: false), + CanFormatCert = table.Column(nullable: false), + CanFormatFRF = table.Column(nullable: false), + CanFormatQCert = table.Column(nullable: false), + CanFormatRRM = table.Column(nullable: false), + CanGenerateBindingNonce = table.Column(nullable: false), + CanLoad = table.Column(nullable: false), + CanMuteSeparateChannels = table.Column(nullable: false), + CanOverwriteSAOTrack = table.Column(nullable: false), + CanOverwriteTAOTrack = table.Column(nullable: false), + CanPlayCDAudio = table.Column(nullable: false), + CanPseudoOverwriteBDR = table.Column(nullable: false), + CanReadAllDualR = table.Column(nullable: false), + CanReadAllDualRW = table.Column(nullable: false), + CanReadBD = table.Column(nullable: false), + CanReadBDR = table.Column(nullable: false), + CanReadBDRE1 = table.Column(nullable: false), + CanReadBDRE2 = table.Column(nullable: false), + CanReadBDROM = table.Column(nullable: false), + CanReadBluBCA = table.Column(nullable: false), + CanReadCD = table.Column(nullable: false), + CanReadCDMRW = table.Column(nullable: false), + CanReadCPRM_MKB = table.Column(nullable: false), + CanReadDDCD = table.Column(nullable: false), + CanReadDVD = table.Column(nullable: false), + CanReadDVDPlusMRW = table.Column(nullable: false), + CanReadDVDPlusR = table.Column(nullable: false), + CanReadDVDPlusRDL = table.Column(nullable: false), + CanReadDVDPlusRW = table.Column(nullable: false), + CanReadDVDPlusRWDL = table.Column(nullable: false), + CanReadDriveAACSCertificate = table.Column(nullable: false), + CanReadHDDVD = table.Column(nullable: false), + CanReadHDDVDR = table.Column(nullable: false), + CanReadHDDVDRAM = table.Column(nullable: false), + CanReadLeadInCDText = table.Column(nullable: false), + CanReadOldBDR = table.Column(nullable: false), + CanReadOldBDRE = table.Column(nullable: false), + CanReadOldBDROM = table.Column(nullable: false), + CanReadSpareAreaInformation = table.Column(nullable: false), + CanReportDriveSerial = table.Column(nullable: false), + CanReportMediaSerial = table.Column(nullable: false), + CanTestWriteDDCDR = table.Column(nullable: false), + CanTestWriteDVD = table.Column(nullable: false), + CanTestWriteInSAO = table.Column(nullable: false), + CanTestWriteInTAO = table.Column(nullable: false), + CanUpgradeFirmware = table.Column(nullable: false), + CanWriteBD = table.Column(nullable: false), + CanWriteBDR = table.Column(nullable: false), + CanWriteBDRE1 = table.Column(nullable: false), + CanWriteBDRE2 = table.Column(nullable: false), + CanWriteBusEncryptedBlocks = table.Column(nullable: false), + CanWriteCDMRW = table.Column(nullable: false), + CanWriteCDRW = table.Column(nullable: false), + CanWriteCDRWCAV = table.Column(nullable: false), + CanWriteCDSAO = table.Column(nullable: false), + CanWriteCDTAO = table.Column(nullable: false), + CanWriteCSSManagedDVD = table.Column(nullable: false), + CanWriteDDCDR = table.Column(nullable: false), + CanWriteDDCDRW = table.Column(nullable: false), + CanWriteDVDPlusMRW = table.Column(nullable: false), + CanWriteDVDPlusR = table.Column(nullable: false), + CanWriteDVDPlusRDL = table.Column(nullable: false), + CanWriteDVDPlusRW = table.Column(nullable: false), + CanWriteDVDPlusRWDL = table.Column(nullable: false), + CanWriteDVDR = table.Column(nullable: false), + CanWriteDVDRDL = table.Column(nullable: false), + CanWriteDVDRW = table.Column(nullable: false), + CanWriteHDDVDR = table.Column(nullable: false), + CanWriteHDDVDRAM = table.Column(nullable: false), + CanWriteOldBDR = table.Column(nullable: false), + CanWriteOldBDRE = table.Column(nullable: false), + CanWritePackedSubchannelInTAO = table.Column(nullable: false), + CanWriteRWSubchannelInSAO = table.Column(nullable: false), + CanWriteRWSubchannelInTAO = table.Column(nullable: false), + CanWriteRaw = table.Column(nullable: false), + CanWriteRawMultiSession = table.Column(nullable: false), + CanWriteRawSubchannelInTAO = table.Column(nullable: false), + ChangerIsSideChangeCapable = table.Column(nullable: false), + ChangerSlots = table.Column(nullable: false), + ChangerSupportsDiscPresent = table.Column(nullable: true), + CPRMVersion = table.Column(nullable: true), + CSSVersion = table.Column(nullable: true), + DBML = table.Column(nullable: false), + DVDMultiRead = table.Column(nullable: false), + EmbeddedChanger = table.Column(nullable: false), + ErrorRecoveryPage = table.Column(nullable: false), + FirmwareDate = table.Column(nullable: true), + LoadingMechanismType = table.Column(nullable: true), + Locked = table.Column(nullable: false), + LogicalBlockSize = table.Column(nullable: true), + MultiRead = table.Column(nullable: false), + PhysicalInterfaceStandard = table.Column(nullable: true), + PhysicalInterfaceStandardNumber = table.Column(nullable: true), + PreventJumper = table.Column(nullable: false), + SupportsAACS = table.Column(nullable: false), + SupportsBusEncryption = table.Column(nullable: false), + SupportsC2 = table.Column(nullable: false), + SupportsCPRM = table.Column(nullable: false), + SupportsCSS = table.Column(nullable: false), + SupportsDAP = table.Column(nullable: false), + SupportsDeviceBusyEvent = table.Column(nullable: false), + SupportsHybridDiscs = table.Column(nullable: false), + SupportsModePage1Ch = table.Column(nullable: false), + SupportsOSSC = table.Column(nullable: false), + SupportsPWP = table.Column(nullable: false), + SupportsSWPP = table.Column(nullable: false), + SupportsSecurDisc = table.Column(nullable: false), + SupportsSeparateVolume = table.Column(nullable: false), + SupportsVCPS = table.Column(nullable: false), + SupportsWriteInhibitDCB = table.Column(nullable: false), + SupportsWriteProtectPAC = table.Column(nullable: false), + VolumeLevels = table.Column(nullable: true) + }, constraints: table => { table.PrimaryKey("PK_Features", x => x.Id); }); + + migrationBuilder.CreateTable("FireWire", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + VendorID = table.Column(nullable: false), + ProductID = table.Column(nullable: false), + Manufacturer = table.Column(nullable: true), + Product = table.Column(nullable: true), + RemovableMedia = table.Column(nullable: false) + }, constraints: table => { table.PrimaryKey("PK_FireWire", x => x.Id); }); + + migrationBuilder.CreateTable("Inquiry", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccessControlCoordinator = table.Column(nullable: false), + ACKRequests = table.Column(nullable: false), + AERCSupported = table.Column(nullable: false), + Address16 = table.Column(nullable: false), + Address32 = table.Column(nullable: false), + ANSIVersion = table.Column(nullable: true), + AsymmetricalLUNAccess = table.Column(nullable: false), + BasicQueueing = table.Column(nullable: false), + DeviceTypeModifier = table.Column(nullable: true), + ECMAVersion = table.Column(nullable: true), + EnclosureServices = table.Column(nullable: false), + HierarchicalLUN = table.Column(nullable: false), + IUS = table.Column(nullable: false), + ISOVersion = table.Column(nullable: true), + LinkedCommands = table.Column(nullable: false), + MediumChanger = table.Column(nullable: false), + MultiPortDevice = table.Column(nullable: false), + NormalACA = table.Column(nullable: false), + PeripheralDeviceType = table.Column(nullable: false), + PeripheralQualifier = table.Column(nullable: false), + ProductIdentification = table.Column(nullable: true), + ProductRevisionLevel = table.Column(nullable: true), + Protection = table.Column(nullable: false), + QAS = table.Column(nullable: false), + RelativeAddressing = table.Column(nullable: false), + Removable = table.Column(nullable: false), + ResponseDataFormat = table.Column(nullable: true), + TaggedCommandQueue = table.Column(nullable: false), + TerminateTaskSupported = table.Column(nullable: false), + ThirdPartyCopy = table.Column(nullable: false), + TranferDisable = table.Column(nullable: false), + SoftReset = table.Column(nullable: false), + SPIClocking = table.Column(nullable: false), + StorageArrayController = table.Column(nullable: false), + SyncTransfer = table.Column(nullable: false), + VendorIdentification = table.Column(nullable: true), + WideBus16 = table.Column(nullable: false), + WideBus32 = table.Column(nullable: false), + Data = table.Column(nullable: true) + }, constraints: table => { table.PrimaryKey("PK_Inquiry", x => x.Id); }); + + migrationBuilder.CreateTable("Mode", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + MediumType = table.Column(nullable: true), + WriteProtected = table.Column(nullable: false), + Speed = table.Column(nullable: true), + BufferedMode = table.Column(nullable: true), + BlankCheckEnabled = table.Column(nullable: false), + DPOandFUA = table.Column(nullable: false) + }, constraints: table => { table.PrimaryKey("PK_Mode", x => x.Id); }); + + migrationBuilder.CreateTable("Mode2A", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccurateCDDA = table.Column(nullable: false), + BCK = table.Column(nullable: false), + BufferSize = table.Column(nullable: false), + BufferUnderRunProtection = table.Column(nullable: true), + CanEject = table.Column(nullable: false), + CanLockMedia = table.Column(nullable: false), + CDDACommand = table.Column(nullable: false), + CompositeAudioVideo = table.Column(nullable: false), + CSSandCPPMSupported = table.Column(nullable: false), + CurrentSpeed = table.Column(nullable: true), + CurrentWriteSpeed = table.Column(nullable: true), + CurrentWriteSpeedSelected = table.Column(nullable: true), + DeterministicSlotChanger = table.Column(nullable: false), + DigitalPort1 = table.Column(nullable: false), + DigitalPort2 = table.Column(nullable: false), + LeadInPW = table.Column(nullable: false), + LoadingMechanismType = table.Column(nullable: false), + LockStatus = table.Column(nullable: false), + LSBF = table.Column(nullable: false), + MaximumSpeed = table.Column(nullable: true), + MaximumWriteSpeed = table.Column(nullable: true), + PlaysAudio = table.Column(nullable: false), + PreventJumperStatus = table.Column(nullable: false), + RCK = table.Column(nullable: false), + ReadsBarcode = table.Column(nullable: false), + ReadsBothSides = table.Column(nullable: false), + ReadsCDR = table.Column(nullable: false), + ReadsCDRW = table.Column(nullable: false), + ReadsDeinterlavedSubchannel = table.Column(nullable: false), + ReadsDVDR = table.Column(nullable: false), + ReadsDVDRAM = table.Column(nullable: false), + ReadsDVDROM = table.Column(nullable: false), + ReadsISRC = table.Column(nullable: false), + ReadsMode2Form2 = table.Column(nullable: false), + ReadsMode2Form1 = table.Column(nullable: false), + ReadsPacketCDR = table.Column(nullable: false), + ReadsSubchannel = table.Column(nullable: false), + ReadsUPC = table.Column(nullable: false), + ReturnsC2Pointers = table.Column(nullable: false), + RotationControlSelected = table.Column(nullable: true), + SeparateChannelMute = table.Column(nullable: false), + SeparateChannelVolume = table.Column(nullable: false), + SSS = table.Column(nullable: false), + SupportsMultiSession = table.Column(nullable: false), + SupportedVolumeLevels = table.Column(nullable: true), + TestWrite = table.Column(nullable: false), + WritesCDR = table.Column(nullable: false), + WritesCDRW = table.Column(nullable: false), + WritesDVDR = table.Column(nullable: false), + WritesDVDRAM = table.Column(nullable: false) + }, constraints: table => { table.PrimaryKey("PK_Mode2A", x => x.Id); }); + + migrationBuilder.CreateTable("PCMCIA", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + CIS = table.Column(nullable: true), + Compliance = table.Column(nullable: true), + ManufacturerCode = table.Column(nullable: false), + CardCode = table.Column(nullable: false), + Manufacturer = table.Column(nullable: true), + ProductName = table.Column(nullable: true) + }, constraints: table => { table.PrimaryKey("PK_PCMCIA", x => x.Id); }); + + migrationBuilder.CreateTable("SecureDigital", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + CID = table.Column(nullable: true), + CSD = table.Column(nullable: true), + OCR = table.Column(nullable: true), + SCR = table.Column(nullable: true), + ExtendedCSD = table.Column(nullable: true) + }, constraints: table => { table.PrimaryKey("PK_SecureDigital", x => x.Id); }); + + migrationBuilder.CreateTable("SSC", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + BlockSizeGranularity = table.Column(nullable: true), + MaxBlockLength = table.Column(nullable: true), + MinBlockLength = table.Column(nullable: true) + }, constraints: table => { table.PrimaryKey("PK_SSC", x => x.Id); }); + + migrationBuilder.CreateTable("USB", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + VendorID = table.Column(nullable: false), + ProductID = table.Column(nullable: false), + Manufacturer = table.Column(nullable: true), + Product = table.Column(nullable: true), + RemovableMedia = table.Column(nullable: false), + Descriptors = table.Column(nullable: true) + }, constraints: table => { table.PrimaryKey("PK_USB", x => x.Id); }); + + migrationBuilder.CreateTable("UshortClass", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Value = table.Column(nullable: false), + InquiryId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_UshortClass", x => x.Id); + table.ForeignKey("FK_UshortClass_Inquiry_InquiryId", x => x.InquiryId, + "Inquiry", "Id", onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("BlockDescriptor", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Density = table.Column(nullable: false), + Blocks = table.Column(nullable: true), + BlockLength = table.Column(nullable: true), + ModeId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_BlockDescriptor", x => x.Id); + table.ForeignKey("FK_BlockDescriptor_Mode_ModeId", x => x.ModeId, "Mode", + "Id", onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("ModePage", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + page = table.Column(nullable: false), + subpage = table.Column(nullable: false), + value = table.Column(nullable: true), + ModeId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_ModePage", x => x.Id); + table.ForeignKey("FK_ModePage_Mode_ModeId", x => x.ModeId, "Mode", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("MMC", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + ModeSense2AId = table.Column(nullable: true), + FeaturesId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_MMC", x => x.Id); + table.ForeignKey("FK_MMC_Features_FeaturesId", x => x.FeaturesId, + "Features", "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_MMC_Mode2A_ModeSense2AId", x => x.ModeSense2AId, + "Mode2A", "Id", onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("WriteDescriptor", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + RotationControl = table.Column(nullable: false), + WriteSpeed = table.Column(nullable: false), + Mode2AId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_WriteDescriptor", x => x.Id); + table.ForeignKey("FK_WriteDescriptor_Mode2A_Mode2AId", x => x.Mode2AId, + "Mode2A", "Id", onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("StringClass", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Value = table.Column(nullable: false), + PCMCIAId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_StringClass", x => x.Id); + table.ForeignKey("FK_StringClass_PCMCIA_PCMCIAId", x => x.PCMCIAId, + "PCMCIA", "Id", onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("SequentialMedia", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + CanReadMediaSerial = table.Column(nullable: true), + Density = table.Column(nullable: true), + Manufacturer = table.Column(nullable: true), + MediaIsRecognized = table.Column(nullable: false), + MediumType = table.Column(nullable: true), + MediumTypeName = table.Column(nullable: true), + Model = table.Column(nullable: true), + ModeSense6Data = table.Column(nullable: true), + ModeSense10Data = table.Column(nullable: true), + SSCId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_SequentialMedia", x => x.Id); + table.ForeignKey("FK_SequentialMedia_SSC_SSCId", x => x.SSCId, "SSC", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("SupportedDensity", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + PrimaryCode = table.Column(nullable: false), + SecondaryCode = table.Column(nullable: false), + Writable = table.Column(nullable: false), + Duplicate = table.Column(nullable: false), + DefaultDensity = table.Column(nullable: false), + BitsPerMm = table.Column(nullable: false), + Width = table.Column(nullable: false), + Tracks = table.Column(nullable: false), + Capacity = table.Column(nullable: false), + Organization = table.Column(nullable: true), + Name = table.Column(nullable: true), + Description = table.Column(nullable: true), + SSCId = table.Column(nullable: true), + SequentialMediaId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_SupportedDensity", x => x.Id); + table.ForeignKey("FK_SupportedDensity_SSC_SSCId", x => x.SSCId, "SSC", + "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_SupportedDensity_SequentialMedia_SequentialMediaId", + x => x.SequentialMediaId, "SequentialMedia", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("SupportedMedia", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + MediumType = table.Column(nullable: false), + Width = table.Column(nullable: false), + Length = table.Column(nullable: false), + Organization = table.Column(nullable: true), + Name = table.Column(nullable: true), + Description = table.Column(nullable: true), + SSCId = table.Column(nullable: true), + SequentialMediaId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_SupportedMedia", x => x.Id); + table.ForeignKey("FK_SupportedMedia_SSC_SSCId", x => x.SSCId, "SSC", "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_SupportedMedia_SequentialMedia_SequentialMediaId", + x => x.SequentialMediaId, "SequentialMedia", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("IntClass", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Value = table.Column(nullable: false), + SupportedMediaId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_IntClass", x => x.Id); + table.ForeignKey("FK_IntClass_SupportedMedia_SupportedMediaId", + x => x.SupportedMediaId, "SupportedMedia", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("Device", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + WhenAdded = table.Column(nullable: false), + WhenModified = table.Column(nullable: true), + Manufacturer = table.Column(nullable: true), + Model = table.Column(nullable: true), + Revision = table.Column(nullable: true), + Type = table.Column(nullable: false), + USBId = table.Column(nullable: true), + FireWireId = table.Column(nullable: true), + PCMCIAId = table.Column(nullable: true), + ATAId = table.Column(nullable: true), + ATAPIId = table.Column(nullable: true), + SCSIId = table.Column(nullable: true), + MultiMediaCardId = table.Column(nullable: true), + SecureDigitalId = table.Column(nullable: true), + IsValid = table.Column(nullable: false), + TimesSeen = table.Column(nullable: false) + }, constraints: table => + { + table.PrimaryKey("PK_Device", x => x.Id); + table.ForeignKey("FK_Device_FireWire_FireWireId", x => x.FireWireId, + "FireWire", "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_Device_SecureDigital_MultiMediaCardId", + x => x.MultiMediaCardId, "SecureDigital", "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_Device_PCMCIA_PCMCIAId", x => x.PCMCIAId, "PCMCIA", + "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_Device_SecureDigital_SecureDigitalId", + x => x.SecureDigitalId, "SecureDigital", "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_Device_USB_USBId", x => x.USBId, "USB", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("TestedMedia", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Blocks = table.Column(nullable: true), + BlockSize = table.Column(nullable: true), + CanReadAACS = table.Column(nullable: true), + CanReadADIP = table.Column(nullable: true), + CanReadATIP = table.Column(nullable: true), + CanReadBCA = table.Column(nullable: true), + CanReadC2Pointers = table.Column(nullable: true), + CanReadCMI = table.Column(nullable: true), + CanReadCorrectedSubchannel = table.Column(nullable: true), + CanReadCorrectedSubchannelWithC2 = table.Column(nullable: true), + CanReadDCB = table.Column(nullable: true), + CanReadDDS = table.Column(nullable: true), + CanReadDMI = table.Column(nullable: true), + CanReadDiscInformation = table.Column(nullable: true), + CanReadFullTOC = table.Column(nullable: true), + CanReadHDCMI = table.Column(nullable: true), + CanReadLayerCapacity = table.Column(nullable: true), + CanReadLeadIn = table.Column(nullable: true), + CanReadLeadInPostgap = table.Column(nullable: true), + CanReadLeadOut = table.Column(nullable: true), + CanReadMediaID = table.Column(nullable: true), + CanReadMediaSerial = table.Column(nullable: true), + CanReadPAC = table.Column(nullable: true), + CanReadPFI = table.Column(nullable: true), + CanReadPMA = table.Column(nullable: true), + CanReadPQSubchannel = table.Column(nullable: true), + CanReadPQSubchannelWithC2 = table.Column(nullable: true), + CanReadPRI = table.Column(nullable: true), + CanReadRWSubchannel = table.Column(nullable: true), + CanReadRWSubchannelWithC2 = table.Column(nullable: true), + CanReadRecordablePFI = table.Column(nullable: true), + CanReadSpareAreaInformation = table.Column(nullable: true), + CanReadTOC = table.Column(nullable: true), + Density = table.Column(nullable: true), + LongBlockSize = table.Column(nullable: true), + Manufacturer = table.Column(nullable: true), + MediaIsRecognized = table.Column(nullable: false), + MediumType = table.Column(nullable: true), + MediumTypeName = table.Column(nullable: true), + Model = table.Column(nullable: true), + SupportsHLDTSTReadRawDVD = table.Column(nullable: true), + SupportsNECReadCDDA = table.Column(nullable: true), + SupportsPioneerReadCDDA = table.Column(nullable: true), + SupportsPioneerReadCDDAMSF = table.Column(nullable: true), + SupportsPlextorReadCDDA = table.Column(nullable: true), + SupportsPlextorReadRawDVD = table.Column(nullable: true), + SupportsRead10 = table.Column(nullable: true), + SupportsRead12 = table.Column(nullable: true), + SupportsRead16 = table.Column(nullable: true), + SupportsRead = table.Column(nullable: true), + SupportsReadCapacity16 = table.Column(nullable: true), + SupportsReadCapacity = table.Column(nullable: true), + SupportsReadCd = table.Column(nullable: true), + SupportsReadCdMsf = table.Column(nullable: true), + SupportsReadCdRaw = table.Column(nullable: true), + SupportsReadCdMsfRaw = table.Column(nullable: true), + SupportsReadLong16 = table.Column(nullable: true), + SupportsReadLong = table.Column(nullable: true), + ModeSense6Data = table.Column(nullable: true), + ModeSense10Data = table.Column(nullable: true), + CHSId = table.Column(nullable: true), + CurrentCHSId = table.Column(nullable: true), + LBASectors = table.Column(nullable: true), + LBA48Sectors = table.Column(nullable: true), + LogicalAlignment = table.Column(nullable: true), + NominalRotationRate = table.Column(nullable: true), + PhysicalBlockSize = table.Column(nullable: true), + SolidStateDevice = table.Column(nullable: true), + UnformattedBPT = table.Column(nullable: true), + UnformattedBPS = table.Column(nullable: true), + SupportsReadDmaLba = table.Column(nullable: true), + SupportsReadDmaRetryLba = table.Column(nullable: true), + SupportsReadLba = table.Column(nullable: true), + SupportsReadRetryLba = table.Column(nullable: true), + SupportsReadLongLba = table.Column(nullable: true), + SupportsReadLongRetryLba = table.Column(nullable: true), + SupportsSeekLba = table.Column(nullable: true), + SupportsReadDmaLba48 = table.Column(nullable: true), + SupportsReadLba48 = table.Column(nullable: true), + SupportsReadDma = table.Column(nullable: true), + SupportsReadDmaRetry = table.Column(nullable: true), + SupportsReadRetry = table.Column(nullable: true), + SupportsReadLongRetry = table.Column(nullable: true), + SupportsSeek = table.Column(nullable: true), + ATAId = table.Column(nullable: true), + MMCId = table.Column(nullable: true), + SCSIId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_TestedMedia", x => x.Id); + table.ForeignKey("FK_TestedMedia_CHS_CHSId", x => x.CHSId, "CHS", "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_TestedMedia_CHS_CurrentCHSId", x => x.CurrentCHSId, + "CHS", "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_TestedMedia_MMC_MMCId", x => x.MMCId, "MMC", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("ATA", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AdditionalPID = table.Column(nullable: true), + APIOSupported = table.Column(nullable: true), + ATAPIByteCount = table.Column(nullable: true), + BufferType = table.Column(nullable: true), + BufferSize = table.Column(nullable: true), + Capabilities = table.Column(nullable: true), + Capabilities2 = table.Column(nullable: true), + Capabilities3 = table.Column(nullable: true), + CFAPowerMode = table.Column(nullable: true), + CommandSet = table.Column(nullable: true), + CommandSet2 = table.Column(nullable: true), + CommandSet3 = table.Column(nullable: true), + CommandSet4 = table.Column(nullable: true), + CommandSet5 = table.Column(nullable: true), + CurrentAAM = table.Column(nullable: true), + CurrentAPM = table.Column(nullable: true), + DataSetMgmt = table.Column(nullable: true), + DataSetMgmtSize = table.Column(nullable: true), + DeviceFormFactor = table.Column(nullable: true), + DMAActive = table.Column(nullable: true), + DMASupported = table.Column(nullable: true), + DMATransferTimingMode = table.Column(nullable: true), + EnhancedSecurityEraseTime = table.Column(nullable: true), + EnabledCommandSet = table.Column(nullable: true), + EnabledCommandSet2 = table.Column(nullable: true), + EnabledCommandSet3 = table.Column(nullable: true), + EnabledCommandSet4 = table.Column(nullable: true), + EnabledSATAFeatures = table.Column(nullable: true), + ExtendedUserSectors = table.Column(nullable: true), + FreeFallSensitivity = table.Column(nullable: true), + FirmwareRevision = table.Column(nullable: true), + GeneralConfiguration = table.Column(nullable: true), + HardwareResetResult = table.Column(nullable: true), + InterseekDelay = table.Column(nullable: true), + MajorVersion = table.Column(nullable: true), + MasterPasswordRevisionCode = table.Column(nullable: true), + MaxDownloadMicroMode3 = table.Column(nullable: true), + MaxQueueDepth = table.Column(nullable: true), + MDMAActive = table.Column(nullable: true), + MDMASupported = table.Column(nullable: true), + MinDownloadMicroMode3 = table.Column(nullable: true), + MinMDMACycleTime = table.Column(nullable: true), + MinorVersion = table.Column(nullable: true), + MinPIOCycleTimeNoFlow = table.Column(nullable: true), + MinPIOCycleTimeFlow = table.Column(nullable: true), + Model = table.Column(nullable: true), + MultipleMaxSectors = table.Column(nullable: true), + MultipleSectorNumber = table.Column(nullable: true), + NVCacheCaps = table.Column(nullable: true), + NVCacheSize = table.Column(nullable: true), + NVCacheWriteSpeed = table.Column(nullable: true), + NVEstimatedSpinUp = table.Column(nullable: true), + PacketBusRelease = table.Column(nullable: true), + PIOTransferTimingMode = table.Column(nullable: true), + RecommendedAAM = table.Column(nullable: true), + RecommendedMDMACycleTime = table.Column(nullable: true), + RemovableStatusSet = table.Column(nullable: true), + SATACapabilities = table.Column(nullable: true), + SATACapabilities2 = table.Column(nullable: true), + SATAFeatures = table.Column(nullable: true), + SCTCommandTransport = table.Column(nullable: true), + SectorsPerCard = table.Column(nullable: true), + SecurityEraseTime = table.Column(nullable: true), + SecurityStatus = table.Column(nullable: true), + ServiceBusyClear = table.Column(nullable: true), + SpecificConfiguration = table.Column(nullable: true), + StreamAccessLatency = table.Column(nullable: true), + StreamMinReqSize = table.Column(nullable: true), + StreamPerformanceGranularity = table.Column(nullable: true), + StreamTransferTimeDMA = table.Column(nullable: true), + StreamTransferTimePIO = table.Column(nullable: true), + TransportMajorVersion = table.Column(nullable: true), + TransportMinorVersion = table.Column(nullable: true), + TrustedComputing = table.Column(nullable: true), + UDMAActive = table.Column(nullable: true), + UDMASupported = table.Column(nullable: true), + WRVMode = table.Column(nullable: true), + WRVSectorCountMode3 = table.Column(nullable: true), + WRVSectorCountMode2 = table.Column(nullable: true), + Identify = table.Column(nullable: true), + ReadCapabilitiesId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_ATA", x => x.Id); + table.ForeignKey("FK_ATA_TestedMedia_ReadCapabilitiesId", + x => x.ReadCapabilitiesId, "TestedMedia", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("SCSI", + table => new + { + Id = + table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + InquiryId = table.Column(nullable: true), + SupportsModeSense6 = table.Column(nullable: false), + SupportsModeSense10 = table.Column(nullable: false), + SupportsModeSubpages = table.Column(nullable: false), + ModeSenseId = table.Column(nullable: true), + MultiMediaDeviceId = table.Column(nullable: true), + ReadCapabilitiesId = table.Column(nullable: true), + SequentialDeviceId = table.Column(nullable: true), + ModeSense6Data = table.Column(nullable: true), + ModeSense10Data = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_SCSI", x => x.Id); + table.ForeignKey("FK_SCSI_Inquiry_InquiryId", x => x.InquiryId, "Inquiry", + "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_SCSI_Mode_ModeSenseId", x => x.ModeSenseId, "Mode", + "Id", onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_SCSI_MMC_MultiMediaDeviceId", + x => x.MultiMediaDeviceId, "MMC", "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_SCSI_TestedMedia_ReadCapabilitiesId", + x => x.ReadCapabilitiesId, "TestedMedia", "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey("FK_SCSI_SSC_SequentialDeviceId", + x => x.SequentialDeviceId, "SSC", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable("Page", + table => new + { + Id = table.Column(nullable: false) + .Annotation("Sqlite:Autoincrement", true), + page = table.Column(nullable: false), + value = table.Column(nullable: true), + SCSIId = table.Column(nullable: true) + }, constraints: table => + { + table.PrimaryKey("PK_Page", x => x.Id); + table.ForeignKey("FK_Page_SCSI_SCSIId", x => x.SCSIId, "SCSI", "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex("IX_ATA_ReadCapabilitiesId", "ATA", "ReadCapabilitiesId"); + + migrationBuilder.CreateIndex("IX_BlockDescriptor_ModeId", "BlockDescriptor", "ModeId"); + + migrationBuilder.CreateIndex("IX_Device_ATAId", "Device", "ATAId"); + + migrationBuilder.CreateIndex("IX_Device_ATAPIId", "Device", "ATAPIId"); + + migrationBuilder.CreateIndex("IX_Device_FireWireId", "Device", "FireWireId"); + + migrationBuilder.CreateIndex("IX_Device_MultiMediaCardId", "Device", "MultiMediaCardId"); + + migrationBuilder.CreateIndex("IX_Device_PCMCIAId", "Device", "PCMCIAId"); + + migrationBuilder.CreateIndex("IX_Device_SCSIId", "Device", "SCSIId"); + + migrationBuilder.CreateIndex("IX_Device_SecureDigitalId", "Device", "SecureDigitalId"); + + migrationBuilder.CreateIndex("IX_Device_USBId", "Device", "USBId"); + + migrationBuilder.CreateIndex("IX_IntClass_SupportedMediaId", "IntClass", "SupportedMediaId"); + + migrationBuilder.CreateIndex("IX_MMC_FeaturesId", "MMC", "FeaturesId"); + + migrationBuilder.CreateIndex("IX_MMC_ModeSense2AId", "MMC", "ModeSense2AId"); + + migrationBuilder.CreateIndex("IX_ModePage_ModeId", "ModePage", "ModeId"); + + migrationBuilder.CreateIndex("IX_Page_SCSIId", "Page", "SCSIId"); + + migrationBuilder.CreateIndex("IX_SCSI_InquiryId", "SCSI", "InquiryId"); + + migrationBuilder.CreateIndex("IX_SCSI_ModeSenseId", "SCSI", "ModeSenseId"); + + migrationBuilder.CreateIndex("IX_SCSI_MultiMediaDeviceId", "SCSI", "MultiMediaDeviceId"); + + migrationBuilder.CreateIndex("IX_SCSI_ReadCapabilitiesId", "SCSI", "ReadCapabilitiesId"); + + migrationBuilder.CreateIndex("IX_SCSI_SequentialDeviceId", "SCSI", "SequentialDeviceId"); + + migrationBuilder.CreateIndex("IX_SequentialMedia_SSCId", "SequentialMedia", "SSCId"); + + migrationBuilder.CreateIndex("IX_StringClass_PCMCIAId", "StringClass", "PCMCIAId"); + + migrationBuilder.CreateIndex("IX_SupportedDensity_SSCId", "SupportedDensity", "SSCId"); + + migrationBuilder.CreateIndex("IX_SupportedDensity_SequentialMediaId", "SupportedDensity", + "SequentialMediaId"); + + migrationBuilder.CreateIndex("IX_SupportedMedia_SSCId", "SupportedMedia", "SSCId"); + + migrationBuilder.CreateIndex("IX_SupportedMedia_SequentialMediaId", "SupportedMedia", "SequentialMediaId"); + + migrationBuilder.CreateIndex("IX_TestedMedia_ATAId", "TestedMedia", "ATAId"); + + migrationBuilder.CreateIndex("IX_TestedMedia_CHSId", "TestedMedia", "CHSId"); + + migrationBuilder.CreateIndex("IX_TestedMedia_CurrentCHSId", "TestedMedia", "CurrentCHSId"); + + migrationBuilder.CreateIndex("IX_TestedMedia_MMCId", "TestedMedia", "MMCId"); + + migrationBuilder.CreateIndex("IX_TestedMedia_SCSIId", "TestedMedia", "SCSIId"); + + migrationBuilder.CreateIndex("IX_UshortClass_InquiryId", "UshortClass", "InquiryId"); + + migrationBuilder.CreateIndex("IX_WriteDescriptor_Mode2AId", "WriteDescriptor", "Mode2AId"); + + migrationBuilder.AddForeignKey("FK_Device_ATA_ATAId", "Device", "ATAId", "ATA", principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey("FK_Device_ATA_ATAPIId", "Device", "ATAPIId", "ATA", principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey("FK_Device_SCSI_SCSIId", "Device", "SCSIId", "SCSI", principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey("FK_TestedMedia_ATA_ATAId", "TestedMedia", "ATAId", "ATA", + principalColumn: "Id", onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey("FK_TestedMedia_SCSI_SCSIId", "TestedMedia", "SCSIId", "SCSI", + principalColumn: "Id", onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey("FK_ATA_TestedMedia_ReadCapabilitiesId", "ATA"); + + migrationBuilder.DropForeignKey("FK_SCSI_TestedMedia_ReadCapabilitiesId", "SCSI"); + + migrationBuilder.DropTable("BlockDescriptor"); + + migrationBuilder.DropTable("Device"); + + migrationBuilder.DropTable("IntClass"); + + migrationBuilder.DropTable("ModePage"); + + migrationBuilder.DropTable("Page"); + + migrationBuilder.DropTable("StringClass"); + + migrationBuilder.DropTable("SupportedDensity"); + + migrationBuilder.DropTable("UshortClass"); + + migrationBuilder.DropTable("WriteDescriptor"); + + migrationBuilder.DropTable("FireWire"); + + migrationBuilder.DropTable("SecureDigital"); + + migrationBuilder.DropTable("USB"); + + migrationBuilder.DropTable("SupportedMedia"); + + migrationBuilder.DropTable("PCMCIA"); + + migrationBuilder.DropTable("SequentialMedia"); + + migrationBuilder.DropTable("TestedMedia"); + + migrationBuilder.DropTable("ATA"); + + migrationBuilder.DropTable("CHS"); + + migrationBuilder.DropTable("SCSI"); + + migrationBuilder.DropTable("Inquiry"); + + migrationBuilder.DropTable("Mode"); + + migrationBuilder.DropTable("MMC"); + + migrationBuilder.DropTable("SSC"); + + migrationBuilder.DropTable("Features"); + + migrationBuilder.DropTable("Mode2A"); + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs b/DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs new file mode 100644 index 000000000..bdc720212 --- /dev/null +++ b/DiscImageChef.Database/Migrations/DicContextModelSnapshot.cs @@ -0,0 +1,1432 @@ +// + +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; + +namespace DiscImageChef.Database.Migrations +{ + [DbContext(typeof(DicContext))] + class DicContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { + #pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "2.1.1-rtm-30846"); + + modelBuilder.Entity("EFTest.Models.ATA", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("APIOSupported"); + + b.Property("ATAPIByteCount"); + + b.Property("AdditionalPID"); + + b.Property("BufferSize"); + + b.Property("BufferType"); + + b.Property("CFAPowerMode"); + + b.Property("Capabilities"); + + b.Property("Capabilities2"); + + b.Property("Capabilities3"); + + b.Property("CommandSet"); + + b.Property("CommandSet2"); + + b.Property("CommandSet3"); + + b.Property("CommandSet4"); + + b.Property("CommandSet5"); + + b.Property("CurrentAAM"); + + b.Property("CurrentAPM"); + + b.Property("DMAActive"); + + b.Property("DMASupported"); + + b.Property("DMATransferTimingMode"); + + b.Property("DataSetMgmt"); + + b.Property("DataSetMgmtSize"); + + b.Property("DeviceFormFactor"); + + b.Property("EnabledCommandSet"); + + b.Property("EnabledCommandSet2"); + + b.Property("EnabledCommandSet3"); + + b.Property("EnabledCommandSet4"); + + b.Property("EnabledSATAFeatures"); + + b.Property("EnhancedSecurityEraseTime"); + + b.Property("ExtendedUserSectors"); + + b.Property("FirmwareRevision"); + + b.Property("FreeFallSensitivity"); + + b.Property("GeneralConfiguration"); + + b.Property("HardwareResetResult"); + + b.Property("Identify"); + + b.Property("InterseekDelay"); + + b.Property("MDMAActive"); + + b.Property("MDMASupported"); + + b.Property("MajorVersion"); + + b.Property("MasterPasswordRevisionCode"); + + b.Property("MaxDownloadMicroMode3"); + + b.Property("MaxQueueDepth"); + + b.Property("MinDownloadMicroMode3"); + + b.Property("MinMDMACycleTime"); + + b.Property("MinPIOCycleTimeFlow"); + + b.Property("MinPIOCycleTimeNoFlow"); + + b.Property("MinorVersion"); + + b.Property("Model"); + + b.Property("MultipleMaxSectors"); + + b.Property("MultipleSectorNumber"); + + b.Property("NVCacheCaps"); + + b.Property("NVCacheSize"); + + b.Property("NVCacheWriteSpeed"); + + b.Property("NVEstimatedSpinUp"); + + b.Property("PIOTransferTimingMode"); + + b.Property("PacketBusRelease"); + + b.Property("ReadCapabilitiesId"); + + b.Property("RecommendedAAM"); + + b.Property("RecommendedMDMACycleTime"); + + b.Property("RemovableStatusSet"); + + b.Property("SATACapabilities"); + + b.Property("SATACapabilities2"); + + b.Property("SATAFeatures"); + + b.Property("SCTCommandTransport"); + + b.Property("SectorsPerCard"); + + b.Property("SecurityEraseTime"); + + b.Property("SecurityStatus"); + + b.Property("ServiceBusyClear"); + + b.Property("SpecificConfiguration"); + + b.Property("StreamAccessLatency"); + + b.Property("StreamMinReqSize"); + + b.Property("StreamPerformanceGranularity"); + + b.Property("StreamTransferTimeDMA"); + + b.Property("StreamTransferTimePIO"); + + b.Property("TransportMajorVersion"); + + b.Property("TransportMinorVersion"); + + b.Property("TrustedComputing"); + + b.Property("UDMAActive"); + + b.Property("UDMASupported"); + + b.Property("WRVMode"); + + b.Property("WRVSectorCountMode2"); + + b.Property("WRVSectorCountMode3"); + + b.HasKey("Id"); + + b.HasIndex("ReadCapabilitiesId"); + + b.ToTable("ATA"); + }); + + modelBuilder.Entity("EFTest.Models.CHS", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("Cylinders"); + + b.Property("Heads"); + + b.Property("Sectors"); + + b.HasKey("Id"); + + b.ToTable("CHS"); + }); + + modelBuilder.Entity("EFTest.Models.Device", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("ATAId"); + + b.Property("ATAPIId"); + + b.Property("FireWireId"); + + b.Property("IsValid"); + + b.Property("Manufacturer"); + + b.Property("Model"); + + b.Property("MultiMediaCardId"); + + b.Property("PCMCIAId"); + + b.Property("Revision"); + + b.Property("SCSIId"); + + b.Property("SecureDigitalId"); + + b.Property("TimesSeen"); + + b.Property("Type"); + + b.Property("USBId"); + + b.Property("WhenAdded"); + + b.Property("WhenModified"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("ATAPIId"); + + b.HasIndex("FireWireId"); + + b.HasIndex("MultiMediaCardId"); + + b.HasIndex("PCMCIAId"); + + b.HasIndex("SCSIId"); + + b.HasIndex("SecureDigitalId"); + + b.HasIndex("USBId"); + + b.ToTable("Device"); + }); + + modelBuilder.Entity("EFTest.Models.FireWire", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("Manufacturer"); + + b.Property("Product"); + + b.Property("ProductID"); + + b.Property("RemovableMedia"); + + b.Property("VendorID"); + + b.HasKey("Id"); + + b.ToTable("FireWire"); + }); + + modelBuilder.Entity("EFTest.Models.IntClass", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("SupportedMediaId"); + + b.Property("Value"); + + b.HasKey("Id"); + + b.HasIndex("SupportedMediaId"); + + b.ToTable("IntClass"); + }); + + modelBuilder.Entity("EFTest.Models.PCMCIA", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("CIS"); + + b.Property("CardCode"); + + b.Property("Compliance"); + + b.Property("Manufacturer"); + + b.Property("ManufacturerCode"); + + b.Property("ProductName"); + + b.HasKey("Id"); + + b.ToTable("PCMCIA"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.BlockDescriptor", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("BlockLength"); + + b.Property("Blocks"); + + b.Property("Density"); + + b.Property("ModeId"); + + b.HasKey("Id"); + + b.HasIndex("ModeId"); + + b.ToTable("BlockDescriptor"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Inquiry", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("ACKRequests"); + + b.Property("AERCSupported"); + + b.Property("ANSIVersion"); + + b.Property("AccessControlCoordinator"); + + b.Property("Address16"); + + b.Property("Address32"); + + b.Property("AsymmetricalLUNAccess"); + + b.Property("BasicQueueing"); + + b.Property("Data"); + + b.Property("DeviceTypeModifier"); + + b.Property("ECMAVersion"); + + b.Property("EnclosureServices"); + + b.Property("HierarchicalLUN"); + + b.Property("ISOVersion"); + + b.Property("IUS"); + + b.Property("LinkedCommands"); + + b.Property("MediumChanger"); + + b.Property("MultiPortDevice"); + + b.Property("NormalACA"); + + b.Property("PeripheralDeviceType"); + + b.Property("PeripheralQualifier"); + + b.Property("ProductIdentification"); + + b.Property("ProductRevisionLevel"); + + b.Property("Protection"); + + b.Property("QAS"); + + b.Property("RelativeAddressing"); + + b.Property("Removable"); + + b.Property("ResponseDataFormat"); + + b.Property("SPIClocking"); + + b.Property("SoftReset"); + + b.Property("StorageArrayController"); + + b.Property("SyncTransfer"); + + b.Property("TaggedCommandQueue"); + + b.Property("TerminateTaskSupported"); + + b.Property("ThirdPartyCopy"); + + b.Property("TranferDisable"); + + b.Property("VendorIdentification"); + + b.Property("WideBus16"); + + b.Property("WideBus32"); + + b.HasKey("Id"); + + b.ToTable("Inquiry"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.Features", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("AACSVersion"); + + b.Property("AGIDs"); + + b.Property("BindingNonceBlocks"); + + b.Property("BlocksPerReadableUnit"); + + b.Property("BufferUnderrunFreeInDVD"); + + b.Property("BufferUnderrunFreeInSAO"); + + b.Property("BufferUnderrunFreeInTAO"); + + b.Property("CPRMVersion"); + + b.Property("CSSVersion"); + + b.Property("CanAudioScan"); + + b.Property("CanEject"); + + b.Property("CanEraseSector"); + + b.Property("CanExpandBDRESpareArea"); + + b.Property("CanFormat"); + + b.Property("CanFormatBDREWithoutSpare"); + + b.Property("CanFormatCert"); + + b.Property("CanFormatFRF"); + + b.Property("CanFormatQCert"); + + b.Property("CanFormatRRM"); + + b.Property("CanGenerateBindingNonce"); + + b.Property("CanLoad"); + + b.Property("CanMuteSeparateChannels"); + + b.Property("CanOverwriteSAOTrack"); + + b.Property("CanOverwriteTAOTrack"); + + b.Property("CanPlayCDAudio"); + + b.Property("CanPseudoOverwriteBDR"); + + b.Property("CanReadAllDualR"); + + b.Property("CanReadAllDualRW"); + + b.Property("CanReadBD"); + + b.Property("CanReadBDR"); + + b.Property("CanReadBDRE1"); + + b.Property("CanReadBDRE2"); + + b.Property("CanReadBDROM"); + + b.Property("CanReadBluBCA"); + + b.Property("CanReadCD"); + + b.Property("CanReadCDMRW"); + + b.Property("CanReadCPRM_MKB"); + + b.Property("CanReadDDCD"); + + b.Property("CanReadDVD"); + + b.Property("CanReadDVDPlusMRW"); + + b.Property("CanReadDVDPlusR"); + + b.Property("CanReadDVDPlusRDL"); + + b.Property("CanReadDVDPlusRW"); + + b.Property("CanReadDVDPlusRWDL"); + + b.Property("CanReadDriveAACSCertificate"); + + b.Property("CanReadHDDVD"); + + b.Property("CanReadHDDVDR"); + + b.Property("CanReadHDDVDRAM"); + + b.Property("CanReadLeadInCDText"); + + b.Property("CanReadOldBDR"); + + b.Property("CanReadOldBDRE"); + + b.Property("CanReadOldBDROM"); + + b.Property("CanReadSpareAreaInformation"); + + b.Property("CanReportDriveSerial"); + + b.Property("CanReportMediaSerial"); + + b.Property("CanTestWriteDDCDR"); + + b.Property("CanTestWriteDVD"); + + b.Property("CanTestWriteInSAO"); + + b.Property("CanTestWriteInTAO"); + + b.Property("CanUpgradeFirmware"); + + b.Property("CanWriteBD"); + + b.Property("CanWriteBDR"); + + b.Property("CanWriteBDRE1"); + + b.Property("CanWriteBDRE2"); + + b.Property("CanWriteBusEncryptedBlocks"); + + b.Property("CanWriteCDMRW"); + + b.Property("CanWriteCDRW"); + + b.Property("CanWriteCDRWCAV"); + + b.Property("CanWriteCDSAO"); + + b.Property("CanWriteCDTAO"); + + b.Property("CanWriteCSSManagedDVD"); + + b.Property("CanWriteDDCDR"); + + b.Property("CanWriteDDCDRW"); + + b.Property("CanWriteDVDPlusMRW"); + + b.Property("CanWriteDVDPlusR"); + + b.Property("CanWriteDVDPlusRDL"); + + b.Property("CanWriteDVDPlusRW"); + + b.Property("CanWriteDVDPlusRWDL"); + + b.Property("CanWriteDVDR"); + + b.Property("CanWriteDVDRDL"); + + b.Property("CanWriteDVDRW"); + + b.Property("CanWriteHDDVDR"); + + b.Property("CanWriteHDDVDRAM"); + + b.Property("CanWriteOldBDR"); + + b.Property("CanWriteOldBDRE"); + + b.Property("CanWritePackedSubchannelInTAO"); + + b.Property("CanWriteRWSubchannelInSAO"); + + b.Property("CanWriteRWSubchannelInTAO"); + + b.Property("CanWriteRaw"); + + b.Property("CanWriteRawMultiSession"); + + b.Property("CanWriteRawSubchannelInTAO"); + + b.Property("ChangerIsSideChangeCapable"); + + b.Property("ChangerSlots"); + + b.Property("ChangerSupportsDiscPresent"); + + b.Property("DBML"); + + b.Property("DVDMultiRead"); + + b.Property("EmbeddedChanger"); + + b.Property("ErrorRecoveryPage"); + + b.Property("FirmwareDate"); + + b.Property("LoadingMechanismType"); + + b.Property("Locked"); + + b.Property("LogicalBlockSize"); + + b.Property("MultiRead"); + + b.Property("PhysicalInterfaceStandard"); + + b.Property("PhysicalInterfaceStandardNumber"); + + b.Property("PreventJumper"); + + b.Property("SupportsAACS"); + + b.Property("SupportsBusEncryption"); + + b.Property("SupportsC2"); + + b.Property("SupportsCPRM"); + + b.Property("SupportsCSS"); + + b.Property("SupportsDAP"); + + b.Property("SupportsDeviceBusyEvent"); + + b.Property("SupportsHybridDiscs"); + + b.Property("SupportsModePage1Ch"); + + b.Property("SupportsOSSC"); + + b.Property("SupportsPWP"); + + b.Property("SupportsSWPP"); + + b.Property("SupportsSecurDisc"); + + b.Property("SupportsSeparateVolume"); + + b.Property("SupportsVCPS"); + + b.Property("SupportsWriteInhibitDCB"); + + b.Property("SupportsWriteProtectPAC"); + + b.Property("VolumeLevels"); + + b.HasKey("Id"); + + b.ToTable("Features"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.MMC", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("FeaturesId"); + + b.Property("ModeSense2AId"); + + b.HasKey("Id"); + + b.HasIndex("FeaturesId"); + + b.HasIndex("ModeSense2AId"); + + b.ToTable("MMC"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.Mode2A", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("AccurateCDDA"); + + b.Property("BCK"); + + b.Property("BufferSize"); + + b.Property("BufferUnderRunProtection"); + + b.Property("CDDACommand"); + + b.Property("CSSandCPPMSupported"); + + b.Property("CanEject"); + + b.Property("CanLockMedia"); + + b.Property("CompositeAudioVideo"); + + b.Property("CurrentSpeed"); + + b.Property("CurrentWriteSpeed"); + + b.Property("CurrentWriteSpeedSelected"); + + b.Property("DeterministicSlotChanger"); + + b.Property("DigitalPort1"); + + b.Property("DigitalPort2"); + + b.Property("LSBF"); + + b.Property("LeadInPW"); + + b.Property("LoadingMechanismType"); + + b.Property("LockStatus"); + + b.Property("MaximumSpeed"); + + b.Property("MaximumWriteSpeed"); + + b.Property("PlaysAudio"); + + b.Property("PreventJumperStatus"); + + b.Property("RCK"); + + b.Property("ReadsBarcode"); + + b.Property("ReadsBothSides"); + + b.Property("ReadsCDR"); + + b.Property("ReadsCDRW"); + + b.Property("ReadsDVDR"); + + b.Property("ReadsDVDRAM"); + + b.Property("ReadsDVDROM"); + + b.Property("ReadsDeinterlavedSubchannel"); + + b.Property("ReadsISRC"); + + b.Property("ReadsMode2Form1"); + + b.Property("ReadsMode2Form2"); + + b.Property("ReadsPacketCDR"); + + b.Property("ReadsSubchannel"); + + b.Property("ReadsUPC"); + + b.Property("ReturnsC2Pointers"); + + b.Property("RotationControlSelected"); + + b.Property("SSS"); + + b.Property("SeparateChannelMute"); + + b.Property("SeparateChannelVolume"); + + b.Property("SupportedVolumeLevels"); + + b.Property("SupportsMultiSession"); + + b.Property("TestWrite"); + + b.Property("WritesCDR"); + + b.Property("WritesCDRW"); + + b.Property("WritesDVDR"); + + b.Property("WritesDVDRAM"); + + b.HasKey("Id"); + + b.ToTable("Mode2A"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.WriteDescriptor", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("Mode2AId"); + + b.Property("RotationControl"); + + b.Property("WriteSpeed"); + + b.HasKey("Id"); + + b.HasIndex("Mode2AId"); + + b.ToTable("WriteDescriptor"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Mode", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("BlankCheckEnabled"); + + b.Property("BufferedMode"); + + b.Property("DPOandFUA"); + + b.Property("MediumType"); + + b.Property("Speed"); + + b.Property("WriteProtected"); + + b.HasKey("Id"); + + b.ToTable("Mode"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.ModePage", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("ModeId"); + + b.Property("page"); + + b.Property("subpage"); + + b.Property("value"); + + b.HasKey("Id"); + + b.HasIndex("ModeId"); + + b.ToTable("ModePage"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Page", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("SCSIId"); + + b.Property("page"); + + b.Property("value"); + + b.HasKey("Id"); + + b.HasIndex("SCSIId"); + + b.ToTable("Page"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SCSI", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("InquiryId"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("ModeSenseId"); + + b.Property("MultiMediaDeviceId"); + + b.Property("ReadCapabilitiesId"); + + b.Property("SequentialDeviceId"); + + b.Property("SupportsModeSense10"); + + b.Property("SupportsModeSense6"); + + b.Property("SupportsModeSubpages"); + + b.HasKey("Id"); + + b.HasIndex("InquiryId"); + + b.HasIndex("ModeSenseId"); + + b.HasIndex("MultiMediaDeviceId"); + + b.HasIndex("ReadCapabilitiesId"); + + b.HasIndex("SequentialDeviceId"); + + b.ToTable("SCSI"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SequentialMedia", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("CanReadMediaSerial"); + + b.Property("Density"); + + b.Property("Manufacturer"); + + b.Property("MediaIsRecognized"); + + b.Property("MediumType"); + + b.Property("MediumTypeName"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("Model"); + + b.Property("SSCId"); + + b.HasKey("Id"); + + b.HasIndex("SSCId"); + + b.ToTable("SequentialMedia"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SSC", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("BlockSizeGranularity"); + + b.Property("MaxBlockLength"); + + b.Property("MinBlockLength"); + + b.HasKey("Id"); + + b.ToTable("SSC"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SupportedDensity", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("BitsPerMm"); + + b.Property("Capacity"); + + b.Property("DefaultDensity"); + + b.Property("Description"); + + b.Property("Duplicate"); + + b.Property("Name"); + + b.Property("Organization"); + + b.Property("PrimaryCode"); + + b.Property("SSCId"); + + b.Property("SecondaryCode"); + + b.Property("SequentialMediaId"); + + b.Property("Tracks"); + + b.Property("Width"); + + b.Property("Writable"); + + b.HasKey("Id"); + + b.HasIndex("SSCId"); + + b.HasIndex("SequentialMediaId"); + + b.ToTable("SupportedDensity"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SupportedMedia", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("Description"); + + b.Property("Length"); + + b.Property("MediumType"); + + b.Property("Name"); + + b.Property("Organization"); + + b.Property("SSCId"); + + b.Property("SequentialMediaId"); + + b.Property("Width"); + + b.HasKey("Id"); + + b.HasIndex("SSCId"); + + b.HasIndex("SequentialMediaId"); + + b.ToTable("SupportedMedia"); + }); + + modelBuilder.Entity("EFTest.Models.SecureDigital", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("CID"); + + b.Property("CSD"); + + b.Property("ExtendedCSD"); + + b.Property("OCR"); + + b.Property("SCR"); + + b.HasKey("Id"); + + b.ToTable("SecureDigital"); + }); + + modelBuilder.Entity("EFTest.Models.StringClass", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("PCMCIAId"); + + b.Property("Value").IsRequired(); + + b.HasKey("Id"); + + b.HasIndex("PCMCIAId"); + + b.ToTable("StringClass"); + }); + + modelBuilder.Entity("EFTest.Models.TestedMedia", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("ATAId"); + + b.Property("BlockSize"); + + b.Property("Blocks"); + + b.Property("CHSId"); + + b.Property("CanReadAACS"); + + b.Property("CanReadADIP"); + + b.Property("CanReadATIP"); + + b.Property("CanReadBCA"); + + b.Property("CanReadC2Pointers"); + + b.Property("CanReadCMI"); + + b.Property("CanReadCorrectedSubchannel"); + + b.Property("CanReadCorrectedSubchannelWithC2"); + + b.Property("CanReadDCB"); + + b.Property("CanReadDDS"); + + b.Property("CanReadDMI"); + + b.Property("CanReadDiscInformation"); + + b.Property("CanReadFullTOC"); + + b.Property("CanReadHDCMI"); + + b.Property("CanReadLayerCapacity"); + + b.Property("CanReadLeadIn"); + + b.Property("CanReadLeadInPostgap"); + + b.Property("CanReadLeadOut"); + + b.Property("CanReadMediaID"); + + b.Property("CanReadMediaSerial"); + + b.Property("CanReadPAC"); + + b.Property("CanReadPFI"); + + b.Property("CanReadPMA"); + + b.Property("CanReadPQSubchannel"); + + b.Property("CanReadPQSubchannelWithC2"); + + b.Property("CanReadPRI"); + + b.Property("CanReadRWSubchannel"); + + b.Property("CanReadRWSubchannelWithC2"); + + b.Property("CanReadRecordablePFI"); + + b.Property("CanReadSpareAreaInformation"); + + b.Property("CanReadTOC"); + + b.Property("CurrentCHSId"); + + b.Property("Density"); + + b.Property("LBA48Sectors"); + + b.Property("LBASectors"); + + b.Property("LogicalAlignment"); + + b.Property("LongBlockSize"); + + b.Property("MMCId"); + + b.Property("Manufacturer"); + + b.Property("MediaIsRecognized"); + + b.Property("MediumType"); + + b.Property("MediumTypeName"); + + b.Property("ModeSense10Data"); + + b.Property("ModeSense6Data"); + + b.Property("Model"); + + b.Property("NominalRotationRate"); + + b.Property("PhysicalBlockSize"); + + b.Property("SCSIId"); + + b.Property("SolidStateDevice"); + + b.Property("SupportsHLDTSTReadRawDVD"); + + b.Property("SupportsNECReadCDDA"); + + b.Property("SupportsPioneerReadCDDA"); + + b.Property("SupportsPioneerReadCDDAMSF"); + + b.Property("SupportsPlextorReadCDDA"); + + b.Property("SupportsPlextorReadRawDVD"); + + b.Property("SupportsRead"); + + b.Property("SupportsRead10"); + + b.Property("SupportsRead12"); + + b.Property("SupportsRead16"); + + b.Property("SupportsReadCapacity"); + + b.Property("SupportsReadCapacity16"); + + b.Property("SupportsReadCd"); + + b.Property("SupportsReadCdMsf"); + + b.Property("SupportsReadCdMsfRaw"); + + b.Property("SupportsReadCdRaw"); + + b.Property("SupportsReadDma"); + + b.Property("SupportsReadDmaLba"); + + b.Property("SupportsReadDmaLba48"); + + b.Property("SupportsReadDmaRetry"); + + b.Property("SupportsReadDmaRetryLba"); + + b.Property("SupportsReadLba"); + + b.Property("SupportsReadLba48"); + + b.Property("SupportsReadLong"); + + b.Property("SupportsReadLong16"); + + b.Property("SupportsReadLongLba"); + + b.Property("SupportsReadLongRetry"); + + b.Property("SupportsReadLongRetryLba"); + + b.Property("SupportsReadRetry"); + + b.Property("SupportsReadRetryLba"); + + b.Property("SupportsSeek"); + + b.Property("SupportsSeekLba"); + + b.Property("UnformattedBPS"); + + b.Property("UnformattedBPT"); + + b.HasKey("Id"); + + b.HasIndex("ATAId"); + + b.HasIndex("CHSId"); + + b.HasIndex("CurrentCHSId"); + + b.HasIndex("MMCId"); + + b.HasIndex("SCSIId"); + + b.ToTable("TestedMedia"); + }); + + modelBuilder.Entity("EFTest.Models.USB", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("Descriptors"); + + b.Property("Manufacturer"); + + b.Property("Product"); + + b.Property("ProductID"); + + b.Property("RemovableMedia"); + + b.Property("VendorID"); + + b.HasKey("Id"); + + b.ToTable("USB"); + }); + + modelBuilder.Entity("EFTest.Models.UshortClass", b => + { + b.Property("Id").ValueGeneratedOnAdd(); + + b.Property("InquiryId"); + + b.Property("Value"); + + b.HasKey("Id"); + + b.HasIndex("InquiryId"); + + b.ToTable("UshortClass"); + }); + + modelBuilder.Entity("EFTest.Models.ATA", + b => + { + b.HasOne("EFTest.Models.TestedMedia", "ReadCapabilities").WithMany() + .HasForeignKey("ReadCapabilitiesId"); + }); + + modelBuilder.Entity("EFTest.Models.Device", b => + { + b.HasOne("EFTest.Models.ATA", "ATA").WithMany().HasForeignKey("ATAId"); + + b.HasOne("EFTest.Models.ATA", "ATAPI").WithMany().HasForeignKey("ATAPIId"); + + b.HasOne("EFTest.Models.FireWire", "FireWire").WithMany().HasForeignKey("FireWireId"); + + b.HasOne("EFTest.Models.SecureDigital", "MultiMediaCard").WithMany().HasForeignKey("MultiMediaCardId"); + + b.HasOne("EFTest.Models.PCMCIA", "PCMCIA").WithMany().HasForeignKey("PCMCIAId"); + + b.HasOne("EFTest.Models.SCSI.SCSI", "SCSI").WithMany().HasForeignKey("SCSIId"); + + b.HasOne("EFTest.Models.SecureDigital", "SecureDigital").WithMany().HasForeignKey("SecureDigitalId"); + + b.HasOne("EFTest.Models.USB", "USB").WithMany().HasForeignKey("USBId"); + }); + + modelBuilder.Entity("EFTest.Models.IntClass", + b => + { + b.HasOne("EFTest.Models.SCSI.SupportedMedia").WithMany("DensityCodes") + .HasForeignKey("SupportedMediaId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.BlockDescriptor", + b => + { + b.HasOne("EFTest.Models.SCSI.Mode").WithMany("BlockDescriptors") + .HasForeignKey("ModeId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.MMC", b => + { + b.HasOne("EFTest.Models.SCSI.MMC.Features", "Features").WithMany().HasForeignKey("FeaturesId"); + + b.HasOne("EFTest.Models.SCSI.MMC.Mode2A", "ModeSense2A").WithMany().HasForeignKey("ModeSense2AId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.MMC.WriteDescriptor", + b => + { + b.HasOne("EFTest.Models.SCSI.MMC.Mode2A") + .WithMany("WriteSpeedPerformanceDescriptors").HasForeignKey("Mode2AId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.ModePage", + b => + { + b.HasOne("EFTest.Models.SCSI.Mode").WithMany("ModePages").HasForeignKey("ModeId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.Page", + b => + { + b.HasOne("EFTest.Models.SCSI.SCSI").WithMany("EVPDPages").HasForeignKey("SCSIId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SCSI", b => + { + b.HasOne("EFTest.Models.SCSI.Inquiry", "Inquiry").WithMany().HasForeignKey("InquiryId"); + + b.HasOne("EFTest.Models.SCSI.Mode", "ModeSense").WithMany().HasForeignKey("ModeSenseId"); + + b.HasOne("EFTest.Models.SCSI.MMC.MMC", "MultiMediaDevice").WithMany() + .HasForeignKey("MultiMediaDeviceId"); + + b.HasOne("EFTest.Models.TestedMedia", "ReadCapabilities").WithMany() + .HasForeignKey("ReadCapabilitiesId"); + + b.HasOne("EFTest.Models.SCSI.SSC.SSC", "SequentialDevice").WithMany() + .HasForeignKey("SequentialDeviceId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SequentialMedia", + b => + { + b.HasOne("EFTest.Models.SCSI.SSC.SSC").WithMany("TestedMedia") + .HasForeignKey("SSCId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SSC.SupportedDensity", b => + { + b.HasOne("EFTest.Models.SCSI.SSC.SSC").WithMany("SupportedDensities").HasForeignKey("SSCId"); + + b.HasOne("EFTest.Models.SCSI.SSC.SequentialMedia").WithMany("SupportedDensities") + .HasForeignKey("SequentialMediaId"); + }); + + modelBuilder.Entity("EFTest.Models.SCSI.SupportedMedia", b => + { + b.HasOne("EFTest.Models.SCSI.SSC.SSC").WithMany("SupportedMediaTypes").HasForeignKey("SSCId"); + + b.HasOne("EFTest.Models.SCSI.SSC.SequentialMedia").WithMany("SupportedMediaTypes") + .HasForeignKey("SequentialMediaId"); + }); + + modelBuilder.Entity("EFTest.Models.StringClass", + b => + { + b.HasOne("EFTest.Models.PCMCIA").WithMany("AdditionalInformation") + .HasForeignKey("PCMCIAId"); + }); + + modelBuilder.Entity("EFTest.Models.TestedMedia", b => + { + b.HasOne("EFTest.Models.ATA").WithMany("RemovableMedias").HasForeignKey("ATAId"); + + b.HasOne("EFTest.Models.CHS", "CHS").WithMany().HasForeignKey("CHSId"); + + b.HasOne("EFTest.Models.CHS", "CurrentCHS").WithMany().HasForeignKey("CurrentCHSId"); + + b.HasOne("EFTest.Models.SCSI.MMC.MMC").WithMany("TestedMedia").HasForeignKey("MMCId"); + + b.HasOne("EFTest.Models.SCSI.SCSI").WithMany("RemovableMedias").HasForeignKey("SCSIId"); + }); + + modelBuilder.Entity("EFTest.Models.UshortClass", + b => + { + b.HasOne("EFTest.Models.SCSI.Inquiry").WithMany("VersionDescriptors") + .HasForeignKey("InquiryId"); + }); + #pragma warning restore 612, 618 + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/ATA.cs b/DiscImageChef.Database/Models/ATA.cs new file mode 100644 index 000000000..5ccdb52f9 --- /dev/null +++ b/DiscImageChef.Database/Models/ATA.cs @@ -0,0 +1,225 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : ATA.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for ATA/ATAPI device information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; +using DiscImageChef.Decoders.ATA; + +namespace DiscImageChef.Database.Models +{ + public class ATA : BaseEntity + { + public string AdditionalPID { get; set; } + public Identify.TransferMode? APIOSupported { get; set; } + public ushort? ATAPIByteCount { get; set; } + public ushort? BufferType { get; set; } + public ushort? BufferSize { get; set; } + public Identify.CapabilitiesBit? Capabilities { get; set; } + public Identify.CapabilitiesBit2? Capabilities2 { get; set; } + public Identify.CapabilitiesBit3? Capabilities3 { get; set; } + public ushort? CFAPowerMode { get; set; } + public Identify.CommandSetBit? CommandSet { get; set; } + public Identify.CommandSetBit2? CommandSet2 { get; set; } + public Identify.CommandSetBit3? CommandSet3 { get; set; } + public Identify.CommandSetBit4? CommandSet4 { get; set; } + public Identify.CommandSetBit5? CommandSet5 { get; set; } + public byte? CurrentAAM { get; set; } + public ushort? CurrentAPM { get; set; } + public Identify.DataSetMgmtBit? DataSetMgmt { get; set; } + public ushort? DataSetMgmtSize { get; set; } + public Identify.DeviceFormFactorEnum? DeviceFormFactor { get; set; } + public Identify.TransferMode? DMAActive { get; set; } + public Identify.TransferMode? DMASupported { get; set; } + public byte? DMATransferTimingMode { get; set; } + public ushort? EnhancedSecurityEraseTime { get; set; } + public Identify.CommandSetBit? EnabledCommandSet { get; set; } + public Identify.CommandSetBit2? EnabledCommandSet2 { get; set; } + public Identify.CommandSetBit3? EnabledCommandSet3 { get; set; } + public Identify.CommandSetBit4? EnabledCommandSet4 { get; set; } + public Identify.SATAFeaturesBit? EnabledSATAFeatures { get; set; } + public ulong? ExtendedUserSectors { get; set; } + public byte? FreeFallSensitivity { get; set; } + public string FirmwareRevision { get; set; } + public Identify.GeneralConfigurationBit? GeneralConfiguration { get; set; } + public ushort? HardwareResetResult { get; set; } + public ushort? InterseekDelay { get; set; } + public Identify.MajorVersionBit? MajorVersion { get; set; } + public ushort? MasterPasswordRevisionCode { get; set; } + public ushort? MaxDownloadMicroMode3 { get; set; } + public ushort? MaxQueueDepth { get; set; } + public Identify.TransferMode? MDMAActive { get; set; } + public Identify.TransferMode? MDMASupported { get; set; } + public ushort? MinDownloadMicroMode3 { get; set; } + public ushort? MinMDMACycleTime { get; set; } + public ushort? MinorVersion { get; set; } + public ushort? MinPIOCycleTimeNoFlow { get; set; } + public ushort? MinPIOCycleTimeFlow { get; set; } + public string Model { get; set; } + public byte? MultipleMaxSectors { get; set; } + public byte? MultipleSectorNumber { get; set; } + public ushort? NVCacheCaps { get; set; } + public uint? NVCacheSize { get; set; } + public ushort? NVCacheWriteSpeed { get; set; } + public byte? NVEstimatedSpinUp { get; set; } + public ushort? PacketBusRelease { get; set; } + public byte? PIOTransferTimingMode { get; set; } + public byte? RecommendedAAM { get; set; } + public ushort? RecommendedMDMACycleTime { get; set; } + public ushort? RemovableStatusSet { get; set; } + public Identify.SATACapabilitiesBit? SATACapabilities { get; set; } + public Identify.SATACapabilitiesBit2? SATACapabilities2 { get; set; } + public Identify.SATAFeaturesBit? SATAFeatures { get; set; } + public Identify.SCTCommandTransportBit? SCTCommandTransport { get; set; } + public uint? SectorsPerCard { get; set; } + public ushort? SecurityEraseTime { get; set; } + public Identify.SecurityStatusBit? SecurityStatus { get; set; } + public ushort? ServiceBusyClear { get; set; } + public Identify.SpecificConfigurationEnum? SpecificConfiguration { get; set; } + public ushort? StreamAccessLatency { get; set; } + public ushort? StreamMinReqSize { get; set; } + public uint? StreamPerformanceGranularity { get; set; } + public ushort? StreamTransferTimeDMA { get; set; } + public ushort? StreamTransferTimePIO { get; set; } + public ushort? TransportMajorVersion { get; set; } + public ushort? TransportMinorVersion { get; set; } + public Identify.TrustedComputingBit? TrustedComputing { get; set; } + public Identify.TransferMode? UDMAActive { get; set; } + public Identify.TransferMode? UDMASupported { get; set; } + public byte? WRVMode { get; set; } + public uint? WRVSectorCountMode3 { get; set; } + public uint? WRVSectorCountMode2 { get; set; } + public byte[] Identify { get; set; } + public TestedMedia ReadCapabilities { get; set; } + public List RemovableMedias { get; set; } + + public static ATA MapAta(ataType oldAta) + { + if(oldAta == null) return null; + + ATA newAta = new ATA + { + Identify = oldAta.Identify, + ReadCapabilities = TestedMedia.MapTestedMedia(oldAta.ReadCapabilities) + }; + if(oldAta.AdditionalPIDSpecified) newAta.AdditionalPID = oldAta.AdditionalPID; + if(oldAta.APIOSupportedSpecified) newAta.APIOSupported = oldAta.APIOSupported; + if(oldAta.ATAPIByteCountSpecified) newAta.ATAPIByteCount = oldAta.ATAPIByteCount; + if(oldAta.BufferTypeSpecified) newAta.BufferType = oldAta.BufferType; + if(oldAta.BufferSizeSpecified) newAta.BufferSize = oldAta.BufferSize; + if(oldAta.CapabilitiesSpecified) newAta.Capabilities = oldAta.Capabilities; + if(oldAta.Capabilities2Specified) newAta.Capabilities2 = oldAta.Capabilities2; + if(oldAta.Capabilities3Specified) newAta.Capabilities3 = oldAta.Capabilities3; + if(oldAta.CFAPowerModeSpecified) newAta.CFAPowerMode = oldAta.CFAPowerMode; + if(oldAta.CommandSetSpecified) newAta.CommandSet = oldAta.CommandSet; + if(oldAta.CommandSet2Specified) newAta.CommandSet2 = oldAta.CommandSet2; + if(oldAta.CommandSet3Specified) newAta.CommandSet3 = oldAta.CommandSet3; + if(oldAta.CommandSet4Specified) newAta.CommandSet4 = oldAta.CommandSet4; + if(oldAta.CommandSet5Specified) newAta.CommandSet5 = oldAta.CommandSet5; + if(oldAta.CurrentAAMSpecified) newAta.CurrentAAM = oldAta.CurrentAAM; + if(oldAta.CurrentAPMSpecified) newAta.CurrentAPM = oldAta.CurrentAPM; + if(oldAta.DataSetMgmtSpecified) newAta.DataSetMgmt = oldAta.DataSetMgmt; + if(oldAta.DataSetMgmtSizeSpecified) newAta.DataSetMgmtSize = oldAta.DataSetMgmtSize; + if(oldAta.DeviceFormFactorSpecified) newAta.DeviceFormFactor = oldAta.DeviceFormFactor; + if(oldAta.DMAActiveSpecified) newAta.DMAActive = oldAta.DMAActive; + if(oldAta.DMASupportedSpecified) newAta.DMASupported = oldAta.DMASupported; + if(oldAta.DMATransferTimingModeSpecified) newAta.DMATransferTimingMode = oldAta.DMATransferTimingMode; + if(oldAta.EnhancedSecurityEraseTimeSpecified) + newAta.EnhancedSecurityEraseTime = oldAta.EnhancedSecurityEraseTime; + if(oldAta.EnabledCommandSetSpecified) newAta.EnabledCommandSet = oldAta.EnabledCommandSet; + if(oldAta.EnabledCommandSet2Specified) newAta.EnabledCommandSet2 = oldAta.EnabledCommandSet2; + if(oldAta.EnabledCommandSet3Specified) newAta.EnabledCommandSet3 = oldAta.EnabledCommandSet3; + if(oldAta.EnabledCommandSet4Specified) newAta.EnabledCommandSet4 = oldAta.EnabledCommandSet4; + if(oldAta.EnabledSATAFeaturesSpecified) newAta.EnabledSATAFeatures = oldAta.EnabledSATAFeatures; + if(oldAta.ExtendedUserSectorsSpecified) newAta.ExtendedUserSectors = oldAta.ExtendedUserSectors; + if(oldAta.FreeFallSensitivitySpecified) newAta.FreeFallSensitivity = oldAta.FreeFallSensitivity; + if(oldAta.FirmwareRevisionSpecified) newAta.FirmwareRevision = oldAta.FirmwareRevision; + if(oldAta.GeneralConfigurationSpecified) newAta.GeneralConfiguration = oldAta.GeneralConfiguration; + if(oldAta.HardwareResetResultSpecified) newAta.HardwareResetResult = oldAta.HardwareResetResult; + if(oldAta.InterseekDelaySpecified) newAta.InterseekDelay = oldAta.InterseekDelay; + if(oldAta.MajorVersionSpecified) newAta.MajorVersion = oldAta.MajorVersion; + if(oldAta.MasterPasswordRevisionCodeSpecified) + newAta.MasterPasswordRevisionCode = oldAta.MasterPasswordRevisionCode; + if(oldAta.MaxDownloadMicroMode3Specified) newAta.MaxDownloadMicroMode3 = oldAta.MaxDownloadMicroMode3; + if(oldAta.MaxQueueDepthSpecified) newAta.MaxQueueDepth = oldAta.MaxQueueDepth; + if(oldAta.MDMAActiveSpecified) newAta.MDMAActive = oldAta.MDMAActive; + if(oldAta.MDMASupportedSpecified) newAta.MDMASupported = oldAta.MDMASupported; + if(oldAta.MinDownloadMicroMode3Specified) newAta.MinDownloadMicroMode3 = oldAta.MinDownloadMicroMode3; + if(oldAta.MinMDMACycleTimeSpecified) newAta.MinMDMACycleTime = oldAta.MinMDMACycleTime; + if(oldAta.MinorVersionSpecified) newAta.MinorVersion = oldAta.MinorVersion; + if(oldAta.MinPIOCycleTimeNoFlowSpecified) newAta.MinPIOCycleTimeNoFlow = oldAta.MinPIOCycleTimeNoFlow; + if(oldAta.MinPIOCycleTimeFlowSpecified) newAta.MinPIOCycleTimeFlow = oldAta.MinPIOCycleTimeFlow; + if(oldAta.ModelSpecified) newAta.Model = oldAta.Model; + if(oldAta.MultipleMaxSectorsSpecified) newAta.MultipleMaxSectors = oldAta.MultipleMaxSectors; + if(oldAta.MultipleSectorNumberSpecified) newAta.MultipleSectorNumber = oldAta.MultipleSectorNumber; + if(oldAta.NVCacheCapsSpecified) newAta.NVCacheCaps = oldAta.NVCacheCaps; + if(oldAta.NVCacheSizeSpecified) newAta.NVCacheSize = oldAta.NVCacheSize; + if(oldAta.NVCacheWriteSpeedSpecified) newAta.NVCacheWriteSpeed = oldAta.NVCacheWriteSpeed; + if(oldAta.NVEstimatedSpinUpSpecified) newAta.NVEstimatedSpinUp = oldAta.NVEstimatedSpinUp; + if(oldAta.PacketBusReleaseSpecified) newAta.PacketBusRelease = oldAta.PacketBusRelease; + if(oldAta.PIOTransferTimingModeSpecified) newAta.PIOTransferTimingMode = oldAta.PIOTransferTimingMode; + if(oldAta.RecommendedAAMSpecified) newAta.RecommendedAAM = oldAta.RecommendedAAM; + if(oldAta.RecommendedMDMACycleTimeSpecified) + newAta.RecommendedMDMACycleTime = oldAta.RecommendedMDMACycleTime; + if(oldAta.RemovableStatusSetSpecified) newAta.RemovableStatusSet = oldAta.RemovableStatusSet; + if(oldAta.SATACapabilitiesSpecified) newAta.SATACapabilities = oldAta.SATACapabilities; + if(oldAta.SATACapabilities2Specified) newAta.SATACapabilities2 = oldAta.SATACapabilities2; + if(oldAta.SATAFeaturesSpecified) newAta.SATAFeatures = oldAta.SATAFeatures; + if(oldAta.SCTCommandTransportSpecified) newAta.SCTCommandTransport = oldAta.SCTCommandTransport; + if(oldAta.SectorsPerCardSpecified) newAta.SectorsPerCard = oldAta.SectorsPerCard; + if(oldAta.SecurityEraseTimeSpecified) newAta.SecurityEraseTime = oldAta.SecurityEraseTime; + if(oldAta.SecurityStatusSpecified) newAta.SecurityStatus = oldAta.SecurityStatus; + if(oldAta.ServiceBusyClearSpecified) newAta.ServiceBusyClear = oldAta.ServiceBusyClear; + if(oldAta.SpecificConfigurationSpecified) newAta.SpecificConfiguration = oldAta.SpecificConfiguration; + if(oldAta.StreamAccessLatencySpecified) newAta.StreamAccessLatency = oldAta.StreamAccessLatency; + if(oldAta.StreamMinReqSizeSpecified) newAta.StreamMinReqSize = oldAta.StreamMinReqSize; + if(oldAta.StreamPerformanceGranularitySpecified) + newAta.StreamPerformanceGranularity = oldAta.StreamPerformanceGranularity; + if(oldAta.StreamTransferTimeDMASpecified) newAta.StreamTransferTimeDMA = oldAta.StreamTransferTimeDMA; + if(oldAta.StreamTransferTimePIOSpecified) newAta.StreamTransferTimePIO = oldAta.StreamTransferTimePIO; + if(oldAta.TransportMajorVersionSpecified) newAta.TransportMajorVersion = oldAta.TransportMajorVersion; + if(oldAta.TransportMinorVersionSpecified) newAta.TransportMinorVersion = oldAta.TransportMinorVersion; + if(oldAta.TrustedComputingSpecified) newAta.TrustedComputing = oldAta.TrustedComputing; + if(oldAta.UDMAActiveSpecified) newAta.UDMAActive = oldAta.UDMAActive; + if(oldAta.UDMASupportedSpecified) newAta.UDMASupported = oldAta.UDMASupported; + if(oldAta.WRVModeSpecified) newAta.WRVMode = oldAta.WRVMode; + if(oldAta.WRVSectorCountMode3Specified) newAta.WRVSectorCountMode3 = oldAta.WRVSectorCountMode3; + if(oldAta.WRVSectorCountMode2Specified) newAta.WRVSectorCountMode2 = oldAta.WRVSectorCountMode2; + + if(oldAta.RemovableMedias == null) return newAta; + + newAta.RemovableMedias = new List(oldAta.RemovableMedias.Select(TestedMedia.MapTestedMedia)); + + return newAta; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/BaseEntity.cs b/DiscImageChef.Database/Models/BaseEntity.cs new file mode 100644 index 000000000..1195a7908 --- /dev/null +++ b/DiscImageChef.Database/Models/BaseEntity.cs @@ -0,0 +1,49 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : BaseEntity.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for base entities. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System; +using System.ComponentModel.DataAnnotations; + +namespace DiscImageChef.Database.Models +{ + public class BaseEntity + { + [Key] + public ulong Id { get; set; } + } + + public class DatedEntity : BaseEntity + { + public DateTime WhenAdded { get; set; } + public DateTime? WhenModified { get; set; } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/BaseTypes.cs b/DiscImageChef.Database/Models/BaseTypes.cs new file mode 100644 index 000000000..7066445d1 --- /dev/null +++ b/DiscImageChef.Database/Models/BaseTypes.cs @@ -0,0 +1,52 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : BaseTypes.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database models for making arrays with C# base types. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.ComponentModel.DataAnnotations; + +namespace DiscImageChef.Database.Models +{ + public class StringClass : BaseEntity + { + [Required] + public string Value { get; set; } + } + + public class IntClass : BaseEntity + { + public int Value { get; set; } + } + + public class UshortClass : BaseEntity + { + public ushort Value { get; set; } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/CHS.cs b/DiscImageChef.Database/Models/CHS.cs new file mode 100644 index 000000000..2fe108666 --- /dev/null +++ b/DiscImageChef.Database/Models/CHS.cs @@ -0,0 +1,41 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : CHS.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for Cylinder/Head/Sector. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +namespace DiscImageChef.Database.Models +{ + public class CHS : BaseEntity + { + public ushort Cylinders { get; set; } + public ushort Heads { get; set; } + public ushort Sectors { get; set; } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/Device.cs b/DiscImageChef.Database/Models/Device.cs new file mode 100644 index 000000000..18de54b1b --- /dev/null +++ b/DiscImageChef.Database/Models/Device.cs @@ -0,0 +1,163 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : this.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for device information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System; +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models +{ + public class Device : DatedEntity + { + public Device() + { + WhenAdded = DateTime.UtcNow; + } + + public Device(DeviceReport report) + { + WhenAdded = DateTime.UtcNow; + if(report.SecureDigital != null) Type = DeviceType.SecureDigital; + else if(report.MultiMediaCard != null) Type = DeviceType.MMC; + else if(report.FireWire != null) Type = DeviceType.FireWire; + else if(report.USB != null) Type = DeviceType.USB; + else if(report.PCMCIA != null) Type = DeviceType.PCMCIA; + else if(report.ATAPI != null) Type = DeviceType.ATAPI; + else if(report.ATA != null) Type = DeviceType.ATA; + else if(report.SCSI?.Inquiry != null) Type = DeviceType.SCSI; + + if(report.CompactFlashSpecified && report.CompactFlash) Type = DeviceType.CompactFlash; + + if(!string.IsNullOrWhiteSpace(report.FireWire?.Manufacturer)) Manufacturer = report.FireWire.Manufacturer; + else if(!string.IsNullOrWhiteSpace(report.USB?.Manufacturer)) Manufacturer = report.USB.Manufacturer; + else if(!string.IsNullOrWhiteSpace(report.SCSI?.Inquiry?.VendorIdentification)) + Manufacturer = + report.SCSI.Inquiry.VendorIdentification; + else if(!string.IsNullOrWhiteSpace(report.PCMCIA?.Manufacturer)) Manufacturer = report.PCMCIA.Manufacturer; + else if(!string.IsNullOrWhiteSpace(report.ATAPI?.Model)) + { + string[] atapiSplit = report.ATAPI.Model.Split(' '); + Manufacturer = atapiSplit.Length > 1 ? atapiSplit[0] : report.ATAPI.Model; + } + else if(!string.IsNullOrWhiteSpace(report.ATA?.Model)) + { + string[] ataSplit = report.ATA.Model.Split(' '); + Manufacturer = ataSplit.Length > 1 ? ataSplit[0] : report.ATA.Model; + } + + if(!string.IsNullOrWhiteSpace(report.FireWire?.Product)) Model = report.FireWire.Product; + else if(!string.IsNullOrWhiteSpace(report.USB?.Product)) Model = report.USB.Product; + else if(!string.IsNullOrWhiteSpace(report.SCSI?.Inquiry?.ProductIdentification)) + Model = + report.SCSI.Inquiry.ProductIdentification; + else if(!string.IsNullOrWhiteSpace(report.PCMCIA?.ProductName)) Model = report.PCMCIA.ProductName; + else if(!string.IsNullOrWhiteSpace(report.ATAPI?.Model)) + { + string[] atapiSplit = report.ATAPI.Model.Split(' '); + Model = atapiSplit.Length > 1 ? report.ATAPI.Model.Substring(atapiSplit[0].Length + 1) : null; + } + else if(!string.IsNullOrWhiteSpace(report.ATA?.Model)) + { + string[] ataSplit = report.ATA.Model.Split(' '); + Model = ataSplit.Length > 1 ? report.ATA.Model.Substring(ataSplit[0].Length + 1) : null; + } + + if(!string.IsNullOrWhiteSpace(report.SCSI?.Inquiry?.ProductRevisionLevel)) + Revision = report.SCSI.Inquiry.ProductRevisionLevel; + else if(!string.IsNullOrWhiteSpace(report.ATAPI?.FirmwareRevision)) + Revision = report.ATAPI.FirmwareRevision; + else if(!string.IsNullOrWhiteSpace(report.ATA?.FirmwareRevision)) Revision = report.ATA.FirmwareRevision; + + USB = USB.MapUsb(report.USB); + FireWire = FireWire.MapFirewire(report.FireWire); + PCMCIA = PCMCIA.MapPcmcia(report.PCMCIA); + ATA = ATA.MapAta(report.ATA); + ATAPI = ATA.MapAta(report.ATAPI); + SCSI = Models.SCSI.SCSI.MapScsi(report.SCSI); + MultiMediaCard = SecureDigital.MapSd(report.MultiMediaCard); + SecureDigital = SecureDigital.MapSd(report.SecureDigital); + + WhenAdded = DateTime.UtcNow; + IsValid = true; + } + + public Device(string manufacturer, string model, string revision, DeviceType type, DeviceReport report) + { + WhenAdded = DateTime.UtcNow; + Manufacturer = manufacturer; + Model = model; + Revision = revision; + Type = type; + + USB = USB.MapUsb(report.USB); + FireWire = FireWire.MapFirewire(report.FireWire); + PCMCIA = PCMCIA.MapPcmcia(report.PCMCIA); + ATA = ATA.MapAta(report.ATA); + ATAPI = ATA.MapAta(report.ATAPI); + SCSI = Models.SCSI.SCSI.MapScsi(report.SCSI); + MultiMediaCard = SecureDigital.MapSd(report.MultiMediaCard); + SecureDigital = SecureDigital.MapSd(report.SecureDigital); + + WhenAdded = DateTime.UtcNow; + IsValid = true; + } + + public string Manufacturer { get; set; } + public string Model { get; set; } + public string Revision { get; set; } + public DeviceType Type { get; set; } + public USB USB { get; set; } + public FireWire FireWire { get; set; } + public PCMCIA PCMCIA { get; set; } + public ATA ATA { get; set; } + public ATA ATAPI { get; set; } + public SCSI.SCSI SCSI { get; set; } + public SecureDigital MultiMediaCard { get; set; } + public SecureDigital SecureDigital { get; set; } + public bool IsValid { get; set; } + public ulong TimesSeen { get; set; } + } + + public enum DeviceType + { + Unknown, + ATA, + ATAPI, + SCSI, + SecureDigital, + MMC, + NVMe, + PCMCIA, + CompactFlash, + FireWire, + USB + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/FireWire.cs b/DiscImageChef.Database/Models/FireWire.cs new file mode 100644 index 000000000..7daf58e85 --- /dev/null +++ b/DiscImageChef.Database/Models/FireWire.cs @@ -0,0 +1,59 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : FireWire.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for FireWire device information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models +{ + public class FireWire : BaseEntity + { + public uint VendorID { get; set; } + public uint ProductID { get; set; } + public string Manufacturer { get; set; } + public string Product { get; set; } + public bool RemovableMedia { get; set; } + + public static FireWire MapFirewire(firewireType oldFirewire) + { + if(oldFirewire == null) return null; + + return new FireWire + { + Manufacturer = oldFirewire.Manufacturer, + Product = oldFirewire.Product, + ProductID = oldFirewire.ProductID, + RemovableMedia = oldFirewire.RemovableMedia, + VendorID = oldFirewire.VendorID + }; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/PCMCIA.cs b/DiscImageChef.Database/Models/PCMCIA.cs new file mode 100644 index 000000000..13aae1d74 --- /dev/null +++ b/DiscImageChef.Database/Models/PCMCIA.cs @@ -0,0 +1,72 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : PCMCIA.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for PCMCIA device information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models +{ + public class PCMCIA : BaseEntity + { + public byte[] CIS { get; set; } + public string Compliance { get; set; } + public ushort ManufacturerCode { get; set; } + public ushort CardCode { get; set; } + public string Manufacturer { get; set; } + public string ProductName { get; set; } + public List AdditionalInformation { get; set; } + + public static PCMCIA MapPcmcia(pcmciaType oldPcmcia) + { + if(oldPcmcia == null) return null; + + PCMCIA newPcmcia = new PCMCIA + { + CIS = oldPcmcia.CIS, + Compliance = oldPcmcia.Compliance, + Manufacturer = oldPcmcia.Manufacturer, + ProductName = oldPcmcia.ProductName + }; + if(oldPcmcia.ManufacturerCodeSpecified) newPcmcia.ManufacturerCode = oldPcmcia.ManufacturerCode; + if(oldPcmcia.CardCodeSpecified) newPcmcia.CardCode = oldPcmcia.CardCode; + if(oldPcmcia.AdditionalInformation == null) return newPcmcia; + + if(oldPcmcia.AdditionalInformation == null) return newPcmcia; + + newPcmcia.AdditionalInformation = + new List(oldPcmcia.AdditionalInformation.Select(t => new StringClass {Value = t})); + + return newPcmcia; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/BlockDescriptor.cs b/DiscImageChef.Database/Models/SCSI/BlockDescriptor.cs new file mode 100644 index 000000000..52b591fc9 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/BlockDescriptor.cs @@ -0,0 +1,55 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : BlockDescriptor.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI block descriptor. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI +{ + public class BlockDescriptor : BaseEntity + { + public byte Density { get; set; } + public ulong? Blocks { get; set; } + public uint? BlockLength { get; set; } + + public static BlockDescriptor MapBlockDescriptor(blockDescriptorType oldBlockDescriptor) + { + if(oldBlockDescriptor == null) return null; + + BlockDescriptor newBlockDescriptor = new BlockDescriptor {Density = oldBlockDescriptor.Density}; + + if(oldBlockDescriptor.BlockLengthSpecified) newBlockDescriptor.BlockLength = oldBlockDescriptor.BlockLength; + if(oldBlockDescriptor.BlocksSpecified) newBlockDescriptor.Blocks = oldBlockDescriptor.Blocks; + + return newBlockDescriptor; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/Inquiry.cs b/DiscImageChef.Database/Models/SCSI/Inquiry.cs new file mode 100644 index 000000000..e256ad842 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/Inquiry.cs @@ -0,0 +1,141 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Inquiry.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI INQUIRY. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; +using DiscImageChef.Decoders.SCSI; + +namespace DiscImageChef.Database.Models.SCSI +{ + public class Inquiry : BaseEntity + { + public bool AccessControlCoordinator { get; set; } + public bool ACKRequests { get; set; } + public bool AERCSupported { get; set; } + public bool Address16 { get; set; } + public bool Address32 { get; set; } + public byte? ANSIVersion { get; set; } + public TGPSValues AsymmetricalLUNAccess { get; set; } + public bool BasicQueueing { get; set; } + public byte? DeviceTypeModifier { get; set; } + public byte? ECMAVersion { get; set; } + public bool EnclosureServices { get; set; } + public bool HierarchicalLUN { get; set; } + public bool IUS { get; set; } + public byte? ISOVersion { get; set; } + public bool LinkedCommands { get; set; } + public bool MediumChanger { get; set; } + public bool MultiPortDevice { get; set; } + public bool NormalACA { get; set; } + public PeripheralDeviceTypes PeripheralDeviceType { get; set; } + public PeripheralQualifiers PeripheralQualifier { get; set; } + public string ProductIdentification { get; set; } + public string ProductRevisionLevel { get; set; } + public bool Protection { get; set; } + public bool QAS { get; set; } + public bool RelativeAddressing { get; set; } + public bool Removable { get; set; } + public byte? ResponseDataFormat { get; set; } + public bool TaggedCommandQueue { get; set; } + public bool TerminateTaskSupported { get; set; } + public bool ThirdPartyCopy { get; set; } + public bool TranferDisable { get; set; } + public bool SoftReset { get; set; } + public SPIClocking SPIClocking { get; set; } + public bool StorageArrayController { get; set; } + public bool SyncTransfer { get; set; } + public string VendorIdentification { get; set; } + public List VersionDescriptors { get; set; } + public bool WideBus16 { get; set; } + public bool WideBus32 { get; set; } + public byte[] Data { get; set; } + + public static Inquiry MapInquiry(scsiInquiryType oldInquiry) + { + if(oldInquiry == null) return null; + + Inquiry newInquiry = new Inquiry + { + AccessControlCoordinator = oldInquiry.AccessControlCoordinator, + ACKRequests = oldInquiry.ACKRequests, + AERCSupported = oldInquiry.AERCSupported, + Address16 = oldInquiry.Address16, + Address32 = oldInquiry.Address32, + AsymmetricalLUNAccess = oldInquiry.AsymmetricalLUNAccess, + BasicQueueing = oldInquiry.BasicQueueing, + EnclosureServices = oldInquiry.EnclosureServices, + HierarchicalLUN = oldInquiry.HierarchicalLUN, + IUS = oldInquiry.IUS, + LinkedCommands = oldInquiry.LinkedCommands, + MediumChanger = oldInquiry.MediumChanger, + MultiPortDevice = oldInquiry.MultiPortDevice, + NormalACA = oldInquiry.NormalACA, + PeripheralDeviceType = oldInquiry.PeripheralDeviceType, + PeripheralQualifier = oldInquiry.PeripheralQualifier, + Protection = oldInquiry.Protection, + QAS = oldInquiry.QAS, + RelativeAddressing = oldInquiry.RelativeAddressing, + Removable = oldInquiry.Removable, + TaggedCommandQueue = oldInquiry.TaggedCommandQueue, + TerminateTaskSupported = oldInquiry.TerminateTaskSupported, + ThirdPartyCopy = oldInquiry.ThirdPartyCopy, + TranferDisable = oldInquiry.TranferDisable, + SoftReset = oldInquiry.SoftReset, + SPIClocking = oldInquiry.SPIClocking, + StorageArrayController = oldInquiry.StorageArrayController, + SyncTransfer = oldInquiry.SyncTransfer, + WideBus16 = oldInquiry.WideBus16, + WideBus32 = oldInquiry.WideBus32, + Data = oldInquiry.Data + }; + + if(oldInquiry.ANSIVersionSpecified) newInquiry.ANSIVersion = oldInquiry.ANSIVersion; + if(oldInquiry.DeviceTypeModifierSpecified) newInquiry.DeviceTypeModifier = oldInquiry.DeviceTypeModifier; + if(oldInquiry.ECMAVersionSpecified) newInquiry.ECMAVersion = oldInquiry.ECMAVersion; + if(oldInquiry.ISOVersionSpecified) newInquiry.ISOVersion = oldInquiry.ISOVersion; + if(oldInquiry.ProductIdentificationSpecified) + newInquiry.ProductIdentification = oldInquiry.ProductIdentification; + if(oldInquiry.ProductRevisionLevelSpecified) + newInquiry.ProductRevisionLevel = oldInquiry.ProductRevisionLevel; + if(oldInquiry.ResponseDataFormatSpecified) newInquiry.ResponseDataFormat = oldInquiry.ResponseDataFormat; + if(oldInquiry.VendorIdentificationSpecified) + newInquiry.VendorIdentification = oldInquiry.VendorIdentification; + if(oldInquiry.VersionDescriptors == null) return newInquiry; + + newInquiry.VersionDescriptors = + new List(oldInquiry.VersionDescriptors.Select(t => new UshortClass {Value = t})); + + return newInquiry; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/MMC/Features.cs b/DiscImageChef.Database/Models/SCSI/MMC/Features.cs new file mode 100644 index 000000000..3b595d937 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/MMC/Features.cs @@ -0,0 +1,306 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Features.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for MMC features. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System; +using DiscImageChef.CommonTypes.Metadata; +using DiscImageChef.Decoders.SCSI.MMC; + +namespace DiscImageChef.Database.Models.SCSI.MMC +{ + public class Features : BaseEntity + { + public byte? AACSVersion { get; set; } + public byte? AGIDs { get; set; } + public byte? BindingNonceBlocks { get; set; } + public ushort? BlocksPerReadableUnit { get; set; } + public bool BufferUnderrunFreeInDVD { get; set; } + public bool BufferUnderrunFreeInSAO { get; set; } + public bool BufferUnderrunFreeInTAO { get; set; } + public bool CanAudioScan { get; set; } + public bool CanEject { get; set; } + public bool CanEraseSector { get; set; } + public bool CanExpandBDRESpareArea { get; set; } + public bool CanFormat { get; set; } + public bool CanFormatBDREWithoutSpare { get; set; } + public bool CanFormatCert { get; set; } + public bool CanFormatFRF { get; set; } + public bool CanFormatQCert { get; set; } + public bool CanFormatRRM { get; set; } + public bool CanGenerateBindingNonce { get; set; } + public bool CanLoad { get; set; } + public bool CanMuteSeparateChannels { get; set; } + public bool CanOverwriteSAOTrack { get; set; } + public bool CanOverwriteTAOTrack { get; set; } + public bool CanPlayCDAudio { get; set; } + public bool CanPseudoOverwriteBDR { get; set; } + public bool CanReadAllDualR { get; set; } + public bool CanReadAllDualRW { get; set; } + public bool CanReadBD { get; set; } + public bool CanReadBDR { get; set; } + public bool CanReadBDRE1 { get; set; } + public bool CanReadBDRE2 { get; set; } + public bool CanReadBDROM { get; set; } + public bool CanReadBluBCA { get; set; } + public bool CanReadCD { get; set; } + public bool CanReadCDMRW { get; set; } + public bool CanReadCPRM_MKB { get; set; } + public bool CanReadDDCD { get; set; } + public bool CanReadDVD { get; set; } + public bool CanReadDVDPlusMRW { get; set; } + public bool CanReadDVDPlusR { get; set; } + public bool CanReadDVDPlusRDL { get; set; } + public bool CanReadDVDPlusRW { get; set; } + public bool CanReadDVDPlusRWDL { get; set; } + public bool CanReadDriveAACSCertificate { get; set; } + public bool CanReadHDDVD { get; set; } + public bool CanReadHDDVDR { get; set; } + public bool CanReadHDDVDRAM { get; set; } + public bool CanReadLeadInCDText { get; set; } + public bool CanReadOldBDR { get; set; } + public bool CanReadOldBDRE { get; set; } + public bool CanReadOldBDROM { get; set; } + public bool CanReadSpareAreaInformation { get; set; } + public bool CanReportDriveSerial { get; set; } + public bool CanReportMediaSerial { get; set; } + public bool CanTestWriteDDCDR { get; set; } + public bool CanTestWriteDVD { get; set; } + public bool CanTestWriteInSAO { get; set; } + public bool CanTestWriteInTAO { get; set; } + public bool CanUpgradeFirmware { get; set; } + public bool CanWriteBD { get; set; } + public bool CanWriteBDR { get; set; } + public bool CanWriteBDRE1 { get; set; } + public bool CanWriteBDRE2 { get; set; } + public bool CanWriteBusEncryptedBlocks { get; set; } + public bool CanWriteCDMRW { get; set; } + public bool CanWriteCDRW { get; set; } + public bool CanWriteCDRWCAV { get; set; } + public bool CanWriteCDSAO { get; set; } + public bool CanWriteCDTAO { get; set; } + public bool CanWriteCSSManagedDVD { get; set; } + public bool CanWriteDDCDR { get; set; } + public bool CanWriteDDCDRW { get; set; } + public bool CanWriteDVDPlusMRW { get; set; } + public bool CanWriteDVDPlusR { get; set; } + public bool CanWriteDVDPlusRDL { get; set; } + public bool CanWriteDVDPlusRW { get; set; } + public bool CanWriteDVDPlusRWDL { get; set; } + public bool CanWriteDVDR { get; set; } + public bool CanWriteDVDRDL { get; set; } + public bool CanWriteDVDRW { get; set; } + public bool CanWriteHDDVDR { get; set; } + public bool CanWriteHDDVDRAM { get; set; } + public bool CanWriteOldBDR { get; set; } + public bool CanWriteOldBDRE { get; set; } + public bool CanWritePackedSubchannelInTAO { get; set; } + public bool CanWriteRWSubchannelInSAO { get; set; } + public bool CanWriteRWSubchannelInTAO { get; set; } + public bool CanWriteRaw { get; set; } + public bool CanWriteRawMultiSession { get; set; } + public bool CanWriteRawSubchannelInTAO { get; set; } + public bool ChangerIsSideChangeCapable { get; set; } + public byte ChangerSlots { get; set; } + public bool? ChangerSupportsDiscPresent { get; set; } + public byte? CPRMVersion { get; set; } + public byte? CSSVersion { get; set; } + public bool DBML { get; set; } + public bool DVDMultiRead { get; set; } + public bool EmbeddedChanger { get; set; } + public bool ErrorRecoveryPage { get; set; } + public DateTime? FirmwareDate { get; set; } + public byte? LoadingMechanismType { get; set; } + public bool Locked { get; set; } + public uint? LogicalBlockSize { get; set; } + public bool MultiRead { get; set; } + public PhysicalInterfaces? PhysicalInterfaceStandard { get; set; } + public uint? PhysicalInterfaceStandardNumber { get; set; } + public bool PreventJumper { get; set; } + public bool SupportsAACS { get; set; } + public bool SupportsBusEncryption { get; set; } + public bool SupportsC2 { get; set; } + public bool SupportsCPRM { get; set; } + public bool SupportsCSS { get; set; } + public bool SupportsDAP { get; set; } + public bool SupportsDeviceBusyEvent { get; set; } + public bool SupportsHybridDiscs { get; set; } + public bool SupportsModePage1Ch { get; set; } + public bool SupportsOSSC { get; set; } + public bool SupportsPWP { get; set; } + public bool SupportsSWPP { get; set; } + public bool SupportsSecurDisc { get; set; } + public bool SupportsSeparateVolume { get; set; } + public bool SupportsVCPS { get; set; } + public bool SupportsWriteInhibitDCB { get; set; } + public bool SupportsWriteProtectPAC { get; set; } + public ushort? VolumeLevels { get; set; } + + public static Features MapFeatures(mmcFeaturesType oldFeatures) + { + if(oldFeatures == null) return null; + + Features newFeatures = new Features + { + BufferUnderrunFreeInDVD = oldFeatures.BufferUnderrunFreeInDVD, + BufferUnderrunFreeInSAO = oldFeatures.BufferUnderrunFreeInSAO, + BufferUnderrunFreeInTAO = oldFeatures.BufferUnderrunFreeInTAO, + CanAudioScan = oldFeatures.CanAudioScan, + CanEject = oldFeatures.CanEject, + CanEraseSector = oldFeatures.CanEraseSector, + CanExpandBDRESpareArea = oldFeatures.CanExpandBDRESpareArea, + CanFormat = oldFeatures.CanFormat, + CanFormatBDREWithoutSpare = oldFeatures.CanFormatBDREWithoutSpare, + CanFormatCert = oldFeatures.CanFormatCert, + CanFormatFRF = oldFeatures.CanFormatFRF, + CanFormatQCert = oldFeatures.CanFormatQCert, + CanFormatRRM = oldFeatures.CanFormatRRM, + CanGenerateBindingNonce = oldFeatures.CanGenerateBindingNonce, + CanLoad = oldFeatures.CanLoad, + CanMuteSeparateChannels = oldFeatures.CanMuteSeparateChannels, + CanOverwriteSAOTrack = oldFeatures.CanOverwriteSAOTrack, + CanOverwriteTAOTrack = oldFeatures.CanOverwriteTAOTrack, + CanPlayCDAudio = oldFeatures.CanPlayCDAudio, + CanPseudoOverwriteBDR = oldFeatures.CanPseudoOverwriteBDR, + CanReadAllDualR = oldFeatures.CanReadAllDualR, + CanReadAllDualRW = oldFeatures.CanReadAllDualRW, + CanReadBD = oldFeatures.CanReadBD, + CanReadBDR = oldFeatures.CanReadBDR, + CanReadBDRE1 = oldFeatures.CanReadBDRE1, + CanReadBDRE2 = oldFeatures.CanReadBDRE2, + CanReadBDROM = oldFeatures.CanReadBDROM, + CanReadBluBCA = oldFeatures.CanReadBluBCA, + CanReadCD = oldFeatures.CanReadCD, + CanReadCDMRW = oldFeatures.CanReadCDMRW, + CanReadCPRM_MKB = oldFeatures.CanReadCPRM_MKB, + CanReadDDCD = oldFeatures.CanReadDDCD, + CanReadDVD = oldFeatures.CanReadDVD, + CanReadDVDPlusMRW = oldFeatures.CanReadDVDPlusMRW, + CanReadDVDPlusR = oldFeatures.CanReadDVDPlusR, + CanReadDVDPlusRDL = oldFeatures.CanReadDVDPlusRDL, + CanReadDVDPlusRW = oldFeatures.CanReadDVDPlusRW, + CanReadDVDPlusRWDL = oldFeatures.CanReadDVDPlusRWDL, + CanReadDriveAACSCertificate = oldFeatures.CanReadDriveAACSCertificate, + CanReadHDDVD = oldFeatures.CanReadHDDVD, + CanReadHDDVDR = oldFeatures.CanReadHDDVDR, + CanReadHDDVDRAM = oldFeatures.CanReadHDDVDRAM, + CanReadLeadInCDText = oldFeatures.CanReadLeadInCDText, + CanReadOldBDR = oldFeatures.CanReadOldBDR, + CanReadOldBDRE = oldFeatures.CanReadOldBDRE, + CanReadOldBDROM = oldFeatures.CanReadOldBDROM, + CanReadSpareAreaInformation = oldFeatures.CanReadSpareAreaInformation, + CanReportDriveSerial = oldFeatures.CanReportDriveSerial, + CanReportMediaSerial = oldFeatures.CanReportMediaSerial, + CanTestWriteDDCDR = oldFeatures.CanTestWriteDDCDR, + CanTestWriteDVD = oldFeatures.CanTestWriteDVD, + CanTestWriteInSAO = oldFeatures.CanTestWriteInSAO, + CanTestWriteInTAO = oldFeatures.CanTestWriteInTAO, + CanUpgradeFirmware = oldFeatures.CanUpgradeFirmware, + CanWriteBD = oldFeatures.CanWriteBD, + CanWriteBDR = oldFeatures.CanWriteBDR, + CanWriteBDRE1 = oldFeatures.CanWriteBDRE1, + CanWriteBDRE2 = oldFeatures.CanWriteBDRE2, + CanWriteBusEncryptedBlocks = oldFeatures.CanWriteBusEncryptedBlocks, + CanWriteCDMRW = oldFeatures.CanWriteCDMRW, + CanWriteCDRW = oldFeatures.CanWriteCDRW, + CanWriteCDRWCAV = oldFeatures.CanWriteCDRWCAV, + CanWriteCDSAO = oldFeatures.CanWriteCDSAO, + CanWriteCDTAO = oldFeatures.CanWriteCDTAO, + CanWriteCSSManagedDVD = oldFeatures.CanWriteCSSManagedDVD, + CanWriteDDCDR = oldFeatures.CanWriteDDCDR, + CanWriteDDCDRW = oldFeatures.CanWriteDDCDRW, + CanWriteDVDPlusMRW = oldFeatures.CanWriteDVDPlusMRW, + CanWriteDVDPlusR = oldFeatures.CanWriteDVDPlusR, + CanWriteDVDPlusRDL = oldFeatures.CanWriteDVDPlusRDL, + CanWriteDVDPlusRW = oldFeatures.CanWriteDVDPlusRW, + CanWriteDVDPlusRWDL = oldFeatures.CanWriteDVDPlusRWDL, + CanWriteDVDR = oldFeatures.CanWriteDVDR, + CanWriteDVDRDL = oldFeatures.CanWriteDVDRDL, + CanWriteDVDRW = oldFeatures.CanWriteDVDRW, + CanWriteHDDVDR = oldFeatures.CanWriteHDDVDR, + CanWriteHDDVDRAM = oldFeatures.CanWriteHDDVDRAM, + CanWriteOldBDR = oldFeatures.CanWriteOldBDR, + CanWriteOldBDRE = oldFeatures.CanWriteOldBDRE, + CanWritePackedSubchannelInTAO = oldFeatures.CanWritePackedSubchannelInTAO, + CanWriteRWSubchannelInSAO = oldFeatures.CanWriteRWSubchannelInSAO, + CanWriteRWSubchannelInTAO = oldFeatures.CanWriteRWSubchannelInTAO, + CanWriteRaw = oldFeatures.CanWriteRaw, + CanWriteRawMultiSession = oldFeatures.CanWriteRawMultiSession, + CanWriteRawSubchannelInTAO = oldFeatures.CanWriteRawSubchannelInTAO, + ChangerIsSideChangeCapable = oldFeatures.ChangerIsSideChangeCapable, + ChangerSlots = oldFeatures.ChangerSlots, + ChangerSupportsDiscPresent = oldFeatures.ChangerSupportsDiscPresent, + DBML = oldFeatures.DBML, + DVDMultiRead = oldFeatures.DVDMultiRead, + EmbeddedChanger = oldFeatures.EmbeddedChanger, + ErrorRecoveryPage = oldFeatures.ErrorRecoveryPage, + Locked = oldFeatures.Locked, + MultiRead = oldFeatures.MultiRead, + PreventJumper = oldFeatures.PreventJumper, + SupportsAACS = oldFeatures.SupportsAACS, + SupportsBusEncryption = oldFeatures.SupportsBusEncryption, + SupportsC2 = oldFeatures.SupportsC2, + SupportsCPRM = oldFeatures.SupportsCPRM, + SupportsCSS = oldFeatures.SupportsCSS, + SupportsDAP = oldFeatures.SupportsDAP, + SupportsDeviceBusyEvent = oldFeatures.SupportsDeviceBusyEvent, + SupportsHybridDiscs = oldFeatures.SupportsHybridDiscs, + SupportsModePage1Ch = oldFeatures.SupportsModePage1Ch, + SupportsOSSC = oldFeatures.SupportsOSSC, + SupportsPWP = oldFeatures.SupportsPWP, + SupportsSWPP = oldFeatures.SupportsSWPP, + SupportsSecurDisc = oldFeatures.SupportsSecurDisc, + SupportsSeparateVolume = oldFeatures.SupportsSeparateVolume, + SupportsVCPS = oldFeatures.SupportsVCPS, + SupportsWriteInhibitDCB = oldFeatures.SupportsWriteInhibitDCB, + SupportsWriteProtectPAC = oldFeatures.SupportsWriteProtectPAC + }; + + if(oldFeatures.AACSVersionSpecified) newFeatures.AACSVersion = oldFeatures.AACSVersion; + if(oldFeatures.AGIDsSpecified) newFeatures.AGIDs = oldFeatures.AGIDs; + if(oldFeatures.BindingNonceBlocksSpecified) newFeatures.BindingNonceBlocks = oldFeatures.BindingNonceBlocks; + if(oldFeatures.BlocksPerReadableUnitSpecified) + newFeatures.BlocksPerReadableUnit = oldFeatures.BlocksPerReadableUnit; + if(oldFeatures.CPRMVersionSpecified) newFeatures.CPRMVersion = oldFeatures.CPRMVersion; + if(oldFeatures.CSSVersionSpecified) newFeatures.CSSVersion = oldFeatures.CSSVersion; + if(oldFeatures.FirmwareDateSpecified) newFeatures.FirmwareDate = oldFeatures.FirmwareDate; + if(oldFeatures.LoadingMechanismTypeSpecified) + newFeatures.LoadingMechanismType = oldFeatures.LoadingMechanismType; + if(oldFeatures.LogicalBlockSizeSpecified) newFeatures.LogicalBlockSize = oldFeatures.LogicalBlockSize; + if(oldFeatures.PhysicalInterfaceStandardSpecified) + newFeatures.PhysicalInterfaceStandard = oldFeatures.PhysicalInterfaceStandard; + if(oldFeatures.PhysicalInterfaceStandardNumberSpecified) + newFeatures.PhysicalInterfaceStandardNumber = oldFeatures.PhysicalInterfaceStandardNumber; + if(oldFeatures.VolumeLevelsSpecified) newFeatures.VolumeLevels = oldFeatures.VolumeLevels; + + return newFeatures; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/MMC/MMC.cs b/DiscImageChef.Database/Models/SCSI/MMC/MMC.cs new file mode 100644 index 000000000..2a1f0a8b9 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/MMC/MMC.cs @@ -0,0 +1,61 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : MMC.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI MultiMedia Command devices. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI.MMC +{ + public class MMC : BaseEntity + { + public Mode2A ModeSense2A { get; set; } + public Features Features { get; set; } + public List TestedMedia { get; set; } + + public static MMC MapMmc(mmcType oldMmc) + { + if(oldMmc == null) return null; + + MMC newMmc = new MMC + { + Features = Features.MapFeatures(oldMmc.Features), + ModeSense2A = Mode2A.MapMode2A(oldMmc.ModeSense2A) + }; + if(oldMmc.TestedMedia == null) return newMmc; + + newMmc.TestedMedia = new List(oldMmc.TestedMedia.Select(Models.TestedMedia.MapTestedMedia)); + + return newMmc; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/MMC/Mode2A.cs b/DiscImageChef.Database/Models/SCSI/MMC/Mode2A.cs new file mode 100644 index 000000000..0a4c2a312 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/MMC/Mode2A.cs @@ -0,0 +1,166 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Mode2A.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI MODE 2Ah. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI.MMC +{ + public class Mode2A : BaseEntity + { + public bool AccurateCDDA { get; set; } + public bool BCK { get; set; } + public ushort BufferSize { get; set; } + public bool? BufferUnderRunProtection { get; set; } + public bool CanEject { get; set; } + public bool CanLockMedia { get; set; } + public bool CDDACommand { get; set; } + public bool CompositeAudioVideo { get; set; } + public bool CSSandCPPMSupported { get; set; } + public ushort? CurrentSpeed { get; set; } + public ushort? CurrentWriteSpeed { get; set; } + public ushort? CurrentWriteSpeedSelected { get; set; } + public bool DeterministicSlotChanger { get; set; } + public bool DigitalPort1 { get; set; } + public bool DigitalPort2 { get; set; } + public bool LeadInPW { get; set; } + public byte LoadingMechanismType { get; set; } + public bool LockStatus { get; set; } + public bool LSBF { get; set; } + public ushort? MaximumSpeed { get; set; } + public ushort? MaximumWriteSpeed { get; set; } + public bool PlaysAudio { get; set; } + public bool PreventJumperStatus { get; set; } + public bool RCK { get; set; } + public bool ReadsBarcode { get; set; } + public bool ReadsBothSides { get; set; } + public bool ReadsCDR { get; set; } + public bool ReadsCDRW { get; set; } + public bool ReadsDeinterlavedSubchannel { get; set; } + public bool ReadsDVDR { get; set; } + public bool ReadsDVDRAM { get; set; } + public bool ReadsDVDROM { get; set; } + public bool ReadsISRC { get; set; } + public bool ReadsMode2Form2 { get; set; } + public bool ReadsMode2Form1 { get; set; } + public bool ReadsPacketCDR { get; set; } + public bool ReadsSubchannel { get; set; } + public bool ReadsUPC { get; set; } + public bool ReturnsC2Pointers { get; set; } + public byte? RotationControlSelected { get; set; } + public bool SeparateChannelMute { get; set; } + public bool SeparateChannelVolume { get; set; } + public bool SSS { get; set; } + public bool SupportsMultiSession { get; set; } + public ushort? SupportedVolumeLevels { get; set; } + public bool TestWrite { get; set; } + public bool WritesCDR { get; set; } + public bool WritesCDRW { get; set; } + public bool WritesDVDR { get; set; } + public bool WritesDVDRAM { get; set; } + public List WriteSpeedPerformanceDescriptors { get; set; } + + public static Mode2A MapMode2A(mmcModeType oldMode) + { + if(oldMode == null) return null; + + Mode2A newMode = new Mode2A + { + AccurateCDDA = oldMode.AccurateCDDA, + BCK = oldMode.BCK, + BufferUnderRunProtection = oldMode.BufferUnderRunProtection, + CanEject = oldMode.CanEject, + CanLockMedia = oldMode.CanLockMedia, + CDDACommand = oldMode.CDDACommand, + CompositeAudioVideo = oldMode.CompositeAudioVideo, + CSSandCPPMSupported = oldMode.CSSandCPPMSupported, + DeterministicSlotChanger = oldMode.DeterministicSlotChanger, + DigitalPort1 = oldMode.DigitalPort1, + DigitalPort2 = oldMode.DigitalPort2, + LeadInPW = oldMode.LeadInPW, + LoadingMechanismType = oldMode.LoadingMechanismType, + LockStatus = oldMode.LockStatus, + LSBF = oldMode.LSBF, + PlaysAudio = oldMode.PlaysAudio, + PreventJumperStatus = oldMode.PreventJumperStatus, + RCK = oldMode.RCK, + ReadsBarcode = oldMode.ReadsBarcode, + ReadsBothSides = oldMode.ReadsBothSides, + ReadsCDR = oldMode.ReadsCDR, + ReadsCDRW = oldMode.ReadsCDRW, + ReadsDeinterlavedSubchannel = oldMode.ReadsDeinterlavedSubchannel, + ReadsDVDR = oldMode.ReadsDVDR, + ReadsDVDRAM = oldMode.ReadsDVDRAM, + ReadsDVDROM = oldMode.ReadsDVDROM, + ReadsISRC = oldMode.ReadsISRC, + ReadsMode2Form2 = oldMode.ReadsMode2Form2, + ReadsMode2Form1 = oldMode.ReadsMode2Form1, + ReadsPacketCDR = oldMode.ReadsPacketCDR, + ReadsSubchannel = oldMode.ReadsSubchannel, + ReadsUPC = oldMode.ReadsUPC, + ReturnsC2Pointers = oldMode.ReturnsC2Pointers, + SeparateChannelMute = oldMode.SeparateChannelMute, + SeparateChannelVolume = oldMode.SeparateChannelVolume, + SSS = oldMode.SSS, + SupportsMultiSession = oldMode.SupportsMultiSession, + TestWrite = oldMode.TestWrite, + WritesCDR = oldMode.WritesCDR, + WritesCDRW = oldMode.WritesCDRW, + WritesDVDR = oldMode.WritesDVDR, + WritesDVDRAM = oldMode.WritesDVDRAM + }; + + if(oldMode.BufferSizeSpecified) newMode.BufferSize = oldMode.BufferSize; + if(oldMode.CurrentSpeedSpecified) newMode.CurrentSpeed = oldMode.CurrentSpeed; + if(oldMode.CurrentWriteSpeedSpecified) newMode.CurrentWriteSpeed = oldMode.CurrentWriteSpeed; + if(oldMode.CurrentWriteSpeedSelectedSpecified) + newMode.CurrentWriteSpeedSelected = oldMode.CurrentWriteSpeedSelected; + if(oldMode.MaximumSpeedSpecified) newMode.MaximumSpeed = oldMode.MaximumSpeed; + if(oldMode.MaximumWriteSpeedSpecified) newMode.MaximumWriteSpeed = oldMode.MaximumWriteSpeed; + if(oldMode.RotationControlSelectedSpecified) + newMode.RotationControlSelected = oldMode.RotationControlSelected; + if(oldMode.SupportedVolumeLevelsSpecified) newMode.SupportedVolumeLevels = oldMode.SupportedVolumeLevels; + + if(oldMode.WriteSpeedPerformanceDescriptors == null) return newMode; + + newMode.WriteSpeedPerformanceDescriptors = + new List(oldMode.WriteSpeedPerformanceDescriptors.Select(t => new WriteDescriptor + { + RotationControl = t.RotationControl, + WriteSpeed = t.WriteSpeed + })); + + return newMode; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/MMC/WriteDescriptor.cs b/DiscImageChef.Database/Models/SCSI/MMC/WriteDescriptor.cs new file mode 100644 index 000000000..5dca89426 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/MMC/WriteDescriptor.cs @@ -0,0 +1,51 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : WriteDescriptor.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI MODE 2Ah write descriptors. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.Decoders.SCSI; + +namespace DiscImageChef.Database.Models.SCSI.MMC +{ + public class WriteDescriptor : BaseEntity + { + public byte RotationControl { get; set; } + public ushort WriteSpeed { get; set; } + + public static WriteDescriptor MapWriteDescriptor(Modes.ModePage_2A_WriteDescriptor oldDescriptor) + { + return new WriteDescriptor + { + RotationControl = oldDescriptor.RotationControl, + WriteSpeed = oldDescriptor.WriteSpeed + }; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/Mode.cs b/DiscImageChef.Database/Models/SCSI/Mode.cs new file mode 100644 index 000000000..5361fc900 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/Mode.cs @@ -0,0 +1,78 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Mode.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI MODE. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI +{ + public class Mode : BaseEntity + { + public byte? MediumType { get; set; } + public bool WriteProtected { get; set; } + public List BlockDescriptors { get; set; } + public byte? Speed { get; set; } + public byte? BufferedMode { get; set; } + public bool BlankCheckEnabled { get; set; } + public bool DPOandFUA { get; set; } + public List ModePages { get; set; } + + public static Mode MapMode(modeType oldMode) + { + if(oldMode == null) return null; + + Mode newMode = new Mode + { + WriteProtected = oldMode.WriteProtected, + BlankCheckEnabled = oldMode.BlankCheckEnabled, + DPOandFUA = oldMode.DPOandFUA + }; + + if(oldMode.BufferedModeSpecified) newMode.BufferedMode = oldMode.BufferedMode; + if(oldMode.MediumTypeSpecified) newMode.MediumType = oldMode.MediumType; + if(oldMode.SpeedSpecified) newMode.Speed = oldMode.Speed; + + if(oldMode.BlockDescriptors != null) + newMode.BlockDescriptors = + new List(oldMode.BlockDescriptors.Select(BlockDescriptor.MapBlockDescriptor)); + + if(oldMode.ModePages == null) return newMode; + + { + newMode.ModePages = new List(oldMode.ModePages.Select(ModePage.MapModePage)); + } + + return newMode; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/ModePage.cs b/DiscImageChef.Database/Models/SCSI/ModePage.cs new file mode 100644 index 000000000..cf93f9aa7 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/ModePage.cs @@ -0,0 +1,55 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : ModePage.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI MODE page. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI +{ + public class ModePage : BaseEntity + { + public byte page { get; set; } + public byte subpage { get; set; } + public byte[] value { get; set; } + + public static ModePage MapModePage(modePageType oldModePage) + { + return oldModePage == null + ? null + : new ModePage + { + page = oldModePage.page, + subpage = oldModePage.subpage, + value = oldModePage.value + }; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/Page.cs b/DiscImageChef.Database/Models/SCSI/Page.cs new file mode 100644 index 000000000..b2a9cfc61 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/Page.cs @@ -0,0 +1,47 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Page.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI EVPD page. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI +{ + public class Page : BaseEntity + { + public byte page { get; set; } + public byte[] value { get; set; } + + public static Page MapPage(pageType oldPage) + { + return oldPage == null ? null : new Page {page = oldPage.page, value = oldPage.value}; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/SCSI.cs b/DiscImageChef.Database/Models/SCSI/SCSI.cs new file mode 100644 index 000000000..78843004a --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/SCSI.cs @@ -0,0 +1,84 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SCSI.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI device information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI +{ + public class SCSI : BaseEntity + { + public Inquiry Inquiry { get; set; } + public List EVPDPages { get; set; } + public bool SupportsModeSense6 { get; set; } + public bool SupportsModeSense10 { get; set; } + public bool SupportsModeSubpages { get; set; } + public Mode ModeSense { get; set; } + public MMC.MMC MultiMediaDevice { get; set; } + public TestedMedia ReadCapabilities { get; set; } + public List RemovableMedias { get; set; } + public SSC.SSC SequentialDevice { get; set; } + public byte[] ModeSense6Data { get; set; } + public byte[] ModeSense10Data { get; set; } + + public static SCSI MapScsi(scsiType oldScsi) + { + if(oldScsi == null) return null; + + SCSI newScsi = new SCSI + { + Inquiry = Inquiry.MapInquiry(oldScsi.Inquiry), + SupportsModeSense6 = oldScsi.SupportsModeSense6, + SupportsModeSense10 = oldScsi.SupportsModeSense10, + SupportsModeSubpages = oldScsi.SupportsModeSubpages, + ModeSense = Mode.MapMode(oldScsi.ModeSense), + MultiMediaDevice = MMC.MMC.MapMmc(oldScsi.MultiMediaDevice), + ReadCapabilities = TestedMedia.MapTestedMedia(oldScsi.ReadCapabilities), + SequentialDevice = SSC.SSC.MapSsc(oldScsi.SequentialDevice), + ModeSense6Data = oldScsi.ModeSense6Data, + ModeSense10Data = oldScsi.ModeSense10Data + }; + + if(oldScsi.EVPDPages != null) newScsi.EVPDPages = new List(oldScsi.EVPDPages.Select(Page.MapPage)); + + if(oldScsi.RemovableMedias == null) return newScsi; + + { + newScsi.RemovableMedias = + new List(oldScsi.RemovableMedias.Select(TestedMedia.MapTestedMedia)); + } + + return newScsi; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/SSC/SSC.cs b/DiscImageChef.Database/Models/SCSI/SSC/SSC.cs new file mode 100644 index 000000000..02e988b88 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/SSC/SSC.cs @@ -0,0 +1,74 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SSC.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI Streaming Command devices. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models.SCSI.SSC +{ + public class SSC : BaseEntity + { + public byte? BlockSizeGranularity { get; set; } + public uint? MaxBlockLength { get; set; } + public uint? MinBlockLength { get; set; } + public List SupportedDensities { get; set; } + public List SupportedMediaTypes { get; set; } + public List TestedMedia { get; set; } + + public static SSC MapSsc(sscType oldSsc) + { + if(oldSsc == null) return null; + + SSC newSsc = new SSC(); + + if(oldSsc.BlockSizeGranularitySpecified) newSsc.BlockSizeGranularity = oldSsc.BlockSizeGranularity; + if(oldSsc.MaxBlockLengthSpecified) newSsc.MaxBlockLength = oldSsc.MaxBlockLength; + if(oldSsc.MinBlockLengthSpecified) newSsc.MinBlockLength = oldSsc.MinBlockLength; + + if(oldSsc.SupportedDensities != null) + newSsc.SupportedDensities = + new List(oldSsc.SupportedDensities.Select(SupportedDensity.MapSupportedDensity)); + + if(oldSsc.SupportedMediaTypes != null) + newSsc.SupportedMediaTypes = + new List(oldSsc.SupportedMediaTypes.Select(SupportedMedia.MapSupportedMedia)); + + if(oldSsc.TestedMedia == null) return newSsc; + + newSsc.TestedMedia = + new List(oldSsc.TestedMedia.Select(SequentialMedia.MapSequentialMedia)); + + return newSsc; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/SSC/SequentialMedia.cs b/DiscImageChef.Database/Models/SCSI/SSC/SequentialMedia.cs new file mode 100644 index 000000000..acce23be4 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/SSC/SequentialMedia.cs @@ -0,0 +1,82 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SequentialMedia.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SSC tested media. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; + +namespace DiscImageChef.Database.Models.SCSI.SSC +{ + public class SequentialMedia : BaseEntity + { + public bool? CanReadMediaSerial { get; set; } + public byte? Density { get; set; } + public string Manufacturer { get; set; } + public bool MediaIsRecognized { get; set; } + public byte? MediumType { get; set; } + public string MediumTypeName { get; set; } + public string Model { get; set; } + public List SupportedDensities { get; set; } + public List SupportedMediaTypes { get; set; } + public byte[] ModeSense6Data { get; set; } + public byte[] ModeSense10Data { get; set; } + + public static SequentialMedia MapSequentialMedia(CommonTypes.Metadata.SequentialMedia oldSequentialMedia) + { + SequentialMedia newSequentialMedia = new SequentialMedia + { + Manufacturer = oldSequentialMedia.Manufacturer, + MediaIsRecognized = oldSequentialMedia.MediaIsRecognized, + MediumTypeName = oldSequentialMedia.MediumTypeName, + Model = oldSequentialMedia.Model, + ModeSense6Data = oldSequentialMedia.ModeSense6Data, + ModeSense10Data = oldSequentialMedia.ModeSense10Data + }; + + if(oldSequentialMedia.CanReadMediaSerialSpecified) + newSequentialMedia.CanReadMediaSerial = oldSequentialMedia.CanReadMediaSerial; + if(oldSequentialMedia.DensitySpecified) newSequentialMedia.Density = oldSequentialMedia.Density; + if(oldSequentialMedia.MediumTypeSpecified) newSequentialMedia.MediumType = oldSequentialMedia.MediumType; + if(newSequentialMedia.SupportedDensities != null) + newSequentialMedia.SupportedDensities = + new List(oldSequentialMedia.SupportedDensities.Select(SupportedDensity + .MapSupportedDensity)); + + if(newSequentialMedia.SupportedMediaTypes == null) return newSequentialMedia; + + newSequentialMedia.SupportedMediaTypes = + new List(oldSequentialMedia + .SupportedMediaTypes.Select(SupportedMedia.MapSupportedMedia)); + + return newSequentialMedia; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/SSC/SupportedDensity.cs b/DiscImageChef.Database/Models/SCSI/SSC/SupportedDensity.cs new file mode 100644 index 000000000..132f956f9 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/SSC/SupportedDensity.cs @@ -0,0 +1,69 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SupportedDensity.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SSC supported density. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +namespace DiscImageChef.Database.Models.SCSI.SSC +{ + public class SupportedDensity : BaseEntity + { + public byte PrimaryCode { get; set; } + public byte SecondaryCode { get; set; } + public bool Writable { get; set; } + public bool Duplicate { get; set; } + public bool DefaultDensity { get; set; } + public uint BitsPerMm { get; set; } + public ushort Width { get; set; } + public ushort Tracks { get; set; } + public uint Capacity { get; set; } + public string Organization { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public static SupportedDensity MapSupportedDensity(CommonTypes.Metadata.SupportedDensity oldDensity) + { + return new SupportedDensity + { + PrimaryCode = oldDensity.PrimaryCode, + SecondaryCode = oldDensity.SecondaryCode, + Writable = oldDensity.Writable, + Duplicate = oldDensity.Duplicate, + DefaultDensity = oldDensity.DefaultDensity, + BitsPerMm = oldDensity.BitsPerMm, + Width = oldDensity.Width, + Tracks = oldDensity.Tracks, + Capacity = oldDensity.Capacity, + Organization = oldDensity.Organization, + Name = oldDensity.Name, + Description = oldDensity.Description + }; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SCSI/SupportedMedia.cs b/DiscImageChef.Database/Models/SCSI/SupportedMedia.cs new file mode 100644 index 000000000..0be317d57 --- /dev/null +++ b/DiscImageChef.Database/Models/SCSI/SupportedMedia.cs @@ -0,0 +1,68 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SupportedMedia.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SCSI supported media information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using System.Collections.Generic; +using System.Linq; + +namespace DiscImageChef.Database.Models.SCSI +{ + public class SupportedMedia : BaseEntity + { + public byte MediumType { get; set; } + public List DensityCodes { get; set; } + public ushort Width { get; set; } + public ushort Length { get; set; } + public string Organization { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public static SupportedMedia MapSupportedMedia(CommonTypes.Metadata.SupportedMedia oldSupportedMedia) + { + SupportedMedia newSupportedMedia = new SupportedMedia + { + MediumType = oldSupportedMedia.MediumType, + Width = oldSupportedMedia.Width, + Length = oldSupportedMedia.Length, + Organization = oldSupportedMedia.Organization, + Name = oldSupportedMedia.Name, + Description = oldSupportedMedia.Description + }; + + if(oldSupportedMedia.DensityCodes == null) return newSupportedMedia; + + newSupportedMedia.DensityCodes = + new List(oldSupportedMedia.DensityCodes.Select(t => new IntClass {Value = t})); + + return newSupportedMedia; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/SecureDigital.cs b/DiscImageChef.Database/Models/SecureDigital.cs new file mode 100644 index 000000000..52a892a03 --- /dev/null +++ b/DiscImageChef.Database/Models/SecureDigital.cs @@ -0,0 +1,59 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SecureDigital.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for SecureDigital and MMC device information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models +{ + public class SecureDigital : BaseEntity + { + public byte[] CID { get; set; } + public byte[] CSD { get; set; } + public byte[] OCR { get; set; } + public byte[] SCR { get; set; } + public byte[] ExtendedCSD { get; set; } + + public static SecureDigital MapSd(mmcsdType oldSd) + { + if(oldSd == null) return null; + + return new SecureDigital + { + CID = oldSd.CID, + CSD = oldSd.CSD, + ExtendedCSD = oldSd.ExtendedCSD, + OCR = oldSd.OCR, + SCR = oldSd.SCR + }; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/TestedMedia.cs b/DiscImageChef.Database/Models/TestedMedia.cs new file mode 100644 index 000000000..cfea74f25 --- /dev/null +++ b/DiscImageChef.Database/Models/TestedMedia.cs @@ -0,0 +1,243 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : TestedMedia.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for tested media reports. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models +{ + public class TestedMedia : BaseEntity + { + public ulong? Blocks { get; set; } + public uint? BlockSize { get; set; } + public bool? CanReadAACS { get; set; } + public bool? CanReadADIP { get; set; } + public bool? CanReadATIP { get; set; } + public bool? CanReadBCA { get; set; } + public bool? CanReadC2Pointers { get; set; } + public bool? CanReadCMI { get; set; } + public bool? CanReadCorrectedSubchannel { get; set; } + public bool? CanReadCorrectedSubchannelWithC2 { get; set; } + public bool? CanReadDCB { get; set; } + public bool? CanReadDDS { get; set; } + public bool? CanReadDMI { get; set; } + public bool? CanReadDiscInformation { get; set; } + public bool? CanReadFullTOC { get; set; } + public bool? CanReadHDCMI { get; set; } + public bool? CanReadLayerCapacity { get; set; } + public bool? CanReadLeadIn { get; set; } + public bool? CanReadLeadInPostgap { get; set; } + public bool? CanReadLeadOut { get; set; } + public bool? CanReadMediaID { get; set; } + public bool? CanReadMediaSerial { get; set; } + public bool? CanReadPAC { get; set; } + public bool? CanReadPFI { get; set; } + public bool? CanReadPMA { get; set; } + public bool? CanReadPQSubchannel { get; set; } + public bool? CanReadPQSubchannelWithC2 { get; set; } + public bool? CanReadPRI { get; set; } + public bool? CanReadRWSubchannel { get; set; } + public bool? CanReadRWSubchannelWithC2 { get; set; } + public bool? CanReadRecordablePFI { get; set; } + public bool? CanReadSpareAreaInformation { get; set; } + public bool? CanReadTOC { get; set; } + public byte? Density { get; set; } + public uint? LongBlockSize { get; set; } + public string Manufacturer { get; set; } + public bool MediaIsRecognized { get; set; } + public byte? MediumType { get; set; } + public string MediumTypeName { get; set; } + public string Model { get; set; } + public bool? SupportsHLDTSTReadRawDVD { get; set; } + public bool? SupportsNECReadCDDA { get; set; } + public bool? SupportsPioneerReadCDDA { get; set; } + public bool? SupportsPioneerReadCDDAMSF { get; set; } + public bool? SupportsPlextorReadCDDA { get; set; } + public bool? SupportsPlextorReadRawDVD { get; set; } + public bool? SupportsRead10 { get; set; } + public bool? SupportsRead12 { get; set; } + public bool? SupportsRead16 { get; set; } + public bool? SupportsRead { get; set; } + public bool? SupportsReadCapacity16 { get; set; } + public bool? SupportsReadCapacity { get; set; } + public bool? SupportsReadCd { get; set; } + public bool? SupportsReadCdMsf { get; set; } + public bool? SupportsReadCdRaw { get; set; } + public bool? SupportsReadCdMsfRaw { get; set; } + public bool? SupportsReadLong16 { get; set; } + public bool? SupportsReadLong { get; set; } + public byte[] ModeSense6Data { get; set; } + public byte[] ModeSense10Data { get; set; } + public CHS CHS { get; set; } + public CHS CurrentCHS { get; set; } + public uint? LBASectors { get; set; } + public ulong? LBA48Sectors { get; set; } + public ushort? LogicalAlignment { get; set; } + public ushort? NominalRotationRate { get; set; } + public uint? PhysicalBlockSize { get; set; } + public bool? SolidStateDevice { get; set; } + public ushort? UnformattedBPT { get; set; } + public ushort? UnformattedBPS { get; set; } + public bool? SupportsReadDmaLba { get; set; } + public bool? SupportsReadDmaRetryLba { get; set; } + public bool? SupportsReadLba { get; set; } + public bool? SupportsReadRetryLba { get; set; } + public bool? SupportsReadLongLba { get; set; } + public bool? SupportsReadLongRetryLba { get; set; } + public bool? SupportsSeekLba { get; set; } + public bool? SupportsReadDmaLba48 { get; set; } + public bool? SupportsReadLba48 { get; set; } + public bool? SupportsReadDma { get; set; } + public bool? SupportsReadDmaRetry { get; set; } + public bool? SupportsReadRetry { get; set; } + public bool? SupportsReadLongRetry { get; set; } + public bool? SupportsSeek { get; set; } + + public static TestedMedia MapTestedMedia(testedMediaType oldMedia) + { + if(oldMedia == null) return null; + + TestedMedia newMedia = new TestedMedia(); + if(oldMedia.BlocksSpecified) newMedia.Blocks = oldMedia.Blocks; + if(oldMedia.BlockSizeSpecified) newMedia.BlockSize = oldMedia.BlockSize; + if(oldMedia.CanReadAACSSpecified) newMedia.CanReadAACS = oldMedia.CanReadAACS; + if(oldMedia.CanReadADIPSpecified) newMedia.CanReadADIP = oldMedia.CanReadADIP; + if(oldMedia.CanReadATIPSpecified) newMedia.CanReadATIP = oldMedia.CanReadATIP; + if(oldMedia.CanReadBCASpecified) newMedia.CanReadBCA = oldMedia.CanReadBCA; + if(oldMedia.CanReadC2PointersSpecified) newMedia.CanReadC2Pointers = oldMedia.CanReadC2Pointers; + if(oldMedia.CanReadCMISpecified) newMedia.CanReadCMI = oldMedia.CanReadCMI; + if(oldMedia.CanReadCorrectedSubchannelSpecified) + newMedia.CanReadCorrectedSubchannel = oldMedia.CanReadCorrectedSubchannel; + if(oldMedia.CanReadCorrectedSubchannelWithC2Specified) + newMedia.CanReadCorrectedSubchannelWithC2 = oldMedia.CanReadCorrectedSubchannelWithC2; + if(oldMedia.CanReadDCBSpecified) newMedia.CanReadDCB = oldMedia.CanReadDCB; + if(oldMedia.CanReadDDSSpecified) newMedia.CanReadDDS = oldMedia.CanReadDDS; + if(oldMedia.CanReadDMISpecified) newMedia.CanReadDMI = oldMedia.CanReadDMI; + if(oldMedia.CanReadDiscInformationSpecified) + newMedia.CanReadDiscInformation = oldMedia.CanReadDiscInformation; + if(oldMedia.CanReadFullTOCSpecified) newMedia.CanReadFullTOC = oldMedia.CanReadFullTOC; + if(oldMedia.CanReadHDCMISpecified) newMedia.CanReadHDCMI = oldMedia.CanReadHDCMI; + if(oldMedia.CanReadLayerCapacitySpecified) newMedia.CanReadLayerCapacity = oldMedia.CanReadLayerCapacity; + if(oldMedia.CanReadLeadInSpecified) newMedia.CanReadLeadInPostgap = oldMedia.CanReadLeadIn; + if(oldMedia.CanReadLeadOutSpecified) newMedia.CanReadLeadOut = oldMedia.CanReadLeadOut; + if(oldMedia.CanReadMediaIDSpecified) newMedia.CanReadMediaID = oldMedia.CanReadMediaID; + if(oldMedia.CanReadMediaSerialSpecified) newMedia.CanReadMediaSerial = oldMedia.CanReadMediaSerial; + if(oldMedia.CanReadPACSpecified) newMedia.CanReadPAC = oldMedia.CanReadPAC; + if(oldMedia.CanReadPFISpecified) newMedia.CanReadPFI = oldMedia.CanReadPFI; + if(oldMedia.CanReadPMASpecified) newMedia.CanReadPMA = oldMedia.CanReadPMA; + if(oldMedia.CanReadPQSubchannelSpecified) newMedia.CanReadPQSubchannel = oldMedia.CanReadPQSubchannel; + if(oldMedia.CanReadPQSubchannelWithC2Specified) + newMedia.CanReadPQSubchannelWithC2 = oldMedia.CanReadPQSubchannelWithC2; + if(oldMedia.CanReadPRISpecified) newMedia.CanReadPRI = oldMedia.CanReadPRI; + if(oldMedia.CanReadRWSubchannelSpecified) newMedia.CanReadRWSubchannel = oldMedia.CanReadRWSubchannel; + if(oldMedia.CanReadRWSubchannelWithC2Specified) + newMedia.CanReadRWSubchannelWithC2 = oldMedia.CanReadRWSubchannelWithC2; + if(oldMedia.CanReadRecordablePFISpecified) newMedia.CanReadRecordablePFI = oldMedia.CanReadRecordablePFI; + if(oldMedia.CanReadSpareAreaInformationSpecified) + newMedia.CanReadSpareAreaInformation = oldMedia.CanReadSpareAreaInformation; + if(oldMedia.CanReadTOCSpecified) newMedia.CanReadTOC = oldMedia.CanReadTOC; + if(oldMedia.DensitySpecified) newMedia.Density = oldMedia.Density; + if(oldMedia.LongBlockSizeSpecified) newMedia.LongBlockSize = oldMedia.LongBlockSize; + if(oldMedia.ManufacturerSpecified) newMedia.Manufacturer = oldMedia.Manufacturer; + newMedia.MediaIsRecognized = oldMedia.MediaIsRecognized; + if(oldMedia.MediumTypeSpecified) newMedia.MediumType = oldMedia.MediumType; + newMedia.MediumTypeName = oldMedia.MediumTypeName; + if(oldMedia.ModelSpecified) newMedia.Model = oldMedia.Model; + if(oldMedia.SupportsHLDTSTReadRawDVDSpecified) + newMedia.SupportsHLDTSTReadRawDVD = oldMedia.SupportsHLDTSTReadRawDVD; + if(oldMedia.SupportsNECReadCDDASpecified) newMedia.SupportsNECReadCDDA = oldMedia.SupportsNECReadCDDA; + if(oldMedia.SupportsPioneerReadCDDASpecified) + newMedia.SupportsPioneerReadCDDA = oldMedia.SupportsPioneerReadCDDA; + if(oldMedia.SupportsPioneerReadCDDAMSFSpecified) + newMedia.SupportsPioneerReadCDDAMSF = oldMedia.SupportsPioneerReadCDDAMSF; + if(oldMedia.SupportsPlextorReadCDDASpecified) + newMedia.SupportsPlextorReadCDDA = oldMedia.SupportsPlextorReadCDDA; + if(oldMedia.SupportsPlextorReadRawDVDSpecified) + newMedia.SupportsPlextorReadRawDVD = oldMedia.SupportsPlextorReadRawDVD; + if(oldMedia.SupportsRead10Specified) newMedia.SupportsRead10 = oldMedia.SupportsRead10; + if(oldMedia.SupportsRead12Specified) newMedia.SupportsRead12 = oldMedia.SupportsRead12; + if(oldMedia.SupportsRead16Specified) newMedia.SupportsRead16 = oldMedia.SupportsRead16; + if(oldMedia.SupportsReadSpecified) newMedia.SupportsRead = oldMedia.SupportsRead; + if(oldMedia.SupportsReadCapacity16Specified) + newMedia.SupportsReadCapacity16 = oldMedia.SupportsReadCapacity16; + if(oldMedia.SupportsReadCapacitySpecified) newMedia.SupportsReadCapacity = oldMedia.SupportsReadCapacity; + if(oldMedia.SupportsReadCdSpecified) newMedia.SupportsReadCd = oldMedia.SupportsReadCd; + if(oldMedia.SupportsReadCdMsfSpecified) newMedia.SupportsReadCdMsf = oldMedia.SupportsReadCdMsf; + if(oldMedia.SupportsReadCdRawSpecified) newMedia.SupportsReadCdRaw = oldMedia.SupportsReadCdRaw; + if(oldMedia.SupportsReadCdMsfRawSpecified) newMedia.SupportsReadCdMsfRaw = oldMedia.SupportsReadCdMsfRaw; + if(oldMedia.SupportsReadLong16Specified) newMedia.SupportsReadLong16 = oldMedia.SupportsReadLong16; + if(oldMedia.SupportsReadLongSpecified) newMedia.SupportsReadLong = oldMedia.SupportsReadLong; + newMedia.ModeSense6Data = oldMedia.ModeSense6Data; + newMedia.ModeSense10Data = oldMedia.ModeSense10Data; + if(oldMedia.LBASectorsSpecified) newMedia.LBASectors = oldMedia.LBASectors; + if(oldMedia.LBA48SectorsSpecified) newMedia.LBA48Sectors = oldMedia.LBA48Sectors; + if(oldMedia.LogicalAlignmentSpecified) newMedia.LogicalAlignment = oldMedia.LogicalAlignment; + if(oldMedia.NominalRotationRateSpecified) newMedia.NominalRotationRate = oldMedia.NominalRotationRate; + if(oldMedia.PhysicalBlockSizeSpecified) newMedia.PhysicalBlockSize = oldMedia.PhysicalBlockSize; + if(oldMedia.SolidStateDeviceSpecified) newMedia.SolidStateDevice = oldMedia.SolidStateDevice; + if(oldMedia.UnformattedBPTSpecified) newMedia.UnformattedBPT = oldMedia.UnformattedBPT; + if(oldMedia.UnformattedBPSSpecified) newMedia.UnformattedBPS = oldMedia.UnformattedBPS; + if(oldMedia.SupportsReadDmaLbaSpecified) newMedia.SupportsReadDmaLba = oldMedia.SupportsReadDmaLba; + if(oldMedia.SupportsReadDmaRetryLbaSpecified) + newMedia.SupportsReadDmaRetryLba = oldMedia.SupportsReadDmaRetryLba; + if(oldMedia.SupportsReadLbaSpecified) newMedia.SupportsReadLba = oldMedia.SupportsReadLba; + if(oldMedia.SupportsReadRetryLbaSpecified) newMedia.SupportsReadRetryLba = oldMedia.SupportsReadRetryLba; + if(oldMedia.SupportsReadLongLbaSpecified) newMedia.SupportsReadLongLba = oldMedia.SupportsReadLongLba; + if(oldMedia.SupportsReadLongRetryLbaSpecified) + newMedia.SupportsReadLongRetryLba = oldMedia.SupportsReadLongRetryLba; + if(oldMedia.SupportsSeekLbaSpecified) newMedia.SupportsSeekLba = oldMedia.SupportsSeekLba; + if(oldMedia.SupportsReadDmaLba48Specified) newMedia.SupportsReadDmaLba48 = oldMedia.SupportsReadDmaLba48; + if(oldMedia.SupportsReadLba48Specified) newMedia.SupportsReadLba48 = oldMedia.SupportsReadLba48; + if(oldMedia.SupportsReadDmaSpecified) newMedia.SupportsReadDma = oldMedia.SupportsReadDma; + if(oldMedia.SupportsReadDmaRetrySpecified) newMedia.SupportsReadDmaRetry = oldMedia.SupportsReadDmaRetry; + if(oldMedia.SupportsReadRetrySpecified) newMedia.SupportsReadRetry = oldMedia.SupportsReadRetry; + if(oldMedia.SupportsReadLongRetrySpecified) newMedia.SupportsReadLongRetry = oldMedia.SupportsReadLongRetry; + if(oldMedia.SupportsSeekSpecified) newMedia.SupportsSeek = oldMedia.SupportsSeek; + + if(oldMedia.CHS != null) + newMedia.CHS = new CHS + { + Cylinders = oldMedia.CHS.Cylinders, + Heads = oldMedia.CHS.Heads, + Sectors = oldMedia.CHS.Sectors + }; + if(oldMedia.CurrentCHS != null) + newMedia.CurrentCHS = new CHS + { + Cylinders = oldMedia.CurrentCHS.Cylinders, + Heads = oldMedia.CurrentCHS.Heads, + Sectors = oldMedia.CurrentCHS.Sectors + }; + + return newMedia; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.Database/Models/Usb.cs b/DiscImageChef.Database/Models/Usb.cs new file mode 100644 index 000000000..4fc4baf07 --- /dev/null +++ b/DiscImageChef.Database/Models/Usb.cs @@ -0,0 +1,61 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : Usb.cs +// Author(s) : Natalia Portillo +// +// Component : Database. +// +// --[ Description ] ---------------------------------------------------------- +// +// Database model for USB device information. +// +// --[ License ] -------------------------------------------------------------- +// +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 2.1 of the +// License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2018 Natalia Portillo +// ****************************************************************************/ + +using DiscImageChef.CommonTypes.Metadata; + +namespace DiscImageChef.Database.Models +{ + public class USB : BaseEntity + { + public ushort VendorID { get; set; } + public ushort ProductID { get; set; } + public string Manufacturer { get; set; } + public string Product { get; set; } + public bool RemovableMedia { get; set; } + public byte[] Descriptors { get; set; } + + public static USB MapUsb(usbType oldUsb) + { + if(oldUsb == null) return null; + + return new USB + { + Descriptors = oldUsb.Descriptors, + Manufacturer = oldUsb.Manufacturer, + Product = oldUsb.Product, + ProductID = oldUsb.ProductID, + RemovableMedia = oldUsb.RemovableMedia, + VendorID = oldUsb.VendorID + }; + } + } +} \ No newline at end of file diff --git a/DiscImageChef.sln b/DiscImageChef.sln index 459bb7e35..4fa914f03 100644 --- a/DiscImageChef.sln +++ b/DiscImageChef.sln @@ -37,6 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Tests.Devices EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Compression", "DiscImageChef.Compression\DiscImageChef.Compression.csproj", "{858398D1-7321-4763-8BAB-56BBFEC74E29}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Database", "DiscImageChef.Database\DiscImageChef.Database.csproj", "{FA0749B5-EFE0-4148-9545-CD420B45BC36}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -111,6 +113,10 @@ Global {858398D1-7321-4763-8BAB-56BBFEC74E29}.Debug|x86.Build.0 = Debug|Any CPU {858398D1-7321-4763-8BAB-56BBFEC74E29}.Release|x86.ActiveCfg = Release|Any CPU {858398D1-7321-4763-8BAB-56BBFEC74E29}.Release|x86.Build.0 = Release|Any CPU + {FA0749B5-EFE0-4148-9545-CD420B45BC36}.Debug|x86.ActiveCfg = Debug|Any CPU + {FA0749B5-EFE0-4148-9545-CD420B45BC36}.Debug|x86.Build.0 = Debug|Any CPU + {FA0749B5-EFE0-4148-9545-CD420B45BC36}.Release|x86.ActiveCfg = Release|Any CPU + {FA0749B5-EFE0-4148-9545-CD420B45BC36}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE