Skip to content

Scripting Prusa_MK3SMMU2

GitHub Action edited this page Sep 19, 2020 · 1 revision

Scripting options for the selected printer:

Beeper::

  • Mute() - Mutes the beeper
  • ToggleMute() - Toggles the beeper mute
  • Unmute() - Unmutes the beeper

Board::

  • Pause() - Pauses the simulated AVR execution.
  • Quit() - Sends the quit signal to the AVR
  • Reset() - Resets the board by resetting the AVR.
  • Resume() - Resumes simulated AVR execution.
  • WaitMs(int) - Waits the specified number of milliseconds (in AVR-clock time)

Board1::

  • Pause() - Pauses the simulated AVR execution.
  • Quit() - Sends the quit signal to the AVR
  • Reset() - Resets the board by resetting the AVR.
  • Resume() - Resumes simulated AVR execution.
  • WaitMs(int) - Waits the specified number of milliseconds (in AVR-clock time)

E::

  • Reset() - Clears the diag flag immediately
  • Stall() - Sets the diag flag immediately.
  • ToggleStall() - Toggles the stallguard condition on the next step.

EEPROM::

  • Clear() - Clears EEPROM to 0xFF
  • Load() - Loads the last-used file again
  • Poke(int, int) - Pokes a value into the EEPROM. Args are (address,value)
  • Save() - Saves EEPROM contents to disk.

EEPROM1::

  • Clear() - Clears EEPROM to 0xFF
  • Load() - Loads the last-used file again
  • Poke(int, int) - Pokes a value into the EEPROM. Args are (address,value)
  • Save() - Saves EEPROM contents to disk.

Encoder::

  • Press() - Presses the encoder button
  • PressAndRelease() - Presses the encoder button
  • Release() - Releases the encoder button
  • TwistCCW() - Twists the encoder once cycle counterclockwise
  • TwistCW() - Twists the encoder one cycle clockwise

Fan::

  • Resume() - Resumes fan from a stall condition
  • SetPWM(int) - Sets the PWM to a specific value (0-255)
  • Stall() - Stalls the fan

Fan1::

  • Resume() - Resumes fan from a stall condition
  • SetPWM(int) - Sets the PWM to a specific value (0-255)
  • Stall() - Stalls the fan

GLHelper::

  • CheckPixel(uint32, uint32, uint32) - Checks the pixel color at the given position matches specified (x,y,RGBA).
  • SnapRect(string, int, int, int, int) - Takes a snap a region (file,x,y,w,h)
  • Snapshot(string) - Takes a snap of the current GL rendering

Heater_B::

  • Resume() - Resumes auto PWM control and clears the 'stopheating' flag
  • SetPWM(int) - Sets the raw heater PWM value
  • StopHeating() - Stops heating, as if a thermal runaway is happening due to loose heater or thermistor

Heater_H::

  • Resume() - Resumes auto PWM control and clears the 'stopheating' flag
  • SetPWM(int) - Sets the raw heater PWM value
  • StopHeating() - Stops heating, as if a thermal runaway is happening due to loose heater or thermistor

I::

  • Reset() - Clears the diag flag immediately
  • Stall() - Sets the diag flag immediately.
  • ToggleStall() - Toggles the stallguard condition on the next step.

IRSensor::

  • Set(int) - Sets the sensor state to a specific enum entry. (int value)
  • SetAuto() - Resumes auto (MMU) operation
  • SetExtVal(bool) - Sets external imput value
  • SetV(float) - Sets the value the ADC reports
  • SetVScale(float) - Changes the scale factor to convert the input to the ADC input range
  • Toggle() - Toggles the IR sensor state

KeyCtl::

  • Key(string) - Simulates a keypress

LCD::

  • CheckCGRAM(int, int) - Checks if the CGRAM address matches the value. (value, addr)
  • Desync() - Simulates data corruption by desyncing the 4-bit mode
  • WaitForText(string, int) - Waits for a given string to appear anywhere on the specified line. A line value of -1 means any line.

MMUButtons::

  • Press(int) - Presses the specified button in the array
  • Push Left() - Press left button
  • Push Middle() - Press middle button
  • Push Right() - Press right button

P::

  • Reset() - Clears the diag flag immediately
  • Stall() - Sets the diag flag immediately.
  • ToggleStall() - Toggles the stallguard condition on the next step.

PINDA::

  • SetMBLPoint(int, float) - Sets the given MBL point (0-48) to the given Z value
  • SetPos(float, float, float) - Sets X/Y/Z position of the probe
  • SetXYPoint(int, float, float) - Sets the (0-3)rd XY cal point position to x,y. (index, x,y)
  • ToggleSheet() - Toggles the presence of the steel sheet

Power Panic::

  • Press() - Simulate pressing the button
  • PressAndRelease() - Simulate pressing and then releasing the button
  • Release() - Simulate releasing the button

Printer::

  • Key(string) - Simulates a keypress of a given key (character)
  • MouseBtn(int, int) - Simulates a mouse button (# = GL button enum, gl state)

S::

  • Reset() - Clears the diag flag immediately
  • Stall() - Sets the diag flag immediately.
  • ToggleStall() - Toggles the stallguard condition on the next step.

SDCard::

  • Mount(string) - Mounts the specified file on the SD card.
  • Remount() - Remounts the last mounted file, if any.
  • Unmount() - Unmounts the currently mounted file, if any.

SPIFlash::

  • Clear() - Resets the flash memory to empty (0xFF)
  • Fill(int) - Fills the flash memory with the given value
  • Load() - Reloads the last used file
  • Save() - Saves the file

ScriptHost::

  • Log(string) - Print the std::string to stdout
  • SetQuitOnTimeout(bool) - If 1, quits when a timeout occurs. Exit code will be non-zero.
  • SetTimeoutMs(int) - Sets a timeout for actions that wait for an event

Serial0::

  • NextLineMustBe(string) - Errors if the next output line is not as specified.
  • SendGCode(string) - Sends the specified string as G-Code.
  • WaitForLine(string) - Waits for the provided line to appear on the serial output.
  • WaitForLineContains(string) - Waits for the serial output to contain a line with the given string.

TelHost::

  • StartTrace() - Starts the telemetry trace. You must have set a category or set of items with the -t option
  • StopTrace() - Stops a running telemetry trace.
  • WaitFor(string, uint32) - Waits for a specified telemetry value to occur
  • WaitForGT(string, uint32) - Waits for a specified telemetry value to be greater than specified
  • WaitForLT(string, uint32) - Waits for a specified telemetry value to be less than specified

Thermistor::

  • Disconnect() - Disconnects the thermistor as though it has gone open circuit
  • Reconnect() - Restores the normal thermistor state
  • Set(float) - Sets the temperature to the specified value
  • Short() - Short the thermistor out

Thermistor1::

  • Disconnect() - Disconnects the thermistor as though it has gone open circuit
  • Reconnect() - Restores the normal thermistor state
  • Set(float) - Sets the temperature to the specified value
  • Short() - Short the thermistor out

Thermistor2::

  • Disconnect() - Disconnects the thermistor as though it has gone open circuit
  • Reconnect() - Restores the normal thermistor state
  • Set(float) - Sets the temperature to the specified value
  • Short() - Short the thermistor out

Thermistor3::

  • Disconnect() - Disconnects the thermistor as though it has gone open circuit
  • Reconnect() - Restores the normal thermistor state
  • Set(float) - Sets the temperature to the specified value
  • Short() - Short the thermistor out

VSrc::

  • SetV(float) - Sets the value the ADC reports
  • SetVScale(float) - Changes the scale factor to convert the input to the ADC input range

VSrc1::

  • SetV(float) - Sets the value the ADC reports
  • SetVScale(float) - Changes the scale factor to convert the input to the ADC input range

X::

  • Reset() - Clears the diag flag immediately
  • Stall() - Sets the diag flag immediately.
  • ToggleStall() - Toggles the stallguard condition on the next step.

Y::

  • Reset() - Clears the diag flag immediately
  • Stall() - Sets the diag flag immediately.
  • ToggleStall() - Toggles the stallguard condition on the next step.

Z::

  • Reset() - Clears the diag flag immediately
  • Stall() - Sets the diag flag immediately.
  • ToggleStall() - Toggles the stallguard condition on the next step.
Clone this wiki locally