mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Reformat code.
This commit is contained in:
@@ -54,21 +54,22 @@ namespace DiscImageChef.Core.Logging
|
||||
Type monoRunType = Type.GetType("Mono.Runtime");
|
||||
|
||||
logSw.WriteLine("################# System information #################");
|
||||
logSw.WriteLine("{0} {1} ({2}-bit)", Interop.DetectOS.GetPlatformName(platId, platVer), platVer, Environment.Is64BitOperatingSystem ? 64 : 32);
|
||||
logSw.WriteLine("{0} {1} ({2}-bit)", Interop.DetectOS.GetPlatformName(platId, platVer), platVer,
|
||||
Environment.Is64BitOperatingSystem ? 64 : 32);
|
||||
if(monoRunType != null)
|
||||
{
|
||||
string monoVer = "unknown version";
|
||||
MethodInfo monoDisplayName = monoRunType.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if(monoDisplayName != null)
|
||||
monoVer = (string)monoDisplayName.Invoke(null, null);
|
||||
MethodInfo monoDisplayName =
|
||||
monoRunType.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
if(monoDisplayName != null) monoVer = (string)monoDisplayName.Invoke(null, null);
|
||||
logSw.WriteLine("Mono {0}", monoVer);
|
||||
}
|
||||
else
|
||||
logSw.WriteLine(".NET Framework {0}", Environment.Version);
|
||||
else logSw.WriteLine(".NET Framework {0}", Environment.Version);
|
||||
logSw.WriteLine();
|
||||
|
||||
logSw.WriteLine("################# Program information ################");
|
||||
logSw.WriteLine("DiscImageChef {0} running in {1}-bit", Version.GetVersion(), Environment.Is64BitProcess ? 64 : 32);
|
||||
logSw.WriteLine("DiscImageChef {0} running in {1}-bit", Version.GetVersion(),
|
||||
Environment.Is64BitProcess ? 64 : 32);
|
||||
#if DEBUG
|
||||
logSw.WriteLine("DEBUG version");
|
||||
#endif
|
||||
@@ -131,4 +132,4 @@ namespace DiscImageChef.Core.Logging
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,9 +209,9 @@ namespace DiscImageChef.Core.Logging
|
||||
ibgStartSet = true;
|
||||
}
|
||||
|
||||
ibgSb.AppendFormat("{0:0.00},{1},{2:0},0", ibgIntSpeed / ibgSnaps / ibgDivider, ibgIntSector, ibgSampleRate).AppendLine();
|
||||
if((ibgIntSpeed / ibgSnaps / ibgDivider) > ibgMaxSpeed)
|
||||
ibgMaxSpeed = ibgIntSpeed / ibgDivider;
|
||||
ibgSb.AppendFormat("{0:0.00},{1},{2:0},0", ibgIntSpeed / ibgSnaps / ibgDivider, ibgIntSector,
|
||||
ibgSampleRate).AppendLine();
|
||||
if((ibgIntSpeed / ibgSnaps / ibgDivider) > ibgMaxSpeed) ibgMaxSpeed = ibgIntSpeed / ibgDivider;
|
||||
|
||||
ibgDatePoint = DateTime.Now;
|
||||
ibgIntSpeed = 0;
|
||||
@@ -222,19 +222,17 @@ namespace DiscImageChef.Core.Logging
|
||||
}
|
||||
}
|
||||
|
||||
public void Close(Device dev, ulong blocks, ulong blockSize, double totalSeconds, double currentSpeed, double averageSpeed, string devicePath)
|
||||
public void Close(Device dev, ulong blocks, ulong blockSize, double totalSeconds, double currentSpeed,
|
||||
double averageSpeed, string devicePath)
|
||||
{
|
||||
if(ibgFs != null)
|
||||
{
|
||||
StringBuilder ibgHeader = new StringBuilder();
|
||||
string ibgBusType;
|
||||
|
||||
if(dev.IsUSB)
|
||||
ibgBusType = "USB";
|
||||
else if(dev.IsFireWire)
|
||||
ibgBusType = "FireWire";
|
||||
else
|
||||
ibgBusType = dev.Type.ToString();
|
||||
if(dev.IsUSB) ibgBusType = "USB";
|
||||
else if(dev.IsFireWire) ibgBusType = "FireWire";
|
||||
else ibgBusType = dev.Type.ToString();
|
||||
|
||||
ibgHeader.AppendLine("IBGD");
|
||||
ibgHeader.AppendLine();
|
||||
@@ -246,8 +244,8 @@ namespace DiscImageChef.Core.Logging
|
||||
ibgHeader.AppendFormat("SAMPLE_RATE={0}", 100).AppendLine();
|
||||
|
||||
ibgHeader.AppendLine();
|
||||
ibgHeader.AppendFormat("DEVICE=[0:0:0] {0} {1} ({2}) ({3})",
|
||||
dev.Manufacturer, dev.Model, devicePath, ibgBusType).AppendLine();
|
||||
ibgHeader.AppendFormat("DEVICE=[0:0:0] {0} {1} ({2}) ({3})", dev.Manufacturer, dev.Model, devicePath,
|
||||
ibgBusType).AppendLine();
|
||||
ibgHeader.AppendLine("DEVICE_ADDRESS=0:0:0");
|
||||
ibgHeader.AppendFormat("DEVICE_MAKEMODEL={0} {1}", dev.Manufacturer, dev.Model).AppendLine();
|
||||
ibgHeader.AppendFormat("DEVICE_FIRMWAREVERSION={0}", dev.Revision).AppendLine();
|
||||
@@ -270,7 +268,8 @@ namespace DiscImageChef.Core.Logging
|
||||
ibgHeader.AppendLine();
|
||||
ibgHeader.AppendFormat(ibgCulture, "VERIFY_SPEED_START={0:0.00}", ibgStartSpeed).AppendLine();
|
||||
ibgHeader.AppendFormat(ibgCulture, "VERIFY_SPEED_END={0:0.00}", currentSpeed / ibgDivider).AppendLine();
|
||||
ibgHeader.AppendFormat(ibgCulture, "VERIFY_SPEED_AVERAGE={0:0.00}", averageSpeed / ibgDivider).AppendLine();
|
||||
ibgHeader.AppendFormat(ibgCulture, "VERIFY_SPEED_AVERAGE={0:0.00}", averageSpeed / ibgDivider)
|
||||
.AppendLine();
|
||||
ibgHeader.AppendFormat(ibgCulture, "VERIFY_SPEED_MAX={0:0.00}", ibgMaxSpeed).AppendLine();
|
||||
ibgHeader.AppendFormat(ibgCulture, "VERIFY_TIME_TAKEN={0:0}", Math.Floor(totalSeconds)).AppendLine();
|
||||
ibgHeader.AppendLine("[END_CONFIGURATION]");
|
||||
@@ -290,6 +289,4 @@ namespace DiscImageChef.Core.Logging
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -83,8 +83,10 @@ namespace DiscImageChef.Core.Logging
|
||||
fw = string.Format("F/W: {0}", dev.Revision);
|
||||
sn = string.Format("S/N: {0}", dev.Serial);
|
||||
sectors = string.Format(new System.Globalization.CultureInfo("en-US"), "SECTORS: {0:n0}", blocks);
|
||||
sectorsize = string.Format(new System.Globalization.CultureInfo("en-US"), "SECTOR SIZE: {0:n0} bytes", blockSize);
|
||||
scanblocksize = string.Format(new System.Globalization.CultureInfo("en-US"), "SCAN BLOCK SIZE: {0:n0} sectors", blocksToRead);
|
||||
sectorsize = string.Format(new System.Globalization.CultureInfo("en-US"), "SECTOR SIZE: {0:n0} bytes",
|
||||
blockSize);
|
||||
scanblocksize = string.Format(new System.Globalization.CultureInfo("en-US"),
|
||||
"SCAN BLOCK SIZE: {0:n0} sectors", blocksToRead);
|
||||
ver = "VER:2 ";
|
||||
|
||||
byte[] deviceBytes = Encoding.ASCII.GetBytes(device);
|
||||
@@ -96,11 +98,10 @@ namespace DiscImageChef.Core.Logging
|
||||
byte[] scanblocksizeBytes = Encoding.ASCII.GetBytes(scanblocksize);
|
||||
byte[] verBytes = Encoding.ASCII.GetBytes(ver);
|
||||
|
||||
uint Pointer = (uint)(deviceBytes.Length + modeBytes.Length + fwBytes.Length +
|
||||
snBytes.Length + sectorsBytes.Length + sectorsizeBytes.Length +
|
||||
scanblocksizeBytes.Length + verBytes.Length +
|
||||
2 * 9 + // New lines
|
||||
4); // Pointer
|
||||
uint Pointer = (uint)(deviceBytes.Length + modeBytes.Length + fwBytes.Length + snBytes.Length +
|
||||
sectorsBytes.Length + sectorsizeBytes.Length + scanblocksizeBytes.Length +
|
||||
verBytes.Length + 2 * 9 + // New lines
|
||||
4); // Pointer
|
||||
|
||||
byte[] newLine = new byte[2];
|
||||
newLine[0] = 0x0D;
|
||||
@@ -141,10 +142,7 @@ namespace DiscImageChef.Core.Logging
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if(mhddFs != null)
|
||||
mhddFs.Close();
|
||||
if(mhddFs != null) mhddFs.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user