toCabrillo = arr => {
const res = [''];
arr.map(row => {
if (row.type !== 'row') {
return;
}
const freq = (row.FREQ === '2400') ? ' 2.3G' : row.FREQ;
const mode = (row.MODE === 'SSB') ? 'PH' : row.MODE;
const date = row.QSO_DATE.slice(0,4) + '-' + row.QSO_DATE.slice(4,6) + '-' + row.QSO_DATE.slice(6,8);
const time = row.TIME_OFF;
const callSent = row.STATION_CALLSIGN.padEnd(13);
const rstSent = row.RST_SENT.slice(0,3);
const exchSent = row.RST_SENT.slice(3).padEnd(6);
const callRcvd = row.CALL.padEnd(13);
const rstRcvd = row.RST_RCVD.slice(0,3);
const exchRcvd = row.RST_RCVD.slice(3).padEnd(6);
return res.push(['QSO:', freq, mode, date, time, callSent, rstSent, exchSent, callRcvd, rstRcvd, exchRcvd].join(' '));
});
res.push('END-OF-LOG:')
res.push('000000000111111111122222222223333333333444444444455555555556666666666777777777788');
res.push('123456789012345678901234567890123456789012345678901234567890123456789012345678901');
res.push('')
return res.join('\n');
}