/// <summary> /// Primenjuje sva modify podesavanja /// </summary> /// <param name="line">Linija NC koda</param> /// <param name="doLog">Da li vraca beleske</param> /// <returns>Beleske - ako je doLog=False onda je empty string</returns> public String applyToLine(ncLine line, Boolean doLog) { String debug = ""; if (doLog) { debug = debug.log("Before: " + line.ToString()); } foreach (ncParamModify pm in this) { //var ncp = line.getParamByKeyOrIndex(pm.parameterTarget); //if (ncp == null) //{ // //line.addToken(pm. // //if (pm.doAddOnMissing) // //{ // // ncp = new ncParam(); // // ncp.format = pm.modificationValue.getFormatFromExample(2); // // ncp.decValue = 0; // // if (pm.parIndex > -1) // // { // // ncp.index = pm.parIndex; // // line.addParam(ncp, pm.parIndex); // // } else // // { // // ncp.key = pm.parameterTarget; // // line.parameters.addParam(ncp); // // } // //} //} else //{ // ncp.modify(pm.modificationType, pm.modificationValue); // if (pm.doEnforceFormat) // { // ncp.setFormat(pm.modificationValue.getFormatFromExample(0)); // } //} //if (ncp == null) //{ // if (doLog) debug = debug.log("Line parameter not found [" + pm.parameterTarget+"]"); // break; //} } if (doLog) { debug = debug.log("After: " + line.ToString()); } return(debug); }
/// <summary> /// Konvertuje string linije u ncLine objekte /// </summary> /// <returns></returns> public override bool afterLoad() { ncLines = new ncLineCollection(); lineFlagCount.reset(); foreach (String line in lines) { var ln = new ncLine(line, ncLines); lineFlagCount.count(ln.flag); ncLines.Add(ln); } return(ncLines.Any()); }