mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Do the framework and hopefully a lot of the maths of the Victor 9K encoder.
This commit is contained in:
@@ -47,8 +47,9 @@ public:
|
||||
Victor9kEncoderProto::TrackdataProto trackdata;
|
||||
getTrackFormat(trackdata, physicalTrack, physicalSide);
|
||||
|
||||
for (int sectorId : trackdata.sectors().sector())
|
||||
for (int i = 0; i < trackdata.sector_range().sector_count(); i++)
|
||||
{
|
||||
int sectorId = trackdata.sector_range().start_sector() + i;
|
||||
const auto& sector = image.get(physicalTrack, physicalSide, sectorId);
|
||||
if (sector)
|
||||
sectors.push_back(sector);
|
||||
@@ -63,8 +64,9 @@ public:
|
||||
Victor9kEncoderProto::TrackdataProto trackdata;
|
||||
getTrackFormat(trackdata, physicalTrack, physicalSide);
|
||||
|
||||
std::vector<bool> bits(trackdata.bits_per_revolution());
|
||||
unsigned clockRateUs = 166666.0 / trackdata.bits_per_revolution();
|
||||
unsigned bitsPerRevolution = trackdata.original_data_rate_khz() * trackdata.original_period_ms();
|
||||
std::vector<bool> bits(bitsPerRevolution);
|
||||
double clockRateUs = 166666.0 / bitsPerRevolution;
|
||||
unsigned cursor = 0;
|
||||
|
||||
fillBitmapTo(bits, cursor, trackdata.post_index_gap_us() / clockRateUs, { true, false });
|
||||
|
||||
@@ -6,18 +6,20 @@ message Victor9kDecoderProto {}
|
||||
|
||||
message Victor9kEncoderProto {
|
||||
message TrackdataProto {
|
||||
message SectorsProto {
|
||||
repeated int32 sector = 1 [(help) = "write these sectors (in order) on each track"];
|
||||
message SectorRangeProto {
|
||||
optional int32 start_sector = 1 [(help) = "first sector ID on track"];
|
||||
optional int32 sector_count = 2 [(help) = "number of sectors on track"];
|
||||
}
|
||||
|
||||
optional int32 min_cylinder = 1 [(help) = "minimum cylinder this format applies to"];
|
||||
optional int32 max_cylinder = 2 [(help) = "maximum cylinder this format applies to"];
|
||||
optional int32 head = 3 [(help) = "which head this format applies to"];
|
||||
optional int32 min_cylinder = 1 [(help) = "minimum cylinder this format applies to"];
|
||||
optional int32 max_cylinder = 2 [(help) = "maximum cylinder this format applies to"];
|
||||
optional int32 head = 3 [(help) = "which head this format applies to"];
|
||||
|
||||
optional int32 bits_per_revolution = 4 [(help) = "number of bits on this cylinder"];
|
||||
optional double post_index_gap_us = 5 [(help) = "size of post-index gap"];
|
||||
optional double original_period_ms = 4 [(help) = "original rotational period of this cylinder"];
|
||||
optional double original_data_rate_khz = 5 [(help) = "original data rate of this cylinder"];
|
||||
optional double post_index_gap_us = 6 [(help) = "size of post-index gap"];
|
||||
|
||||
optional SectorsProto sectors = 6 [(help) = "write these sectors (in order) on each track"];
|
||||
optional SectorRangeProto sector_range = 7 [(help) = "write these sectors on each track"];
|
||||
}
|
||||
|
||||
repeated TrackdataProto trackdata = 1;
|
||||
|
||||
Reference in New Issue
Block a user