Table of Contents
1. Overview
PartDB is a database system designed to track physical parts, their locations, connections, and properties in large-scale experiments. Think of it as an inventory system that also tracks how parts are connected together.
The system was designed for the ETpathfinder project but can be used for any application that needs to track:
- Physical equipment and components
- Where things are located (hierarchical locations)
- How things are connected (e.g., cables to devices)
- Properties of parts (serial numbers, specifications, etc.)
2. Core Concepts
Types vs. Parts
The most important distinction in PartDB is between Types and Parts:
- Type = Blueprint or specification (e.g., "iPhone 15" or "BNC Cable")
- Part = Physical instance (e.g., "My iPhone" or "Cable_001")
| Concept | Description | Example |
|---|---|---|
| Type | A category or specification | Cable, Amplifier, BNC Connector |
| Part | An actual physical object | Cable_001, Amplifier_A, Device_042 |
| Subpart | A component of a type/part | Cable.connectorA, Device.input1 |
| Attribute | A property or characteristic | serial_number, weight, color |
| Connection | Links between parts | Cable_001 connected to Amp_A |
Dotted Notation
PartDB uses a simple "dot" notation to refer to parts and their subparts, similar to how you navigate folders on a computer:
Amplifier_001- A part named "Amplifier_001"Cable_BNC_001.connectorA- The "connectorA" subpart of cable "Cable_BNC_001"Device_042.input2.pin3- Pin 3 of input 2 on Device_042
3. Working with Types
Types are the building blocks of PartDB. Before you can add any parts, you need to define their types.
Creating a Type
- Go to the Types page
- Enter a name for your type (e.g., "Amplifier", "Cable", "BNC")
- Click "Add Type"
Amplifier, BNC_Cable, Device_Type1
Adding Subparts to Types
Subparts define the components that make up a type. For example, a Cable type might have two connectors as subparts.
- Create a type called "BNC" (for the connector)
- Create a type called "Cable"
- On the Cable type page, add two subparts:
- Subpart name: "connectorA", Type: "BNC"
- Subpart name: "connectorB", Type: "BNC"
4. Working with Parts
Parts are physical instances of types. Once you've created types, you can add actual parts.
Creating a Part
- Go to the Parts page
- Select the type of part you want to create
- Enter a unique name for the part
- Click "Add Part"
If you created a "Cable" type earlier, you can now create specific cables:
- Part name: "Cable_BNC_001", Type: "Cable"
- Part name: "Cable_BNC_002", Type: "Cable"
Location Hierarchy
Parts can be located inside other parts, creating a hierarchy. This is useful for organizing equipment in buildings, rooms, racks, etc.
Building (MainLab)
└─ Room (Lab_A)
└─ Rack (Rack_001)
└─ Shelf (TopShelf)
└─ Device (Amplifier_001)
5. Understanding Subparts
Subparts are the most powerful (and potentially confusing) feature of PartDB. Here's what you need to know:
The Key Insight: Virtual Subparts
When you add subparts to a type, all parts of that type automatically have those subparts. You don't need to create them individually!
If your "Cable" type has subparts "connectorA" and "connectorB", then:
- Cable_BNC_001 automatically has Cable_BNC_001.connectorA and Cable_BNC_001.connectorB
- Cable_BNC_002 automatically has Cable_BNC_002.connectorA and Cable_BNC_002.connectorB
- Every cable you create will have these subparts!
Nested Subparts (Two Levels)
Subparts can have their own subparts, allowing up to 2 levels of nesting:
- Create type "Pin"
- Create type "BNC" with subparts:
- "center" (type: Pin)
- "shield" (type: Pin)
- Create type "Device" with subparts:
- "input1" (type: BNC)
- "output1" (type: BNC)
Now when you create Device_A, you can reference:
Device_A.input1(the input connector)Device_A.input1.center(the center pin of the input)Device_A.output1.shield(the shield pin of the output)
6. Making Connections
Connections represent physical links between parts, like plugging a cable into a device.
Connection Examples
- Cable_001.connectorA ↔ Amplifier_001.input1
- Cable_001.connectorB ↔ DAQ_Main.channel1
You can view all connections on the Connections page.
7. Adding Attributes
Attributes are custom properties you can attach to any part, type, or subpart. Examples include serial numbers, specifications, or any other metadata.
Adding an Attribute to a Part
- Go to the part's detail page
- Scroll to the "Add Attribute" section
- Enter the attribute name (e.g., "serial_number")
- Enter the value (e.g., "SN-12345")
- Select the type (String, Integer, or Float)
- Click "Add"
| Attribute | Type | Example Value |
|---|---|---|
| serial_number | String | SN-2024-001 |
| weight_kg | Float | 2.5 |
| gain | Integer | 100 |
| ip_address | String | 192.168.1.100 |
| manufacturer | String | Generic Corp |
8. Searching the Database
The Search page is one of the most powerful features. You can search for any part or subpart using dotted notation.
How to Search
- Go to the Search page
- Enter a dotted name (e.g., "Cable_BNC_001.connectorA")
- Click "Search"
The search results will show:
- Object information
- What it's connected to (if anything)
- All attributes
Amplifier_001- Find a specific partCable_BNC_001.connectorA- Find a subpartDevice_042.input2.center- Find a nested subpartCable- Search for a type definition
9. Practical Examples
Example 1: Setting Up a Lab with Cables
Step 1: Create Types
- Type: "Pin"
- Type: "BNC" with subparts: center (Pin), shield (Pin)
- Type: "Cable" with subparts: connectorA (BNC), connectorB (BNC)
- Type: "Amplifier" with subparts: input1 (BNC), output1 (BNC)
- Type: "DAQ" with subparts: chan1 (BNC), chan2 (BNC), chan3 (BNC)
Step 2: Create Parts
- Amplifier_001 (type: Amplifier)
- Amplifier_002 (type: Amplifier)
- DAQ_Main (type: DAQ)
- Cable_BNC_001 (type: Cable)
- Cable_BNC_002 (type: Cable)
Step 3: Add Attributes
- Amplifier_001: serial_number = "AMP-2024-001", gain = 100
- Cable_BNC_001: length_m = 5.0, color = "black"
Step 4: Create Connections
- Cable_BNC_001.connectorA ↔ Amplifier_001.output1
- Cable_BNC_001.connectorB ↔ DAQ_Main.chan1
Example 2: Location Hierarchy for Equipment
Step 1: Create Location Types
- Type: "Building"
- Type: "Room"
- Type: "Rack"
- Type: "Shelf"
Step 2: Create Location Parts
- MainLab (type: Building)
- LabA (type: Room, location: MainLab)
- Rack001 (type: Rack, location: LabA)
- TopShelf (type: Shelf, location: Rack001)
Step 3: Place Equipment
- Amplifier_001 (location: TopShelf)
- DAQ_Main (location: Rack001)
Tips and Best Practices
- Plan your types first: Think about the structure before adding parts
- Use consistent naming: Choose a naming convention (e.g., Cable_BNC_001, Cable_BNC_002)
- Add attributes liberally: Any useful information can be stored as an attribute
- Use the search function: It's the fastest way to find and navigate parts
- Keep location hierarchies simple: Usually 2-3 levels is enough