Introduction

This symbol library is for tubes. While tubes have been around for a very long time, they present some issues that other symbols do not. Many of the issues have to do with the one person draws their diagrams as opposed to another person. For example, some like to draw the whole device, including filaments, and then use references to describe their hookup. While other like to draw the filaments separately. Therefore, I allow for drawing the device with filaments, without filaments, or filaments only.

Each tube has an associated array, that is based on the tube number, with a "T" prepended. For example, a "6C4" has an array named "T6C4". This is necessary because Javascript does not like array names that start with a number. The first entry in the array (e.g. T6C4[0]) is the tube number (e.g. "6C4"). The next entry (e.g. T6C4[1]) is the Base reference. This entry is then used to point to a Base array. The array contains the device's pin number and function. For example the Base reference for the 6C4 is "Base_6BG". This reference points to an array that contains [ "1-NC", "2-NC", "3-H1", "4-H2", "5-P", "6-G", "7-K" ];. This identifies each pin and the function associated with that pin.

Development Notes

These are simply my development notes. It's just a way of keeping my thoughts in order, when developing a complicated piece of software. I will leave them in this document but comment them out so they can't be seen.

  • Each tube has an array with a "T" prepended to the Tube Type. e.g. "T6C4" || "T6L6" || ....
    var T6C4 = [ "6C4", "6BG", "7-Pin Miniature", ... ];
    • Entry [0] is the actual Tube Type.
    • Entry [1] is the Base Diagram. This entry serves two purposes:
      • The entry is used to steer the drawing routine to the correct Base Diagram.
        The Base Diagram is the functional picture of the tube showing the tube elements (e.g. Grid, Plate, etc..).
      • The entry, prepended with "Base_", is the name of the Base Pin Array.
        The Base Pin Array attaches a significance to each pin.
        var Base_6BG = [ "1-P", "2-NC", "3-H1", "4-H2", "5-P", "6-G", "7-K" ]; // 6C4
        The format for each pin is "Pin Number-Element". Element definitions are below.
        Element Definitions
        NC = No Connection K, K1, K2 = Cathode G, G1, G2, G3 = Grid H1, HCT, H2 = Filament (Heater)
        P = Plate (Single Section) P1, P2 = Plate (Multi-Section) G = Grid KG3 = Cathode/Grid 3
        Note: Elements can be associated with multiple pins. For example, the 6C4 has pins 1 and 5 connected to the plate (1-P and 5-P). These kind of associations will show up on the drawing as "1,5" next to the element connection.
    • Entry [2] is the Base Layout.
      The Base Layout is the physical base layout (e.g. 4-Pin, Octal, 7-Pin Miniature, etc.).
    • Entries, [3-N], have yet to be defined..
  • A tube drawing is instantiated through a call to the Tube() function.
    Tube( Dwg_Obj, RefDes, Name, Sect, Center_X, Center_Y );
    • Dwg_Obj - Drawing Object. This is defined in the main drawing routine and is passed to the other functions.
    • RefDes - Reference Designator (e.g. "V1", "V2", etc..).
    • Name - Name of the tube (e.g. "6C4", "6L6", etc..).
    • Sect - Section to draw (e.g. "Fil", "NoFil", "Fil_Only", etc..).
    • Center_X, Center_Y - Center of the drawing.
  • A call to the Tube() function returns the XY locations of each pin that has a valid element. The return comes in various forms that depend on how the Tube() function was called. For example:
    • "Lib_T_Sect" == "NoFil" - Returns the XY coordinates of each element connection point, without the filaments. For example:
      T6C4_Return = Tube( Dwg_Obj, "V1", "6C4", "Fil", Center_X, Center_Y );
      returns the XY corrdinates for Cathode (K), Grid (G), and Plate (P).
    • "Lib_T_Sect" == "Fil" - Returns the XY coordinates of each element connection point, including the filaments. For example:
      T6C4_Return = Tube( Dwg_Obj, "V1", "6C4", "Fil", Center_X, Center_Y );
      returns the XY corrdinates for Cathode (K), Grid (G), Plate (P), Heater 1 (H1), and Heater 2 (H2).
    • "Lib_T_Sect" == "Fil_Only" - Returns the XY coordinates of the filament connection points only.
    • "Lib_T_Rot" == ""R0" || "R90" || "R180" || "R270"" - Specifies the rotation angle from standard, counter clockwise. Only applys to tubes like rectifier tubes (e.g. 5U4).
  • Steps for adding a new tube. - There are two possibilities. One is, the tube and it's base diagram are new to the symbol function. The other is that the tube is new to the symbol function, but the base diagram already exists.
    1. The tube and it's base diagram are new to the symbol function.
      1. Creat a new array, in Tube.js, for the new tube. Preceed the tube name with a "T" (e.g. T6C4). The array must include the tube name [0], base diagram [1], and tube descriptor [2], as a minimum.
        var T6C4 = [ "6C4", "6BG", "7-Pin Miniature", ... ];
      2. Create a new array, in Tube.js, for the new tube base diagram. For this array, the base diagram reference is prepended with "Base_".
        var Base_6BG = [ "1-P", "2-NC", "3-H1", "4-H2", "5-P", "6-G", "7-K" ]; // 6C4
      3. Add a new entry in the Tube() function.
        else if (Dev_Name[1]=="6BG") { XY_Return = Draw_Base_6BG( Lib_T_Dwg_Obj, Lib_T_RefDes, Lib_T_Name, Lib_T_Sect, Lib_T_Rot, Lib_T_Center_X, Lib_T_Center_Y ); }
      4. Create a new function for drawing the new base diagram.
        function Draw_Base_6BG( Lib_T_Dwg_Obj, ... ) {
        // Draw Operations //
        XY_Return = [ Lib_T_Center_X-10, Lib_T_Center_Y-40.... ];
        return XY_Return; }
    2. The tube is new to the symbol function, but the base diagram already exists.
Tubes

Description: This function draws the specified logic device centered at point Lib_T_Center_X, Lib_T_Center_Y. Most logic devices contain multiple instances of a particular logic function, so the Device Section selector below will change dynamically based on which device is selected. Power and Ground connections are considered a separate Device Section.

Parameter Description Example
Lib_T_Dwg_Obj jsGraphics Object that points to the drawing.
V1
6C4
1,5
6
7
3
4
V1
6C4
1,5
6
7
3
4
Lib_T_RefDes Device Section ("V1", "V2", etc.) quoted string.
Lib_T_Name Device Name ("6C4", "6L6", etc.) quoted sting. OC = Open Collector.
Lib_T_Sect Device Section ("Fil", "NoFil", "Fil_Only") in quotes.
Lib_T_Rot Rotate the tube symbol Lib_S_Rot degrees, counter clockwise. Select Rotation Angle:
"R0" | "R90" | "R180" | "R270" ⇒
Lib_T_Center_X Symbol Center X Position Show/Hide Grid (10x10), Center Mark, Pins (green dot).
Grid
On
Off
Center
On
Off
Pins
On
Off
Lib_T_Start_Y Symbol Start Y Position

Return: The draw function will return, in an array, the X and Y points for each of the displayed pins. This can be different depending on how the device is specified. For example, the "6C4" can be specified with, or without, filaments. If the device was specified "without filaments", the function would return the X,Y points for all of the pins (cathode, grid(s), plate, etc..), but the filaments will not be included. If the device was specified "with filaments", the same X,Y points for the pins would be included, plus the filament pins would be appended to the end.

Return points are always ordered the same. First is the Cathode pin followed by one, or more Grid pins. That is finished off by the XY for the Plate pin.

XY_Return = [ Cathode_X, Cathode_Y, Grid_1_X, Grid_1_Y, Plate_X, Plate_Y ];

If the filaments are included with the body, the XY of each filament pin is appended to the XY_Return.

XY_Return = [ Cathode_X, Cathode_Y, Grid_1_X, Grid_1_Y, Plate_X, Plate_Y, Heater_1_X, Heater_1_Y, Heater_2_X, Heater_2_Y ];

For multi-section tubes, the actual return depends on how they are defined to display. Multi-section tubes can be displayed all together or separately. Plus, the filaments can be included in one or all of the sections.

Usage: The selections from the table above, are used to create the example below. After selecting and entering your specific information, the example can be used directly, with a copy/paste. The items in Red are the only ones that need to be adjusted to your specific needs. The lines in Green are just comments and can be deleted. Due to space limitations, some of the lines below may be split onto more than one line.

// Draw V1
// Declare and Set the center point.
var V1_Center_X = ??; var V1_Center_Y = ??;
// Declare the return variables.
var V1_K_X, V1_K_Y, V1_G_X, V1_G_Y, V1_P_X, V1_P_Y;
var V1_Fi1_X, V1_F1_Y, V1_F2_X, V1_F2_Y;
var V1_XY_Return = new Array();
// Draw the symbol.
V1_XY_Return = Tube( Dwg_Obj, "V1", "6C4", "Fil", "R0", V1_Center_X, V1_Center_Y );
// Extract the end points from the return array.
V1_P_X = V1_XY_Return[0]; V1_P_Y = V1_XY_Return[1];
V1_G_X = V1_XY_Return[2]; V1_G_Y = V1_XY_Return[3];
V1_K_X = V1_XY_Return[4]; V1_K_Y = V1_XY_Return[5];
V1_H1_X = V1_XY_Return[6]; V1_H1_Y = V1_XY_Return[7];
V1_H2_X = V1_XY_Return[8]; V1_H2_Y = V1_XY_Return[9];

  • Annotation - Pin Numbers, Reference Designator, Device and Technology are 11px.
  • Inversion Bubbles - 10 px diameter.
  • Open Collector Output - Diamond with underscore on body.
  • Buffers and Inverters - 50 px wide (Right facing -20, +30), 50 px wide (Left facing -30, +20)
  • Gates - 70 px wide (-30, +40)