Rename all InputProto and OutputProtos for clarity.

This commit is contained in:
David Given
2021-05-15 18:05:53 +02:00
parent f741ad058e
commit 4ab8b4984d
29 changed files with 80 additions and 80 deletions

View File

@@ -7,12 +7,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class AesLanierInputProto; class AesLanierDecoderProto;
class AesLanierDecoder : public AbstractDecoder class AesLanierDecoder : public AbstractDecoder
{ {
public: public:
AesLanierDecoder(const AesLanierInputProto&) {} AesLanierDecoder(const AesLanierDecoderProto&) {}
virtual ~AesLanierDecoder() {} virtual ~AesLanierDecoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message AesLanierInputProto {} message AesLanierDecoderProto {}

View File

@@ -12,13 +12,13 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class SectorSet; class SectorSet;
class AmigaInputProto; class AmigaDecoderProto;
class AmigaOutputProto; class AmigaEncoderProto;
class AmigaDecoder : public AbstractDecoder class AmigaDecoder : public AbstractDecoder
{ {
public: public:
AmigaDecoder(const AmigaInputProto&) {} AmigaDecoder(const AmigaDecoderProto&) {}
virtual ~AmigaDecoder() {} virtual ~AmigaDecoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();
@@ -30,7 +30,7 @@ public:
class AmigaEncoder : public AbstractEncoder class AmigaEncoder : public AbstractEncoder
{ {
public: public:
AmigaEncoder(const AmigaOutputProto& config): AmigaEncoder(const AmigaEncoderProto& config):
_config(config) {} _config(config) {}
virtual ~AmigaEncoder() {} virtual ~AmigaEncoder() {}
@@ -38,7 +38,7 @@ public:
std::unique_ptr<Fluxmap> encode(int physicalTrack, int physicalSide, const SectorSet& allSectors); std::unique_ptr<Fluxmap> encode(int physicalTrack, int physicalSide, const SectorSet& allSectors);
private: private:
const AmigaOutputProto& _config; const AmigaEncoderProto& _config;
}; };
extern uint32_t amigaChecksum(const Bytes& bytes); extern uint32_t amigaChecksum(const Bytes& bytes);

View File

@@ -2,9 +2,9 @@ syntax = "proto2";
import "lib/common.proto"; import "lib/common.proto";
message AmigaInputProto {} message AmigaDecoderProto {}
message AmigaOutputProto { message AmigaEncoderProto {
optional double clock_rate_us = 1 optional double clock_rate_us = 1
[default=2.00, (help)="Encoded data clock rate."]; [default=2.00, (help)="Encoded data clock rate."];
optional double post_index_gap_ms = 2 optional double post_index_gap_ms = 2

View File

@@ -9,12 +9,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class Apple2InputProto; class Apple2DecoderProto;
class Apple2Decoder : public AbstractDecoder class Apple2Decoder : public AbstractDecoder
{ {
public: public:
Apple2Decoder(const Apple2InputProto&) {} Apple2Decoder(const Apple2DecoderProto&) {}
virtual ~Apple2Decoder() {} virtual ~Apple2Decoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message Apple2InputProto {} message Apple2DecoderProto {}

View File

@@ -16,13 +16,13 @@
class Sector; class Sector;
class SectorSet; class SectorSet;
class Fluxmap; class Fluxmap;
class BrotherInputProto; class BrotherDecoderProto;
class BrotherOutputProto; class BrotherEncoderProto;
class BrotherDecoder : public AbstractDecoder class BrotherDecoder : public AbstractDecoder
{ {
public: public:
BrotherDecoder(const BrotherInputProto& config) {} BrotherDecoder(const BrotherDecoderProto& config) {}
virtual ~BrotherDecoder() {} virtual ~BrotherDecoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();
@@ -33,14 +33,14 @@ public:
class BrotherEncoder : public AbstractEncoder class BrotherEncoder : public AbstractEncoder
{ {
public: public:
BrotherEncoder(const BrotherOutputProto& config): BrotherEncoder(const BrotherEncoderProto& config):
_config(config) _config(config)
{} {}
virtual ~BrotherEncoder() {} virtual ~BrotherEncoder() {}
private: private:
const BrotherOutputProto& _config; const BrotherEncoderProto& _config;
public: public:
std::unique_ptr<Fluxmap> encode(int physicalTrack, int physicalSide, const SectorSet& allSectors); std::unique_ptr<Fluxmap> encode(int physicalTrack, int physicalSide, const SectorSet& allSectors);

View File

@@ -1,13 +1,13 @@
syntax = "proto2"; syntax = "proto2";
message BrotherInputProto {} message BrotherDecoderProto {}
enum BrotherFormat { enum BrotherFormat {
BROTHER240 = 0; BROTHER240 = 0;
BROTHER120 = 1; BROTHER120 = 1;
}; };
message BrotherOutputProto { message BrotherEncoderProto {
optional double clock_rate_us = 1 [default = 3.83]; optional double clock_rate_us = 1 [default = 3.83];
optional double post_index_gap_ms = 2 [default = 1.0]; optional double post_index_gap_ms = 2 [default = 1.0];
optional double sector_spacing_ms = 3 [default = 16.2]; optional double sector_spacing_ms = 3 [default = 16.2];

View File

@@ -7,12 +7,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class Commodore64InputProto; class Commodore64DecoderProto;
class Commodore64Decoder : public AbstractDecoder class Commodore64Decoder : public AbstractDecoder
{ {
public: public:
Commodore64Decoder(const Commodore64InputProto&) {} Commodore64Decoder(const Commodore64DecoderProto&) {}
virtual ~Commodore64Decoder() {} virtual ~Commodore64Decoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message Commodore64InputProto {} message Commodore64DecoderProto {}

View File

@@ -7,12 +7,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class F85InputProto; class F85DecoderProto;
class DurangoF85Decoder : public AbstractDecoder class DurangoF85Decoder : public AbstractDecoder
{ {
public: public:
DurangoF85Decoder(const F85InputProto&) {} DurangoF85Decoder(const F85DecoderProto&) {}
virtual ~DurangoF85Decoder() {} virtual ~DurangoF85Decoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message F85InputProto {} message F85DecoderProto {}

View File

@@ -8,12 +8,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class Track; class Track;
class Fb100InputProto; class Fb100DecoderProto;
class Fb100Decoder : public AbstractDecoder class Fb100Decoder : public AbstractDecoder
{ {
public: public:
Fb100Decoder(const Fb100InputProto&) {} Fb100Decoder(const Fb100DecoderProto&) {}
virtual ~Fb100Decoder() {} virtual ~Fb100Decoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message Fb100InputProto {} message Fb100DecoderProto {}

View File

@@ -4,8 +4,8 @@
#include "decoders/decoders.h" #include "decoders/decoders.h"
#include "encoders/encoders.h" #include "encoders/encoders.h"
class IBMInputProto; class IbmDecoderProto;
class IBMOutputProto; class IbmEncoderProto;
/* IBM format (i.e. ordinary PC floppies). */ /* IBM format (i.e. ordinary PC floppies). */
@@ -35,7 +35,7 @@ struct IbmIdam
class IbmDecoder : public AbstractDecoder class IbmDecoder : public AbstractDecoder
{ {
public: public:
IbmDecoder(const IBMInputProto& config): IbmDecoder(const IbmDecoderProto& config):
_config(config) _config(config)
{} {}
@@ -46,7 +46,7 @@ public:
std::set<unsigned> requiredSectors(Track& track) const; std::set<unsigned> requiredSectors(Track& track) const;
private: private:
const IBMInputProto& _config; const IbmDecoderProto& _config;
unsigned _currentSectorSize; unsigned _currentSectorSize;
unsigned _currentHeaderLength; unsigned _currentHeaderLength;
}; };
@@ -54,7 +54,7 @@ private:
class IbmEncoder : public AbstractEncoder class IbmEncoder : public AbstractEncoder
{ {
public: public:
IbmEncoder(const IBMOutputProto& config): IbmEncoder(const IbmEncoderProto& config):
_config(config) _config(config)
{} {}
@@ -70,7 +70,7 @@ private:
void writeSync(); void writeSync();
private: private:
const IBMOutputProto& _config; const IbmEncoderProto& _config;
std::vector<bool> _bits; std::vector<bool> _bits;
unsigned _cursor; unsigned _cursor;
bool _lastBit; bool _lastBit;

View File

@@ -2,7 +2,7 @@ syntax = "proto2";
import "lib/common.proto"; import "lib/common.proto";
message IBMInputProto { message IbmDecoderProto {
optional int32 sector_id_base = 1 [default = 1, optional int32 sector_id_base = 1 [default = 1,
(help) = "ID of first sector"]; (help) = "ID of first sector"];
optional bool ignore_side_byte = 2 [default = false, optional bool ignore_side_byte = 2 [default = false,
@@ -11,7 +11,7 @@ message IBMInputProto {
(help) = "require these sectors to exist for a good read"]; (help) = "require these sectors to exist for a good read"];
} }
message IBMOutputProto { message IbmEncoderProto {
optional double track_length_ms = 1; optional double track_length_ms = 1;
optional int32 sector_size = 2 [default=512]; optional int32 sector_size = 2 [default=512];
optional bool emit_iam = 3 [default=true]; optional bool emit_iam = 3 [default=true];

View File

@@ -15,13 +15,13 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class MacintoshInputProto; class MacintoshDecoderProto;
class MacintoshOutputProto; class MacintoshEncoderProto;
class MacintoshDecoder : public AbstractDecoder class MacintoshDecoder : public AbstractDecoder
{ {
public: public:
MacintoshDecoder(const MacintoshInputProto&) {} MacintoshDecoder(const MacintoshDecoderProto&) {}
virtual ~MacintoshDecoder() {} virtual ~MacintoshDecoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();
@@ -34,7 +34,7 @@ public:
class MacintoshEncoder : public AbstractEncoder class MacintoshEncoder : public AbstractEncoder
{ {
public: public:
MacintoshEncoder(const MacintoshOutputProto&) {} MacintoshEncoder(const MacintoshEncoderProto&) {}
virtual ~MacintoshEncoder() {} virtual ~MacintoshEncoder() {}
public: public:

View File

@@ -1,5 +1,5 @@
syntax = "proto2"; syntax = "proto2";
message MacintoshInputProto {} message MacintoshDecoderProto {}
message MacintoshOutputProto {} message MacintoshEncoderProto {}

View File

@@ -5,12 +5,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class MicropolisInputProto; class MicropolisDecoderProto;
class MicropolisDecoder : public AbstractDecoder class MicropolisDecoder : public AbstractDecoder
{ {
public: public:
MicropolisDecoder(const MicropolisInputProto&) {} MicropolisDecoder(const MicropolisDecoderProto&) {}
virtual ~MicropolisDecoder() {} virtual ~MicropolisDecoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message MicropolisInputProto {} message MicropolisDecoderProto {}

View File

@@ -3,12 +3,12 @@
#include "decoders/decoders.h" #include "decoders/decoders.h"
class MxInputProto; class MxDecoderProto;
class MxDecoder : public AbstractDecoder class MxDecoder : public AbstractDecoder
{ {
public: public:
MxDecoder(const MxInputProto&) {} MxDecoder(const MxDecoderProto&) {}
virtual ~MxDecoder() {} virtual ~MxDecoder() {}
void beginTrack(); void beginTrack();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message MxInputProto {} message MxDecoderProto {}

View File

@@ -9,13 +9,13 @@ class Sector;
class SectorSet; class SectorSet;
class Fluxmap; class Fluxmap;
class Track; class Track;
class Tids990InputProto; class Tids990DecoderProto;
class Tids990OutputProto; class Tids990EncoderProto;
class Tids990Decoder : public AbstractDecoder class Tids990Decoder : public AbstractDecoder
{ {
public: public:
Tids990Decoder(const Tids990InputProto&) {} Tids990Decoder(const Tids990DecoderProto&) {}
virtual ~Tids990Decoder() {} virtual ~Tids990Decoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();
@@ -26,7 +26,7 @@ public:
class Tids990Encoder : public AbstractEncoder class Tids990Encoder : public AbstractEncoder
{ {
public: public:
Tids990Encoder(const Tids990OutputProto& config): Tids990Encoder(const Tids990EncoderProto& config):
_config(config) _config(config)
{} {}
virtual ~Tids990Encoder() {} virtual ~Tids990Encoder() {}
@@ -41,7 +41,7 @@ public:
std::unique_ptr<Fluxmap> encode(int physicalTrack, int physicalSide, const SectorSet& allSectors); std::unique_ptr<Fluxmap> encode(int physicalTrack, int physicalSide, const SectorSet& allSectors);
private: private:
const Tids990OutputProto& _config; const Tids990EncoderProto& _config;
std::vector<bool> _bits; std::vector<bool> _bits;
unsigned _cursor; unsigned _cursor;
bool _lastBit; bool _lastBit;

View File

@@ -2,8 +2,8 @@ syntax = "proto2";
import "lib/common.proto"; import "lib/common.proto";
message Tids990InputProto {} message Tids990DecoderProto {}
message Tids990OutputProto { message Tids990EncoderProto {
optional double track_length_ms = 1 [ default = 166, optional double track_length_ms = 1 [ default = 166,
(help) = "length of a track" ]; (help) = "length of a track" ];
optional int32 sector_count = 2 [ default = 26, optional int32 sector_count = 2 [ default = 26,

View File

@@ -8,12 +8,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class Victor9kInputProto; class Victor9kDecoderProto;
class Victor9kDecoder : public AbstractDecoder class Victor9kDecoder : public AbstractDecoder
{ {
public: public:
Victor9kDecoder(const Victor9kInputProto&) {} Victor9kDecoder(const Victor9kDecoderProto&) {}
virtual ~Victor9kDecoder() {} virtual ~Victor9kDecoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -3,12 +3,12 @@
class Sector; class Sector;
class Fluxmap; class Fluxmap;
class ZilogMczInputProto; class ZilogMczDecoderProto;
class ZilogMczDecoder : public AbstractDecoder class ZilogMczDecoder : public AbstractDecoder
{ {
public: public:
ZilogMczDecoder(const ZilogMczInputProto&) {} ZilogMczDecoder(const ZilogMczDecoderProto&) {}
virtual ~ZilogMczDecoder() {} virtual ~ZilogMczDecoder() {}
RecordType advanceToNextRecord(); RecordType advanceToNextRecord();

View File

@@ -1,4 +1,4 @@
syntax = "proto2"; syntax = "proto2";
message ZilogMczInputProto {} message ZilogMczDecoderProto {}

View File

@@ -27,20 +27,20 @@ message DecoderProto {
(help) = "refuse to detect clocks shorter than this, to avoid false positives"]; (help) = "refuse to detect clocks shorter than this, to avoid false positives"];
oneof format { oneof format {
IBMInputProto ibm = 5; IbmDecoderProto ibm = 5;
BrotherInputProto brother = 6; BrotherDecoderProto brother = 6;
AesLanierInputProto aeslanier = 7; AesLanierDecoderProto aeslanier = 7;
AmigaInputProto amiga = 8; AmigaDecoderProto amiga = 8;
Commodore64InputProto c64 = 9; Commodore64DecoderProto c64 = 9;
F85InputProto f85 = 10; F85DecoderProto f85 = 10;
Fb100InputProto fb100 = 11; Fb100DecoderProto fb100 = 11;
MacintoshInputProto macintosh = 12; MacintoshDecoderProto macintosh = 12;
Apple2InputProto apple2 = 13; Apple2DecoderProto apple2 = 13;
MicropolisInputProto micropolis = 14; MicropolisDecoderProto micropolis = 14;
MxInputProto mx = 15; MxDecoderProto mx = 15;
Tids990InputProto tids990 = 16; Tids990DecoderProto tids990 = 16;
Victor9kInputProto victor9k = 17; Victor9kDecoderProto victor9k = 17;
ZilogMczInputProto zilogmcz = 18; ZilogMczDecoderProto zilogmcz = 18;
} }
} }

View File

@@ -9,10 +9,10 @@ import "arch/tids990/tids990.proto";
message EncoderProto { message EncoderProto {
oneof format { oneof format {
IBMOutputProto ibm = 3; IbmEncoderProto ibm = 3;
BrotherOutputProto brother = 4; BrotherEncoderProto brother = 4;
AmigaOutputProto amiga = 5; AmigaEncoderProto amiga = 5;
MacintoshOutputProto macintosh = 6; MacintoshEncoderProto macintosh = 6;
Tids990OutputProto tids990 = 7; Tids990EncoderProto tids990 = 7;
} }
} }