Files
Aaru/Aaru.Gui/ViewModels/Panels/DeviceInfoViewModel.cs

1017 lines
36 KiB
C#
Raw Normal View History

2020-04-17 21:45:50 +01:00
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : DeviceInfoViewModel.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : GUI view models.
//
// --[ Description ] ----------------------------------------------------------
//
// View model and code for the device information panel.
//
// --[ 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/>.
//
// ----------------------------------------------------------------------------
2022-12-03 16:07:10 +00:00
// Copyright © 2011-2023 Natalia Portillo
2020-04-17 21:45:50 +01:00
// ****************************************************************************/
using System;
using System.Collections.Generic;
using System.IO;
using System.Reactive;
using System.Threading.Tasks;
using Aaru.Decoders.SCSI.SSC;
using Aaru.Devices;
2020-04-16 20:40:25 +01:00
using Aaru.Gui.ViewModels.Tabs;
using Aaru.Gui.Views.Tabs;
using Aaru.Localization;
using Avalonia.Controls;
using ReactiveUI;
using DeviceInfo = Aaru.Core.Devices.Info.DeviceInfo;
namespace Aaru.Gui.ViewModels.Panels;
2022-03-06 13:29:38 +00:00
public sealed class DeviceInfoViewModel : ViewModelBase
{
2022-03-06 13:29:38 +00:00
readonly DeviceInfo _devInfo;
readonly Window _view;
AtaInfo _ataInfo;
string _blockLimits;
string _blockSizeGranularity;
string _cid;
string _csd;
string _densities;
string _deviceType;
string _extendedCsd;
string _firewireGuid;
string _firewireManufacturer;
string _firewireModel;
string _firewireModelId;
string _firewireVendorId;
bool _firewireVisible;
bool _kreon;
bool _kreonChallengeResponse;
bool _kreonChallengeResponse360;
bool _kreonDecryptSs;
bool _kreonDecryptSs360;
bool _kreonErrorSkipping;
bool _kreonLock;
bool _kreonWxripperUnlock;
bool _kreonWxripperUnlock360;
bool _kreonXtremeUnlock;
bool _kreonXtremeUnlock360;
string _manufacturer;
string _maxBlockSize;
string _mediumDensity;
string _mediumTypes;
string _minBlockSize;
string _model;
string _ocr;
PcmciaInfo _pcmciaInfo;
bool _plextorBitSetting;
bool _plextorBitSettingDl;
string _plextorCdReadTime;
string _plextorCdWriteTime;
string _plextorDiscs;
string _plextorDvd;
bool _plextorDvdPlusWriteTest;
string _plextorDvdReadTime;
bool _plextorDvdTimesVisible;
string _plextorDvdWriteTime;
bool _plextorEepromVisible;
bool _plextorGigaRec;
bool _plextorHidesRecordables;
bool _plextorHidesSessions;
bool _plextorHiding;
bool _plextorPoweRec;
bool _plextorPoweRecEnabled;
string _plextorPoweRecLast;
bool _plextorPoweRecLastVisible;
string _plextorPoweRecMax;
bool _plextorPoweRecMaxVisible;
string _plextorPoweRecRecommended;
bool _plextorPoweRecRecommendedVisible;
string _plextorPoweRecSelected;
bool _plextorPoweRecSelectedVisible;
bool _plextorSecuRec;
bool _plextorSilentMode;
string _plextorSilentModeAccessTime;
string _plextorSilentModeCdReadSpeedLimit;
string _plextorSilentModeCdWriteSpeedLimit;
string _plextorSilentModeDvdReadSpeedLimit;
bool _plextorSilentModeDvdReadSpeedLimitVisible;
bool _plextorSilentModeEnabled;
bool _plextorSpeedEnabled;
bool _plextorSpeedRead;
bool _plextorVariRec;
bool _plextorVariRecDvd;
bool _plextorVisible;
bool _removable;
string _revision;
bool _saveUsbDescriptorsEnabled;
string _scr;
ScsiInfo _scsiInfo;
string _scsiType;
string _sdMm;
SdMmcInfo _sdMmcInfo;
string _secureDigital;
string _serial;
bool _ssc;
string _usbConnected;
string _usbManufacturer;
string _usbProduct;
string _usbProductId;
string _usbSerial;
string _usbVendorId;
bool _usbVisible;
public DeviceInfoViewModel(DeviceInfo devInfo, Window view)
{
SaveUsbDescriptorsCommand = ReactiveCommand.Create(ExecuteSaveUsbDescriptorsCommand);
_view = view;
_devInfo = devInfo;
DeviceType = devInfo.Type.ToString();
Manufacturer = devInfo.Manufacturer;
Model = devInfo.Model;
Revision = devInfo.FirmwareRevision;
Serial = devInfo.Serial;
ScsiType = devInfo.ScsiType.ToString();
Removable = devInfo.IsRemovable;
UsbVisible = devInfo.IsUsb;
if(devInfo.IsUsb)
{
2022-03-06 13:29:38 +00:00
UsbVisible = true;
SaveUsbDescriptorsEnabled = devInfo.UsbDescriptors != null;
UsbVendorId = $"{devInfo.UsbVendorId:X4}";
UsbProductId = $"{devInfo.UsbProductId:X4}";
UsbManufacturer = devInfo.UsbManufacturerString;
UsbProduct = devInfo.UsbProductString;
UsbSerial = devInfo.UsbSerialString;
}
2022-03-06 13:29:38 +00:00
if(devInfo.IsFireWire)
{
FirewireVisible = true;
FirewireVendorId = $"{devInfo.FireWireVendor:X4}";
FirewireModelId = $"{devInfo.FireWireModel:X4}";
FirewireManufacturer = devInfo.FireWireVendorName;
FirewireModel = devInfo.FireWireModelName;
FirewireGuid = $"{devInfo.FireWireGuid:X16}";
}
if(devInfo.IsPcmcia)
PcmciaInfo = new PcmciaInfo
{
2022-03-06 13:29:38 +00:00
DataContext = new PcmciaInfoViewModel(devInfo.Cis, _view)
};
2022-03-06 13:29:38 +00:00
if(devInfo.AtaIdentify != null ||
devInfo.AtapiIdentify != null)
AtaInfo = new AtaInfo
{
2022-03-06 13:29:38 +00:00
DataContext =
new AtaInfoViewModel(devInfo.AtaIdentify, devInfo.AtapiIdentify, devInfo.AtaMcptError, _view)
};
2022-03-06 13:29:38 +00:00
if(devInfo.ScsiInquiryData != null)
{
ScsiInfo = new ScsiInfo
{
2022-03-07 07:36:44 +00:00
DataContext = new ScsiInfoViewModel(devInfo.ScsiInquiryData, devInfo.ScsiInquiry, devInfo.ScsiEvpdPages,
devInfo.ScsiMode, devInfo.ScsiType, devInfo.ScsiModeSense6,
devInfo.ScsiModeSense10, devInfo.MmcConfiguration, _view)
2022-03-06 13:29:38 +00:00
};
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures != null)
{
2022-03-06 13:29:38 +00:00
PlextorVisible = true;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.Eeprom != null)
{
2022-03-06 13:29:38 +00:00
PlextorEepromVisible = true;
PlextorDiscs = $"{devInfo.PlextorFeatures.Discs}";
PlextorCdReadTime = TimeSpan.FromSeconds(devInfo.PlextorFeatures.CdReadTime).ToString();
2022-03-06 13:29:38 +00:00
PlextorCdWriteTime = TimeSpan.FromSeconds(devInfo.PlextorFeatures.CdWriteTime).ToString();
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.IsDvd)
{
PlextorDvdTimesVisible = true;
2022-03-06 13:29:38 +00:00
PlextorDvdReadTime = TimeSpan.FromSeconds(devInfo.PlextorFeatures.DvdReadTime).ToString();
2022-03-06 13:29:38 +00:00
PlextorDvdWriteTime = TimeSpan.FromSeconds(devInfo.PlextorFeatures.DvdWriteTime).ToString();
}
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
PlextorPoweRec = devInfo.PlextorFeatures.PoweRec;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.PoweRec)
{
PlextorPoweRecEnabled = devInfo.PlextorFeatures.PoweRecEnabled;
if(devInfo.PlextorFeatures.PoweRecEnabled)
{
2022-03-06 13:29:38 +00:00
PlextorPoweRecEnabled = true;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.PoweRecRecommendedSpeed > 0)
{
2022-03-06 13:29:38 +00:00
PlextorPoweRecRecommendedVisible = true;
PlextorPoweRecRecommended =
string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecRecommendedSpeed);
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.PoweRecSelected > 0)
{
2022-03-06 13:29:38 +00:00
PlextorPoweRecSelectedVisible = true;
PlextorPoweRecSelected =
string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecSelected);
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.PoweRecMax > 0)
{
PlextorPoweRecMaxVisible = true;
PlextorPoweRecMax = string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecMax);
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.PoweRecLast > 0)
{
PlextorPoweRecLastVisible = true;
PlextorPoweRecLast = string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecLast);
}
}
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
PlextorSilentMode = devInfo.PlextorFeatures.SilentMode;
if(devInfo.PlextorFeatures.SilentMode)
{
PlextorSilentModeEnabled = devInfo.PlextorFeatures.SilentModeEnabled;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.SilentModeEnabled)
{
2022-03-06 13:29:38 +00:00
PlextorSilentModeAccessTime = devInfo.PlextorFeatures.AccessTimeLimit == 2
? Localization.Core.Access_time_is_slow
: Localization.Core.Access_time_is_fast;
2022-03-06 13:29:38 +00:00
PlextorSilentModeCdReadSpeedLimit =
devInfo.PlextorFeatures.CdReadSpeedLimit > 0
? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x" : UI.unlimited_as_in_speed;
2022-03-06 13:29:38 +00:00
PlextorSilentModeCdWriteSpeedLimit =
devInfo.PlextorFeatures.CdWriteSpeedLimit > 0
? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x" : UI.unlimited_as_in_speed;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.IsDvd)
{
PlextorSilentModeDvdReadSpeedLimitVisible = true;
2022-03-06 13:29:38 +00:00
PlextorSilentModeDvdReadSpeedLimit =
devInfo.PlextorFeatures.DvdReadSpeedLimit > 0
? $"{devInfo.PlextorFeatures.DvdReadSpeedLimit}x" : UI.unlimited_as_in_speed;
2022-03-06 13:29:38 +00:00
}
}
}
2022-03-06 13:29:38 +00:00
PlextorGigaRec = devInfo.PlextorFeatures.GigaRec;
PlextorSecuRec = devInfo.PlextorFeatures.SecuRec;
PlextorSpeedRead = devInfo.PlextorFeatures.SpeedRead;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.SpeedRead)
PlextorSpeedEnabled = devInfo.PlextorFeatures.SpeedReadEnabled;
2022-03-06 13:29:38 +00:00
PlextorHiding = devInfo.PlextorFeatures.Hiding;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.Hiding)
{
PlextorHidesRecordables = devInfo.PlextorFeatures.HidesRecordables;
PlextorHidesSessions = devInfo.PlextorFeatures.HidesSessions;
}
2022-03-06 13:29:38 +00:00
PlextorVariRec = devInfo.PlextorFeatures.VariRec;
2022-03-06 13:29:38 +00:00
if(devInfo.PlextorFeatures.IsDvd)
{
PlextorVariRecDvd = devInfo.PlextorFeatures.VariRecDvd;
PlextorBitSetting = devInfo.PlextorFeatures.BitSetting;
PlextorBitSettingDl = devInfo.PlextorFeatures.BitSettingDl;
PlextorDvdPlusWriteTest = devInfo.PlextorFeatures.DvdPlusWriteTest;
}
2022-03-06 13:29:38 +00:00
}
2022-03-06 13:29:38 +00:00
if(devInfo.ScsiInquiry?.KreonPresent == true)
{
Kreon = true;
KreonChallengeResponse = devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse);
KreonDecryptSs = devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs);
KreonXtremeUnlock = devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock);
KreonWxripperUnlock = devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock);
KreonChallengeResponse360 = devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse360);
KreonDecryptSs360 = devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs360);
KreonXtremeUnlock360 = devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock360);
KreonWxripperUnlock360 = devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock360);
KreonLock = devInfo.KreonFeatures.HasFlag(KreonFeatures.Lock);
KreonErrorSkipping = devInfo.KreonFeatures.HasFlag(KreonFeatures.ErrorSkipping);
}
if(devInfo.BlockLimits != null)
{
2022-03-07 07:36:44 +00:00
BlockLimits.BlockLimitsData? blockLimits = Decoders.SCSI.SSC.BlockLimits.Decode(devInfo.BlockLimits);
2022-03-06 13:29:38 +00:00
if(blockLimits.HasValue)
{
2022-03-06 13:29:38 +00:00
Ssc = true;
if(blockLimits.Value.minBlockLen == blockLimits.Value.maxBlockLen)
MinBlockSize = string.Format(Localization.Core.Device_block_size_is_fixed_at_0_bytes,
blockLimits.Value.minBlockLen);
2022-03-06 13:29:38 +00:00
else
{
MaxBlockSize = blockLimits.Value.maxBlockLen > 0
? string.Format(Localization.Core.Device_maximum_block_size_is_0_bytes,
blockLimits.Value.maxBlockLen) : Localization.Core.
Device_does_not_specify_a_maximum_block_size;
2022-03-06 13:29:38 +00:00
MinBlockSize = string.Format(Localization.Core.Device_minimum_block_size_is_0_bytes,
blockLimits.Value.minBlockLen);
2022-03-06 13:29:38 +00:00
if(blockLimits.Value.granularity > 0)
BlockSizeGranularity =
string.Format(Localization.Core.Device_needs_a_block_size_granularity_of_pow_0_1_bytes,
blockLimits.Value.granularity,
Math.Pow(2, blockLimits.Value.granularity));
2022-03-06 13:29:38 +00:00
}
}
}
2022-03-06 13:29:38 +00:00
if(devInfo.DensitySupport != null)
if(devInfo.DensitySupportHeader.HasValue)
Densities = DensitySupport.PrettifyDensity(devInfo.DensitySupportHeader);
2022-03-06 13:29:38 +00:00
if(devInfo.MediumDensitySupport != null)
{
if(devInfo.MediaTypeSupportHeader.HasValue)
MediumTypes = DensitySupport.PrettifyMediumType(devInfo.MediaTypeSupportHeader);
2022-03-06 13:29:38 +00:00
MediumDensity = DensitySupport.PrettifyMediumType(devInfo.MediumDensitySupport);
}
}
2022-03-06 13:29:38 +00:00
SdMmcInfo = new SdMmcInfo
{
2022-03-06 13:29:38 +00:00
DataContext = new SdMmcInfoViewModel(devInfo.Type, devInfo.CID, devInfo.CSD, devInfo.OCR,
devInfo.ExtendedCSD, devInfo.SCR)
};
}
public ReactiveCommand<Unit, Task> SaveUsbDescriptorsCommand { get; }
2022-03-06 13:29:38 +00:00
public string DeviceType
{
get => _deviceType;
set => this.RaiseAndSetIfChanged(ref _deviceType, value);
}
2022-03-06 13:29:38 +00:00
public string Manufacturer
{
get => _manufacturer;
set => this.RaiseAndSetIfChanged(ref _manufacturer, value);
}
2022-03-06 13:29:38 +00:00
public string Model
{
get => _model;
set => this.RaiseAndSetIfChanged(ref _model, value);
}
2022-03-06 13:29:38 +00:00
public string Revision
{
get => _revision;
set => this.RaiseAndSetIfChanged(ref _revision, value);
}
2022-03-06 13:29:38 +00:00
public string Serial
{
get => _serial;
set => this.RaiseAndSetIfChanged(ref _serial, value);
}
2022-03-06 13:29:38 +00:00
public string ScsiType
{
get => _scsiType;
set => this.RaiseAndSetIfChanged(ref _scsiType, value);
}
2022-03-06 13:29:38 +00:00
public bool Removable
{
get => _removable;
set => this.RaiseAndSetIfChanged(ref _removable, value);
}
2022-03-06 13:29:38 +00:00
public string UsbConnected
{
get => _usbConnected;
set => this.RaiseAndSetIfChanged(ref _usbConnected, value);
}
2022-03-06 13:29:38 +00:00
public bool UsbVisible
{
get => _usbVisible;
set => this.RaiseAndSetIfChanged(ref _usbVisible, value);
}
2022-03-06 13:29:38 +00:00
public string UsbVendorId
{
get => _usbVendorId;
set => this.RaiseAndSetIfChanged(ref _usbVendorId, value);
}
2022-03-06 13:29:38 +00:00
public string UsbProductId
{
get => _usbProductId;
set => this.RaiseAndSetIfChanged(ref _usbProductId, value);
}
2022-03-06 13:29:38 +00:00
public string UsbManufacturer
{
get => _usbManufacturer;
set => this.RaiseAndSetIfChanged(ref _usbManufacturer, value);
}
2022-03-06 13:29:38 +00:00
public string UsbProduct
{
get => _usbProduct;
set => this.RaiseAndSetIfChanged(ref _usbProduct, value);
}
2022-03-06 13:29:38 +00:00
public string UsbSerial
{
get => _usbSerial;
set => this.RaiseAndSetIfChanged(ref _usbSerial, value);
}
2022-03-06 13:29:38 +00:00
public bool SaveUsbDescriptorsEnabled
{
get => _saveUsbDescriptorsEnabled;
set => this.RaiseAndSetIfChanged(ref _saveUsbDescriptorsEnabled, value);
}
2022-03-06 13:29:38 +00:00
public bool FirewireVisible
{
get => _firewireVisible;
set => this.RaiseAndSetIfChanged(ref _firewireVisible, value);
}
2022-03-06 13:29:38 +00:00
public string FirewireVendorId
{
get => _firewireVendorId;
set => this.RaiseAndSetIfChanged(ref _firewireVendorId, value);
}
2022-03-06 13:29:38 +00:00
public string FirewireModelId
{
get => _firewireModelId;
set => this.RaiseAndSetIfChanged(ref _firewireModelId, value);
}
2022-03-06 13:29:38 +00:00
public string FirewireManufacturer
{
get => _firewireManufacturer;
set => this.RaiseAndSetIfChanged(ref _firewireManufacturer, value);
}
2022-03-06 13:29:38 +00:00
public string FirewireModel
{
get => _firewireModel;
set => this.RaiseAndSetIfChanged(ref _firewireModel, value);
}
2022-03-06 13:29:38 +00:00
public string FirewireGuid
{
get => _firewireGuid;
set => this.RaiseAndSetIfChanged(ref _firewireGuid, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorVisible
{
get => _plextorVisible;
set => this.RaiseAndSetIfChanged(ref _plextorVisible, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorEepromVisible
{
get => _plextorEepromVisible;
set => this.RaiseAndSetIfChanged(ref _plextorEepromVisible, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorDiscs
{
get => _plextorDiscs;
set => this.RaiseAndSetIfChanged(ref _plextorDiscs, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorCdReadTime
{
get => _plextorCdReadTime;
set => this.RaiseAndSetIfChanged(ref _plextorCdReadTime, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorCdWriteTime
{
get => _plextorCdWriteTime;
set => this.RaiseAndSetIfChanged(ref _plextorCdWriteTime, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorDvdTimesVisible
{
get => _plextorDvdTimesVisible;
set => this.RaiseAndSetIfChanged(ref _plextorDvdTimesVisible, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorDvdReadTime
{
get => _plextorDvdReadTime;
set => this.RaiseAndSetIfChanged(ref _plextorDvdReadTime, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorDvdWriteTime
{
get => _plextorDvdWriteTime;
set => this.RaiseAndSetIfChanged(ref _plextorDvdWriteTime, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorPoweRec
{
get => _plextorPoweRec;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRec, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorPoweRecEnabled
{
get => _plextorPoweRecEnabled;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecEnabled, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorPoweRecRecommendedVisible
{
get => _plextorPoweRecRecommendedVisible;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecRecommendedVisible, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorPoweRecRecommended
{
get => _plextorPoweRecRecommended;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecRecommended, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorPoweRecSelectedVisible
{
get => _plextorPoweRecSelectedVisible;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecSelectedVisible, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorPoweRecSelected
{
get => _plextorPoweRecSelected;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecSelected, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorPoweRecMaxVisible
{
get => _plextorPoweRecMaxVisible;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecMaxVisible, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorPoweRecMax
{
get => _plextorPoweRecMax;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecMax, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorPoweRecLastVisible
{
get => _plextorPoweRecLastVisible;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecLastVisible, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorPoweRecLast
{
get => _plextorPoweRecLast;
set => this.RaiseAndSetIfChanged(ref _plextorPoweRecLast, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorSilentMode
{
get => _plextorSilentMode;
set => this.RaiseAndSetIfChanged(ref _plextorSilentMode, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorSilentModeEnabled
{
get => _plextorSilentModeEnabled;
set => this.RaiseAndSetIfChanged(ref _plextorSilentModeEnabled, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorSilentModeAccessTime
{
get => _plextorSilentModeAccessTime;
set => this.RaiseAndSetIfChanged(ref _plextorSilentModeAccessTime, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorSilentModeCdReadSpeedLimit
{
get => _plextorSilentModeCdReadSpeedLimit;
set => this.RaiseAndSetIfChanged(ref _plextorSilentModeCdReadSpeedLimit, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorSilentModeCdWriteSpeedLimit
{
get => _plextorSilentModeCdWriteSpeedLimit;
set => this.RaiseAndSetIfChanged(ref _plextorSilentModeCdWriteSpeedLimit, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorSilentModeDvdReadSpeedLimitVisible
{
get => _plextorSilentModeDvdReadSpeedLimitVisible;
set => this.RaiseAndSetIfChanged(ref _plextorSilentModeDvdReadSpeedLimitVisible, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorSilentModeDvdReadSpeedLimit
{
get => _plextorSilentModeDvdReadSpeedLimit;
set => this.RaiseAndSetIfChanged(ref _plextorSilentModeDvdReadSpeedLimit, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorGigaRec
{
get => _plextorGigaRec;
set => this.RaiseAndSetIfChanged(ref _plextorGigaRec, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorSecuRec
{
get => _plextorSecuRec;
set => this.RaiseAndSetIfChanged(ref _plextorSecuRec, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorSpeedRead
{
get => _plextorSpeedRead;
set => this.RaiseAndSetIfChanged(ref _plextorSpeedRead, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorSpeedEnabled
{
get => _plextorSpeedEnabled;
set => this.RaiseAndSetIfChanged(ref _plextorSpeedEnabled, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorHiding
{
get => _plextorHiding;
set => this.RaiseAndSetIfChanged(ref _plextorHiding, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorHidesRecordables
{
get => _plextorHidesRecordables;
set => this.RaiseAndSetIfChanged(ref _plextorHidesRecordables, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorHidesSessions
{
get => _plextorHidesSessions;
set => this.RaiseAndSetIfChanged(ref _plextorHidesSessions, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorVariRec
{
get => _plextorVariRec;
set => this.RaiseAndSetIfChanged(ref _plextorVariRec, value);
}
2022-03-06 13:29:38 +00:00
public string PlextorDvd
{
get => _plextorDvd;
set => this.RaiseAndSetIfChanged(ref _plextorDvd, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorVariRecDvd
{
get => _plextorVariRecDvd;
set => this.RaiseAndSetIfChanged(ref _plextorVariRecDvd, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorBitSetting
{
get => _plextorBitSetting;
set => this.RaiseAndSetIfChanged(ref _plextorBitSetting, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorBitSettingDl
{
get => _plextorBitSettingDl;
set => this.RaiseAndSetIfChanged(ref _plextorBitSettingDl, value);
}
2022-03-06 13:29:38 +00:00
public bool PlextorDvdPlusWriteTest
{
get => _plextorDvdPlusWriteTest;
set => this.RaiseAndSetIfChanged(ref _plextorDvdPlusWriteTest, value);
}
2022-03-06 13:29:38 +00:00
public bool Kreon
{
get => _kreon;
set => this.RaiseAndSetIfChanged(ref _kreon, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonChallengeResponse
{
get => _kreonChallengeResponse;
set => this.RaiseAndSetIfChanged(ref _kreonChallengeResponse, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonDecryptSs
{
get => _kreonDecryptSs;
set => this.RaiseAndSetIfChanged(ref _kreonDecryptSs, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonXtremeUnlock
{
get => _kreonXtremeUnlock;
set => this.RaiseAndSetIfChanged(ref _kreonXtremeUnlock, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonWxripperUnlock
{
get => _kreonWxripperUnlock;
set => this.RaiseAndSetIfChanged(ref _kreonWxripperUnlock, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonChallengeResponse360
{
get => _kreonChallengeResponse360;
set => this.RaiseAndSetIfChanged(ref _kreonChallengeResponse360, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonDecryptSs360
{
get => _kreonDecryptSs360;
set => this.RaiseAndSetIfChanged(ref _kreonDecryptSs360, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonXtremeUnlock360
{
get => _kreonXtremeUnlock360;
set => this.RaiseAndSetIfChanged(ref _kreonXtremeUnlock360, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonWxripperUnlock360
{
get => _kreonWxripperUnlock360;
set => this.RaiseAndSetIfChanged(ref _kreonWxripperUnlock360, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonLock
{
get => _kreonLock;
set => this.RaiseAndSetIfChanged(ref _kreonLock, value);
}
2022-03-06 13:29:38 +00:00
public bool KreonErrorSkipping
{
get => _kreonErrorSkipping;
set => this.RaiseAndSetIfChanged(ref _kreonErrorSkipping, value);
}
2022-03-06 13:29:38 +00:00
public bool Ssc
{
get => _ssc;
set => this.RaiseAndSetIfChanged(ref _ssc, value);
}
2022-03-06 13:29:38 +00:00
public string BlockLimits
{
get => _blockLimits;
set => this.RaiseAndSetIfChanged(ref _blockLimits, value);
}
2022-03-06 13:29:38 +00:00
public string MinBlockSize
{
get => _minBlockSize;
set => this.RaiseAndSetIfChanged(ref _minBlockSize, value);
}
2022-03-06 13:29:38 +00:00
public string MaxBlockSize
{
get => _maxBlockSize;
set => this.RaiseAndSetIfChanged(ref _maxBlockSize, value);
}
2022-03-06 13:29:38 +00:00
public string BlockSizeGranularity
{
get => _blockSizeGranularity;
set => this.RaiseAndSetIfChanged(ref _blockSizeGranularity, value);
}
2022-03-06 13:29:38 +00:00
public string Densities
{
get => _densities;
set => this.RaiseAndSetIfChanged(ref _densities, value);
}
2022-03-06 13:29:38 +00:00
public string MediumTypes
{
get => _mediumTypes;
set => this.RaiseAndSetIfChanged(ref _mediumTypes, value);
}
2022-03-06 13:29:38 +00:00
public string MediumDensity
{
get => _mediumDensity;
set => this.RaiseAndSetIfChanged(ref _mediumDensity, value);
}
2022-03-06 13:29:38 +00:00
public string SecureDigital
{
get => _secureDigital;
set => this.RaiseAndSetIfChanged(ref _secureDigital, value);
}
2022-03-06 13:29:38 +00:00
public string SdMm
{
get => _sdMm;
set => this.RaiseAndSetIfChanged(ref _sdMm, value);
}
2022-03-06 13:29:38 +00:00
public string Cid
{
get => _cid;
set => this.RaiseAndSetIfChanged(ref _cid, value);
}
2022-03-06 13:29:38 +00:00
public string Csd
{
get => _csd;
set => this.RaiseAndSetIfChanged(ref _csd, value);
}
2022-03-06 13:29:38 +00:00
public string Ocr
{
get => _ocr;
set => this.RaiseAndSetIfChanged(ref _ocr, value);
}
2022-03-06 13:29:38 +00:00
public string ExtendedCsd
{
get => _extendedCsd;
set => this.RaiseAndSetIfChanged(ref _extendedCsd, value);
}
2022-03-06 13:29:38 +00:00
public string Scr
{
get => _scr;
set => this.RaiseAndSetIfChanged(ref _scr, value);
}
2022-03-06 13:29:38 +00:00
public PcmciaInfo PcmciaInfo
{
get => _pcmciaInfo;
set => this.RaiseAndSetIfChanged(ref _pcmciaInfo, value);
}
2022-03-06 13:29:38 +00:00
public ScsiInfo ScsiInfo
{
get => _scsiInfo;
set => this.RaiseAndSetIfChanged(ref _scsiInfo, value);
}
public AtaInfo AtaInfo
{
get => _ataInfo;
set => this.RaiseAndSetIfChanged(ref _ataInfo, value);
}
public SdMmcInfo SdMmcInfo
{
get => _sdMmcInfo;
set => this.RaiseAndSetIfChanged(ref _sdMmcInfo, value);
}
public string DeviceInformationLabel => UI.Title_Device_information;
public string GeneralLabel => UI.Title_General;
public string DeviceTypeLabel => UI.Title_Device_type;
public string ManufacturerLabel => UI.Title_Manufacturer;
public string ModelLabel => UI.Title_Model;
public string RevisionLabel => UI.Title_Revision;
public string SerialNumberLabel => UI.Title_Serial_number;
public string ScsiTypeLabel => UI.Title_Peripheral_device_type;
public string RemovableMediaLabel => UI.Title_Removable_media;
public string UsbConnectedLabel => UI.Title_Connected_by_USB;
public string USBLabel => UI.Title_USB;
public string VendorIDLabel => UI.Title_Vendor_ID;
public string ProductIDLabel => UI.Title_Product_ID;
public string ProductLabel => UI.Title_Product;
public string SaveUsbDescriptorsLabel => UI.Save_descriptors_to_file;
public string FireWireLabel => UI.Title_FireWire;
public string ModelIDLabel => UI.Title_Model_ID;
public string GUIDLabel => UI.Title_GUID;
public string PlextorLabel => UI.Title_Plextor;
public string PlextorDiscsLabel => UI.Total_loaded_discs;
public string PlextorCdReadTimeLabel => UI.Time_spent_reading_CDs;
public string PlextorCdWriteTimeLabel => UI.Time_spent_writing_CDs;
public string PlextorDvdReadTimeLabel => UI.Time_spent_reading_DVDs;
public string PlextorDvdWriteTimeLabel => UI.Time_spent_writing_DVDs;
public string PlextorPoweRecLabel => UI.Supports_PoweRec;
public string PlextorPoweRecEnabledLabel => UI.PoweRec_is_enabled;
public string PlextorPoweRecRecommendedLabel => UI.Recommended_speed;
public string PlextorPoweRecSelectedLabel => UI.Selected_PoweRec_speed_for_currently_inserted_media;
public string PlextorPoweRecMaxLabel => UI.Maximum_PoweRec_speed_for_currently_inserted_media;
public string PlextorPoweRecLastLabel => UI.Last_PoweRec_used_speed;
public string PlextorSilentModeLabel => UI.Supports_SilentMode;
public string PlextorSilentModeEnabledLabel => UI.SilentMode_is_enabled;
public string PlextorSilentModeCdReadSpeedLimitLabel => UI.CD_read_speed_limited_to;
public string PlextorSilentModeCdWriteSpeedLimitLabel => UI.CD_write_speed_limited_to;
public string PlextorSilentModeDvdReadSpeedLimitLabel => UI.DVD_read_speed_limited_to;
public string PlextorGigaRecLabel => UI.Supports_GigaRec;
public string PlextorSecuRecLabel => UI.Supports_SecuRec;
public string PlextorSpeedReadLabel => UI.Supports_SpeedRead;
public string PlextorSpeedEnabledLabel => UI.SpeedRead_is_enabled;
public string PlextorHidingLabel => UI.Supports_hiding_CD_Rs_and_sessions;
public string PlextorHidesRecordablesLabel => UI.Is_hiding_CD_Rs;
public string PlextorHidesSessionsLabel => UI.Is_forcing_only_first_session;
public string PlextorVariRecLabel => UI.Supports_VariRec;
public string PlextorVariRecDvdLabel => UI.Supports_VariRec_on_DVDs;
public string PlextorBitSettingLabel => UI.Supports_bitsetting_DVD_R_book_type;
public string PlextorBitSettingDlLabel => UI.Supports_bitsetting_DVD_R_DL_book_type;
public string PlextorDvdPlusWriteTestLabel => UI.Supports_test_writing_DVD_Plus;
public string KreonLabel => UI.Title_Kreon;
public string KreonChallengeResponseLabel => Localization.Core.Can_do_challenge_response_with_Xbox_discs;
public string KreonDecryptSsLabel => Localization.Core.Can_read_and_decrypt_SS_from_Xbox_discs;
public string KreonXtremeUnlockLabel => Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_discs;
public string KreonWxripperUnlockLabel => Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_discs;
public string KreonChallengeResponse360Label => Localization.Core.Can_do_challenge_response_with_Xbox_360_discs;
public string KreonDecryptSs360Label => Localization.Core.Can_read_and_decrypt_SS_from_Xbox_360_discs;
public string KreonXtremeUnlock360Label => Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_360_discs;
public string KreonWxripperUnlock360Label => Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_360_discs;
public string KreonSetLockedLabel => Localization.Core.Can_set_Kreon_locked_state;
public string KreonErrorSkippingLabel => Localization.Core.Kreon_Can_skip_read_errors;
public string DensitiesSupportedByDeviceLabel => UI.Densities_supported_by_device;
public string MediumTypesSupportedByDeviceLabel => UI.Medium_types_supported_by_device;
public string CIDLabel => UI.Title_CID;
public string CSDLabel => UI.Title_CSD;
public string OCRLabel => UI.Title_OCR;
public string ExtendedCSDLabel => UI.Title_Extended_CSD;
public string SCRLabel => UI.Title_SCR;
public string PCMCIALabel => UI.Title_PCMCIA;
public string ATA_ATAPILabel => UI.Title_ATA_ATAPI;
public string SCSILabel => UI.Title_SCSI;
public string SD_MMCLabel => UI.Title_SD_MMC;
async Task ExecuteSaveUsbDescriptorsCommand()
2022-03-06 13:29:38 +00:00
{
var dlgSaveBinary = new SaveFileDialog();
2022-11-15 01:35:06 +00:00
dlgSaveBinary.Filters?.Add(new FileDialogFilter
2022-03-06 13:29:38 +00:00
{
Extensions = new List<string>(new[]
{
2022-03-06 13:29:38 +00:00
"*.bin"
}),
Name = UI.Dialog_Binary_files
2022-03-06 13:29:38 +00:00
});
2022-03-06 13:29:38 +00:00
string result = await dlgSaveBinary.ShowAsync(_view);
2022-03-06 13:29:38 +00:00
if(result is null)
return;
2022-03-06 13:29:38 +00:00
var saveFs = new FileStream(result, FileMode.Create);
saveFs.Write(_devInfo.UsbDescriptors, 0, _devInfo.UsbDescriptors.Length);
2022-03-06 13:29:38 +00:00
saveFs.Close();
}
}