metalizzsas / NusterKit

Nuster — Automate with JSON
1 stars 0 forks source link

PBR refactoring #159

Closed Kworz closed 1 year ago

Kworz commented 1 year ago

PBR Syntax is way too complex for what we want to do with it. This block is simply for writing IOGate ventilation to 1.

{
   "name": "io",
   "params": [
      {
         "name": "conststr",
         "value": "ventilation"
      },
      {
         "name": "const",
         "value": 1
      }
   ]
}

and could be replaced by this

{
  "io": [
    {"conststr": "ventilation"},
    {"const": 1}
  ]
} 

This improves readability & saving space

Kworz commented 1 year ago

We can even go deeper by removing const & conststr to be replaced by number & string

Kworz commented 1 year ago

The ProgramBlock registry and ParameterBlocks registry should give the pbr instance to blocks that needs it

https://github.com/metalizzsas/NusterKit/blob/2830ac6da5628cdc5df1cbfea0e21213382073e0/packages/turbine/src/pbr/ProgramBlocks/ProgramBlockRegistry.ts#L32-L52

Kworz commented 1 year ago

Estimated run time should be computed from blocks