This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
//uint8_t data9209[] = {0x7B, 0x04, 0x00, 0x00, 0x02, 0x00, 0x09, 0x92, 0x2D, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x50, 0x02, 0x00, 0x01, 0x01, 0x02, 0x10, 0x02, 0x05, 0x00, 0x02, 0x03, 0x04, 0x10, 0x13, 0x05, 0x50, 0x04, 0x00, 0x01, 0x01, 0x02, 0x00, 0x04, 0x00, 0x02, 0x0F, 0x00, 0x02, 0x00, 0x04, 0x00, 0x11, 0x80, 0x10, 0x80, 0x06, 0x00, 0x01, 0x80, 0x02, 0x80, 0x03, 0x80, 0x04, 0x80, 0x07, 0x00, 0x30, 0x80, 0x12, 0x80, 0x20, 0x80, 0x21, 0x80, 0x22, 0x80, 0x07, 0x50, 0x04, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0x0A, 0x50, 0x04, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x08, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x80, 0x05, 0x80, 0x08, 0x80, 0x06, 0x80, 0x07, 0x80, 0x0B, 0x50, 0x04, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x00, 0x01, 0x00, 0x02, 0x80, 0x0C, 0x50, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x0A, 0x00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fixUpverterFile(filename) { | |
try { | |
var upverterDoc = JSON.parse(fs.readFileSync(filename).toString()); | |
var grid = 10; | |
var changes = fixUpverterSchematicGrid(upverterDoc, grid); | |
var newName = filename.replace(".upv", "") + "-fixed.upv"; | |
return { | |
success: changes !== false, | |
newName: newName, | |
fileContents: JSON.stringify(upverterDoc) |