HPInc / HP-Digital-Microfluidics

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

Add coordinates and regions to the macro language #243

Open EvanKirshenbaum opened 5 months ago

EvanKirshenbaum commented 5 months ago

Currently, if you say (x, y), the system takes this to refer to the pad at that coordinate.

There are situations such as reservations (#242) in which it would be useful to be able to talk about the coordinates themselves, so that you can do arithmetic on them (e.g., p + (1, 3)). To handle this, we can add a new coord type and have coordinate pairs return this value. If we do this, we probably want pads and coordinates to be freely interconvertable.

Also, for reservations, it would be useful to be able to talk about regions of pads/coordinates by specifying two corners or one corner and two extents. The obvious syntax for the first would be p1 to p2, but that would cause problems for repeat with expressions. So probably p1 ... p2. (Or maybe through.) Or possibly with a prefixed region, e.g., region p1 through p2.

For the other forms, maybe stretched? p1 stretched 2 left, 3 up, p1 stretched (-2, 3)

Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 11, 2023 at 12:06 PM PST.
EvanKirshenbaum commented 5 months ago

It dawns on me that while a pad should implicitly convert to a coord, a coord should implicitly convert to a maybe pad, not a pad, to allow for coords that refer off the board or to dead pads. That would allow c exists or c is missing to test whether the pad actually exists.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 16, 2023 at 10:28 AM PST.