mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Implement SSC device info in GUI.
This commit is contained in:
@@ -386,6 +386,24 @@
|
|||||||
<CheckBox ID="chkKreonErrorSkipping" Text="Can skip read errors" Enabled="False"/>
|
<CheckBox ID="chkKreonErrorSkipping" Text="Can skip read errors" Enabled="False"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</TabPage>
|
</TabPage>
|
||||||
|
<TabPage ID="tabSsc" Text="SSC" Visible="False">
|
||||||
|
<StackLayout Orientation="Vertical">
|
||||||
|
<StackLayout Orientation="Vertical" ID="stkBlockLimits" Visible="False">
|
||||||
|
<Label ID="lblMinBlockSize" Visible="False"/>
|
||||||
|
<Label ID="lblMaxBlockSize" Visible="False"/>
|
||||||
|
<Label ID="lblBlockSizeGranularity" Visible="False"/>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout Orientation="Vertical" ID="stkDensities" Visible="False">
|
||||||
|
<Label ID="lblDensities" Text="Densities supported by device:"/>
|
||||||
|
<TextArea ID="txtDensities" ReadOnly="True"/>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout Orientation="Vertical" ID="stkMediaTypes" Visible="False">
|
||||||
|
<Label ID="lblMediumTypes" Text="Medium types supported by device:"/>
|
||||||
|
<TextArea ID="txtMediumTypes" ReadOnly="True"/>
|
||||||
|
</StackLayout>
|
||||||
|
<TextArea ID="txtMediumDensity" ReadOnly="True" Visible="False"/>
|
||||||
|
</StackLayout>
|
||||||
|
</TabPage>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
</StackLayoutItem>
|
</StackLayoutItem>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ using DiscImageChef.Console;
|
|||||||
using DiscImageChef.Decoders.ATA;
|
using DiscImageChef.Decoders.ATA;
|
||||||
using DiscImageChef.Decoders.SCSI;
|
using DiscImageChef.Decoders.SCSI;
|
||||||
using DiscImageChef.Decoders.SCSI.MMC;
|
using DiscImageChef.Decoders.SCSI.MMC;
|
||||||
|
using DiscImageChef.Decoders.SCSI.SSC;
|
||||||
using DiscImageChef.Devices;
|
using DiscImageChef.Devices;
|
||||||
using Eto.Forms;
|
using Eto.Forms;
|
||||||
using Eto.Serialization.Xaml;
|
using Eto.Serialization.Xaml;
|
||||||
@@ -980,6 +981,59 @@ namespace DiscImageChef.Gui
|
|||||||
chkKreonLock.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.Lock);
|
chkKreonLock.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.Lock);
|
||||||
chkKreonErrorSkipping.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.ErrorSkipping);
|
chkKreonErrorSkipping.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.ErrorSkipping);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(devInfo.BlockLimits != null)
|
||||||
|
{
|
||||||
|
BlockLimits.BlockLimitsData? blockLimits = BlockLimits.Decode(devInfo.BlockLimits);
|
||||||
|
|
||||||
|
if(blockLimits.HasValue)
|
||||||
|
{
|
||||||
|
tabSsc.Visible = true;
|
||||||
|
if(blockLimits.Value.minBlockLen == blockLimits.Value.maxBlockLen)
|
||||||
|
{
|
||||||
|
lblMinBlockSize.Visible = true;
|
||||||
|
lblMinBlockSize.Text =
|
||||||
|
$"Device's block size is fixed at {blockLimits.Value.minBlockLen} bytes";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblMinBlockSize.Visible = true;
|
||||||
|
lblMaxBlockSize.Visible = true;
|
||||||
|
|
||||||
|
lblMaxBlockSize.Text = blockLimits.Value.maxBlockLen > 0
|
||||||
|
? $"Device's maximum block size is {blockLimits.Value.maxBlockLen} bytes"
|
||||||
|
: "Device does not specify a maximum block size";
|
||||||
|
lblMinBlockSize.Text =
|
||||||
|
$"Device's minimum block size is {blockLimits.Value.minBlockLen} bytes";
|
||||||
|
|
||||||
|
if(blockLimits.Value.granularity > 0)
|
||||||
|
{
|
||||||
|
lblBlockSizeGranularity.Visible = true;
|
||||||
|
lblBlockSizeGranularity.Text =
|
||||||
|
$"Device's needs a block size granularity of 2^{blockLimits.Value.granularity} ({Math.Pow(2, blockLimits.Value.granularity)}) bytes";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(devInfo.DensitySupport != null)
|
||||||
|
if(devInfo.DensitySupportHeader.HasValue)
|
||||||
|
{
|
||||||
|
stkDensities.Visible = true;
|
||||||
|
txtDensities.Text = DensitySupport.PrettifyDensity(devInfo.DensitySupportHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(devInfo.MediumDensitySupport != null)
|
||||||
|
{
|
||||||
|
if(devInfo.MediaTypeSupportHeader.HasValue)
|
||||||
|
{
|
||||||
|
stkMediaTypes.Visible = true;
|
||||||
|
txtMediumTypes.Text = DensitySupport.PrettifyMediumType(devInfo.MediaTypeSupportHeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
txtMediumDensity.Visible = true;
|
||||||
|
txtMediumDensity.Text = DensitySupport.PrettifyMediumType(devInfo.MediumDensitySupport);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1233,6 +1287,18 @@ namespace DiscImageChef.Gui
|
|||||||
CheckBox chkPlextorBitSetting;
|
CheckBox chkPlextorBitSetting;
|
||||||
CheckBox chkPlextorBitSettingDl;
|
CheckBox chkPlextorBitSettingDl;
|
||||||
CheckBox chkPlextorDvdPlusWriteTest;
|
CheckBox chkPlextorDvdPlusWriteTest;
|
||||||
|
TabPage tabSsc;
|
||||||
|
StackLayout Vertical;
|
||||||
|
Label lblMinBlockSize;
|
||||||
|
Label lblMaxBlockSize;
|
||||||
|
Label lblBlockSizeGranularity;
|
||||||
|
StackLayout stkDensities;
|
||||||
|
Label lblDensities;
|
||||||
|
TextArea txtDensities;
|
||||||
|
StackLayout stkMediaTypes;
|
||||||
|
Label lblMediumTypes;
|
||||||
|
TextArea txtMediumTypes;
|
||||||
|
TextArea txtMediumDensity;
|
||||||
#pragma warning restore 169
|
#pragma warning restore 169
|
||||||
#pragma warning restore 649
|
#pragma warning restore 649
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user