Skip to content

Scripting Prusa_CW1S

GitHub Action edited this page Oct 27, 2021 · 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.
  • WaitForReset() - Waits for the board to reset
  • WaitMs(int) - Waits the specified number of milliseconds (in AVR-clock time)

EEPROM::

  • Clear() - Clears EEPROM to 0xFF
  • Load() - Loads the last-used file again
  • PeekVerify(int, int) - Checks and prints the value of (address,expected val)
  • 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

Fan2::

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

GLHelper::

  • AutoSnap() - Takes a snap of the current GL rendering and gives it the current date/time.
  • 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_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

Heater_U::

  • 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

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.

Lid::

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

Printer::

  • MouseBtn(int, int) - Simulates a mouse button (# = GL button enum, gl state)

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

Tank::

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

TelHost::

  • IsEqual(string, uint32) - Checks if a value is equal to the specified value and errors if not.
  • 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

W::

  • 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