Skip to content

Commit c8e6795

Browse files
authored
Merge pull request #546 from wybren1971/IMDwriter
Im dwriter
2 parents 1edc51c + eb9d0db commit c8e6795

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

lib/imagereader/imdimagereader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class IMDImageReader : public ImageReader
403403

404404

405405
Logger() << "IMD: read "
406-
<< fmt::format("{} tracks, {} heads; {}; {} kbps; {} sectoren; sectorsize {}; {} kB total.",
406+
<< fmt::format("{} tracks, {} heads; {}; {} kbps; {} sectors; sectorsize {}; {} kB total.",
407407
header.track + 1, header.Head + 1,
408408
fm ? "FM" : "MFM",
409409
Modulation_Speed, header.numSectors, sectorSize, (header.track+1) * trackSize / 1024);

lib/imagewriter/imdimagewriter.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <algorithm>
1111
#include <iostream>
1212
#include <fstream>
13+
#include <chrono>
14+
#include <ctime>
1315

1416
/*
1517
* Where to get the type of encoding FM or MFM? Now solved with options in proto config
@@ -168,14 +170,17 @@ class ImdImageWriter : public ImageWriter
168170

169171

170172
//Give the user a option to give a comment in the IMD file for archive purposes.
173+
auto start = std::chrono::system_clock::now();
174+
std::time_t time = std::chrono::system_clock::to_time_t(start);
175+
171176
std::string comment = _config.imd().comment();
172177
if (comment.size() == 0)
173178
{
174179
comment = LABEL ;
175180
comment.append(" date: ");
176-
comment.append(__DATE__);
177-
comment.append(" time: ");
178-
comment.append(__TIME__);
181+
comment.append(std::ctime(&time));
182+
// comment.append(" time: ");
183+
// comment.append(__TIME__);
179184
} else
180185
{
181186
comment.insert(0,"IMD ");

0 commit comments

Comments
 (0)