-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from MaslowCNC/Add-a-tag-for-cutlist
Add a tag for cutlist atom
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import Atom from '../prototypes/atom' | ||
import GlobalVariables from '../globalvariables.js' | ||
|
||
/** | ||
* This class creates the Add To Cutlist atom. | ||
*/ | ||
export default class CutList extends Atom{ | ||
|
||
/** | ||
* The constructor function. | ||
* @param {object} values An array of values passed in which will be assigned to the class as this.x | ||
*/ | ||
constructor(values){ | ||
super(values) | ||
|
||
this.addIO('input', 'geometry', this, 'geometry', '') | ||
this.addIO('output', 'geometry', this, 'geometry', '') | ||
|
||
/** | ||
* This atom's name | ||
* @type {string} | ||
*/ | ||
this.name = 'Add To Cutlist' | ||
/** | ||
* This atom's type | ||
* @type {string} | ||
*/ | ||
this.atomType = 'cutList' | ||
|
||
this.setValues(values) | ||
} | ||
|
||
/** | ||
* Add a tag to the input geometry. The substance is not changed. | ||
*/ | ||
updateValue(){ | ||
try{ | ||
const values = [this.findIOValue('geometry'), "cutList"+GlobalVariables.generateUniqueID()] | ||
this.basicThreadValueProcessing(values, "tag") | ||
}catch(err){this.setAlert(err)} | ||
super.updateValue() | ||
} | ||
} |
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