REFACTOR: Final cleanup of DiscImageChef.Server.

This commit is contained in:
2017-12-24 03:23:06 +00:00
parent 3f628cd3c9
commit 9b8771cce3
20 changed files with 316 additions and 280 deletions

View File

@@ -40,7 +40,8 @@ namespace DiscImageChef.Server.App_Start
public static class Ata
{
/// <summary>
/// Takes the ATA part of a device report and prints it as a list of values and another list of key=value pairs to be sequenced by ASP.NET in the rendering
/// Takes the ATA part of a device report and prints it as a list of values and another list of key=value pairs to be
/// sequenced by ASP.NET in the rendering
/// </summary>
/// <param name="ataReport">ATA part of a device report</param>
/// <param name="cfa"><c>true</c> if compact flash device</param>
@@ -435,7 +436,8 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add("ATAPI Unknown or no device type");
break;
default:
ataOneValue.Add($"ATAPI Unknown device type field value 0x{((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8:X2}");
ataOneValue
.Add($"ATAPI Unknown device type field value 0x{((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8:X2}");
break;
}
@@ -452,7 +454,8 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add("Device shall set DRQ within 50 µs of receiving PACKET");
break;
default:
ataOneValue.Add($"Unknown ATAPI DRQ behaviour code {((ushort)ataReport.GeneralConfiguration & 0x60) >> 5}");
ataOneValue
.Add($"Unknown ATAPI DRQ behaviour code {((ushort)ataReport.GeneralConfiguration & 0x60) >> 5}");
break;
}
@@ -466,7 +469,8 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add("ATAPI device uses 16 byte command packet");
break;
default:
ataOneValue.Add($"Unknown ATAPI packet size code {(ushort)ataReport.GeneralConfiguration & 0x03}");
ataOneValue
.Add($"Unknown ATAPI packet size code {(ushort)ataReport.GeneralConfiguration & 0x03}");
break;
}
}
@@ -535,7 +539,8 @@ namespace DiscImageChef.Server.App_Start
.Add("Device does not require SET FEATURES to spin up and IDENTIFY DEVICE response is complete.");
break;
default:
ataOneValue.Add($"Unknown device specific configuration 0x{(ushort)ataReport.SpecificConfiguration:X4}");
ataOneValue
.Add($"Unknown device specific configuration 0x{(ushort)ataReport.SpecificConfiguration:X4}");
break;
}
@@ -545,16 +550,20 @@ namespace DiscImageChef.Server.App_Start
switch(ataReport.BufferType)
{
case 1:
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of single ported single sector buffer");
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of single ported single sector buffer");
break;
case 2:
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer");
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer");
break;
case 3:
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer with read caching");
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of dual ported multi sector buffer with read caching");
break;
default:
ataOneValue.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of unknown type {ataReport.BufferType} buffer");
ataOneValue
.Add($"{ataReport.BufferSize * logicalsectorsize / 1024} KiB of unknown type {ataReport.BufferType} buffer");
break;
}
@@ -805,7 +814,8 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.PacketBusRelease != 0)
ataOneValue.Add($"{ataReport.PacketBusRelease} ns. typical to release bus from receipt of PACKET");
if(ataReport.ServiceBusyClear != 0)
ataOneValue.Add($"{ataReport.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE");
ataOneValue
.Add($"{ataReport.ServiceBusyClear} ns. typical to clear BSY bit from receipt of SERVICE");
}
if(ataReport.TransportMajorVersionSpecified && ((ataReport.TransportMajorVersion & 0xF000) >> 12 == 0x1 ||
@@ -813,25 +823,28 @@ namespace DiscImageChef.Server.App_Start
{
if(!ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear))
{
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed)) ataOneValue.Add("SATA 1.5Gb/s is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed)) ataOneValue.Add("SATA 3.0Gb/s is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed)) ataOneValue.Add("SATA 6.0Gb/s is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed))
ataOneValue.Add("SATA 1.5Gb/s is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed))
ataOneValue.Add("SATA 3.0Gb/s is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed))
ataOneValue.Add("SATA 6.0Gb/s is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PowerReceipt))
ataOneValue
.Add("Receipt of host initiated power management requests is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter)) ataOneValue.Add("PHY Event counters are supported");
ataOneValue.Add("Receipt of host initiated power management requests is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter))
ataOneValue.Add("PHY Event counters are supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.HostSlumbTrans))
ataOneValue
.Add("Supports host automatic partial to slumber transitions is supported");
ataOneValue.Add("Supports host automatic partial to slumber transitions is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.DevSlumbTrans))
ataOneValue
.Add("Supports device automatic partial to slumber transitions is supported");
ataOneValue.Add("Supports device automatic partial to slumber transitions is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ))
{
ataOneValue.Add("NCQ is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority)) ataOneValue.Add("NCQ priority is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ)) ataOneValue.Add("Unload is supported with outstanding NCQ commands");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority))
ataOneValue.Add("NCQ priority is supported");
if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ))
ataOneValue.Add("Unload is supported with outstanding NCQ commands");
}
}
@@ -842,16 +855,18 @@ namespace DiscImageChef.Server.App_Start
!ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) &&
ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ))
{
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt)) ataOneValue.Add("NCQ queue management is supported");
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream)) ataOneValue.Add("NCQ streaming is supported");
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt))
ataOneValue.Add("NCQ queue management is supported");
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream))
ataOneValue.Add("NCQ streaming is supported");
}
if(ataReport.SATACapabilities2Specified && atapi)
{
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect)) ataOneValue.Add("ATAPI device supports host environment detection");
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect))
ataOneValue.Add("ATAPI device supports host environment detection");
if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.DevAttSlimline))
ataOneValue
.Add("ATAPI device supports attention on slimline connected devices");
ataOneValue.Add("ATAPI device supports attention on slimline connected devices");
}
}
}
@@ -999,7 +1014,8 @@ namespace DiscImageChef.Server.App_Start
ataReport.EnabledCommandSet2Specified)
ataOneValue.Add("Address Offset Reserved Area Boot is supported and enabled");
else ataOneValue.Add("Address Offset Reserved Area Boot is supported");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired)) ataOneValue.Add("SET FEATURES is required before spin-up");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.SetFeaturesRequired))
ataOneValue.Add("SET FEATURES is required before spin-up");
if(ataReport.CommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby))
if(ataReport.EnabledCommandSet2.HasFlag(CommandSetBit2.PowerUpInStandby) &&
ataReport.EnabledCommandSet2Specified)
@@ -1059,8 +1075,10 @@ namespace DiscImageChef.Server.App_Start
ataReport.EnabledCommandSet3Specified)
ataOneValue.Add("IDLE IMMEDIATE with UNLOAD FEATURE is supported and enabled");
else ataOneValue.Add("IDLE IMMEDIATE with UNLOAD FEATURE is supported");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.WriteURG)) ataOneValue.Add("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.ReadURG)) ataOneValue.Add("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.WriteURG))
ataOneValue.Add("URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.ReadURG))
ataOneValue.Add("URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.WWN)) ataOneValue.Add("Device has a World Wide Name");
if(ataReport.CommandSet3.HasFlag(CommandSetBit3.FUAWriteQ))
if(ataReport.EnabledCommandSet3.HasFlag(CommandSetBit3.FUAWriteQ) &&
@@ -1161,24 +1179,35 @@ namespace DiscImageChef.Server.App_Start
if(ataReport.CommandSet5Specified)
{
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA)) ataOneValue.Add("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA)) ataOneValue.Add("READ BUFFER DMA is supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA)) ataOneValue.Add("WRITE BUFFER DMA is supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA)) ataOneValue.Add("DOWNLOAD MICROCODE DMA is supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA)) ataOneValue.Add("SET PASSWORD DMA and SET UNLOCK DMA are supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Ata28)) ataOneValue.Add("Not all 28-bit commands are supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DeviceConfDMA))
ataOneValue.Add("DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadBufferDMA))
ataOneValue.Add("READ BUFFER DMA is supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.WriteBufferDMA))
ataOneValue.Add("WRITE BUFFER DMA is supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DownloadMicroCodeDMA))
ataOneValue.Add("DOWNLOAD MICROCODE DMA is supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.SetMaxDMA))
ataOneValue.Add("SET PASSWORD DMA and SET UNLOCK DMA are supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Ata28))
ataOneValue.Add("Not all 28-bit commands are supported");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.CFast)) ataOneValue.Add("Device follows CFast specification");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.CFast))
ataOneValue.Add("Device follows CFast specification");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.IEEE1667)) ataOneValue.Add("Device follows IEEE-1667");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.DeterministicTrim))
{
ataOneValue.Add("Read after TRIM is deterministic");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim)) ataOneValue.Add("Read after TRIM returns empty data");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ReadZeroTrim))
ataOneValue.Add("Read after TRIM returns empty data");
}
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError)) ataOneValue.Add("Device supports Long Physical Sector Alignment Error Reporting Control");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Encrypted)) ataOneValue.Add("Device encrypts all user data");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.AllCacheNV)) ataOneValue.Add("Device's write cache is non-volatile");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.LongPhysSectorAligError))
ataOneValue.Add("Device supports Long Physical Sector Alignment Error Reporting Control");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.Encrypted))
ataOneValue.Add("Device encrypts all user data");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.AllCacheNV))
ataOneValue.Add("Device's write cache is non-volatile");
if(ataReport.CommandSet5.HasFlag(CommandSetBit5.ZonedBit0) ||
ataReport.CommandSet5.HasFlag(CommandSetBit5.ZonedBit1)) ataOneValue.Add("Device is zoned");
}
@@ -1255,13 +1284,17 @@ namespace DiscImageChef.Server.App_Start
ataReport.EnabledSATAFeaturesSpecified)
ataOneValue.Add("Software Settings Preservation is supported");
else ataOneValue.Add("Software Settings Preservation is supported");
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense)) ataOneValue.Add("NCQ Autosense is supported");
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber)) ataOneValue.Add("Automatic Partial to Slumber transitions are enabled");
if(ataReport.SATAFeatures.HasFlag(SATAFeaturesBit.NCQAutoSense))
ataOneValue.Add("NCQ Autosense is supported");
if(ataReport.EnabledSATAFeatures.HasFlag(SATAFeaturesBit.EnabledSlumber))
ataOneValue.Add("Automatic Partial to Slumber transitions are enabled");
}
}
if((ataReport.RemovableStatusSet & 0x03) > 0) ataOneValue.Add("Removable Media Status Notification feature set is supported");
if((ataReport.RemovableStatusSet & 0x03) > 0)
ataOneValue.Add("Removable Media Status Notification feature set is supported");
if(ataReport.FreeFallSensitivity != 0x00 && ataReport.FreeFallSensitivity != 0xFF) ataOneValue.Add($"Free-fall sensitivity set to {ataReport.FreeFallSensitivity}");
if(ataReport.FreeFallSensitivity != 0x00 && ataReport.FreeFallSensitivity != 0xFF)
ataOneValue.Add($"Free-fall sensitivity set to {ataReport.FreeFallSensitivity}");
if(ataReport.DataSetMgmtSpecified && ataReport.DataSetMgmt.HasFlag(DataSetMgmtBit.Trim))
ataOneValue.Add("TRIM is supported");
@@ -1297,7 +1330,8 @@ namespace DiscImageChef.Server.App_Start
ataOneValue.Add($"{ataReport.SecurityEraseTime * 2} minutes to complete secure erase");
if(ataReport.SecurityStatus.HasFlag(SecurityStatusBit.Enhanced))
ataOneValue.Add($"{ataReport.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase");
ataOneValue
.Add($"{ataReport.EnhancedSecurityEraseTime * 2} minutes to complete enhanced secure erase");
ataOneValue.Add($"Master password revision code: {ataReport.MasterPasswordRevisionCode}");
}
@@ -1365,7 +1399,8 @@ namespace DiscImageChef.Server.App_Start
logicalsectorsize = ataReport.ReadCapabilities.BlockSize;
}
if(ataReport.ReadCapabilities.PhysicalBlockSizeSpecified)
ataTwoValue.Add("Physical sector size", $"{ataReport.ReadCapabilities.PhysicalBlockSize} bytes");
ataTwoValue.Add("Physical sector size",
$"{ataReport.ReadCapabilities.PhysicalBlockSize} bytes");
if(ataReport.ReadCapabilities.LongBlockSizeSpecified)
ataTwoValue.Add("READ LONG sector size", $"{ataReport.ReadCapabilities.LongBlockSize} bytes");
@@ -1374,7 +1409,8 @@ namespace DiscImageChef.Server.App_Start
ataReport.ReadCapabilities.BlockSize != ataReport.ReadCapabilities.PhysicalBlockSize &&
(ataReport.ReadCapabilities.LogicalAlignment & 0x8000) == 0x0000 &&
(ataReport.ReadCapabilities.LogicalAlignment & 0x4000) == 0x4000)
ataOneValue.Add($"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector");
ataOneValue
.Add($"Logical sector starts at offset {ataReport.ReadCapabilities.LogicalAlignment & 0x3FFF} from physical sector");
if(ataReport.ReadCapabilities.CHS != null && ataReport.ReadCapabilities.CurrentCHS != null)
{
@@ -1413,8 +1449,7 @@ namespace DiscImageChef.Server.App_Start
if((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 > 1000000)
ataTwoValue.Add("Device size in 28-bit LBA mode",
$"{(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize} bytes, {(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 >
1000)
else if((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1024 / 1024 > 1000)
ataTwoValue.Add("Device size in 28-bit LBA mode",
$"{(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize} bytes, {(ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize / 1000 / 1000 / 1000} Gb, {(double)((ulong)ataReport.ReadCapabilities.LBASectors * logicalsectorsize) / 1024 / 1024 / 1024:F2} GiB");
else

View File

@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
public static class ScsiEvpd
{
/// <summary>
/// Takes the SCSI EVPD part of a device report and prints it as a list key=value pairs to be sequenced by ASP.NET in the rendering
/// Takes the SCSI EVPD part of a device report and prints it as a list key=value pairs to be sequenced by ASP.NET in
/// the rendering
/// </summary>
/// <param name="pages">EVPD pages</param>
/// <param name="vendor">SCSI vendor string</param>
@@ -65,16 +66,13 @@ namespace DiscImageChef.Server.App_Start
decoded = EVPD.PrettifyPage_C0_Quantum(evpd.value);
else if(evpd.page == 0xC0 && vendor.Trim() == "seagate")
decoded = EVPD.PrettifyPage_C0_Seagate(evpd.value);
else if(evpd.page == 0xC0 && vendor.Trim() == "ibm")
decoded = EVPD.PrettifyPage_C0_IBM(evpd.value);
else if(evpd.page == 0xC1 && vendor.Trim() == "ibm")
decoded = EVPD.PrettifyPage_C1_IBM(evpd.value);
else if(evpd.page == 0xC0 && vendor.Trim() == "ibm") decoded = EVPD.PrettifyPage_C0_IBM(evpd.value);
else if(evpd.page == 0xC1 && vendor.Trim() == "ibm") decoded = EVPD.PrettifyPage_C1_IBM(evpd.value);
else if((evpd.page == 0xC0 || evpd.page == 0xC1) && vendor.Trim() == "certance")
decoded = EVPD.PrettifyPage_C0_C1_Certance(evpd.value);
else if((evpd.page == 0xC2 || evpd.page == 0xC3 || evpd.page == 0xC4 || evpd.page == 0xC5 ||
evpd.page == 0xC6) &&
vendor.Trim() == "certance")
decoded = EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value);
vendor.Trim() == "certance") decoded = EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value);
else if((evpd.page == 0xC0 || evpd.page == 0xC1 || evpd.page == 0xC2 || evpd.page == 0xC3 ||
evpd.page == 0xC4 || evpd.page == 0xC5) &&
vendor.Trim() == "hp") decoded = EVPD.PrettifyPage_C0_to_C5_HP(evpd.value);

View File

@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
static class ScsiInquiry
{
/// <summary>
/// Takes the SCSI INQUIRY part of a device report and prints it as a list of values to be sequenced by ASP.NET in the rendering
/// Takes the SCSI INQUIRY part of a device report and prints it as a list of values to be sequenced by ASP.NET in the
/// rendering
/// </summary>
/// <param name="inquiry">INQUIRY part of the report</param>
/// <returns>List of values</returns>
@@ -1026,8 +1027,7 @@ namespace DiscImageChef.Server.App_Start
scsiOneValue.Add("Device complies with SPI ANSI INCITS 253-1995");
break;
case 0x0ABB:
scsiOneValue
.Add("Device complies with SPI T10/0855-D revision 15a with SPI Amnd revision 3a");
scsiOneValue.Add("Device complies with SPI T10/0855-D revision 15a with SPI Amnd revision 3a");
break;
case 0x0ABC:
scsiOneValue
@@ -1216,8 +1216,7 @@ namespace DiscImageChef.Server.App_Start
scsiOneValue.Add("Device complies with FC-AL-2 T11/1133-D revision 7.0");
break;
case 0x0D63:
scsiOneValue
.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with AM1-2003 & AM2-2006");
scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with AM1-2003 & AM2-2006");
break;
case 0x0D64:
scsiOneValue.Add("Device complies with FC-AL-2 ANSI INCITS 332-1999 with Amnd 2 AM2-2006");
@@ -1620,8 +1619,7 @@ namespace DiscImageChef.Server.App_Start
scsiOneValue.Add("Device complies with SPL ANSI INCITS 476-2011");
break;
case 0x20A8:
scsiOneValue
.Add("Device complies with SPL ANSI INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012");
scsiOneValue.Add("Device complies with SPL ANSI INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012");
break;
case 0x20AA:
scsiOneValue.Add("Device complies with SPL ISO/IEC 14776-261:2012");

View File

@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
public static class ScsiMmcFeatures
{
/// <summary>
/// Takes the MMC FEATURES part of a device report and prints it as a list of values to be sequenced by ASP.NET in the rendering
/// Takes the MMC FEATURES part of a device report and prints it as a list of values to be sequenced by ASP.NET in the
/// rendering
/// </summary>
/// <param name="ftr">FEATURES part of the report</param>
/// <param name="mmcOneValue">List to put the values on</param>
@@ -125,8 +126,7 @@ namespace DiscImageChef.Server.App_Start
if(ftr.CanUpgradeFirmware) mmcOneValue.Add("Drive supports Microcode Upgrade");
if(ftr.ErrorRecoveryPage) mmcOneValue.Add("Drive shall report Read/Write Error Recovery mode page");
if(ftr.Locked) mmcOneValue.Add("Drive can lock media");
if(ftr.LogicalBlockSize > 0)
mmcOneValue.Add($"{ftr.LogicalBlockSize} bytes per logical block");
if(ftr.LogicalBlockSize > 0) mmcOneValue.Add($"{ftr.LogicalBlockSize} bytes per logical block");
if(ftr.MultiRead)
mmcOneValue.Add("Drive claims capability to read all CD formats according to OSTA Multi-Read Specification");
@@ -233,8 +233,7 @@ namespace DiscImageChef.Server.App_Start
else if(ftr.SupportsCPRM) mmcOneValue.Add("Drive supports DVD CPRM");
if(ftr.DBML) mmcOneValue.Add("Drive reports Device Busy Class events during medium loading/unloading");
if(ftr.DVDMultiRead) mmcOneValue.Add("Drive conforms to DVD Multi Drive Read-only Specifications");
if(ftr.FirmwareDateSpecified)
mmcOneValue.Add($"Drive firmware is dated {ftr.FirmwareDate}");
if(ftr.FirmwareDateSpecified) mmcOneValue.Add($"Drive firmware is dated {ftr.FirmwareDate}");
if(ftr.SupportsC2) mmcOneValue.Add("Drive supports C2 Error Pointers");
if(ftr.SupportsDAP) mmcOneValue.Add("Drive supports the DAP bit in the READ CD and READ CD MSF commands");
if(ftr.SupportsDeviceBusyEvent) mmcOneValue.Add("Drive supports Device Busy events");
@@ -271,8 +270,7 @@ namespace DiscImageChef.Server.App_Start
if(ftr.SupportsSecurDisc) mmcOneValue.Add("Drive supports SecurDisc");
if(ftr.SupportsSeparateVolume) mmcOneValue.Add("Drive supports separate volume per channel");
if(ftr.SupportsVCPS) mmcOneValue.Add("Drive supports VCPS");
if(ftr.VolumeLevelsSpecified)
mmcOneValue.Add($"Drive has {ftr.VolumeLevels + 1} volume levels");
if(ftr.VolumeLevelsSpecified) mmcOneValue.Add($"Drive has {ftr.VolumeLevels + 1} volume levels");
if(ftr.SupportsWriteProtectPAC)
mmcOneValue.Add("Drive supports reading/writing the Disc Write Protect PAC on BD-R/-RE media");
if(ftr.SupportsWriteInhibitDCB)

View File

@@ -40,7 +40,8 @@ namespace DiscImageChef.Server.App_Start
public static class ScsiMmcMode
{
/// <summary>
/// Takes the MODE PAGE 2Ah part of a device report and prints it as a list of values to be sequenced by ASP.NET in the rendering
/// Takes the MODE PAGE 2Ah part of a device report and prints it as a list of values to be sequenced by ASP.NET in the
/// rendering
/// </summary>
/// <param name="mode">MODE PAGE 2Ah part of the report</param>
/// <param name="mmcOneValue">List to put the values on</param>
@@ -91,11 +92,9 @@ namespace DiscImageChef.Server.App_Start
: "Drive is not locked, media can be ejected and inserted");
}
else
{
mmcOneValue.Add(mode.LockStatus
? "Drive is locked, media cannot be ejected, but if empty, can be inserted"
: "Drive is not locked, media can be ejected and inserted");
}
if(mode.CanEject) mmcOneValue.Add("Drive can eject media");
if(mode.SeparateChannelMute) mmcOneValue.Add("Each channel can be muted independently");
@@ -134,9 +133,11 @@ namespace DiscImageChef.Server.App_Start
if(mode.CurrentWriteSpeedSelected > 0)
{
if(mode.RotationControlSelected == 0)
mmcOneValue.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in CLV mode");
mmcOneValue
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in CLV mode");
else if(mode.RotationControlSelected == 1)
mmcOneValue.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in pure CAV mode");
mmcOneValue
.Add($"Drive's current writing speed is {mode.CurrentWriteSpeedSelected} Kbyte/sec. in pure CAV mode");
}
else
{
@@ -147,7 +148,9 @@ namespace DiscImageChef.Server.App_Start
}
if(mode.WriteSpeedPerformanceDescriptors != null)
foreach(Modes.ModePage_2A_WriteDescriptor descriptor in mode.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0)) if(descriptor.RotationControl == 0)
foreach(Modes.ModePage_2A_WriteDescriptor descriptor in
mode.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0))
if(descriptor.RotationControl == 0)
mmcOneValue.Add($"Drive supports writing at {descriptor.WriteSpeed} Kbyte/sec. in CLV mode");
else if(descriptor.RotationControl == 1)
mmcOneValue

View File

@@ -39,7 +39,8 @@ namespace DiscImageChef.Server.App_Start
public static class ScsiModeSense
{
/// <summary>
/// Takes the MODE PAGEs part of a device report and prints it as a list of values and another list of key=value pairs to be sequenced by ASP.NET in the rendering
/// Takes the MODE PAGEs part of a device report and prints it as a list of values and another list of key=value pairs
/// to be sequenced by ASP.NET in the rendering
/// </summary>
/// <param name="modeSense">MODE PAGEs part of a device report</param>
/// <param name="vendor">SCSI vendor string</param>
@@ -49,13 +50,13 @@ namespace DiscImageChef.Server.App_Start
public static void Report(modeType modeSense, string vendor, PeripheralDeviceTypes deviceType,
ref List<string> scsiOneValue, ref Dictionary<string, string> modePages)
{
if(modeSense.MediumTypeSpecified)
scsiOneValue.Add($"Medium type is {modeSense.MediumType:X2}h");
if(modeSense.MediumTypeSpecified) scsiOneValue.Add($"Medium type is {modeSense.MediumType:X2}h");
if(modeSense.WriteProtected) scsiOneValue.Add("Device is write protected.");
if(modeSense.BlockDescriptors != null)
foreach(blockDescriptorType descriptor in modeSense.BlockDescriptors)
if(descriptor.BlocksSpecified && descriptor.BlockLengthSpecified)
scsiOneValue.Add($"Density code {descriptor.Density:X2}h has {descriptor.Blocks} blocks of {descriptor.BlockLength} bytes each");
scsiOneValue
.Add($"Density code {descriptor.Density:X2}h has {descriptor.Blocks} blocks of {descriptor.BlockLength} bytes each");
else scsiOneValue.Add($"Density code {descriptor.Density:X2}h");
if(modeSense.DPOandFUA) scsiOneValue.Add("Drive supports DPO and FUA bits");
@@ -85,14 +86,11 @@ namespace DiscImageChef.Server.App_Start
case 0x00:
{
if(deviceType == PeripheralDeviceTypes.MultiMediaDevice && page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_00_SFF(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_00_SFF(page.value));
else
{
modePages
.Add(page.subpage != 0 ? $"MODE page {page.page:X2}h subpage {page.subpage:X2}h" : $"MODE page {page.page:X2}h",
"Unknown vendor mode page");
}
break;
}
case 0x01:
@@ -109,8 +107,7 @@ namespace DiscImageChef.Server.App_Start
case 0x02:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_02(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_02(page.value));
else goto default;
break;
@@ -118,8 +115,7 @@ namespace DiscImageChef.Server.App_Start
case 0x03:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_03(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_03(page.value));
else goto default;
break;
@@ -127,8 +123,7 @@ namespace DiscImageChef.Server.App_Start
case 0x04:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_04(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_04(page.value));
else goto default;
break;
@@ -136,8 +131,7 @@ namespace DiscImageChef.Server.App_Start
case 0x05:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_05(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_05(page.value));
else goto default;
break;
@@ -145,8 +139,7 @@ namespace DiscImageChef.Server.App_Start
case 0x06:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_06(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_06(page.value));
else goto default;
break;
@@ -165,8 +158,7 @@ namespace DiscImageChef.Server.App_Start
case 0x08:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_08(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_08(page.value));
else goto default;
break;
@@ -174,11 +166,9 @@ namespace DiscImageChef.Server.App_Start
case 0x0A:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_0A(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0A(page.value));
else if(page.subpage == 1)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_0A_S01(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0A_S01(page.value));
else goto default;
break;
@@ -186,8 +176,7 @@ namespace DiscImageChef.Server.App_Start
case 0x0B:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_0B(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0B(page.value));
else goto default;
break;
@@ -195,8 +184,7 @@ namespace DiscImageChef.Server.App_Start
case 0x0D:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_0D(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0D(page.value));
else goto default;
break;
@@ -204,8 +192,7 @@ namespace DiscImageChef.Server.App_Start
case 0x0E:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_0E(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0E(page.value));
else goto default;
break;
@@ -213,8 +200,7 @@ namespace DiscImageChef.Server.App_Start
case 0x0F:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_0F(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_0F(page.value));
else goto default;
break;
@@ -233,8 +219,7 @@ namespace DiscImageChef.Server.App_Start
case 0x11:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_11(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_11(page.value));
else goto default;
break;
@@ -244,8 +229,7 @@ namespace DiscImageChef.Server.App_Start
case 0x14:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_12_13_14(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_12_13_14(page.value));
else goto default;
break;
@@ -253,11 +237,9 @@ namespace DiscImageChef.Server.App_Start
case 0x1A:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_1A(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1A(page.value));
else if(page.subpage == 1)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_1A_S01(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1A_S01(page.value));
else goto default;
break;
@@ -265,8 +247,7 @@ namespace DiscImageChef.Server.App_Start
case 0x1B:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_1B(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1B(page.value));
else goto default;
break;
@@ -279,8 +260,7 @@ namespace DiscImageChef.Server.App_Start
? Modes.PrettifyModePage_1C_SFF(page.value)
: Modes.PrettifyModePage_1C(page.value));
else if(page.subpage == 1)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_1C_S01(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1C_S01(page.value));
else goto default;
break;
@@ -288,8 +268,7 @@ namespace DiscImageChef.Server.App_Start
case 0x1D:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_1D(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_1D(page.value));
else goto default;
break;
@@ -297,8 +276,7 @@ namespace DiscImageChef.Server.App_Start
case 0x21:
{
if(vendor == "CERTANCE")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyCertanceModePage_21(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyCertanceModePage_21(page.value));
else goto default;
break;
@@ -306,8 +284,7 @@ namespace DiscImageChef.Server.App_Start
case 0x22:
{
if(vendor == "CERTANCE")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyCertanceModePage_22(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyCertanceModePage_22(page.value));
else goto default;
break;
@@ -315,8 +292,7 @@ namespace DiscImageChef.Server.App_Start
case 0x24:
{
if(vendor == "IBM")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyIBMModePage_24(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_24(page.value));
else goto default;
break;
@@ -324,8 +300,7 @@ namespace DiscImageChef.Server.App_Start
case 0x2A:
{
if(page.subpage == 0)
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyModePage_2A(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyModePage_2A(page.value));
else goto default;
break;
@@ -333,8 +308,7 @@ namespace DiscImageChef.Server.App_Start
case 0x2F:
{
if(vendor == "IBM")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyIBMModePage_2F(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_2F(page.value));
else goto default;
break;
@@ -350,8 +324,7 @@ namespace DiscImageChef.Server.App_Start
case 0x3B:
{
if(vendor == "HP")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyHPModePage_3B(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3B(page.value));
else goto default;
break;
@@ -359,8 +332,7 @@ namespace DiscImageChef.Server.App_Start
case 0x3C:
{
if(vendor == "HP")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyHPModePage_3C(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3C(page.value));
else goto default;
break;
@@ -368,11 +340,9 @@ namespace DiscImageChef.Server.App_Start
case 0x3D:
{
if(vendor == "IBM")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyIBMModePage_3D(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyIBMModePage_3D(page.value));
else if(vendor == "HP")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyHPModePage_3D(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3D(page.value));
else goto default;
break;
@@ -380,11 +350,9 @@ namespace DiscImageChef.Server.App_Start
case 0x3E:
{
if(vendor == "FUJITSU")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyFujitsuModePage_3E(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyFujitsuModePage_3E(page.value));
else if(vendor == "HP")
modePages.Add($"MODE page {page.page:X2}h",
Modes.PrettifyHPModePage_3E(page.value));
modePages.Add($"MODE page {page.page:X2}h", Modes.PrettifyHPModePage_3E(page.value));
else goto default;
break;

View File

@@ -49,8 +49,7 @@ namespace DiscImageChef.Server.App_Start
if(!string.IsNullOrWhiteSpace(media.MediumTypeName))
{
mediaOneValue.Add($"<i>Information for medium named \"{media.MediumTypeName}\"</i>");
if(media.MediumTypeSpecified)
mediaOneValue.Add($"Medium type code: {media.MediumType:X2}h");
if(media.MediumTypeSpecified) mediaOneValue.Add($"Medium type code: {media.MediumType:X2}h");
}
else if(media.MediumTypeSpecified)
mediaOneValue.Add($"<i>Information for medium type {media.MediumType:X2}h</i>");
@@ -58,11 +57,9 @@ namespace DiscImageChef.Server.App_Start
if(!string.IsNullOrWhiteSpace(media.Manufacturer))
mediaOneValue.Add($"Medium manufactured by: {media.Manufacturer}");
if(!string.IsNullOrWhiteSpace(media.Model))
mediaOneValue.Add($"Medium model: {media.Model}");
if(!string.IsNullOrWhiteSpace(media.Model)) mediaOneValue.Add($"Medium model: {media.Model}");
if(media.DensitySpecified)
mediaOneValue.Add($"Medium has density code {media.Density:X2}h");
if(media.DensitySpecified) mediaOneValue.Add($"Medium has density code {media.Density:X2}h");
if(media.CanReadMediaSerial) mediaOneValue.Add("Drive can read medium serial number.");
if(media.MediaIsRecognized) mediaOneValue.Add("DiscImageChef recognizes this medium.");

View File

@@ -65,8 +65,7 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add($"Medium manufactured by: {testedMedia.Manufacturer}");
if(!string.IsNullOrWhiteSpace(testedMedia.Model))
mediaOneValue.Add($"Medium model: {testedMedia.Model}");
if(testedMedia.DensitySpecified)
mediaOneValue.Add($"Density code: {testedMedia.Density:X2}h");
if(testedMedia.DensitySpecified) mediaOneValue.Add($"Density code: {testedMedia.Density:X2}h");
if(testedMedia.BlockSizeSpecified)
mediaOneValue.Add($"Logical sector size: {testedMedia.BlockSize} bytes");
@@ -80,22 +79,29 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add($"Medium has {testedMedia.Blocks} blocks of {testedMedia.BlockSize} bytes each");
if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000000)
mediaOneValue.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
mediaOneValue
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000)
mediaOneValue.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
mediaOneValue
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
mediaOneValue.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
mediaOneValue
.Add($"Medium size: {testedMedia.Blocks * testedMedia.BlockSize} bytes, {testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.CHS != null && testedMedia.CurrentCHS != null)
{
int currentSectors = testedMedia.CurrentCHS.Cylinders * testedMedia.CurrentCHS.Heads *
testedMedia.CurrentCHS.Sectors;
mediaOneValue.Add($"Cylinders: {testedMedia.CHS.Cylinders} max., {testedMedia.CurrentCHS.Cylinders} current");
mediaOneValue
.Add($"Cylinders: {testedMedia.CHS.Cylinders} max., {testedMedia.CurrentCHS.Cylinders} current");
mediaOneValue.Add($"Heads: {testedMedia.CHS.Heads} max., {testedMedia.CurrentCHS.Heads} current");
mediaOneValue.Add($"Sectors per track: {testedMedia.CHS.Sectors} max., {testedMedia.CurrentCHS.Sectors} current");
mediaOneValue.Add($"Sectors addressable in CHS mode: {testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors} max., {currentSectors} current");
mediaOneValue.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
mediaOneValue
.Add($"Sectors per track: {testedMedia.CHS.Sectors} max., {testedMedia.CurrentCHS.Sectors} current");
mediaOneValue
.Add($"Sectors addressable in CHS mode: {testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors} max., {currentSectors} current");
mediaOneValue
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
else if(testedMedia.CHS != null)
{
@@ -104,7 +110,8 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add($"Heads: {testedMedia.CHS.Heads}");
mediaOneValue.Add($"Sectors per track: {testedMedia.CHS.Sectors}");
mediaOneValue.Add($"Sectors addressable in CHS mode: {currentSectors}");
mediaOneValue.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
mediaOneValue
.Add($"Medium size in CHS mode: {(ulong)currentSectors * testedMedia.BlockSize} bytes, {(ulong)currentSectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.LBASectorsSpecified)
@@ -112,11 +119,14 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add($"Sectors addressable in sectors in 28-bit LBA mode: {testedMedia.LBASectors}");
if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000000)
mediaOneValue.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
mediaOneValue
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000)
mediaOneValue.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
mediaOneValue
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
mediaOneValue.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
mediaOneValue
.Add($"Medium size in 28-bit LBA mode: {(ulong)testedMedia.LBASectors * testedMedia.BlockSize} bytes, {(ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.LBA48SectorsSpecified)
@@ -124,11 +134,14 @@ namespace DiscImageChef.Server.App_Start
mediaOneValue.Add($"Sectors addressable in sectors in 48-bit LBA mode: {testedMedia.LBA48Sectors}");
if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000000)
mediaOneValue.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
mediaOneValue
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000)
mediaOneValue.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
mediaOneValue
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
mediaOneValue.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
mediaOneValue
.Add($"Medium size in 48-bit LBA mode: {testedMedia.LBA48Sectors * testedMedia.BlockSize} bytes, {testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000} Mb, {(double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024:F2} MiB");
}
if(testedMedia.NominalRotationRateSpecified && testedMedia.NominalRotationRate != 0x0000 &&
@@ -141,7 +154,8 @@ namespace DiscImageChef.Server.App_Start
testedMedia.BlockSize != testedMedia.PhysicalBlockSize &&
(testedMedia.LogicalAlignment & 0x8000) == 0x0000 &&
(testedMedia.LogicalAlignment & 0x4000) == 0x4000)
mediaOneValue.Add($"Logical sector starts at offset {testedMedia.LogicalAlignment & 0x3FFF} from physical sector");
mediaOneValue
.Add($"Logical sector starts at offset {testedMedia.LogicalAlignment & 0x3FFF} from physical sector");
if(testedMedia.SupportsRead && ata)
mediaOneValue.Add("Device can use the READ SECTOR(S) command in CHS mode with this medium");

View File

@@ -43,7 +43,9 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-111466173-1');

View File

@@ -71,11 +71,13 @@ namespace DiscImageChef.Server.Controllers
Random rng = new Random();
string filename = $"NewReport_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Upload", filename))) filename =
$"NewReport_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"Upload", filename)))
filename = $"NewReport_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
FileStream newFile =
new FileStream(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Upload", filename),
new
FileStream(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Upload", filename),
FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None);
xs.Serialize(newFile, newReport);
newFile.Close();

View File

@@ -119,7 +119,10 @@ namespace DiscImageChef.Server.Controllers
OsStats removeNvs = null;
OsStats addNvs = null;
foreach(OsStats oldNvs in oldStats.OperatingSystems.Where(oldNvs => oldNvs.name == newNvs.name && oldNvs.version == newNvs.version)) {
foreach(OsStats oldNvs in
oldStats.OperatingSystems.Where(oldNvs => oldNvs.name == newNvs.name &&
oldNvs.version == newNvs.version))
{
addNvs = new OsStats
{
name = oldNvs.name,
@@ -140,14 +143,14 @@ namespace DiscImageChef.Server.Controllers
else
{
if(oldStats.OperatingSystems == null)
oldStats.OperatingSystems =
new List<OsStats> {new OsStats {name = "Linux", Value = 1}};
oldStats.OperatingSystems = new List<OsStats> {new OsStats {name = "Linux", Value = 1}};
else
{
OsStats removeNvs = null;
OsStats addNvs = null;
foreach(OsStats oldNvs in oldStats.OperatingSystems.Where(oldNvs => oldNvs.name == "Linux")) {
foreach(OsStats oldNvs in oldStats.OperatingSystems.Where(oldNvs => oldNvs.name == "Linux"))
{
addNvs = new OsStats
{
name = oldNvs.name,
@@ -175,12 +178,10 @@ namespace DiscImageChef.Server.Controllers
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in oldStats.Versions.Where(oldNvs => oldNvs.name == newNvs.name)) {
addNvs = new NameValueStats
foreach(NameValueStats oldNvs in
oldStats.Versions.Where(oldNvs => oldNvs.name == newNvs.name))
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
removeNvs = oldNvs;
break;
}
@@ -196,16 +197,14 @@ namespace DiscImageChef.Server.Controllers
{
if(oldStats.Versions == null)
oldStats.Versions =
new List<NameValueStats>
{
new NameValueStats {name = "previous", Value = 1}
};
new List<NameValueStats> {new NameValueStats {name = "previous", Value = 1}};
else
{
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in oldStats.Versions.Where(oldNvs => oldNvs.name == "previous")) {
foreach(NameValueStats oldNvs in oldStats.Versions.Where(oldNvs => oldNvs.name == "previous"))
{
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + 1};
removeNvs = oldNvs;
break;
@@ -228,12 +227,10 @@ namespace DiscImageChef.Server.Controllers
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in oldStats.Filesystems.Where(oldNvs => oldNvs.name == newNvs.name)) {
addNvs = new NameValueStats
foreach(NameValueStats oldNvs in
oldStats.Filesystems.Where(oldNvs => oldNvs.name == newNvs.name))
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
removeNvs = oldNvs;
break;
}
@@ -254,12 +251,10 @@ namespace DiscImageChef.Server.Controllers
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in oldStats.Partitions.Where(oldNvs => oldNvs.name == newNvs.name)) {
addNvs = new NameValueStats
foreach(NameValueStats oldNvs in
oldStats.Partitions.Where(oldNvs => oldNvs.name == newNvs.name))
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
removeNvs = oldNvs;
break;
}
@@ -280,12 +275,10 @@ namespace DiscImageChef.Server.Controllers
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in oldStats.MediaImages.Where(oldNvs => oldNvs.name == newNvs.name)) {
addNvs = new NameValueStats
foreach(NameValueStats oldNvs in
oldStats.MediaImages.Where(oldNvs => oldNvs.name == newNvs.name))
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
removeNvs = oldNvs;
break;
}
@@ -306,12 +299,10 @@ namespace DiscImageChef.Server.Controllers
NameValueStats removeNvs = null;
NameValueStats addNvs = null;
foreach(NameValueStats oldNvs in oldStats.Filters.Where(oldNvs => oldNvs.name == newNvs.name)) {
addNvs = new NameValueStats
foreach(NameValueStats oldNvs in
oldStats.Filters.Where(oldNvs => oldNvs.name == newNvs.name))
{
name = oldNvs.name,
Value = oldNvs.Value + newNvs.Value
};
addNvs = new NameValueStats {name = oldNvs.name, Value = oldNvs.Value + newNvs.Value};
removeNvs = oldNvs;
break;
}
@@ -336,7 +327,7 @@ namespace DiscImageChef.Server.Controllers
oldDev.Revision == newDev.Revision &&
oldDev.Bus == newDev.Bus)
where !found
select newDev) { oldStats.Devices.Add(newDev); }
select newDev) oldStats.Devices.Add(newDev);
if(newStats.Medias != null)
if(oldStats.Medias == null) oldStats.Medias = newStats.Medias;
@@ -346,7 +337,10 @@ namespace DiscImageChef.Server.Controllers
MediaStats removeMstat = null;
MediaStats addMstat = null;
foreach(MediaStats oldMstat in oldStats.Medias.Where(oldMstat => oldMstat.real == newMstat.real && oldMstat.type == newMstat.type)) {
foreach(MediaStats oldMstat in
oldStats.Medias.Where(oldMstat => oldMstat.real == newMstat.real &&
oldMstat.type == newMstat.type))
{
addMstat = new MediaStats
{
real = oldMstat.real,
@@ -419,13 +413,11 @@ namespace DiscImageChef.Server.Controllers
Random rng = new Random();
string filename = $"BackupStats_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics",
filename)))
while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", filename)))
filename = $"BackupStats_{DateTime.UtcNow:yyyyMMddHHmmssfff}_{rng.Next()}.xml";
FileStream backup =
new
FileStream(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", filename),
new FileStream(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", filename),
FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None);
fs.Seek(0, SeekOrigin.Begin);
fs.CopyTo(backup);

View File

@@ -43,7 +43,9 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-111466173-1');

View File

@@ -1,5 +1,4 @@
<%@ Page Language="C#" Inherits="DiscImageChef.Server.Default" %>
<%@ Register TagPrefix="velyo" Namespace="Velyo.AspNet.Markdown" Assembly="Velyo.AspNet.Markdown" %>
<%--
// /***************************************************************************
// The Disc Image Chef
@@ -43,14 +42,17 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="body" runat="server">
<h1 align="center">Welcome to <i>
<h1 align="center">
Welcome to <i>
<a href="http://github.com/claunia/discimagechef" target="_blank">DiscImageChef</a>
</i> Server version <asp:Label id="lblVersion" runat="server"/>
</h1>

View File

@@ -48,7 +48,8 @@ namespace DiscImageChef.Server
{
MarkdownContent mkdown = new MarkdownContent();
StreamReader sr =
new StreamReader(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "docs", "README.md"));
new StreamReader(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"docs", "README.md"));
string mdcontent = sr.ReadToEnd();
sr.Close();

View File

@@ -26,6 +26,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -173,7 +174,7 @@
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp" />
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" NewLineForMembersInObjectInit="False" NewLineForMembersInAnonymousTypes="False" NewLineForClausesInQuery="False" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp" />
<ChangeLogPolicy VcsIntegration="Enabled" UpdateMode="ProjectRoot">
<MessageStyle Header="${Date:yyyy-MM-dd} ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA;" Indent="&#x9;" FirstFilePrefix="* " FileSeparator=":&#xA;* " LastFilePostfix=": " LineAlign="0" InterMessageLines="1" IncludeDirectoryPaths="False" Wrap="True" />
<MessageStyle Header="${Date:yyyy-MM-dd} ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA;" Indent=" " FirstFilePrefix="* " FileSeparator=":&#xA;* " LastFilePostfix=": " LineAlign="0" InterMessageLines="1" IncludeDirectoryPaths="False" Wrap="True" />
<inheritsSet />
<inheritsScope />
</ChangeLogPolicy>

View File

@@ -42,14 +42,17 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-111466173-1');
</script>
</head>
<body id="body" runat="server">
<h1 align="center">Welcome to <i>
<h1 align="center">
Welcome to <i>
<a href="http://github.com/claunia/discimagechef" target="_blank">DiscImageChef</a>
</i> Server version <asp:Label id="lblVersion" runat="server"/>
</h1>
@@ -60,7 +63,8 @@
<asp:Repeater id="repOperatingSystems" runat="server">
<ItemTemplate>
<tr>
<td>DiscImageChef has run on <i>
<td>
DiscImageChef has run on <i>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
</i> <asp:Label runat="server" Text='<%# Eval("Value") %>'/> times.
</td>
@@ -75,7 +79,8 @@
<asp:Repeater id="repVersions" runat="server">
<ItemTemplate>
<tr>
<td>DiscImageChef version <i>
<td>
DiscImageChef version <i>
<asp:Label runat="server" Text='<%# Eval("name") %>'/>
</i> has been used <asp:Label runat="server" Text='<%# Eval("Value") %>'/> times.
</td>

View File

@@ -51,28 +51,13 @@ namespace DiscImageChef.Server
/// </summary>
public partial class Statistics : Page
{
class MediaItem
{
public string Type { get; set; }
public string SubType { get; set; }
public long Count { get; set; }
}
class DeviceItem
{
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Revision { get; set; }
public string Bus { get; set; }
public string ReportLink { get; set; }
}
List<DeviceItem> devices;
List<NameValueStats> operatingSystems;
List<MediaItem> realMedia;
Stats statistics;
List<MediaItem> realMedia;
List<MediaItem> virtualMedia;
List<NameValueStats> operatingSystems;
List<DeviceItem> devices;
List<NameValueStats> versions;
List<MediaItem> virtualMedia;
protected void Page_Load(object sender, EventArgs e)
{
@@ -80,8 +65,8 @@ namespace DiscImageChef.Server
try
{
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Statistics",
"Statistics.xml")))
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"Statistics", "Statistics.xml")))
{
#if DEBUG
content.InnerHtml =
@@ -253,8 +238,7 @@ namespace DiscImageChef.Server
xmlFile = xmlFile.Replace('/', '_').Replace('\\', '_').Replace('?', '_');
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Reports",
xmlFile))) url = null;
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Reports", xmlFile))) url = null;
devices.Add(new DeviceItem
{
@@ -262,8 +246,7 @@ namespace DiscImageChef.Server
Model = device.Model,
Revision = device.Revision,
Bus = device.Bus,
ReportLink =
url == null ? "No" : $"<a href=\"{url}\" target=\"_blank\">Yes</a>"
ReportLink = url == null ? "No" : $"<a href=\"{url}\" target=\"_blank\">Yes</a>"
});
}
@@ -302,5 +285,21 @@ namespace DiscImageChef.Server
return null;
}
class MediaItem
{
public string Type { get; set; }
public string SubType { get; set; }
public long Count { get; set; }
}
class DeviceItem
{
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Revision { get; set; }
public string Bus { get; set; }
public string ReportLink { get; set; }
}
}
}

View File

@@ -43,7 +43,9 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-111466173-1');

View File

@@ -42,7 +42,9 @@
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111466173-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-111466173-1');

View File

@@ -85,7 +85,8 @@ namespace DiscImageChef.Server
else if(!string.IsNullOrWhiteSpace(model)) xmlFile = model + ".xml";
if(xmlFile == null ||
!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Reports", xmlFile)))
!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"Reports", xmlFile)))
{
content.InnerHtml = "<b>Could not find the specified report</b>";
return;
@@ -98,8 +99,9 @@ namespace DiscImageChef.Server
DeviceReport report = new DeviceReport();
XmlSerializer xs = new XmlSerializer(report.GetType());
StreamReader sr =
new StreamReader(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "Reports",
xmlFile));
new
StreamReader(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"Reports", xmlFile));
report = (DeviceReport)xs.Deserialize(sr);
sr.Close();
@@ -148,8 +150,7 @@ namespace DiscImageChef.Server
case TupleCodes.CISTPL_VERS_1: break;
case TupleCodes.CISTPL_DEVICEGEO:
case TupleCodes.CISTPL_DEVICEGEO_A:
DeviceGeometryTuple geom =
CIS.DecodeDeviceGeometryTuple(tuple.Data);
DeviceGeometryTuple geom = CIS.DecodeDeviceGeometryTuple(tuple.Data);
if(geom?.Geometries != null)
foreach(DeviceGeometry geometry in geom.Geometries)
{
@@ -260,8 +261,11 @@ namespace DiscImageChef.Server
Dictionary<string, string> modePages = new Dictionary<string, string>();
Dictionary<string, string> evpdPages = new Dictionary<string, string>();
lblScsiVendor.Text = VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification) !=
report.SCSI.Inquiry.VendorIdentification ? $"{report.SCSI.Inquiry.VendorIdentification} ({VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification)})" : report.SCSI.Inquiry.VendorIdentification;
lblScsiVendor.Text =
VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification) !=
report.SCSI.Inquiry.VendorIdentification
? $"{report.SCSI.Inquiry.VendorIdentification} ({VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification)})"
: report.SCSI.Inquiry.VendorIdentification;
lblScsiProduct.Text = report.SCSI.Inquiry.ProductIdentification;
lblScsiRevision.Text = report.SCSI.Inquiry.ProductRevisionLevel;
@@ -328,11 +332,17 @@ namespace DiscImageChef.Server
{
divScsiSsc.Visible = true;
lblScsiSscGranularity.Text = report.SCSI.SequentialDevice.BlockSizeGranularitySpecified ? report.SCSI.SequentialDevice.BlockSizeGranularity.ToString() : "Unspecified";
lblScsiSscGranularity.Text = report.SCSI.SequentialDevice.BlockSizeGranularitySpecified
? report.SCSI.SequentialDevice.BlockSizeGranularity.ToString()
: "Unspecified";
lblScsiSscMaxBlock.Text = report.SCSI.SequentialDevice.MaxBlockLengthSpecified ? report.SCSI.SequentialDevice.MaxBlockLength.ToString() : "Unspecified";
lblScsiSscMaxBlock.Text = report.SCSI.SequentialDevice.MaxBlockLengthSpecified
? report.SCSI.SequentialDevice.MaxBlockLength.ToString()
: "Unspecified";
lblScsiSscMinBlock.Text = report.SCSI.SequentialDevice.MinBlockLengthSpecified ? report.SCSI.SequentialDevice.MinBlockLength.ToString() : "Unspecified";
lblScsiSscMinBlock.Text = report.SCSI.SequentialDevice.MinBlockLengthSpecified
? report.SCSI.SequentialDevice.MinBlockLength.ToString()
: "Unspecified";
if(report.SCSI.SequentialDevice.SupportedDensities != null)
{
@@ -370,17 +380,20 @@ namespace DiscImageChef.Server
if(report.SCSI.ReadCapabilities.BlocksSpecified &&
report.SCSI.ReadCapabilities.BlockSizeSpecified)
{
scsiOneValue.Add($"Device has {report.SCSI.ReadCapabilities.Blocks} blocks of {report.SCSI.ReadCapabilities.BlockSize} bytes each");
scsiOneValue
.Add($"Device has {report.SCSI.ReadCapabilities.Blocks} blocks of {report.SCSI.ReadCapabilities.BlockSize} bytes each");
if(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1024 /
1024 > 1000000)
scsiOneValue.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if(
report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1024 /
1024 > 1000)
scsiOneValue.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
scsiOneValue
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000 / 1000} Tb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024 / 1024:F2} TiB");
else if(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize /
1024 / 1024 > 1000)
scsiOneValue
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000 / 1000} Gb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024:F2} GiB");
else
scsiOneValue.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000} Mb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024:F2} MiB");
scsiOneValue
.Add($"Device size: {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize} bytes, {report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1000 / 1000} Mb, {(double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024:F2} MiB");
}
if(report.SCSI.ReadCapabilities.MediumTypeSpecified)
@@ -518,10 +531,12 @@ namespace DiscImageChef.Server
vendorDescription = null;
productDescription = null;
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "usb.ids"))) return;
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"usb.ids"))) return;
StreamReader tocStream =
new StreamReader(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(), "usb.ids"));
new StreamReader(Path.Combine(HostingEnvironment.MapPath("~") ?? throw new InvalidOperationException(),
"usb.ids"));
bool inManufacturer = false;
while(tocStream.Peek() >= 0)