2.0.0 Workers Standard - lokokung/Starburst-Front-End-Control-System GitHub Wiki

Standards for Workers

As mentioned in 1.0.0 Getting Started, the standard for each implementation of IWorker is to have blocks for private worker-specific methods, command routines, function map, stateframe querying helper methods, public worker-specific methods, and finally the IWorker method implementations. Each command routine should be private with a name corresponding to ACC command that it handles. These functions should never be called independently and should always be called through the function map in the execute(acc_command) function. Each different ACC command should have its own command routine in order to make maintenance easy and effective. The function map should map each command to their corresponding function and styled clearly so that readers can easily add or remove mappings as necessary.

Each worker should have a field upon being instantiated that contains the list of commands that it is responsible for simply for documentation and clarity reasons. Similarly, each worker should override the self.name field in the constructor in order to allow for differentiation of the workers. The general format for the name should follow the format "{hardware-name}-Worker" i.e. "PDU-Worker".