mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-24 11:11:02 -07:00
Compare commits
1 Commits
5b7f9d84f9
...
collation
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb82dc864a |
@@ -137,8 +137,10 @@ std::shared_ptr<TrackDataFlux> Decoder::decodeToSectors(
|
||||
|
||||
if (_sector->status != Sector::MISSING)
|
||||
{
|
||||
auto trackLayout = Layout::getLayoutOfTrack(
|
||||
_sector->logicalTrack, _sector->logicalSide);
|
||||
if ((_sector->status == Sector::OK) &&
|
||||
((_sector->logicalTrack != trackInfo->logicalTrack) ||
|
||||
(_sector->logicalSide != trackInfo->logicalSide)))
|
||||
_sector->status == Sector::WRONG_PLACE;
|
||||
_trackdata->sectors.push_back(_sector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import "arch/zilogmcz/zilogmcz.proto";
|
||||
import "lib/fluxsink/fluxsink.proto";
|
||||
import "lib/common.proto";
|
||||
|
||||
//NEXT: 32
|
||||
//NEXT: 33
|
||||
message DecoderProto {
|
||||
optional double pulse_debounce_threshold = 1 [default = 0.30,
|
||||
(help) = "ignore pulses with intervals shorter than this, in fractions of a clock"];
|
||||
@@ -66,6 +66,7 @@ message DecoderProto {
|
||||
optional string write_csv_to = 23
|
||||
[(help) = "if set, write a CSV report of the disk state"];
|
||||
optional bool skip_unnecessary_tracks = 29 [default = true,
|
||||
(help) = "don't read tracks if we already have all necessary sectors"];
|
||||
(help) = "don't read physical tracks if we already have all necessary sectors"];
|
||||
optional bool collate_sectors_from_all_tracks = 32 [default = false,
|
||||
(help) = "when creating the image, consider all valid sectors even if they're on the wrong track"];
|
||||
}
|
||||
|
||||
|
||||
@@ -97,9 +97,16 @@ void measureDiskRotation()
|
||||
log(EndSpeedOperationLogMessage{oneRevolution});
|
||||
}
|
||||
|
||||
static int getEffectiveStatus(int status)
|
||||
{
|
||||
if ((status == Sector::WRONG_PLACE) &&
|
||||
globalConfig()->decoder().collate_sectors_from_all_tracks())
|
||||
return Sector::OK;
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Given a set of sectors, deduplicates them sensibly (e.g. if there is a good
|
||||
* and bad version of the same sector, the bad version is dropped). */
|
||||
|
||||
static std::set<std::shared_ptr<const Sector>> collectSectors(
|
||||
std::set<std::shared_ptr<const Sector>>& track_sectors,
|
||||
bool collapse_conflicts = true)
|
||||
@@ -124,9 +131,11 @@ static std::set<std::shared_ptr<const Sector>> collectSectors(
|
||||
it->second,
|
||||
[&](auto left, auto& rightit) -> std::shared_ptr<const Sector>
|
||||
{
|
||||
int leftStatus = left->status;
|
||||
auto& right = rightit.second;
|
||||
if ((left->status == Sector::OK) &&
|
||||
(right->status == Sector::OK) &&
|
||||
int rightStatus = right->status;
|
||||
if ((leftStatus == Sector::OK) &&
|
||||
(rightStatus == Sector::OK) &&
|
||||
(left->data != right->data))
|
||||
{
|
||||
if (!collapse_conflicts)
|
||||
@@ -139,13 +148,13 @@ static std::set<std::shared_ptr<const Sector>> collectSectors(
|
||||
s->status = Sector::CONFLICT;
|
||||
return s;
|
||||
}
|
||||
if (left->status == Sector::CONFLICT)
|
||||
if (leftStatus == Sector::CONFLICT)
|
||||
return left;
|
||||
if (right->status == Sector::CONFLICT)
|
||||
if (rightStatus == Sector::CONFLICT)
|
||||
return right;
|
||||
if (left->status == Sector::OK)
|
||||
if (leftStatus == Sector::OK)
|
||||
return left;
|
||||
if (right->status == Sector::OK)
|
||||
if (rightStatus == Sector::OK)
|
||||
return right;
|
||||
return left;
|
||||
});
|
||||
|
||||
@@ -31,6 +31,8 @@ std::string Sector::statusToString(Status status)
|
||||
return "present but no data found";
|
||||
case Status::CONFLICT:
|
||||
return "conflicting data";
|
||||
case Status::WRONG_PLACE:
|
||||
return "incorrectly placed";
|
||||
default:
|
||||
return fmt::format("unknown error {}", status);
|
||||
}
|
||||
@@ -50,6 +52,8 @@ std::string Sector::statusToChar(Status status)
|
||||
return "!";
|
||||
case Status::CONFLICT:
|
||||
return "*";
|
||||
case Status::WRONG_PLACE:
|
||||
return "/";
|
||||
default:
|
||||
return "?";
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ struct Sector : public LogicalLocation
|
||||
DATA_MISSING,
|
||||
CONFLICT,
|
||||
INTERNAL_ERROR,
|
||||
WRONG_PLACE,
|
||||
};
|
||||
|
||||
static std::string statusToString(Status status);
|
||||
|
||||
@@ -109,6 +109,10 @@ option_group {
|
||||
set_by_default: true
|
||||
|
||||
config {
|
||||
decoder {
|
||||
collate_sectors_from_all_tracks: true
|
||||
}
|
||||
|
||||
layout {
|
||||
format_type: FORMATTYPE_80TRACK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user