Open Computers support and control - Lach01298/QMD GitHub Wiki
OpenComputers can be used to read information from, and control accelerators. To connect a computer with an accelerator, you need to place the Accelerator Computer Port
block into the casing of the accelerator. All methods are component methods, and can be accessed via component.qmd_accelerator
. Try them out in the Lua interpreter! Below you can find a list of all the methods, their syntax, and what do they return.
- getBeamInfo()
Returns Table with (beam_length, beam_radius). Returns information about the beamline in the accelerator.
- getBeamPortMode(int x, int y, int z)
Returns string. Returns the mode of the beam port at (x,y,z). Returns invalid
if the position doesn't have a beam port, otherwise returns input
, output
or disabled
.
- getBeamPortSwitchMode(int x, int y, int z)
Returns String. Returns to what mode will the beam port at (x,y,z) will switch to when it is asked to switch modes. Returns invalid
if position doesn't have a beam port, otherwise returns either input
or output
.
- getCoolingInfo()
Returns Table with (cooling_fluid, cooling, max_coolant_in, max_coolant_out). Returns information about the cooling. The coolant name, cooling H/t and the maximum coolant in and out.
- getEnergyInfo()
Returns Table with (energy_required, energy_stored, energy_capacity, energy_efficiency). The statistics returned are the RF/t the accelerator uses, the RF currently stored, the maximum RF that can be stored, and the energy efficiency of the accelerator.
- getEnergyPercentage()
Returns Number. Returns the energyPercentage setting.
- getHeatBufferInfo()
Returns Table with (stored_heat, heat_capacity). Returns information about the heat buffer, the heat currently stored and the maximum heat that can be stored.
- getHeatingInfo()
Returns Table with (internal_heating, external_heating, max_external_heating, ambient_temperature). Returns information about the Heating. The heating from accelerator components, the heating from the environment, the maximum heating from the environment and the ambient environment temperature.
- getInputParticleInfo()
Returns Table with (type, amount, energy, focus). Returns input particle stack parameters. The name of the type of particles, the pu/t of the particles, the energy of the particles in keV and the focus of the particle. Note: this is the particles inputted to the accelerator.
- getIonSourceInfo()
Returns Table with (source_item, particle_type, amount, energy, focus). Returns information about the ion source. The name of the source item, the name of the particle the item produces, the pu/t it makes, the initial energy of the particles, the initial focus of the particle.
- getNumberOfDipole()
Returns Number. Returns the number of dipole magnets in the accelerator.
- getNumberOfRfCavity()
Returns Number. Returns the number of RF cavities in the accelerator.
- getNumberOfQuadrupole()
Returns Number. Returns the number of quadrupole magnets in the accelerator.
- getOutputParticleInfo()
Returns Table with (type, amount, energy, focus). Returns output particle stack parameters. The name of the type of particles, the pu/t of the particles, the energy of the particles in keV and the focus of the particle. Note: this is the particles outputted from the accelerator, as seen in the accelerator's GUI.
- getParticleInfo()
Returns Table with (type, mass, energy, charge, spin, interacts_with_em, interacts_with_weak, interacts_with_strong). Returns information about the particle in the accelerator. The name of the particle, mass in MeV/c^2, charge, spin, does it interact via the electromagnetic force, does it interact via the weak force, does it interact via the strong force.
- getSizeInfo()
Returns Table with (x_length, y_length, z_length, volume, surface_area). Returns information about the size of the accelerator.
- getStats()
Returns Table with (accelerating_voltage, dipole_strength, quadrupole_strength, input_particle_min_energy). Returns statistics about the accelerator, such as the accelerating voltage in kV, the dipole and quadrupole strengths, and the minimum energy required for input particles in keV.
- getSynchrotronParticleInfo()
Returns Table with (type, amount, energy, focus). Returns synchrotron port's particle stack parameters. The name of the type of particles, the pu/t of the particles, the energy of the particles in keV and the focus of the particle.
- getTemperature()
Returns Number. Returns the temperature of the accelerator.
- hasIonSource()
Returns Boolean. Returns if the accelerator has an ion source.
- hasParticle()
Returns Boolean. True if the accelerator has a particle stack
- isAcceleratorOn()
Returns Boolean. True if the accelerator is on.
- isBeamPort(int x, int y, int z)
Returns Boolean. Returns if position (x,y,z) is a beam port.
- isComplete()
Returns Boolean. True if the accelerator is complete.
- isComputerControlled()
Returns Boolean. Returns if the accelerator is in computer controlled mode.
- setComputerControlled(boolean computerControlled)
Returns boolean. Turns computer controlled mode on/off. When computer controlled mode is on, accelerator ignores redstone control. Returns the value of computerControlled
.
- setEnergyPercentage(int energyPercentage)
Returns Number. This method sets the output energy of the accelerator to energyPercentage
% of the accelerator's maximum energy. For decelerators, the particle is decelerated to the complement of energyPercentage
% (eg. energyPercentage
= 15 means particles are decelerated to (100 - 15) = 85% of their input energy). The percentage can be a whole number between 5 and 100 (both inclusive), or 0 to turn the accelerator off. If this method is used in a beam diverter, the diverter simply turns off or on.
- switchBeamPort(int x, int y, int z)
Returns Boolean. Returns whether switching the mode of the beam port at (x,y,z) was successful.