| 56 | { |
| 57 | public: |
| 58 | DmkFluxSource(const DmkFluxSourceProto& config): _path(config.directory()) |
| 59 | { |
| 60 | std::vector<CylinderHead> chs; |
| 61 | for (const auto& di : std::filesystem::directory_iterator(_path)) |
| 62 | { |
| 63 | static const std::regex FILENAME_REGEX( |
| 64 | "C_S([0-9]+)T([0-9]+)\\.[0-9]+"); |
| 65 | |
| 66 | std::string filename = di.path().filename().string(); |
| 67 | std::smatch dmatch; |
| 68 | if (std::regex_match(filename, dmatch, FILENAME_REGEX)) |
| 69 | chs.push_back(CylinderHead{(unsigned)std::stoi(dmatch[2]), |
| 70 | (unsigned)std::stoi(dmatch[1])}); |
| 71 | } |
| 72 | _extraConfig.mutable_drive()->set_tracks( |
| 73 | convertCylinderHeadsToString(chs)); |
| 74 | } |
| 75 | |
| 76 | public: |
| 77 | std::unique_ptr<FluxSourceIterator> readFlux(int track, int side) override |
nothing calls this directly
no test coverage detected