import { DsrRobotStatus } from './util'

export async function getStatus({ client }) {
  // TODO; need to have addition robot status which is returned by getStatus funciton
  var { isBusy, isRun, isEmegencyStop, isSecurityStop } = await client.getRobotStatus()

  // export interface RobotArmStatus {
  //   running: Boolean
  //   ready: Boolean
  //   busy: Boolean
  //   moveFinished: Boolean
  //   home: Boolean
  //   zero: Boolean
  //   teachingMode: Boolean
  //   error: Boolean
  //   collided: Boolean
  //   emergency: Boolean
  // }

  return {
    running: isRun,
    ready: isRun && !isBusy,
    busy: isBusy,
    moveFinished: !isBusy,
    home: false,
    zero: false,
    teachingMode: false,
    error: !isRun,
    collided: !isRun,
    emergency: isEmegencyStop
  }
}
