ImportExport Class Reference

#include <importexport.h>

List of all members.

Public Slots

void batchConverter ()
void retranslateUi ()

Signals

void modified ()
 signal page modified, emitted if save or open functions finished
void active ()
 signal savePage(QString Str) function active, emitted if save functions started
void ready ()
 signal savePage(QString Str) function ready, emitted if save function finished

Public Member Functions

 ImportExport (PageCtrl *pageCtrl, Prototype *prototype)
virtual ~ImportExport ()
QString createKMHeader (QString Str)
QString currentTabText ()
int currentTabIndex ()
bool OpenPrepare (QStringList files)
int savePage (QString Str)
void SavePrepare (int pageIndex, QString fn, QStringList *tmpList, int Ext)
void saveAllPages (QString batchPath, int batchExt)

Public Attributes

bool savePTT
 save prototype flag, used by preferences dialog
bool usePresetDir
 use preset dir flag, used by preferences dialog
bool usePrgLngDetection
 use programming language detection
QString lastDir
 last directory of save or open function
QStringList errorFiles
 string list for files which could not be opened

Private Member Functions

int nextPOUEndIndexAt (QStringList *tmpList, int index)
QString getCoDeSysVISU (QStringList *tmpList, int index, int end)
QString getSiemensDBData (QStringList *tmpList, int index, int end)
bool OpenReinforce (QStringList *tmpList, int index, int endPos, QString ExtStr)
void setProgressBar (int files, int minFiles, QString msg)
QString strippedFileName (const QString &fullFileName)

Private Attributes

QString msg_progress_fopen
 message at progressbar "file open"
QString msg_progress_batch
 message at progressbar "batch converter"
QProgressBar * progressBar
 instance of qprogressbar
PageCtrlm_PageCtrl
 instance of PageCtrl class
Prototypem_Prototype
 instance of Prototype class


Constructor & Destructor Documentation

ImportExport::ImportExport ( PageCtrl pageCtrl,
Prototype prototype 
)

creating function

Parameters:
PageCtrl class, Prototype class

ImportExport::~ImportExport (  )  [virtual]

virtual destructor


Member Function Documentation

void ImportExport::active (  )  [signal]

signal savePage(QString Str) function active, emitted if save functions started

void ImportExport::batchConverter (  )  [slot]

batch converting / file resaving function

The batch dialog returns the full string of the combobox:

'only copy'

'clean POU (.txt)'

'Moeller POE (.poe)'

'CoDeSys (.EXP)'

'Siemens S7 (.awl / .scl - keep current language)'

'KW-Software (.IL / .ST - keep current language)'

If Siemens of KW-Software were detected the called saveAllPages(QString batchPath, int batchExt) function will only get batchExt=4 or batchExt=6 to keep the current programming language by self detection.

QString ImportExport::createKMHeader ( QString  Str  ) 

revise Moeller header from string input

int ImportExport::currentTabIndex (  ) 

return current page index

QString ImportExport::currentTabText (  ) 

return file name of current page

QString ImportExport::getCoDeSysVISU ( QStringList *  tmpList,
int  index,
int  end 
) [private]

return CoDeSys VISU section from a list, by using a start index and an end position

QString ImportExport::getSiemensDBData ( QStringList *  tmpList,
int  index,
int  end 
) [private]

return Siemens DB data from a list, by using a start index and an end position

void ImportExport::modified (  )  [signal]

signal page modified, emitted if save or open functions finished

int ImportExport::nextPOUEndIndexAt ( QStringList *  tmpList,
int  index 
) [private]

return next POU end index of tmpList up from index

bool ImportExport::OpenPrepare ( QStringList  files  ) 

prepare file opening of string list content and call open reinforce function

bool ImportExport::OpenReinforce ( QStringList *  tmpList,
int  index,
int  endPos,
QString  ExtStr 
) [private]

reinforce import of file content in tmpList up from index until endPos, respecting the ExtStr value

supported extension values:

  • '.txt'

  • '.poe'

  • '.EXP'

  • '.awl'

  • '.scl'

  • '.IL'

  • '.ST'

void ImportExport::ready (  )  [signal]

signal savePage(QString Str) function ready, emitted if save function finished

void ImportExport::retranslateUi (  )  [slot]

retranslate Ui

void ImportExport::saveAllPages ( QString  batchPath,
int  batchExt 
)

save all pages

Parameters:
batchPath contains save path, if empty call PageCtrl->filePathOf(i)
batchExt contains the selected file extension, if set to 99 use PageCtrl->fileExtOf(i)
supported extension values:

  • 0/1 = .txt

  • 2 = .poe

  • 3 = .EXP

  • 4 = .awl

  • 5 = .scl

  • 6 = .IL

  • 7 = .ST

  • 99 = PageCtrl->fileExtOf(i)

int ImportExport::savePage ( QString  Str  ) 

save page content into path which is setted in Str and call saveprepare function

void ImportExport::SavePrepare ( int  pageIndex,
QString  fn,
QStringList *  tmpList,
int  Ext 
)

prepare file storage for content at pageIndex into tmpList, with specified by filename and extension from fn and Ext

supported extension values:

  • 0/1 = .txt

  • 2 = .poe

  • 3 = .EXP

  • 4 = .awl

  • 5 = .scl

  • 6 = .IL

  • 7 = .ST

void ImportExport::setProgressBar ( int  files,
int  minFiles,
QString  msg 
) [private]

set progressbar with number of files, min. files to be activated, message string

QString ImportExport::strippedFileName ( const QString &  fullFileName  )  [private]

strip filename from fullFileName (path + file name)


Member Data Documentation

string list for files which could not be opened

last directory of save or open function

instance of PageCtrl class

instance of Prototype class

message at progressbar "batch converter"

message at progressbar "file open"

QProgressBar* ImportExport::progressBar [private]

instance of qprogressbar

save prototype flag, used by preferences dialog

use preset dir flag, used by preferences dialog

use programming language detection


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

Generated on Thu Feb 26 19:59:54 2009 for PLCEdit by  doxygen 1.5.8