Like port and starboard, copied from the maritime world where;
One bar: second mate/third engineer
Two bars: first officer/second engineer
Three bars: chief mate/first engineer
Four bars: captain/chief engineer
To distinguish between deck and engine officers, one had a command diamond, the other a propeller. Electricians, radio operators and pursers had their own system with silver bars.
The system was pretty universal, when a pilot entered a ship he immediately knew who was who.
Per