mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 14:55:11 +00:00
PIC model cleanup
This commit is contained in:
@@ -29,6 +29,6 @@
|
||||
/// <summary>
|
||||
/// Disc information and emergency brake units
|
||||
/// </summary>
|
||||
public DiscInformationUnit[]? Units { get; set; }
|
||||
public DiscInformationUnit[] Units { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
/// <summary>
|
||||
/// Unit header
|
||||
/// </summary>
|
||||
public DiscInformationUnitHeader? Header { get; set; }
|
||||
public DiscInformationUnitHeader Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unit body
|
||||
/// </summary>
|
||||
public DiscInformationUnitBody? Body { get; set; }
|
||||
public DiscInformationUnitBody Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unit trailer (BD-R/RE only)
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace SabreTools.Data.Models.PIC
|
||||
/// <summary>
|
||||
/// Disc Type Identifier
|
||||
/// </summary>
|
||||
public string? DiscTypeIdentifier { get; set; }
|
||||
public string DiscTypeIdentifier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Disc Size/Class/Version
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace SabreTools.Data.Models.PIC
|
||||
/// Emergency Brake Identifier "EB"
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
|
||||
public string? DiscInformationIdentifier;
|
||||
public string DiscInformationIdentifier;
|
||||
|
||||
/// <summary>
|
||||
/// Disc Information Format
|
||||
|
||||
@@ -24,11 +24,11 @@ namespace SabreTools.Serialization.Wrappers
|
||||
Print(builder, Model.Units);
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, DiscInformationUnit[]? entries)
|
||||
private static void Print(StringBuilder builder, DiscInformationUnit[] entries)
|
||||
{
|
||||
builder.AppendLine(" Disc Information Units:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (entries == null || entries.Length == 0)
|
||||
if (entries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No disc information units");
|
||||
builder.AppendLine();
|
||||
@@ -40,34 +40,19 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var entry = entries[i];
|
||||
|
||||
builder.AppendLine($" Disc Information Unit {i}");
|
||||
if (entry.Header == null)
|
||||
{
|
||||
builder.AppendLine(" No header");
|
||||
}
|
||||
else
|
||||
{
|
||||
var header = entry.Header;
|
||||
|
||||
builder.AppendLine(header.DiscInformationIdentifier, " Disc information identifier");
|
||||
builder.AppendLine(header.DiscInformationFormat, " Disc information format");
|
||||
builder.AppendLine(header.Reserved0, " Reserved");
|
||||
builder.AppendLine(header.SequenceNumber, " Sequence number");
|
||||
builder.AppendLine(header.BytesInUse, " Bytes in use");
|
||||
builder.AppendLine(header.Reserved1, " Reserved");
|
||||
}
|
||||
var header = entry.Header;
|
||||
builder.AppendLine(header.DiscInformationIdentifier, " Disc information identifier");
|
||||
builder.AppendLine(header.DiscInformationFormat, " Disc information format");
|
||||
builder.AppendLine(header.Reserved0, " Reserved");
|
||||
builder.AppendLine(header.SequenceNumber, " Sequence number");
|
||||
builder.AppendLine(header.BytesInUse, " Bytes in use");
|
||||
builder.AppendLine(header.Reserved1, " Reserved");
|
||||
|
||||
if (entry.Body == null)
|
||||
{
|
||||
builder.AppendLine(" No body");
|
||||
}
|
||||
else
|
||||
{
|
||||
var body = entry.Body;
|
||||
|
||||
builder.AppendLine(body.DiscTypeIdentifier, " Disc type identifer");
|
||||
builder.AppendLine(body.DiscSizeClassVersion, " Disc size class version");
|
||||
builder.AppendLine(body.FormatDependentContents, " Format-dependent contents");
|
||||
}
|
||||
var body = entry.Body;
|
||||
builder.AppendLine(body.DiscTypeIdentifier, " Disc type identifer");
|
||||
builder.AppendLine(body.DiscSizeClassVersion, " Disc size class version");
|
||||
builder.AppendLine(body.FormatDependentContents, " Format-dependent contents");
|
||||
|
||||
if (entry.Trailer == null)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
#region Extension Properties
|
||||
|
||||
/// <inheritdoc cref="DiscInformation.Units"/>
|
||||
public DiscInformationUnit[] Units => Model.Units ?? [];
|
||||
public DiscInformationUnit[] Units => Model.Units;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user