mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
SCP: Only write the last continuous fluxmap.
This commit is contained in:
@@ -93,3 +93,18 @@ void Fluxmap::precompensate(int threshold_ticks, int amount_ticks)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Fluxmap> Fluxmap::split() {
|
||||
std::vector<Fluxmap> maps;
|
||||
Fluxmap map;
|
||||
for (unsigned i=0; i<_bytes.size(); i++) {
|
||||
if (_bytes[i] == F_DESYNC) {
|
||||
maps.push_back(map);
|
||||
map = Fluxmap();
|
||||
} else {
|
||||
map.appendByte(_bytes[i]);
|
||||
}
|
||||
}
|
||||
maps.push_back(map);
|
||||
return maps;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,8 @@ public:
|
||||
|
||||
Fluxmap& appendBits(const std::vector<bool>& bits, nanoseconds_t clock);
|
||||
|
||||
void precompensate(int threshold_ticks, int amount_ticks);
|
||||
void precompensate(int threshold_ticks, int amount_ticks);
|
||||
std::vector<Fluxmap> split();
|
||||
|
||||
private:
|
||||
uint8_t& findLastByte();
|
||||
|
||||
@@ -92,7 +92,9 @@ public:
|
||||
trackheader.header.track_id[2] = 'K';
|
||||
trackheader.header.strack = strack;
|
||||
|
||||
FluxmapReader fmr(fluxmap);
|
||||
auto lastFluxmap = fluxmap.split().back();
|
||||
|
||||
FluxmapReader fmr(lastFluxmap);
|
||||
Bytes fluxdata;
|
||||
ByteWriter fluxdataWriter(fluxdata);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user