Skip to content

Commit

Permalink
fix: to-pgn (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurki authored and sbender9 committed Jan 3, 2020
1 parent 786c4d0 commit 6c5707a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bin/to-pgn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

const { toPgn, pgnToActisenseSerialFormat, pgnToiKonvertSerialFormat} = require('../index')
const { encodeActisense } = require('../lib/stringMsg')
const { toActisenseSerialFormat } = require('../lib/stringMsg')

var readline = require('readline')
var rl = readline.createInterface({
Expand All @@ -12,7 +12,7 @@ var rl = readline.createInterface({

var input = []
rl.on('line', function (line) {
var pgn = JSON.parse(line)
console.log(encodeActisense(pgn))
var msg = JSON.parse(line)
console.log(toActisenseSerialFormat(msg.pgn, toPgn(msg), msg.dst, msg.src))
//console.log(pgnToiKonvertSerialFormat(pgn))
})
2 changes: 1 addition & 1 deletion lib/toPgn.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function writeField(bs, pgn_number, field, data, value, bitLength) {
bitLength = field.BitLength
}

//console.log(`${field.Name} ${value} ${bitLength} ${field.Resolution}`)
// console.log(`${field.Name}:${value}(${bitLength}-${field.Resolution})`)
if ( _.isUndefined(value) ) {
if ( field.Type && fieldTypeWriters[field.Type] ) {
fieldTypeWriters[field.Type](pgn_number, field, value, bs)
Expand Down

0 comments on commit 6c5707a

Please sign in to comment.