Need Help. How to pull all this data together??

C

clut

I am currently creating a tool for a company that builds power stations. The
tool simply allows users to select which equipment will be included in the
order, and then gives a price.

There are 3 levels of equipment used in building a power station:

Level 1: Equipment.
- this is large equipment, such as a high voltage switchboard, or a Gas
Train.

Level 2: Components
- Some equipment can be taken as is. (for example, a gas train is simply a
gas train.) Other equipment, such as the high voltage switchboard is made up
from smaller components. (such as a circuit breaker and a current transformer)

Level 3: Sub-Components
- some components are again made up from smaller 'sub-components'. for
example, the circuit breaker component is made up from a generator incomer, a
fuse feeder and a bus section.


When building an order, the tool allows the users to select which equipment,
components and sub-components to include.
This builds a structure to the order. The next step is to actually select
the physical hardware to be used. (for example, the gas train to be used may
be part number 'GS443-P1'. this gas train has specifications and is a
physical entity, so this physical entitiy is linked with the 'Gas Train'
hardware on the order.

The problem I have is outputting all this information.
the structure of the database is as follows

Table : equipment_list (pk_equip_id, equip_name)
Table : component_list (pk_comp_id, comp_name)
Table : subcomponent_list (pk_subcomp_id, subcomp_name, fk_subcomp_parent)


The equipment and components are linked with a join table, (pk_join,
fk_equip, fk_comp) (not real field names) to identify which components are
used to build which equipment

The subcomponents are linked to a parent component via a field in the
subcomponents table the indicates the parent (i.e. pk_comp_id in
components_list)


various items from these 3 categories are selected by the user and entered
onto a buildsheet, which is basically the electronic order.

the buildsheet contains :

pk_buildentry_id
parent_element_type (this is 1, 2 or 3, depending on equip, comp, or subcomp)
fk_parent_element (the actual ID of the equip, comp or subcomp)

so the buildsheet contains a list of all equipment, components and
sub-components to be incuded in the order.


So each entry in the buildsheet contains an entry on the order which may or
may not require a physical piece of equipment matched up to it.

Power Station
- High Voltage Swtichboard
- - Circuit Breaker
- - - Generator Incomer
- - - Fuse Feeder
- - - Bus Section

so in the above order, the 3 last items would need a physical piece of
hardware attached to them, so the report would look like

Power Station
- High Voltage Swtichboard
- - Circuit Breaker
- - - Generator Incomer
- - - - SELECTED HARDWARE
- - - Fuse Feeder
- - - - SELECTED HARDWARE
- - - Bus Section
- - - - SELECTED HARDWARE

To complicate matters, you could select more than one peice of hardware for
any element : e.g.

Power Station
- High Voltage Swtichboard
- - Circuit Breaker
- - - Generator Incomer
- - - - SELECTED HARDWARE
- - - Fuse Feeder
- - - - SELECTED HARDWARE
- - - - SELECTED HARDWARE
- - - - SELECTED HARDWARE
- - - - SELECTED HARDWARE
- - - Bus Section
- - - - SELECTED HARDWARE

That is a very simply order. To we can add a few bits of equipment to give
the order more substance:

Power Station
- High Voltage Swtichboard
- - Circuit Breaker
- - - Generator Incomer
- - - Fuse Feeder
- - - Bus Section
- Gas Train
- Low Voltage Switchboard
- - Incomer/Feeder

and it's not just the 'level 3' items that could have hardware selected...

Power Station
- High Voltage Swtichboard
- - Circuit Breaker
- - - Generator Incomer
- - - - SELECTED HARDWARE
- - - Fuse Feeder
- - - - SELECTED HARDWARE
- - - - SELECTED HARDWARE
- - - - SELECTED HARDWARE
- - - Bus Section
- - - - SELECTED HARDWARE
- Gas Train
- - SELECTED HARDWARE
- Low Voltage Switchboard
- - Incomer/Feeder
- - - SELECTED HARDWARE
- - - SELECTED HARDWARE



Basically, I'm looking to output a list of 3 different groups of equipment,
and any of the entries at any level in that list could have 'detail' added to
them.


I now it's a tall order, but is there a standard way of outputting this kind
of structure?

any help is greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top