iCub-main
Macros | Enumerations | Functions | Variables
main.cpp File Reference
#include "mainwindow.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QFileInfo>
#include <qdebug.h>
#include <QDir>
#include "firmwareupdatercore.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Macros

#define MY_ADDR   "10.0.1.104"
 
#define MY_PORT   3333
 

Enumerations

enum  action_t {
  action_impossible = -1,
  action_none = 0,
  action_discover = 1,
  action_verify = 2,
  action_program = 3,
  action_forcemaintenance = 4,
  action_forceapplication = 5,
  action_query = 6,
  action_loaddatfile = 7,
  action_setstrainsn = 8,
  action_setstraingainsoffsets = 9,
  action_getcanboardversion = 10,
  action_savedatfile = 11,
  action_changeCanId = 12,
  action_changeBoardIp = 13,
  action_setstrainft45gainsoffsets = 14,
  action_setstrainft58gainsoffsets = 15,
  action_setstraingainsspecificoffsets = 16
}
 
enum  SensorModel {
  SensorModel::ft45,
  SensorModel::ft58
}
 

Functions

bool checkApplicationLock ()
 
void removeApplicationLock ()
 
void printCanDevices (QList< sBoard > canBoards, QString onIPboard, bool slimprint)
 
int printSecondLevelDevices (FirmwareUpdaterCore *, QString device, QString id, bool slimprint)
 
int printThirdLevelDevices (FirmwareUpdaterCore *, QString device, QString id, QString board, bool forceMaintenance, bool forceApplication, bool slimprint)
 
int programEthDevice (FirmwareUpdaterCore *, QString device, QString id, QString board, QString file)
 
int programCanDevice (FirmwareUpdaterCore *, QString device, QString id, QString board, QString canLine, QString canId, QString file, bool eraseEEprom)
 
int setBoardToApplication (FirmwareUpdaterCore *core, QString device, QString id, QString board)
 
int setBoardToMaintenance (FirmwareUpdaterCore *core, QString device, QString id, QString board)
 
int verifyOnSecondLevel (FirmwareUpdaterCore *core, QString device, QString id, const QString &targetIPaddr, const QString &targetCANline, const QString &targetCANaddr, const QString &targetFWvers)
 
int verifyOnSecondLevel_ETHboard (FirmwareUpdaterCore *core, QString device, QString id, const QString &targetIPaddr, const QString &targetFWvers)
 
int verifyOnSecondLevel_CANboard (FirmwareUpdaterCore *core, QString device, QString id, const QString &targetCANline, const QString &targetCANaddr, const QString &targetFWvers)
 
int verifyCanDevices (QList< sBoard > canBoards, const QString &targetCANline, const QString &targetCANaddr, const QString &targetFWvers)
 
int verifyOnThirdLevel_CANunderETH (FirmwareUpdaterCore *core, QString device, QString id, QString board, const QString &targetCANline, const QString &targetCANaddr, const QString &targetFWvers)
 
int queryOnSecondLevel_ETHboard (FirmwareUpdaterCore *core, QString device, QString id, const QString &targetIPaddr)
 
int queryOnSecondLevel_CANboard (FirmwareUpdaterCore *core, QString device, QString id, const QString &targetCANline, const QString &targetCANaddr)
 
int queryCanDevices (QList< sBoard > canBoards, const QString onIPboard, const QString &targetCANline, const QString &targetCANaddr)
 
int queryOnThirdLevel_CANunderETH (FirmwareUpdaterCore *core, QString device, QString id, const QString board, const QString &targetCANline, const QString &targetCANaddr)
 
int loadDatFileStrain2 (FirmwareUpdaterCore *core, QString device, QString id, QString board, QString canLine, QString canId, QString file, bool eraseEEprom)
 
int saveDatFileStrain2 (FirmwareUpdaterCore *core, QString device, QString id, QString board, QString canLine, QString canId, bool eraseEEprom)
 
int setStrainSn (FirmwareUpdaterCore *core, QString device, QString id, QString board, QString canLine, QString canId, QString serialNumber)
 
int setStrainGainsOffsets (FirmwareUpdaterCore *core, QString device, QString id, QString board, QString canLine, QString canId, SensorModel model)
 
int getCanBoardVersion (FirmwareUpdaterCore *core, QString device, QString id, QString board, QString canLine, QString canId, bool save)
 
int changeCanId (FirmwareUpdaterCore *core, QString device, QString id, QString board, QString canLine, QString canId, QString canIdNew)
 
int changeBoardIp (FirmwareUpdaterCore *core, QString device, QString id, QString board, QString newipaddr)
 
int main (int argc, char *argv[])
 

Variables

int verbosity = 1
 

Macro Definition Documentation

◆ MY_ADDR

#define MY_ADDR   "10.0.1.104"

Definition at line 17 of file main.cpp.

◆ MY_PORT

#define MY_PORT   3333

Definition at line 18 of file main.cpp.

Enumeration Type Documentation

◆ action_t

enum action_t
Enumerator
action_impossible 
action_none 
action_discover 
action_verify 
action_program 
action_forcemaintenance 
action_forceapplication 
action_query 
action_loaddatfile 
action_setstrainsn 
action_setstraingainsoffsets 
action_getcanboardversion 
action_savedatfile 
action_changeCanId 
action_changeBoardIp 
action_setstrainft45gainsoffsets 
action_setstrainft58gainsoffsets 
action_setstraingainsspecificoffsets 

Definition at line 25 of file main.cpp.

◆ SensorModel

enum SensorModel
strong
Enumerator
ft45 
ft58 

Definition at line 47 of file main.cpp.

Function Documentation

◆ changeBoardIp()

int changeBoardIp ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  newipaddr 
)

Definition at line 926 of file main.cpp.

◆ changeCanId()

int changeCanId ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  canLine,
QString  canId,
QString  canIdNew 
)

Definition at line 954 of file main.cpp.

◆ checkApplicationLock()

bool checkApplicationLock ( )

Definition at line 1992 of file main.cpp.

◆ getCanBoardVersion()

int getCanBoardVersion ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  canLine,
QString  canId,
bool  save 
)

Definition at line 1011 of file main.cpp.

◆ loadDatFileStrain2()

int loadDatFileStrain2 ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  canLine,
QString  canId,
QString  file,
bool  eraseEEprom 
)

Definition at line 1246 of file main.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 85 of file main.cpp.

◆ printCanDevices()

void printCanDevices ( QList< sBoard canBoards,
QString  onIPboard,
bool  slimprint 
)

Definition at line 1887 of file main.cpp.

◆ printSecondLevelDevices()

int printSecondLevelDevices ( FirmwareUpdaterCore core,
QString  device,
QString  id,
bool  slimprint 
)

Definition at line 1749 of file main.cpp.

◆ printThirdLevelDevices()

int printThirdLevelDevices ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
bool  forceMaintenance,
bool  forceApplication,
bool  slimprint 
)

Definition at line 1846 of file main.cpp.

◆ programCanDevice()

int programCanDevice ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  canLine,
QString  canId,
QString  file,
bool  eraseEEprom 
)

Definition at line 1641 of file main.cpp.

◆ programEthDevice()

int programEthDevice ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  file 
)

Definition at line 1716 of file main.cpp.

◆ queryCanDevices()

int queryCanDevices ( QList< sBoard canBoards,
const QString  onIPboard,
const QString &  targetCANline,
const QString &  targetCANaddr 
)

Definition at line 2433 of file main.cpp.

◆ queryOnSecondLevel_CANboard()

int queryOnSecondLevel_CANboard ( FirmwareUpdaterCore core,
QString  device,
QString  id,
const QString &  targetCANline,
const QString &  targetCANaddr 
)

Definition at line 2512 of file main.cpp.

◆ queryOnSecondLevel_ETHboard()

int queryOnSecondLevel_ETHboard ( FirmwareUpdaterCore core,
QString  device,
QString  id,
const QString &  targetIPaddr 
)

Definition at line 2319 of file main.cpp.

◆ queryOnThirdLevel_CANunderETH()

int queryOnThirdLevel_CANunderETH ( FirmwareUpdaterCore core,
QString  device,
QString  id,
const QString  board,
const QString &  targetCANline,
const QString &  targetCANaddr 
)

Definition at line 2379 of file main.cpp.

◆ removeApplicationLock()

void removeApplicationLock ( )

Definition at line 2022 of file main.cpp.

◆ saveDatFileStrain2()

int saveDatFileStrain2 ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  canLine,
QString  canId,
bool  eraseEEprom 
)

Definition at line 1448 of file main.cpp.

◆ setBoardToApplication()

int setBoardToApplication ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board 
)

Definition at line 1615 of file main.cpp.

◆ setBoardToMaintenance()

int setBoardToMaintenance ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board 
)

Definition at line 1627 of file main.cpp.

◆ setStrainGainsOffsets()

int setStrainGainsOffsets ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  canLine,
QString  canId,
SensorModel  model 
)

Definition at line 1083 of file main.cpp.

◆ setStrainSn()

int setStrainSn ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
QString  canLine,
QString  canId,
QString  serialNumber 
)

Definition at line 1184 of file main.cpp.

◆ verifyCanDevices()

int verifyCanDevices ( QList< sBoard canBoards,
const QString &  targetCANline,
const QString &  targetCANaddr,
const QString &  targetFWvers 
)

Definition at line 2218 of file main.cpp.

◆ verifyOnSecondLevel()

int verifyOnSecondLevel ( FirmwareUpdaterCore core,
QString  device,
QString  id,
const QString &  targetIPaddr,
const QString &  targetCANline,
const QString &  targetCANaddr,
const QString &  targetFWvers 
)

Definition at line 2041 of file main.cpp.

◆ verifyOnSecondLevel_CANboard()

int verifyOnSecondLevel_CANboard ( FirmwareUpdaterCore core,
QString  device,
QString  id,
const QString &  targetCANline,
const QString &  targetCANaddr,
const QString &  targetFWvers 
)

Definition at line 2198 of file main.cpp.

◆ verifyOnSecondLevel_ETHboard()

int verifyOnSecondLevel_ETHboard ( FirmwareUpdaterCore core,
QString  device,
QString  id,
const QString &  targetIPaddr,
const QString &  targetFWvers 
)

Definition at line 2119 of file main.cpp.

◆ verifyOnThirdLevel_CANunderETH()

int verifyOnThirdLevel_CANunderETH ( FirmwareUpdaterCore core,
QString  device,
QString  id,
QString  board,
const QString &  targetCANline,
const QString &  targetCANaddr,
const QString &  targetFWvers 
)

Definition at line 2271 of file main.cpp.

Variable Documentation

◆ verbosity

int verbosity = 1

Definition at line 21 of file main.cpp.