Skip to content

Understanding OctoDroid's util and memory library

Mariogrip edited this page Feb 6, 2015 · 1 revision

Octodroid uses a static objects to make developing easy and quick to developers that what to develop to OctoDroid's git repository.

Classes and files || what they do:

  • util || This is the file where utils and tools are placed
  • util_decode || This is the file where all the json is decoded to smaller json blocks and then to java strings where we can use to display information
  • util_final || This is the class where there will be set final (cannot be edited, hard coded) variables
  • util_get || This file is used to get information out of json blocks that was processed at Util_decode
  • util_send || This file sends (json) commands to the server

Functions and Objects:

Memory

  • memory.temp.current.Bed || float[] || temp.current.Bed[0] is the temp of tool0
  • memory.temp.current.Ext || float[] || temp.current.Ext[0] is the temp of tool0
  • memory.temp.target.Bed || float[] || temp.target.Bed[0] is the temp of tool0
  • memory.temp.target.Ext || float[] || temp.target.Bed[0] is the temp of tool0
  • memory.job.file.name || String
  • memory.job.file.origin || String
  • memory.job.file.size || float
  • memory.job.file.date || float
  • memory.job.progress.completion || float
  • memory.job.progress.filepos || int
  • memory.job.progress.printTime || int
  • memory.job.progress.printTimeLeft
  • memory.job.filament.lenght || int
  • memory.job.filament.volume || float
  • memory.job.estimatedPrintTime || int
  • memory.connected || boolean

Util:

  • util.jsonArraytoStringArray(String input) || return String[]
  • util.toMBGB(double bytes) || return String
  • util.roundDown5(double d) || return double
  • util.isNumeric(String str) || return boolean
  • util.decodeJson() || void (!!This will be removed, replace util_decode!!)
  • util.getData(String job,String cmd) || return String (!!This will be removed, replace util_get!!)
  • util.sendError(String er) || void
  • util.getResponse(String ip, String api, String key) || return String
  • util.sendcmd(String ip ,String api, String cmd, String value) || void
  • util.refreshJson(String ip, String api, String key) || void

Util_decode:

  • util_decode.decodeVersions()
  • util_decode.decodeConnections()
  • util_decode.decodeFiles()
  • util_decode.decodeJob()
  • util_decode.decodePrinter()

Work in Progress