HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
2 stars 0 forks source link

Add transformations to the macro language #244

Open EvanKirshenbaum opened 5 months ago

EvanKirshenbaum commented 5 months ago

When writing macros that take wells as parameters, I've been finding myself repeatedly writing ugly code that references w.exit dir and (on Wombat) an ad hoc safe_direction(w) (down for odd numbered wells, up for even numbered wells).

It would be useful if we could have (as a value) a transformation that essentially put the well's exit pad at (0,0), made the exit direction east, and the safe direction north. That is, be able to pretend that all wells are like well #4. Then you could say

transformation t = // something based on w
using t { ... }

And have all code (statically) within the block take all coordinate expressions and 'row'/'col' attributes based on that transformation.

For specifying the transformation you'd have to be able to specify