mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Migrate sd/mmc info from Eto.Forms to Avalonia.
This commit is contained in:
5
.idea/.idea.Aaru/.idea/contentModel.xml
generated
5
.idea/.idea.Aaru/.idea/contentModel.xml
generated
@@ -1290,8 +1290,8 @@
|
|||||||
<e p="PcmciaInfoTab.xaml.cs" t="Include" />
|
<e p="PcmciaInfoTab.xaml.cs" t="Include" />
|
||||||
<e p="ScsiInfoTab.xaml" t="Include" />
|
<e p="ScsiInfoTab.xaml" t="Include" />
|
||||||
<e p="ScsiInfoTab.xaml.cs" t="Include" />
|
<e p="ScsiInfoTab.xaml.cs" t="Include" />
|
||||||
<e p="tabSdMmcInfo.xeto" t="Include" />
|
<e p="SdMmcInfo.xaml" t="Include" />
|
||||||
<e p="tabSdMmcInfo.xeto.cs" t="Include" />
|
<e p="SdMmcInfo.xaml.cs" t="Include" />
|
||||||
<e p="tabXboxInfo.xeto" t="Include" />
|
<e p="tabXboxInfo.xeto" t="Include" />
|
||||||
<e p="tabXboxInfo.xeto.cs" t="Include" />
|
<e p="tabXboxInfo.xeto.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
@@ -1311,6 +1311,7 @@
|
|||||||
<e p="PcmciaInfoViewModel.cs" t="Include" />
|
<e p="PcmciaInfoViewModel.cs" t="Include" />
|
||||||
<e p="PluginsDialogViewModel.cs" t="Include" />
|
<e p="PluginsDialogViewModel.cs" t="Include" />
|
||||||
<e p="ScsiInfoViewModel.cs" t="Include" />
|
<e p="ScsiInfoViewModel.cs" t="Include" />
|
||||||
|
<e p="SdMmcInfoViewModel.cs" t="Include" />
|
||||||
<e p="SettingsDialogViewModel.cs" t="Include" />
|
<e p="SettingsDialogViewModel.cs" t="Include" />
|
||||||
<e p="SplashWindowViewModel.cs" t="Include" />
|
<e p="SplashWindowViewModel.cs" t="Include" />
|
||||||
<e p="StatisticsDialogViewModel.cs" t="Include" />
|
<e p="StatisticsDialogViewModel.cs" t="Include" />
|
||||||
|
|||||||
@@ -156,6 +156,12 @@
|
|||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<ContentControl Content="{Binding PcmciaInfo}" />
|
<ContentControl Content="{Binding PcmciaInfo}" />
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem IsVisible="{Binding !!SdMmcInfo}">
|
||||||
|
<TabItem.Header>
|
||||||
|
<TextBlock Text="SD / MMC" />
|
||||||
|
</TabItem.Header>
|
||||||
|
<ContentControl Content="{Binding SdMmcInfo}" />
|
||||||
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||||
<Button Command="{Binding EntropyCommand}">
|
<Button Command="{Binding EntropyCommand}">
|
||||||
|
|||||||
@@ -311,13 +311,14 @@ namespace Aaru.Gui.Panels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
var tabSdMmcInfo = new tabSdMmcInfo();
|
var tabSdMmcInfo = new tabSdMmcInfo();
|
||||||
|
|
||||||
tabSdMmcInfo.LoadData(devInfo.Type, devInfo.CID, devInfo.CSD, devInfo.OCR, devInfo.ExtendedCSD,
|
tabSdMmcInfo.LoadData(devInfo.Type, devInfo.CID, devInfo.CSD, devInfo.OCR, devInfo.ExtendedCSD,
|
||||||
devInfo.SCR);
|
devInfo.SCR);
|
||||||
|
|
||||||
tabInfos.Pages.Add(tabSdMmcInfo);
|
tabInfos.Pages.Add(tabSdMmcInfo);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnBtnSaveUsbDescriptors(object sender, EventArgs e)
|
protected void OnBtnSaveUsbDescriptors(object sender, EventArgs e)
|
||||||
|
|||||||
41
Aaru.Gui/Tabs/SdMmcInfo.xaml
Normal file
41
Aaru.Gui/Tabs/SdMmcInfo.xaml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
<UserControl xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:vm="clr-namespace:Aaru.Gui.ViewModels" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
|
x:Class="Aaru.Gui.Tabs.SdMmcInfoTab">
|
||||||
|
<Design.DataContext>
|
||||||
|
<vm:SdMmcInfoViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<TabControl>
|
||||||
|
<TabItem IsVisible="{Binding !!CidText}">
|
||||||
|
<TabItem.Header>
|
||||||
|
<TextBlock Text="CID" />
|
||||||
|
</TabItem.Header>
|
||||||
|
<TextBox IsReadOnly="True" Text="{Binding CidText}" />
|
||||||
|
</TabItem>
|
||||||
|
<TabItem IsVisible="{Binding !!CsdText}">
|
||||||
|
<TabItem.Header>
|
||||||
|
<TextBlock Text="CSD" />
|
||||||
|
</TabItem.Header>
|
||||||
|
<TextBox IsReadOnly="True" Text="{Binding CsdText}" />
|
||||||
|
</TabItem>
|
||||||
|
<TabItem IsVisible="{Binding !!OcrText}">
|
||||||
|
<TabItem.Header>
|
||||||
|
<TextBlock Text="OCR" />
|
||||||
|
</TabItem.Header>
|
||||||
|
<TextBox IsReadOnly="True" Text="{Binding OcrText}" />
|
||||||
|
</TabItem>
|
||||||
|
<TabItem IsVisible="{Binding !!ExtendedCsdText}">
|
||||||
|
<TabItem.Header>
|
||||||
|
<TextBlock Text="Extended CSD" />
|
||||||
|
</TabItem.Header>
|
||||||
|
<TextBox IsReadOnly="True" Text="{Binding ExtendedCsdText}" />
|
||||||
|
</TabItem>
|
||||||
|
<TabItem IsVisible="{Binding !!ScrText}">
|
||||||
|
<TabItem.Header>
|
||||||
|
<TextBlock Text="SCR" />
|
||||||
|
</TabItem.Header>
|
||||||
|
<TextBox IsReadOnly="True" Text="{Binding ScrText}" />
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</UserControl>
|
||||||
12
Aaru.Gui/Tabs/SdMmcInfo.xaml.cs
Normal file
12
Aaru.Gui/Tabs/SdMmcInfo.xaml.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Markup.Xaml;
|
||||||
|
|
||||||
|
namespace Aaru.Gui.Tabs
|
||||||
|
{
|
||||||
|
public class SdMmcInfoTab : UserControl
|
||||||
|
{
|
||||||
|
public SdMmcInfoTab() => InitializeComponent();
|
||||||
|
|
||||||
|
void InitializeComponent() => AvaloniaXamlLoader.Load(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><!--
|
|
||||||
// /***************************************************************************
|
|
||||||
// The Disc Image Chef
|
|
||||||
// ============================================================================
|
|
||||||
//
|
|
||||||
// Filename : tabSdMmcInfo.xeto
|
|
||||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
||||||
//
|
|
||||||
// Component : Device information.
|
|
||||||
//
|
|
||||||
// ==[ Description ] ==========================================================
|
|
||||||
//
|
|
||||||
// Defines the structure for the SecureDigital/MultiMediaCard device information.
|
|
||||||
//
|
|
||||||
// ==[ License ] ==============================================================
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General public License
|
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
// Copyright © 2011-2020 Natalia Portillo
|
|
||||||
// ****************************************************************************/
|
|
||||||
-->
|
|
||||||
<TabPage Text="SD/MMC" Visible="False" xmlns="http://schema.picoe.ca/eto.forms"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<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>
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
// /***************************************************************************
|
|
||||||
// Aaru Data Preservation Suite
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Filename : tabSdMmcInfo.xeto.cs
|
|
||||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
||||||
//
|
|
||||||
// Component : Device information.
|
|
||||||
//
|
|
||||||
// --[ Description ] ----------------------------------------------------------
|
|
||||||
//
|
|
||||||
// Implements the SecureDigital/MultiMediaCard device information.
|
|
||||||
//
|
|
||||||
// --[ License ] --------------------------------------------------------------
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU General public License
|
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
//
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// Copyright © 2011-2020 Natalia Portillo
|
|
||||||
// ****************************************************************************/
|
|
||||||
|
|
||||||
using Aaru.CommonTypes.Enums;
|
|
||||||
using Eto.Forms;
|
|
||||||
using Eto.Serialization.Xaml;
|
|
||||||
|
|
||||||
namespace Aaru.Gui.Tabs
|
|
||||||
{
|
|
||||||
public class tabSdMmcInfo : TabPage
|
|
||||||
{
|
|
||||||
public tabSdMmcInfo() => XamlReader.Load(this);
|
|
||||||
|
|
||||||
internal void LoadData(DeviceType deviceType, byte[] cid, byte[] csd, byte[] ocr, byte[] extendedCsd,
|
|
||||||
byte[] scr)
|
|
||||||
{
|
|
||||||
switch(deviceType)
|
|
||||||
{
|
|
||||||
case DeviceType.MMC:
|
|
||||||
{
|
|
||||||
Text = "MultiMediaCard";
|
|
||||||
|
|
||||||
if(cid != null)
|
|
||||||
{
|
|
||||||
tabCid.Visible = true;
|
|
||||||
txtCid.Text = Decoders.MMC.Decoders.PrettifyCID(cid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(csd != null)
|
|
||||||
{
|
|
||||||
tabCsd.Visible = true;
|
|
||||||
txtCid.Text = Decoders.MMC.Decoders.PrettifyCSD(csd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ocr != null)
|
|
||||||
{
|
|
||||||
tabOcr.Visible = true;
|
|
||||||
txtCid.Text = Decoders.MMC.Decoders.PrettifyOCR(ocr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(extendedCsd != null)
|
|
||||||
{
|
|
||||||
tabExtendedCsd.Visible = true;
|
|
||||||
txtCid.Text = Decoders.MMC.Decoders.PrettifyExtendedCSD(extendedCsd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
case DeviceType.SecureDigital:
|
|
||||||
{
|
|
||||||
Text = "SecureDigital";
|
|
||||||
|
|
||||||
if(cid != null)
|
|
||||||
{
|
|
||||||
tabCid.Visible = true;
|
|
||||||
|
|
||||||
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCID(cid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(csd != null)
|
|
||||||
{
|
|
||||||
tabCsd.Visible = true;
|
|
||||||
|
|
||||||
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCSD(csd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ocr != null)
|
|
||||||
{
|
|
||||||
tabOcr.Visible = true;
|
|
||||||
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyOCR(ocr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(scr != null)
|
|
||||||
{
|
|
||||||
tabScr.Visible = true;
|
|
||||||
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifySCR(scr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Visible = tabCid.Visible || tabCsd.Visible || tabOcr.Visible || tabExtendedCsd.Visible || tabScr.Visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region XAML controls
|
|
||||||
#pragma warning disable 169
|
|
||||||
#pragma warning disable 649
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -535,74 +535,74 @@ namespace Aaru.Gui.ViewModels
|
|||||||
DataContext = new PcmciaInfoViewModel(pcmciaCis, _view)
|
DataContext = new PcmciaInfoViewModel(pcmciaCis, _view)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* TODO: SD/MMC
|
DeviceType deviceType = DeviceType.Unknown;
|
||||||
DeviceType deviceType = DeviceType.Unknown;
|
byte[] cid = null;
|
||||||
byte[] cid = null;
|
byte[] csd = null;
|
||||||
byte[] csd = null;
|
byte[] ocr = null;
|
||||||
byte[] ocr = null;
|
byte[] extendedCsd = null;
|
||||||
byte[] extendedCsd = null;
|
byte[] scr = null;
|
||||||
byte[] scr = null;
|
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_CID))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_CID))
|
||||||
{
|
{
|
||||||
cid = imageFormat.ReadDiskTag(MediaTagType.SD_CID);
|
cid = imageFormat.ReadDiskTag(MediaTagType.SD_CID);
|
||||||
deviceType = DeviceType.SecureDigital;
|
deviceType = DeviceType.SecureDigital;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_CSD))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_CSD))
|
||||||
{
|
{
|
||||||
csd = imageFormat.ReadDiskTag(MediaTagType.SD_CSD);
|
csd = imageFormat.ReadDiskTag(MediaTagType.SD_CSD);
|
||||||
deviceType = DeviceType.SecureDigital;
|
deviceType = DeviceType.SecureDigital;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_OCR))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_OCR))
|
||||||
{
|
{
|
||||||
ocr = imageFormat.ReadDiskTag(MediaTagType.SD_OCR);
|
ocr = imageFormat.ReadDiskTag(MediaTagType.SD_OCR);
|
||||||
deviceType = DeviceType.SecureDigital;
|
deviceType = DeviceType.SecureDigital;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_SCR))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.SD_SCR))
|
||||||
{
|
{
|
||||||
scr = imageFormat.ReadDiskTag(MediaTagType.SD_SCR);
|
scr = imageFormat.ReadDiskTag(MediaTagType.SD_SCR);
|
||||||
deviceType = DeviceType.SecureDigital;
|
deviceType = DeviceType.SecureDigital;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_CID))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_CID))
|
||||||
{
|
{
|
||||||
cid = imageFormat.ReadDiskTag(MediaTagType.MMC_CID);
|
cid = imageFormat.ReadDiskTag(MediaTagType.MMC_CID);
|
||||||
deviceType = DeviceType.MMC;
|
deviceType = DeviceType.MMC;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_CSD))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_CSD))
|
||||||
{
|
{
|
||||||
csd = imageFormat.ReadDiskTag(MediaTagType.MMC_CSD);
|
csd = imageFormat.ReadDiskTag(MediaTagType.MMC_CSD);
|
||||||
deviceType = DeviceType.MMC;
|
deviceType = DeviceType.MMC;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_OCR))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_OCR))
|
||||||
{
|
{
|
||||||
ocr = imageFormat.ReadDiskTag(MediaTagType.MMC_OCR);
|
ocr = imageFormat.ReadDiskTag(MediaTagType.MMC_OCR);
|
||||||
deviceType = DeviceType.MMC;
|
deviceType = DeviceType.MMC;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_ExtendedCSD))
|
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_ExtendedCSD))
|
||||||
{
|
{
|
||||||
extendedCsd = imageFormat.ReadDiskTag(MediaTagType.MMC_ExtendedCSD);
|
extendedCsd = imageFormat.ReadDiskTag(MediaTagType.MMC_ExtendedCSD);
|
||||||
deviceType = DeviceType.MMC;
|
deviceType = DeviceType.MMC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SdMmcInfo = new SdMmcInfoTab
|
||||||
|
{
|
||||||
|
DataContext = new SdMmcInfoViewModel(deviceType, cid, csd, ocr, extendedCsd, scr)
|
||||||
|
};
|
||||||
|
|
||||||
var tabSdMmcInfo = new tabSdMmcInfo();
|
|
||||||
tabSdMmcInfo.LoadData(deviceType, cid, csd, ocr, extendedCsd, scr);
|
|
||||||
tabInfos.Pages.Add(tabSdMmcInfo);
|
|
||||||
*/
|
|
||||||
if(imageFormat is IOpticalMediaImage opticalMediaImage)
|
if(imageFormat is IOpticalMediaImage opticalMediaImage)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -652,6 +652,7 @@ namespace Aaru.Gui.ViewModels
|
|||||||
public DvdWritableInfoTab DvdWritableInfo { get; }
|
public DvdWritableInfoTab DvdWritableInfo { get; }
|
||||||
public BlurayInfoTab BlurayInfo { get; }
|
public BlurayInfoTab BlurayInfo { get; }
|
||||||
public PcmciaInfoTab PcmciaInfo { get; }
|
public PcmciaInfoTab PcmciaInfo { get; }
|
||||||
|
public SdMmcInfoTab SdMmcInfo { get; }
|
||||||
public Bitmap MediaLogo { get; }
|
public Bitmap MediaLogo { get; }
|
||||||
public string ImagePathText { get; }
|
public string ImagePathText { get; }
|
||||||
public string FilterText { get; }
|
public string FilterText { get; }
|
||||||
|
|||||||
57
Aaru.Gui/ViewModels/SdMmcInfoViewModel.cs
Normal file
57
Aaru.Gui/ViewModels/SdMmcInfoViewModel.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
using Aaru.CommonTypes.Enums;
|
||||||
|
|
||||||
|
namespace Aaru.Gui.ViewModels
|
||||||
|
{
|
||||||
|
public class SdMmcInfoViewModel
|
||||||
|
{
|
||||||
|
public SdMmcInfoViewModel(DeviceType deviceType, byte[] cid, byte[] csd, byte[] ocr, byte[] extendedCsd,
|
||||||
|
byte[] scr)
|
||||||
|
{
|
||||||
|
switch(deviceType)
|
||||||
|
{
|
||||||
|
case DeviceType.MMC:
|
||||||
|
{
|
||||||
|
//Text = "MultiMediaCard";
|
||||||
|
|
||||||
|
if(cid != null)
|
||||||
|
CidText = Decoders.MMC.Decoders.PrettifyCID(cid);
|
||||||
|
|
||||||
|
if(csd != null)
|
||||||
|
CsdText = Decoders.MMC.Decoders.PrettifyCSD(csd);
|
||||||
|
|
||||||
|
if(ocr != null)
|
||||||
|
OcrText = Decoders.MMC.Decoders.PrettifyOCR(ocr);
|
||||||
|
|
||||||
|
if(extendedCsd != null)
|
||||||
|
ExtendedCsdText = Decoders.MMC.Decoders.PrettifyExtendedCSD(extendedCsd);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case DeviceType.SecureDigital:
|
||||||
|
{
|
||||||
|
//Text = "SecureDigital";
|
||||||
|
|
||||||
|
if(cid != null)
|
||||||
|
CidText = Decoders.SecureDigital.Decoders.PrettifyCID(cid);
|
||||||
|
|
||||||
|
if(csd != null)
|
||||||
|
CsdText = Decoders.SecureDigital.Decoders.PrettifyCSD(csd);
|
||||||
|
|
||||||
|
if(ocr != null)
|
||||||
|
OcrText = Decoders.SecureDigital.Decoders.PrettifyOCR(ocr);
|
||||||
|
|
||||||
|
if(scr != null)
|
||||||
|
ScrText = Decoders.SecureDigital.Decoders.PrettifySCR(scr);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CidText { get; }
|
||||||
|
public string CsdText { get; }
|
||||||
|
public string OcrText { get; }
|
||||||
|
public string ExtendedCsdText { get; }
|
||||||
|
public string ScrText { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user