Skip to content

Commit

Permalink
OFFN, LIMS parse without values
Browse files Browse the repository at this point in the history
  • Loading branch information
staniska committed Nov 13, 2020
1 parent ff5ee04 commit 0b9bafb
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions lib/interpretator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {replacements} from "./replacements";
import {insertRnd, insertChr} from './element-insert';
import stringParse from './stringParse';


const myMath = new sinumerikMath();

export function progParser(lastLineNum) {
Expand Down Expand Up @@ -237,6 +236,7 @@ function parseDataClear(programName) {
}

function parseRows(programText, programName, variables) {

console.log('parseRows for ' + programName);
// console.log(programText);

Expand Down Expand Up @@ -325,7 +325,9 @@ function parseRows(programText, programName, variables) {

var primitives = generatePrimitives(rowText, programName, row);


if (primitives) {

for (let i = 0; i < primitives.length; i++) {

for (var iter in primitives[i].operators) {
Expand Down Expand Up @@ -1423,7 +1425,7 @@ function generateCanvasPrimitives(primitives, programName, row) {
var elements = insertChr(View.sinumerikView.parseData.prevMove[0], canvasElement, programName);
if (View.sinumerikView.parseData.prevMove[0].type == 'G1') {
View.sinumerikView.parseData.prevMove[0].toolRadiusCompensation = View.sinumerikView.parseData.toolRadiusCompensation;
View.sinumerikView.parseData.canvas.push(View.sinumerikView.parseData.prevMove[0]);
// View.sinumerikView.parseData.canvas.push(View.sinumerikView.parseData.prevMove[0]);
}
View.sinumerikView.parseData.prevMove.shift();
}
Expand Down Expand Up @@ -2173,6 +2175,27 @@ function generatePrimitives(rowText, programName, progRowNum) {
}
//endregion

//region OFFN
regEx = /(?<!\w)OFFN(?!\w)/;
if (regEx.exec(programRow)) {
primitives[0].operators[0] = {};
primitives[0].operators[0].type = 'OFFN';
console.log('OFFN');
return primitives;
}
//endregion

//region LIMS
regEx = /(?<!\w)LIMS(?!\w)/;
if (regEx.exec(programRow)) {
primitives[0].operators[0] = {};
primitives[0].operators[0].type = 'LIMS';
console.log('LIMS');
return primitives;
}
//endregion


for (let i = 0; i < splitRow.length; i ++) {
primitives[0].operators[i] = {};

Expand Down

0 comments on commit 0b9bafb

Please sign in to comment.