Integrated Circuit Component

A component that performs a function when given an input
Can be attached to an integrated circuitboard, where it can then be connected between other components to provide an output or to receive an input. This is the base type of all components
Vars | |
circuit_flags | The flags of the circuit to control basic generalised behaviour. |
---|---|
current_option | The current selected option |
display_desc | The description of the component shown on the UI |
display_name | The name of the component shown on the UI |
input_ports | A list that contains the components the input ports on this component Used to connect between the ports |
options | The options that this component can take on. Limited to strings |
output_ports | A list that contains the outpurt ports on this component Used to connect between the ports |
parent | The integrated_circuit that this component is attached to. |
power_usage_per_input | The power usage whenever this component receives an input |
rel_x | Used to determine the x position of the component within the UI |
rel_y | Used to determine the y position of the component within the UI |
trigger_input | Generic trigger input for triggering this component |
Procs | |
add_input_port | Adds an input port and returns it |
add_output_port | Adds an output port and returns it |
add_to | Called when this component is about to be added to an integrated_circuit. |
create_table_notices | Creates a table UI notice entry to be used in get_ui_notices() |
create_ui_notice | Creates a UI notice entry to be used in get_ui_notices() |
disconnect | Disconnects a component from other components |
get_ui_notices | Gets the UI notices to be displayed on the CircuitInfo panel. |
input_received | Called whenever an input is received from one of the ports. |
load_data_from_list | Loads data from a list |
populate_options | Called when the options variable should be set. |
register_shell | Called when a shell is registered from the component/the component is added to a circuit. |
remove_input_port | Removes an input port and deletes it. This will not cleanup any references made by derivatives of the circuit component |
remove_output_port | Removes an output port and deletes it. This will not cleanup any references made by derivatives of the circuit component |
removed_from | Called when this component is removed from an integrated_circuit. |
save_data_to_list | Saves data to a list. Shouldn't be used unless you are quite literally saving the data of a component to a list. Input value is the list to save the data to |
set_option | Sets the option on this component |
unregister_shell | Called when a shell is unregistered from the component/the component is removed from a circuit. |
Var Details
circuit_flags

The flags of the circuit to control basic generalised behaviour.
current_option

The current selected option
display_desc

The description of the component shown on the UI
display_name

The name of the component shown on the UI
input_ports

A list that contains the components the input ports on this component Used to connect between the ports
options

The options that this component can take on. Limited to strings
output_ports

A list that contains the outpurt ports on this component Used to connect between the ports
parent

The integrated_circuit that this component is attached to.
power_usage_per_input

The power usage whenever this component receives an input
rel_x

Used to determine the x position of the component within the UI
rel_y

Used to determine the y position of the component within the UI
trigger_input

Generic trigger input for triggering this component
Proc Details
add_input_port
Adds an input port and returns it
Arguments:
- name - The name of the input port
- type - The datatype it handles
- trigger - Whether this input port triggers an update on the component when updated.
add_output_port
Adds an output port and returns it
Arguments:
- name - The name of the output port
- type - The datatype it handles.
add_to
Called when this component is about to be added to an integrated_circuit.
create_table_notices
Creates a table UI notice entry to be used in get_ui_notices()
Returns a list that can then be added to the return list in get_ui_notices() Used by components to list their available columns. Recommended to use at the end of get_ui_notices()
create_ui_notice
Creates a UI notice entry to be used in get_ui_notices()
Returns a list that can then be added to the return list in get_ui_notices()
disconnect
Disconnects a component from other components
Disconnects both the input and output ports of the component
get_ui_notices
Gets the UI notices to be displayed on the CircuitInfo panel.
Returns a list of buttons in the following format list( "icon" = ICON(string) "content" = CONTENT(string) "color" = COLOR(string, not a hex) )
input_received
Called whenever an input is received from one of the ports.
Return value indicates that the circuit should not do anything. Also prevents an output signal. Arguments:
- port - Can be null. The port that sent the input
load_data_from_list
Loads data from a list
populate_options
Called when the options variable should be set.
register_shell
Called when a shell is registered from the component/the component is added to a circuit.
Register all signals here on the shell. Arguments:
- shell - Shell being registered
remove_input_port
Removes an input port and deletes it. This will not cleanup any references made by derivatives of the circuit component
Arguments:
- input_port - The input port to remove.
remove_output_port
Removes an output port and deletes it. This will not cleanup any references made by derivatives of the circuit component
Arguments:
- output_port - The output port to remove.
removed_from
Called when this component is removed from an integrated_circuit.
save_data_to_list
Saves data to a list. Shouldn't be used unless you are quite literally saving the data of a component to a list. Input value is the list to save the data to
set_option
Sets the option on this component
Can only be a value from the options variable Arguments:
- option - The option that has been switched to.
unregister_shell
Called when a shell is unregistered from the component/the component is removed from a circuit.
Unregister all signals here on the shell. Arguments:
- shell - Shell being unregistered