mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[GUI] Add IMGBurn log viewer functionality
This commit is contained in:
@@ -85,4 +85,9 @@ public static class FilePickerFileTypes
|
|||||||
Patterns = ["*.bin"],
|
Patterns = ["*.bin"],
|
||||||
MimeTypes = ["application/octet-stream"]
|
MimeTypes = ["application/octet-stream"]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static FilePickerFileType IbgLogFiles { get; } = new(UI.IMGBurn_Log_Files)
|
||||||
|
{
|
||||||
|
Patterns = ["*.ibg"]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
323
Aaru.Gui/ViewModels/Windows/IbgLogViewModel.cs
Normal file
323
Aaru.Gui/ViewModels/Windows/IbgLogViewModel.cs
Normal file
@@ -0,0 +1,323 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// Aaru Data Preservation Suite
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : IbgLogViewModel.cs
|
||||||
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||||
|
//
|
||||||
|
// Component : GUI view models.
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// View model for IMGBurn log viewer.
|
||||||
|
//
|
||||||
|
// --[ 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-2025 Natalia Portillo
|
||||||
|
// ****************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Aaru.Gui.Views.Windows;
|
||||||
|
using Aaru.Localization;
|
||||||
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
using Humanizer;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using MsBox.Avalonia;
|
||||||
|
using MsBox.Avalonia.Enums;
|
||||||
|
|
||||||
|
namespace Aaru.Gui.ViewModels.Windows;
|
||||||
|
|
||||||
|
public partial class IbgLogViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
readonly IbgLogView _window;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _bus;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _capacity;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _date;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _device;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _filePath;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _firmware;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _imagefile;
|
||||||
|
[ObservableProperty]
|
||||||
|
ulong _maxSector;
|
||||||
|
[ObservableProperty]
|
||||||
|
double _maxSpeed;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _mediaSpeeds;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _mediaType;
|
||||||
|
[ObservableProperty]
|
||||||
|
ulong _sectors;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _speedAverage;
|
||||||
|
[ObservableProperty]
|
||||||
|
ObservableCollection<(ulong sector, double speedKbps)> _speedData = [];
|
||||||
|
[ObservableProperty]
|
||||||
|
string _speedEnd;
|
||||||
|
[ObservableProperty]
|
||||||
|
int _speedMultiplier = 1353;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _speedStart;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _timeTaken;
|
||||||
|
[ObservableProperty]
|
||||||
|
string _volumeIdentifier;
|
||||||
|
|
||||||
|
public IbgLogViewModel(IbgLogView window, [NotNull] string filePath)
|
||||||
|
{
|
||||||
|
_window = window;
|
||||||
|
FilePath = filePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadData()
|
||||||
|
{
|
||||||
|
Stream stream = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||||
|
stream.Seek(0, SeekOrigin.Begin);
|
||||||
|
var buffer = new byte[4];
|
||||||
|
stream.ReadExactly(buffer, 0, 4);
|
||||||
|
string id = Encoding.ASCII.GetString(buffer);
|
||||||
|
|
||||||
|
if(id != "IBGD")
|
||||||
|
{
|
||||||
|
stream.Close();
|
||||||
|
|
||||||
|
_ = MessageBoxManager.GetMessageBoxStandard(UI.Title_Error,
|
||||||
|
UI.The_specified_file_is_not_a_correct_IMGBurn_log_file,
|
||||||
|
ButtonEnum.Ok,
|
||||||
|
Icon.Error)
|
||||||
|
.ShowWindowDialogAsync(_window);
|
||||||
|
|
||||||
|
_window.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
stream.Position = 0;
|
||||||
|
|
||||||
|
var sr = new StreamReader(stream);
|
||||||
|
|
||||||
|
var inConfiguration = false;
|
||||||
|
var inGraphValues = false;
|
||||||
|
int multiplier;
|
||||||
|
var ibgCulture = new CultureInfo("en-US");
|
||||||
|
string device = null;
|
||||||
|
string firmware = null;
|
||||||
|
string bus = null;
|
||||||
|
DateTime date = DateTime.MinValue;
|
||||||
|
string mediaSpeeds = null;
|
||||||
|
string capacity = null;
|
||||||
|
ulong sectors = 0;
|
||||||
|
string imagefile = null;
|
||||||
|
string volumeIdentifier = null;
|
||||||
|
string mediaType = null;
|
||||||
|
double speedStart = 0;
|
||||||
|
double speedEnd = 0;
|
||||||
|
double speedAverage = 0;
|
||||||
|
uint timeTaken = 0;
|
||||||
|
Dictionary<ulong, double> speeds = [];
|
||||||
|
|
||||||
|
while(!sr.EndOfStream)
|
||||||
|
{
|
||||||
|
string line = sr.ReadLine();
|
||||||
|
|
||||||
|
if(line == "[START_CONFIGURATION]")
|
||||||
|
{
|
||||||
|
inConfiguration = true;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(inConfiguration)
|
||||||
|
{
|
||||||
|
if(line.StartsWith("DATE=", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
string dateString = line["DATE=".Length..];
|
||||||
|
|
||||||
|
DateTime.TryParseExact(dateString,
|
||||||
|
"M/d/yyyy h:mm:ss tt",
|
||||||
|
ibgCulture,
|
||||||
|
DateTimeStyles.None,
|
||||||
|
out date);
|
||||||
|
}
|
||||||
|
else if(line.StartsWith("DEVICE_MAKEMODEL=", StringComparison.Ordinal))
|
||||||
|
device = line["DEVICE_MAKEMODEL=".Length..];
|
||||||
|
else if(line.StartsWith("DEVICE_FIRMWAREVERSION=", StringComparison.Ordinal))
|
||||||
|
firmware = line["DEVICE_FIRMWAREVERSION=".Length..];
|
||||||
|
else if(line.StartsWith("DEVICE_BUSTYPE=", StringComparison.Ordinal))
|
||||||
|
bus = line["DEVICE_BUSTYPE=".Length..];
|
||||||
|
else if(line.StartsWith("MEDIA_TYPE=", StringComparison.Ordinal))
|
||||||
|
mediaType = line["MEDIA_TYPE=".Length..];
|
||||||
|
else if(line.StartsWith("MEDIA_SPEEDS=", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
mediaSpeeds = line["MEDIA_SPEEDS=".Length..];
|
||||||
|
if(mediaSpeeds == "N/A") mediaSpeeds = null;
|
||||||
|
}
|
||||||
|
else if(line.StartsWith("MEDIA_CAPACITY=", StringComparison.Ordinal))
|
||||||
|
capacity = line["MEDIA_CAPACITY=".Length..];
|
||||||
|
else if(line.StartsWith("DATA_IMAGEFILE", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
imagefile = line["DATA_IMAGEFILE=".Length..];
|
||||||
|
if(imagefile == "/dev/null") imagefile = null;
|
||||||
|
}
|
||||||
|
else if(line.StartsWith("DATA_SECTORS=", StringComparison.Ordinal))
|
||||||
|
ulong.TryParse(line["DATA_SECTORS=".Length..], ibgCulture, out sectors);
|
||||||
|
else if(line.StartsWith("DATA_VOLUMEIDENTIFIER=", StringComparison.Ordinal))
|
||||||
|
volumeIdentifier = line["DATA_VOLUMEIDENTIFIER=".Length..];
|
||||||
|
else if(line.StartsWith("VERIFY_SPEED_START=", StringComparison.Ordinal))
|
||||||
|
double.TryParse(line["VERIFY_SPEED_START=".Length..], ibgCulture, out speedStart);
|
||||||
|
else if(line.StartsWith("VERIFY_SPEED_END=", StringComparison.Ordinal))
|
||||||
|
double.TryParse(line["VERIFY_SPEED_END=".Length..], ibgCulture, out speedEnd);
|
||||||
|
else if(line.StartsWith("VERIFY_SPEED_AVERAGE=", StringComparison.Ordinal))
|
||||||
|
double.TryParse(line["VERIFY_SPEED_AVERAGE=".Length..], ibgCulture, out speedAverage);
|
||||||
|
else if(line.StartsWith("VERIFY_TIME_TAKEN=", StringComparison.Ordinal))
|
||||||
|
uint.TryParse(line["VERIFY_TIME_TAKEN=".Length..], ibgCulture, out timeTaken);
|
||||||
|
else if(line == "[END_CONFIGURATION]") inConfiguration = false;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(line)
|
||||||
|
{
|
||||||
|
case "[START_VERIFY_GRAPH_VALUES]":
|
||||||
|
inGraphValues = true;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
case "[END_VERIFY_GRAPH_VALUES]":
|
||||||
|
inGraphValues = false;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!inGraphValues) continue;
|
||||||
|
|
||||||
|
string[] graphValues = line.Split(',');
|
||||||
|
|
||||||
|
if(graphValues.Length == 4 &&
|
||||||
|
ulong.TryParse(graphValues[1], ibgCulture, out ulong sector) &&
|
||||||
|
double.TryParse(graphValues[0], ibgCulture, out double speed))
|
||||||
|
speeds[sector] = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
double maxSpeedValue = 0;
|
||||||
|
|
||||||
|
switch(mediaType)
|
||||||
|
{
|
||||||
|
case "HDD":
|
||||||
|
multiplier = 1353;
|
||||||
|
maxSpeedValue = 1500000; // 1500 MB/s cap for graph scaling
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "PD-650":
|
||||||
|
case "CD-MO":
|
||||||
|
case "CD-ROM":
|
||||||
|
case "CD-R":
|
||||||
|
case "CD-RW":
|
||||||
|
case "DDCD-ROM":
|
||||||
|
case "DDCD-R":
|
||||||
|
case "DDCD-RW":
|
||||||
|
multiplier = 150;
|
||||||
|
maxSpeedValue = 11250; // 52x CD-ROM cap for graph scaling
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "DVD-ROM":
|
||||||
|
case "DVD-R":
|
||||||
|
case "DVD-RAM":
|
||||||
|
case "DVD-RW":
|
||||||
|
case "DVD-R DL":
|
||||||
|
case "DVD-RW DL":
|
||||||
|
case "DVD-Download":
|
||||||
|
case "DVD+RW":
|
||||||
|
case "DVD+R":
|
||||||
|
case "DVD+RW DL":
|
||||||
|
case "DVD+R DL":
|
||||||
|
multiplier = 1353;
|
||||||
|
maxSpeedValue = 32472; // 24x DVD-ROM cap for graph scaling
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "BD-ROM":
|
||||||
|
case "BD-R":
|
||||||
|
case "BD-RE":
|
||||||
|
multiplier = 4500;
|
||||||
|
maxSpeedValue = 108000; // 24x BD-ROM cap for graph scaling
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "HD DVD-ROM":
|
||||||
|
case "HD DVD-R":
|
||||||
|
case "HD DVD-RAM":
|
||||||
|
case "HD DVD-RW":
|
||||||
|
case "HD DVD-R DL":
|
||||||
|
case "HD DVD-RW DL":
|
||||||
|
multiplier = 4500;
|
||||||
|
maxSpeedValue = 36550; // 8x HD-DVD cap for graph scaling
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
multiplier = 1353;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Dictionary<ulong, double> fixedSpeeds = [];
|
||||||
|
|
||||||
|
foreach(KeyValuePair<ulong, double> kvp in speeds) fixedSpeeds[kvp.Key] = kvp.Value * multiplier;
|
||||||
|
|
||||||
|
speeds = fixedSpeeds;
|
||||||
|
speedStart *= multiplier;
|
||||||
|
speedEnd *= multiplier;
|
||||||
|
speedAverage *= multiplier;
|
||||||
|
|
||||||
|
Device = device != null ? $"[pink]{device}[/]" : null;
|
||||||
|
Firmware = firmware != null ? $"[rosybrown]{firmware}[/]" : null;
|
||||||
|
Bus = bus != null ? $"[purple]{bus}[/]" : null;
|
||||||
|
Date = date != DateTime.MinValue ? $"[yellow]{date}[/]" : null;
|
||||||
|
MediaSpeeds = mediaSpeeds != null ? $"[red]{mediaSpeeds}[/]" : null;
|
||||||
|
Capacity = capacity != null ? string.Format(UI._0_sectors_markup, capacity) : null;
|
||||||
|
Imagefile = imagefile != null ? $"[green]{imagefile}[/]" : null;
|
||||||
|
VolumeIdentifier = !string.IsNullOrEmpty(volumeIdentifier) ? $"[cyan]{volumeIdentifier}[/]" : null;
|
||||||
|
MediaType = mediaType != null ? $"[orange]{mediaType}[/]" : null;
|
||||||
|
SpeedStart = speedStart != 0 ? string.Format(UI._0_N2_KB_s, speedStart) : null;
|
||||||
|
SpeedEnd = speedEnd != 0 ? string.Format(UI._0_N2_KB_s, speedEnd) : null;
|
||||||
|
SpeedAverage = speedAverage != 0 ? string.Format(UI._0_N2_KB_s, speedAverage) : null;
|
||||||
|
TimeTaken = timeTaken != 0 ? $"[aqua]{TimeSpan.FromSeconds(timeTaken).Humanize()}[/]" : null;
|
||||||
|
|
||||||
|
// Populate graph data
|
||||||
|
SpeedMultiplier = multiplier;
|
||||||
|
MaxSector = sectors;
|
||||||
|
|
||||||
|
// Find max speed for Y-axis scaling
|
||||||
|
if(maxSpeedValue == 0) maxSpeedValue = speeds.Select(static kvp => kvp.Value).Prepend(maxSpeedValue).Max();
|
||||||
|
|
||||||
|
MaxSpeed = maxSpeedValue;
|
||||||
|
|
||||||
|
// Populate speed data for graph
|
||||||
|
SpeedData.Clear();
|
||||||
|
|
||||||
|
foreach(KeyValuePair<ulong, double> kvp in speeds.OrderBy(static k => k.Key))
|
||||||
|
SpeedData.Add((kvp.Key, kvp.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -114,6 +114,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
ViewImageSectorsCommand = new RelayCommand(ViewImageSectors);
|
ViewImageSectorsCommand = new RelayCommand(ViewImageSectors);
|
||||||
DecodeImageMediaTagsCommand = new RelayCommand(DecodeImageMediaTags);
|
DecodeImageMediaTagsCommand = new RelayCommand(DecodeImageMediaTags);
|
||||||
OpenMhddLogCommand = new AsyncRelayCommand(OpenMhddLogAsync);
|
OpenMhddLogCommand = new AsyncRelayCommand(OpenMhddLogAsync);
|
||||||
|
OpenIbgLogCommand = new AsyncRelayCommand(OpenIbgLogAsync);
|
||||||
|
|
||||||
_genericHddIcon =
|
_genericHddIcon =
|
||||||
new Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-harddisk.png")));
|
new Bitmap(AssetLoader.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/drive-harddisk.png")));
|
||||||
@@ -166,6 +167,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
public ICommand ViewImageSectorsCommand { get; }
|
public ICommand ViewImageSectorsCommand { get; }
|
||||||
public ICommand DecodeImageMediaTagsCommand { get; }
|
public ICommand DecodeImageMediaTagsCommand { get; }
|
||||||
public ICommand OpenMhddLogCommand { get; }
|
public ICommand OpenMhddLogCommand { get; }
|
||||||
|
public ICommand OpenIbgLogCommand { get; }
|
||||||
|
|
||||||
public bool NativeMenuSupported
|
public bool NativeMenuSupported
|
||||||
{
|
{
|
||||||
@@ -227,7 +229,7 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
IReadOnlyList<IStorageFile> result = await _view.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
IReadOnlyList<IStorageFile> result = await _view.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||||
{
|
{
|
||||||
Title = UI.Dialog_Choose_image_to_open,
|
Title = UI.Choose_MHDD_log_to_open,
|
||||||
AllowMultiple = false,
|
AllowMultiple = false,
|
||||||
FileTypeFilter = [FilePickerFileTypes.MhddLogFiles]
|
FileTypeFilter = [FilePickerFileTypes.MhddLogFiles]
|
||||||
});
|
});
|
||||||
@@ -242,6 +244,26 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
mhddLogViewWindow.Show();
|
mhddLogViewWindow.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async Task OpenIbgLogAsync()
|
||||||
|
{
|
||||||
|
IReadOnlyList<IStorageFile> result = await _view.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
|
||||||
|
{
|
||||||
|
Title = UI.Choose_IMGBurn_log_to_open,
|
||||||
|
AllowMultiple = false,
|
||||||
|
FileTypeFilter = [FilePickerFileTypes.IbgLogFiles]
|
||||||
|
});
|
||||||
|
|
||||||
|
// Exit if user did not select exactly one file
|
||||||
|
if(result.Count != 1) return;
|
||||||
|
|
||||||
|
var ibgLogViewWindow = new IbgLogView();
|
||||||
|
|
||||||
|
ibgLogViewWindow.DataContext = new IbgLogViewModel(ibgLogViewWindow, result[0].Path.LocalPath);
|
||||||
|
|
||||||
|
ibgLogViewWindow.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async Task OpenAsync()
|
async Task OpenAsync()
|
||||||
{
|
{
|
||||||
// Open file picker dialog to allow user to select an image file
|
// Open file picker dialog to allow user to select an image file
|
||||||
|
|||||||
132
Aaru.Gui/Views/Windows/IbgLogView.axaml
Normal file
132
Aaru.Gui/Views/Windows/IbgLogView.axaml
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<Window 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:controls="clr-namespace:Aaru.Gui.Controls"
|
||||||
|
xmlns:localization="clr-namespace:Aaru.Localization;assembly=Aaru.Localization"
|
||||||
|
xmlns:windows="clr-namespace:Aaru.Gui.ViewModels.Windows"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
d:DesignHeight="450"
|
||||||
|
x:Class="Aaru.Gui.Views.Windows.IbgLogView"
|
||||||
|
Title="{x:Static localization:UI.Title_IMGBurn_log_viewer}">
|
||||||
|
<Design.DataContext>
|
||||||
|
<windows:IbgLogViewModel />
|
||||||
|
</Design.DataContext>
|
||||||
|
<Grid RowDefinitions="Auto,*"
|
||||||
|
RowSpacing="8"
|
||||||
|
Margin="12">
|
||||||
|
<StackPanel Grid.Row="0"
|
||||||
|
Orientation="Vertical"
|
||||||
|
Spacing="8">
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_File_path}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding FilePath, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding Firmware, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Firmware}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding Firmware, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding Bus, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Bus}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding Bus, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding Date, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Date}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding Date, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding MediaSpeeds, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Media_speeds}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding MediaSpeeds, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding Capacity, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Media_capacity}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding Capacity, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding Imagefile, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Image_file}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding Imagefile, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding VolumeIdentifier, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Volume_identifier}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding VolumeIdentifier, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding MediaType, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Media_type}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding MediaType, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding SpeedStart, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Speed_start}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding SpeedStart, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding SpeedEnd, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Speed_end}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding SpeedEnd, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding SpeedAverage, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Speed_average}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding SpeedAverage, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
<Grid ColumnDefinitions="Auto,*"
|
||||||
|
ColumnSpacing="8"
|
||||||
|
IsVisible="{Binding TimeTaken, Converter={x:Static StringConverters.IsNotNullOrEmpty}, Mode=OneWay}">
|
||||||
|
<controls:SpectreTextBlock Grid.Column="0"
|
||||||
|
Text="{x:Static localization:UI.Title_Time_taken}" />
|
||||||
|
<controls:SpectreTextBlock Grid.Column="1"
|
||||||
|
Text="{Binding TimeTaken, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
<controls:DiscSpeedGraph Grid.Row="1"
|
||||||
|
SpeedData="{Binding SpeedData, Mode=OneWay}"
|
||||||
|
MaxSector="{Binding MaxSector, Mode=OneWay}"
|
||||||
|
MaxSpeed="{Binding MaxSpeed, Mode=OneWay}"
|
||||||
|
Multiplier="{Binding SpeedMultiplier, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
57
Aaru.Gui/Views/Windows/IbgLogView.axaml.cs
Normal file
57
Aaru.Gui/Views/Windows/IbgLogView.axaml.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
// /***************************************************************************
|
||||||
|
// Aaru Data Preservation Suite
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : IbgLogView.axaml.cs
|
||||||
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||||
|
//
|
||||||
|
// Component : GUI views.
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// View for IMGBurn log viewer.
|
||||||
|
//
|
||||||
|
// --[ 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-2025 Natalia Portillo
|
||||||
|
// ****************************************************************************/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Aaru.Gui.ViewModels.Windows;
|
||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace Aaru.Gui.Views.Windows;
|
||||||
|
|
||||||
|
public partial class IbgLogView : Window
|
||||||
|
{
|
||||||
|
public IbgLogView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
#if DEBUG
|
||||||
|
this.AttachDevTools();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void OnDataContextChanged(EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnDataContextChanged(e);
|
||||||
|
|
||||||
|
if(DataContext is IbgLogViewModel vm) vm?.LoadData();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
Command="{Binding OpenCommand, Mode=OneWay}" />
|
Command="{Binding OpenCommand, Mode=OneWay}" />
|
||||||
<MenuItem Header="{x:Static localization:UI.Menu_Open_MHDD_log}"
|
<MenuItem Header="{x:Static localization:UI.Menu_Open_MHDD_log}"
|
||||||
Command="{Binding OpenMhddLogCommand, Mode=OneWay}" />
|
Command="{Binding OpenMhddLogCommand, Mode=OneWay}" />
|
||||||
|
<MenuItem Header="{x:Static localization:UI.Menu_Open_IMGBurn_log}"
|
||||||
|
Command="{Binding OpenIbgLogCommand, Mode=OneWay}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem Header="{x:Static localization:UI.Menu_Settings}"
|
<MenuItem Header="{x:Static localization:UI.Menu_Settings}"
|
||||||
IsVisible="{Binding !NativeMenuSupported, Mode=OneWay}"
|
IsVisible="{Binding !NativeMenuSupported, Mode=OneWay}"
|
||||||
|
|||||||
90
Aaru.Localization/UI.Designer.cs
generated
90
Aaru.Localization/UI.Designer.cs
generated
@@ -6351,5 +6351,95 @@ namespace Aaru.Localization {
|
|||||||
return ResourceManager.GetString("Error_parsing_MHDD_log_header_0", resourceCulture);
|
return ResourceManager.GetString("Error_parsing_MHDD_log_header_0", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string The_specified_file_is_not_a_correct_IMGBurn_log_file {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("The_specified_file_is_not_a_correct_IMGBurn_log_file", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string _0_N2_KB_s {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("_0_N2_KB_s", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Choose_MHDD_log_to_open {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Choose_MHDD_log_to_open", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Choose_IMGBurn_log_to_open {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Choose_IMGBurn_log_to_open", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string IMGBurn_Log_Files {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("IMGBurn_Log_Files", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_IMGBurn_log_viewer {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_IMGBurn_log_viewer", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Media_speeds {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Media_speeds", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Media_capacity {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Media_capacity", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Image_file {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Image_file", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Volume_identifier {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Volume_identifier", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Speed_start {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Speed_start", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Speed_end {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Speed_end", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Speed_average {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Speed_average", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Title_Time_taken {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Title_Time_taken", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Menu_Open_IMGBurn_log {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Menu_Open_IMGBurn_log", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2472,7 +2472,7 @@ Probadores:
|
|||||||
<value>[slateblue1]Número de serie del medio[/]</value>
|
<value>[slateblue1]Número de serie del medio[/]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Title_Media_type" xml:space="preserve">
|
<data name="Title_Media_type" xml:space="preserve">
|
||||||
<value>[slateblue1]Tipo de medio[/]</value>
|
<value>[bold][slateblue1]Tipo de medio[/][/]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Title_Message" xml:space="preserve">
|
<data name="Title_Message" xml:space="preserve">
|
||||||
<value>[bold][blue]Mensaje[/][/]</value>
|
<value>[bold][blue]Mensaje[/][/]</value>
|
||||||
@@ -3176,4 +3176,49 @@ Probadores:
|
|||||||
<data name="Error_parsing_MHDD_log_header_0" xml:space="preserve">
|
<data name="Error_parsing_MHDD_log_header_0" xml:space="preserve">
|
||||||
<value>Error interpretando cabecera del registro MHDD: {0}</value>
|
<value>Error interpretando cabecera del registro MHDD: {0}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="The_specified_file_is_not_a_correct_IMGBurn_log_file" xml:space="preserve">
|
||||||
|
<value>El archivo especificado no es un registro IMGBurn correcto.</value>
|
||||||
|
</data>
|
||||||
|
<data name="_0_N2_KB_s" xml:space="preserve">
|
||||||
|
<value>[lime]{0:N2}[/] [slateblue1]KB/s[/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Choose_MHDD_log_to_open" xml:space="preserve">
|
||||||
|
<value>Elige registro MHDD para abrir</value>
|
||||||
|
</data>
|
||||||
|
<data name="Choose_IMGBurn_log_to_open" xml:space="preserve">
|
||||||
|
<value>Elige registro IMGBurn para abrir</value>
|
||||||
|
</data>
|
||||||
|
<data name="IMGBurn_Log_Files" xml:space="preserve">
|
||||||
|
<value>Archivos de registro IMGBurn</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_IMGBurn_log_viewer" xml:space="preserve">
|
||||||
|
<value>Visor de registros IMGBurn</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Media_speeds" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Velocidades del medio[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Media_capacity" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Capacidad del medio[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Image_file" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Archivo de imagen[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Volume_identifier" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Identificador del volumen[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Speed_start" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Velocidad de comienzo[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Speed_end" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Velocidad final[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Speed_average" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Velocidad media[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Time_taken" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Tiempo tomado[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Menu_Open_IMGBurn_log" xml:space="preserve">
|
||||||
|
<value>Abrir registro _IMGBurn</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -779,7 +779,7 @@ In you are unsure, please press N to not continue.</value>
|
|||||||
<value>[slateblue1]Last modification time[/]</value>
|
<value>[slateblue1]Last modification time[/]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Title_Media_type" xml:space="preserve">
|
<data name="Title_Media_type" xml:space="preserve">
|
||||||
<value>[slateblue1]Media type[/]</value>
|
<value>[bold][slateblue1]Media type[/][/]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Title_Image_version" xml:space="preserve">
|
<data name="Title_Image_version" xml:space="preserve">
|
||||||
<value>[slateblue1]Image version[/]</value>
|
<value>[slateblue1]Image version[/]</value>
|
||||||
@@ -3252,4 +3252,49 @@ Do you want to continue?</value>
|
|||||||
<data name="Error_parsing_MHDD_log_header_0" xml:space="preserve">
|
<data name="Error_parsing_MHDD_log_header_0" xml:space="preserve">
|
||||||
<value>Error parsing MHDD log header: {0}</value>
|
<value>Error parsing MHDD log header: {0}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="The_specified_file_is_not_a_correct_IMGBurn_log_file" xml:space="preserve">
|
||||||
|
<value>The specified file is not a correct IMGBurn log file.</value>
|
||||||
|
</data>
|
||||||
|
<data name="_0_N2_KB_s" xml:space="preserve">
|
||||||
|
<value>[lime]{0:N2}[/] [slateblue1]KB/s[/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Choose_MHDD_log_to_open" xml:space="preserve">
|
||||||
|
<value>Choose MHDD log to open</value>
|
||||||
|
</data>
|
||||||
|
<data name="Choose_IMGBurn_log_to_open" xml:space="preserve">
|
||||||
|
<value>Choose IMGBurn log to open</value>
|
||||||
|
</data>
|
||||||
|
<data name="IMGBurn_Log_Files" xml:space="preserve">
|
||||||
|
<value>IMGBurn Log Files</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_IMGBurn_log_viewer" xml:space="preserve">
|
||||||
|
<value>IMGBurn log viewer</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Media_speeds" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Media speeds[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Media_capacity" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Media capacity[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Image_file" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Image file[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Volume_identifier" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Volume identifier[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Speed_start" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Speed start[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Speed_end" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Speed end[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Speed_average" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Speed average[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Title_Time_taken" xml:space="preserve">
|
||||||
|
<value>[bold][slateblue1]Time taken[/][/]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Menu_Open_IMGBurn_log" xml:space="preserve">
|
||||||
|
<value>Open _IMGBurn log</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user