# CalConverter Class Reference

`#include <calconverter.h>`

List of all members.

## Public Slots
void | convert (QString *Str, int pageIndex, int from, int to, int option)
## Public Member Functions
| CalConverter (PageCtrl *pageCtrl)
virtual | ~CalConverter ()
## Private Member Functions
int | convertFBCAllAtTo (QStringList *tmpList, int pageIndex, int index, int to, int option)
bool | getCallLineItems (QString str, int ioStyle, QString *fbPart, QString *tag, QString *comment, QString *lineEnd)
QString | getComment (QString str)
QString | getDefaultInputLine (QString str, int ioStyle)
QString | getDefaultOutputLine (QString str, int ioStyle)
QString | getIECInputLine (QString instance, QString str, int ioStyle, QString prgLng)
QString | getIECOutputLine (QString instance, QString str, int ioStyle, QString prgLng)
QString | getMoellerILOutputLine (QString str, int ioStyle)
int | getNextCALPos (QStringList *tmpList, int index)
## Private Attributes
PageCtrl * | m_PageCtrl
| instance of PageCtrl class

## Constructor & Destructor Documentation

CalConverter::CalConverter | ( | PageCtrl * | pageCtrl | ) |

creating function CalConverter call<CAL> model converter

Parameters:

  | PageCtrl | class

CalConverter::~CalConverter | ( |  | ) | `[virtual]`

virtual destructor

## Member Function Documentation

void CalConverter::convert | ( | QString * | Str,
|  | int | pageIndex,
|  | int | from,
|  | int | to,
|  | int | option |
| ) |  |  | `[slot]`

FB call convert routine

Parameters:

  | *Str | contains the string wich will be worked
  | pageIndex | is the index of the selected page
  | from | contains the current extension of the file/page
  | to | contains the requested extension of the file/page
  | option | contains the information about special conversion options option 0: do nothing option 1: all into selected compatibility call model option 2: outputs into simple IEC call model option 3: all into simple IEC call model

int CalConverter::convertFBCAllAtTo | ( | QStringList * | tmpList,
|  | int | pageIndex,
|  | int | index,
|  | int | to,
|  | int | option |
| ) |  |  | `[private]`

convert default call at index in tmpList into Moeller style

Parameters:

  | *tmpList | temporary list which will be filled with the file content
  | pageIndex | is the index of the selected page
  | index | contains position of the next function block call model
  | to | holds the appointed file extension
  | option | contains the information about special conversion options

supported conversion values:

option 0: do nothing

option 1: all into selected compatibility call model

option 2: outputs into simple IEC call model

option 3: all into simple IEC call model

bool CalConverter::getCallLineItems | ( | QString | str,
|  | int | ioStyle,
|  | QString * | fbPart,
|  | QString * | tag,
|  | QString * | comment,
|  | QString * | lineEnd |
| ) |  |  | `[private]`

get function block part and connected tag by solving str into fbPart and tag

Parameters:

  | str | contains line
  | ioStyle | used to handle standard inputs/outputs (0) and Moeller outputs (1)
  | *fbPart | will filled with function block in/out substring
  | *tag | will filled with connected tag substring
  | *comment | will filled with comment substring
  | *lineEnd | will filled with the line end sign

QString CalConverter::getComment | ( | QString | str | ) | `[private]`

get comment from str

QString CalConverter::getDefaultInputLine | ( | QString | str,
|  | int | ioStyle |
| ) |  |  | `[private]`

get default input line: ' input := tag,'

QString CalConverter::getDefaultOutputLine | ( | QString | str,
|  | int | ioStyle |
| ) |  |  | `[private]`

get default output line: ' output => tag,'

QString CalConverter::getIECInputLine | ( | QString | instance,
|  | QString | str,
|  | int | ioStyle,
|  | QString | prgLng |
| ) |  |  | `[private]`

get IEC intput line according to the programming language IL: 'LD tag ST INSTANCE.input (*...*)
' ST: 'INSTANCE.input := tag; (*...*)
'

QString CalConverter::getIECOutputLine | ( | QString | instance,
|  | QString | str,
|  | int | ioStyle,
|  | QString | prgLng |
| ) |  |  | `[private]`

get IEC output line according to the programming language IL: 'LD INSTANCE.output (*...*)
ST tag
' ST: 'tag := INSTANCE.output; (*...*)
'

QString CalConverter::getMoellerILOutputLine | ( | QString | str,
|  | int | ioStyle |
| ) |  |  | `[private]`

get Moeller output line: ' tag := > output,'

int CalConverter::getNextCALPos | ( | QStringList * | tmpList,
|  | int | index |
| ) |  |  | `[private]`

get position of next FB call 'CAL'/'CALL'

## Member Data Documentation

PageCtrl* CalConverter::m_PageCtrl`[private]`

instance of PageCtrl class

The documentation for this class was generated from the following files:

- calconverter.h
- calconverter.cpp