Skip to content

MKOB internal structure

Ed Silky edited this page Dec 12, 2020 · 3 revisions

MKOB internal structure

Here's a block diagram showing the functional structure of the MKOB program.

MKOB block diagram

Functions

The boxes in the block diagram represent the major functions of the program. For the most part they correspond to physical items in the real world.

  • The key and sounder: This box represents the interface to a external key and sounder. In addition, the 'sounder' can refer to the simulated sounder provided by the computer's audio. The functionality of this box is provided by the pykob.kob module. MKOB uses a configuration option to work with either a loop interface (a KOB) or a sounder driver interface (separate key & sounder).
  • The internet: This can be thought of as representing the jack box and plug board in a telegraph office, used to select which of several telegraph wires the local key and sounder are connected to. This functionality is provided by the pykob.internet module.
  • The code reader: In a way, this function corresponds to the operator's mill (typewriter). It provides a record of transmissions sent and received, either locally or over the wire. The Reader class in the pykob.morse module provides this function.
  • The keyboard sender: This is an aid for use by an operator who either isn't proficient at Morse or doesn't have a key available. It can also be used to send canned text from a computer file. In its operation it's analogous to the keyboard of a Teletype system. The Sender class in the pykob.morse module handles the conversion of text to Morse.
  • The station list: This box doesn't have a counterpart in the real world, but it's an important feature of the MKOB program nonetheless. It provides visibility of which other operators are connected to the same wire, and it facilitates turn taking when multiple operators are participating in a net. This function is provided by the kobstationlist module.
  • The "local loop": Finally, we come to the kobmain module, which handles the gory details of integrating the other functions. This module can be thought of as corresponding to a telegraph office's local loop, which essentially does the same thing. The 'local loop' is basically the program's gatekeeper, overseeing the interaction of all the other components.

Data flow

The solid lines of the block diagram represent the flow of code sequences as they move through the program. The dashed lines depict information flow other than Morse, specifically information about the status of station IDs for updating the station list display.

If the last element of a code sequence has the special value +1, then the circuit (for that component, at least) is to be left closed. Three variables are used to keep track of the state of their respective components: kob_latched, keyboard_latched, and internet_latched. If one of these variables is True, then that means its component is latched in a closed condition.

Two other state variables enter into the picture. One is connected, which is toggled whenever the user clicks on the Connect button. The other is circuit_closer, which reflects whether the virtual switch across the external key is closed or not.

Now let's review the basic principles of operation:

  • Anything heard on the sounder needs to be processed by the code reader...and nothing else.
  • The key can send only if the keyboard is latched, and vice versa.
  • The key and keyboard can send to the sounder only if the internet is latched. However, they must send to the internet even if the internet is unlatched. This is so a remote station can know the state of the local system, even if the remote station's key is open.
  • When the user disconnects from the internet or changes wire numbers, the internet needs to be latched if it isn't already. If this is a new latching, then the sounder and code reader need to be notified.

While this may seem simple enough, it gets more complicated because parallel threads are running. For example, the callback functions in pykob.internet and pykob.morse may still issue a few characters even after the user has disconnected from the internet. This requires extra attention to guard against unwanted side-effects.

Clone this wiki locally