Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Include knitout code in kcode comments #14

Open
ixchow opened this issue Nov 2, 2020 · 2 comments
Open

Feature: Include knitout code in kcode comments #14

ixchow opened this issue Nov 2, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@ixchow
Copy link
Member

ixchow commented Nov 2, 2020

For debugging, it would be useful to optionally include the original knitout code and/or line numbers as comments in the kcode file.

For example:

;!knitout-2
;;Machine: Kniterate
;;Gauge: 7
;;Carriers: 1 2 3 4 5 6
;;Position: Keep
in 2
knit + f1 2
knit + f3 2
knit + f5 2
knit - f4 2
knit - f2 2
knit + f1 2
knit + f2 2
knit + f3 2
knit + f4 2
knit + f5 2
out 2

Might transform into something like:

HOME
RACK:0
//
// 1: ;!knitout-2
// 2: ;;Machine: Kniterate
// 3: ;;Gauge: 7
// 4: ;;Carriers: 1 2 3 4 5 6
// 5: ;;Position: Keep
// 6: in 2
// 7: knit + f1 2
// 8: knit + f3 2
// 9: knit + f5 2
FRNT:..../..2.........-_-_-____2\____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________...............
STIF:5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
REAR:..../..2........._________2\____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________...............
STIR:5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
>> Kn-Kn 2 100 100
//
//
// 10: knit - f4 2
// 11: knit - f2 2
FRNT:.........../2...._-_-_____2\____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________...............
STIF:5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
REAR:.........../2...._________2\____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________...............
STIR:5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
<< Kn-Kn 2 100 100
//
//
// 12: knit + f1 2
// 13: knit + f2 2
// 14: knit + f3 2
// 15: knit + f4 2
// 16: knit + f5 2
FRNT:.........../2....-----____2\____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________...............
STIF:5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
REAR:.........../2...._________2\____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________...............
STIR:5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555
>> Kn-Kn 2 100 100
@ixchow ixchow added the enhancement New feature or request label Nov 2, 2020
@kausalyamahadevan
Copy link
Collaborator

It would also be nice to be able to add a line directly to kcode that's not a comment (without //). That would translate to a break in knitting and message on the kniterate screen and allow for on-machine debugging

@gabrielle-ohlson
Copy link
Collaborator

gabrielle-ohlson commented Feb 23, 2021

could be worth having two separate node commands—one for a development environment that runs a 'debugging' version of the program (includes corresponding knitout lines as comments above each kcode pass; maybe some other features too), and then a production one (aka the current status quo).

Could either:

  1. Use npm instead (so could have run command npm run debug [which would run node knitout-to-kcode.js && debug.js , with 'debug.js' being a separate file that contains only the additional debugging features] and npm run knitout-to-kcode.js [runs just node knitout-to-kcode.js] in package.json), or
  2. Stick with using just node and make two separate files (so run command node debug.js [copy & paste original file for debug.js + add additional functions to that one] and node knitout-to-kcode.js).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants