Skip to content

Commit

Permalink
📦 add docs for chemical oxidizer and chemical tank
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberbit committed Jul 24, 2024
1 parent 37033a0 commit a952671
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export default defineConfig({
{ text: 'Chemical Dissolution Chamber', link: '/reference/input/mekanism/ChemicalDissolutionChamber' },
{ text: 'Chemical Infuser', link: '/reference/input/mekanism/ChemicalInfuser' },
{ text: 'Chemical Injection Chamber', link: '/reference/input/mekanism/ChemicalInjectionChamber' },
// { text: 'Chemical Oxidizer', link: '/reference/input/mekanism/ChemicalOxidizer' },
// { text: 'Chemical Tank', link: '/reference/input/mekanism/ChemicalTank' },
{ text: 'Chemical Oxidizer', link: '/reference/input/mekanism/ChemicalOxidizer' },
{ text: 'Chemical Tank', link: '/reference/input/mekanism/ChemicalTank' },
// { text: 'Chemical Washer', link: '/reference/input/mekanism/ChemicalWasher' },
// { text: 'Combiner', link: '/reference/input/mekanism/Combiner' },
// { text: 'Combining Factory', link: '/reference/input/mekanism/CombiningFactory' },
Expand Down
Binary file added docs/assets/mekanism-chem-tank.webp
Binary file not shown.
106 changes: 106 additions & 0 deletions docs/reference/input/mekanism/ChemicalOxidizer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<script setup>
import { data as metrics } from './common/metrics.data.ts'
</script>

# Mekanism Chemical Oxidizer Input <RepoLink path="lib/input/mekanism/ChemicalOxidizerInputAdapter.lua" />

```lua
telem.input.mekanism.chemicalOxidizer (
peripheralID: string,
categories?: string[] | '*'
)
```

::: warning Mod Dependencies
Requires **Mekanism**.
:::

See the Usage section for a complete list of the metrics in each category.

<PropertiesTable
:properties="[
{
name: 'peripheralID',
type: 'string',
default: 'nil',
description: 'Peripheral ID of the Chemical Oxidizer'
},
{
name: 'categories',
type: 'string[] | &quot;*&quot;',
default: '{ &quot;basic&quot; }'
}
]"
>
<template v-slot:categories>
List of metric categories to query. The value `"*"` can be used to include all categories, which are listed below.

```lua
{ "basic", "advanced", "output", "energy", "recipe" }
```
</template>
</PropertiesTable>

## Usage

```lua{4}
local telem = require 'telem'
local backplane = telem.backplane()
:addInput('my_oxidizer', telem.input.mekanism.chemicalOxidizer('right', '*'))
:cycleEvery(5)()
```

Given a Chemical Oxidizer peripheral on the `right` side of the computer, this appends the following metrics to the backplane (grouped by category here for clarity):

### Basic

<MetricTable
prefix="mekchemoxidizer:"
:metrics="[
{ name: 'input_count', value: '0 - inf', unit: 'item' },
{ name: 'output_filled_percentage', value: '0.0 - 1.0' },
{ name: 'output_item_count', value: '0 - inf', unit: 'item' },
{ name: 'energy_usage', value: '0.0 - inf', unit: 'FE/t' },
...metrics.genericMachine.basic
]"
/>

### Advanced

<MetricTable
prefix="mekchemoxidizer:"
:metrics="[
...metrics.genericMachine.advanced
]"
/>

### Output

<MetricTable
prefix="mekchemoxidizer:"
:metrics="[
{ name: 'output', value: '0.0 - inf', unit: 'B' },
{ name: 'output_capacity', value: '0.0 - inf', unit: 'B' },
{ name: 'output_needed', value: '0.0 - inf', unit: 'B' }
]"
/>

### Energy

<MetricTable
prefix="mekchemoxidizer:"
:metrics="[
...metrics.genericMachine.energy
]"
/>

### Recipe

<MetricTable
prefix="mekchemoxidizer:"
:metrics="[
...metrics.recipeProgress.recipe
]"
/>
100 changes: 100 additions & 0 deletions docs/reference/input/mekanism/ChemicalTank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Mekanism Chemical Tank Input <RepoLink path="lib/input/mekanism/ChemicalTankInputAdapter.lua" />

```lua
telem.input.mekanism.chemicalTank (
peripheralID: string,
categories?: string[] | '*'
)
```

::: warning Mod Dependencies
Requires **Mekanism**.
:::

See the Usage section for a complete list of the metrics in each category.

<PropertiesTable
:properties="[
{
name: 'peripheralID',
type: 'string',
default: 'nil',
description: 'Peripheral ID of the Chemical Tank'
},
{
name: 'categories',
type: 'string[] | &quot;*&quot;',
default: '{ &quot;basic&quot; }'
}
]"
>
<template v-slot:categories>
List of metric categories to query. The value `"*"` can be used to include all categories, which are listed below.

```lua
{ "basic", "advanced", "storage" }
```
</template>
</PropertiesTable>

## Usage

```lua{4}
local telem = require 'telem'
local backplane = telem.backplane()
:addInput('my_chemtank', telem.input.mekanism.chemicalTank('right', '*'))
:cycleEvery(5)()
```

Given a Chemical Tank peripheral on the `right` side of the computer, this appends the following metrics to the backplane (grouped by category here for clarity):

### Basic

<MetricTable
prefix="mekchemtank:"
:metrics="[
{ name: 'fill_item_count', value: '0 - inf', unit: 'item' },
{ name: 'filled_percentage', value: '0.0 - 1.0' },
{ name: 'drain_item_count', value: '0 - inf', unit: 'item' }
]"
/>

### Advanced

```lua
DUMPING_MODES = { IDLE = 1, DUMPING_EXCESS = 2, DUMPING = 3 }
```

<MetricTable
prefix="mekchemtank:"
:metrics="[
{ name: 'dumping_mode', value: 'DUMPING_MODES value' }
]"
/>

### Storage

<MetricTable
prefix="mekchemtank:"
:metrics="[
{ name: 'stored', value: '0.0 - inf', unit: 'B' },
{ name: 'capacity', value: '0.0 - inf', unit: 'B' },
{ name: 'needed', value: '0.0 - inf', unit: 'B' }
]"
/>

## Storage
If the tank contains a chemical, a storage metric is added for the chemical. Given a chemical tank with the following contents:

![Mekanism Basic Chemical Tank with contents](/assets/mekanism-chem-tank.webp)

The following metric would be added:

<MetricTable
prefix="storage:"
:metrics="[
{ name: 'mekanism:ethene', value: '47', unit: 'B' }
]"
/>

0 comments on commit a952671

Please sign in to comment.