Replace all the ifdef debugging spaghetti with a single ifdef and a macro so that it is easier to read the flow of the code.
Replace all the ifdef debugging spaghetti with a single ifdef and
a macro so that it is easier to read the flow of the code.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase