Implement MMC/SD device info in GUI.

This commit is contained in:
2018-09-06 20:03:00 +01:00
parent c85f23c3cd
commit 4656106e2a
2 changed files with 97 additions and 0 deletions

View File

@@ -404,6 +404,25 @@
<TextArea ID="txtMediumDensity" ReadOnly="True" Visible="False"/>
</StackLayout>
</TabPage>
<TabPage ID="tabSecureDigital" Text="SD/MMC" Visible="False">
<TabControl>
<TabPage ID="tabCid" Text="CID" Visible="False">
<TextArea ID="txtCid" ReadOnly="True"/>
</TabPage>
<TabPage ID="tabCsd" Text="CSD" Visible="False">
<TextArea ID="txtCsd" ReadOnly="True"/>
</TabPage>
<TabPage ID="tabOcr" Text="OCR" Visible="False">
<TextArea ID="txtOcr" ReadOnly="True"/>
</TabPage>
<TabPage ID="tabExtendedCsd" Text="Extended CSD" Visible="False">
<TextArea ID="txtExtendedCsd" ReadOnly="True"/>
</TabPage>
<TabPage ID="tabScr" Text="SCR" Visible="False">
<TextArea ID="txtScr" ReadOnly="True"/>
</TabPage>
</TabControl>
</TabPage>
</TabControl>
</StackLayoutItem>
</StackLayout>

View File

@@ -1035,6 +1035,73 @@ namespace DiscImageChef.Gui
txtMediumDensity.Text = DensitySupport.PrettifyMediumType(devInfo.MediumDensitySupport);
}
}
switch(devInfo.Type)
{
case DeviceType.MMC:
{
tabSecureDigital.Text = "MultiMediaCard";
if(devInfo.CID != null)
{
txtCid.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyCID(devInfo.CID);
}
if(devInfo.CSD != null)
{
txtCsd.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyCSD(devInfo.CSD);
}
if(devInfo.OCR != null)
{
txtOcr.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyOCR(devInfo.OCR);
}
if(devInfo.ExtendedCSD != null)
{
txtExtendedCsd.Visible = true;
txtCid.Text = Decoders.MMC.Decoders.PrettifyExtendedCSD(devInfo.ExtendedCSD);
}
}
break;
case DeviceType.SecureDigital:
{
tabSecureDigital.Text = "SecureDigital";
if(devInfo.CID != null)
{
txtCid.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCID(devInfo.CID);
}
if(devInfo.CSD != null)
{
txtCsd.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCSD(devInfo.CSD);
}
if(devInfo.OCR != null)
{
txtOcr.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyOCR(devInfo.OCR);
}
if(devInfo.SCR != null)
{
txtScr.Visible = true;
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifySCR(devInfo.SCR);
}
}
break;
}
tabSecureDigital.Visible = txtCid.Visible || txtCsd.Visible || txtOcr.Visible || txtExtendedCsd.Visible ||
txtScr.Visible;
}
protected void OnBtnSaveAtaBinary(object sender, EventArgs e)
@@ -1299,6 +1366,17 @@ namespace DiscImageChef.Gui
Label lblMediumTypes;
TextArea txtMediumTypes;
TextArea txtMediumDensity;
TabPage tabSecureDigital;
TabPage tabCid;
TextArea txtCid;
TabPage tabCsd;
TextArea txtCsd;
TabPage tabOcr;
TextArea txtOcr;
TabPage tabExtendedCsd;
TextArea txtExtendedCsd;
TabPage tabScr;
TextArea txtScr;
#pragma warning restore 169
#pragma warning restore 649
#endregion