You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each sim class should have three parameter options to create objects:
a real hardware object
a port/index/channel number
a native handle (maybe not expose this?)
SimDeviceSim is a bit different since (1) doesn't make much sense, and (2) uses a string key.
Other than ensuring that everything has all three, we also need to standardize what is a constructor and what is a factory method.
Currently, we have some of each.
I'm of the opinion that everything should be constructors. @PeterJohnson -what about you?
We can't always use constructors because we can't always discriminate on type. Take a look at DutyCycleSim for example. We want to be able to construct it from:
a DutyCycle object
a DigitalInput channel number
a DutyCycle FPGA index number
The last two are both integers, so we use factory functions for those, but a constructor for the first one.
In many other places we don't have this confusion (e.g. AnalogInputSim) so we just use constructors rather than forcing the use of factory functions.
Each sim class should have three parameter options to create objects:
SimDeviceSim
is a bit different since (1) doesn't make much sense, and (2) uses a string key.Other than ensuring that everything has all three, we also need to standardize what is a constructor and what is a factory method.
Currently, we have some of each.
I'm of the opinion that everything should be constructors. @PeterJohnson -what about you?
Having this consistent will really help wpilibsuite/frc-docs#1077.
The text was updated successfully, but these errors were encountered: