Skip to content

Commit

Permalink
update on waterjet .sta file
Browse files Browse the repository at this point in the history
  • Loading branch information
pan261 committed Sep 21, 2021
1 parent dd3f8c9 commit d49eec0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Flow_Waterjet_BIDC/Bechtel Waterjet.cps
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,22 @@ var forceOutput = false;
}

var numberFull = sign + exp + mantissa;
return parseInt(numberFull, 2).toString(16);

var hex = parseInt(numberFull, 2).toString(16).split('');
return (hex[6] + hex[7]) + (hex[4] + hex[5]) + (hex[2] + hex[3]) + (hex[0] + hex[1]);
}

/**
* (IN PROGRESS) Write machine config to .sta file
*/
function writeSta() {
try {
var file = new TextFile("C:\\Users\\" + getGlobalParameter("username") + "\\AppData\\Local\\Fusion 360 CAM\\nc\\hello.txt", true, "utf-8");
var file = new TextFile("C:\\Users\\" + getGlobalParameter("username") + "\\AppData\\Local\\Fusion 360 CAM\\nc\\" + programName + ".sta", true, "utf-8");
var float = 9.94;
file.writeln(ToHex(6.0));
var data = BinaryFile.loadBinary("C:\\Users\\kpan8\\Downloads\\stazip\\ld6.sta");
var hex = toHex(6.0);
data = String.fromCharCode(hex[0] + hex[1]) + String.fromCharCode(hex[2] + hex[3]) + String.fromCharCode(hex[4] + hex[5]) + String.fromCharCode(hex[6] + hex[7]);
file.writeln(data);
file.close();
Expand Down

0 comments on commit d49eec0

Please sign in to comment.