Public Member Functions

TemplateMakerPage Class Reference
[File Upload Wizard Pages]

Optional wizard page for making new templates. More...

#include <fileuploadwizard.h>

Inheritance diagram for TemplateMakerPage:
Inheritance graph
[legend]
Collaboration diagram for TemplateMakerPage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TemplateMakerPage (FileSelectionModel *model, QWidget *parent=0)

Detailed Description

Optional wizard page for making new templates.

fileuploadwizard_templatemakerpage_sample.png

Implemented as one of the 6 wizard pages for making templates.

In short, these are the steps for making a template:

  1. Select a non-empty file.
  2. Setup the options so that the data of the file is displayed correctly as a table.
  3. For columns you wish to import: drag the corresponding sensorchannels over the corresponding column and set the correct source unit.
  4. Add one single timestamp column and define the timestamp format.
  5. Recheck. If nothing more can be done, press save (or press back to cancel and go back to the template selection page).

Notes on some components

Timestamp format

Here you must specify the format of the source timestamp. It is likely that the source timestamp is a pattern of letters, each representing a component of the date, time and some arbitrary makeup.

If this is the case, then you can use these expressions to specify the format of the source timestamp. While you type the application will try to interpret the source timestamp with your pattern. If it succeeds, the source timestamp will be printed according to the ISO 8601 specification. An example:

    "2009-04-02 09:57:30" //source timestamp
    "yyyy-MM-dd hh:mm:ss" //your pattern
     2009-04-02T09:57:30  //interpreted ISO 8601 timestamp

If source timestamp is represented by a number then you can write a simple arithmetic expression where X refers to the source timestamp. Currently supported operators are '+', '-', '*' and '/'. Brackets '(' and ')' are also supported. Function 'int()' is also supported. Note that currently no bracket can be used inside a function. The result of this expression should be the positive number of milliseconds that have passed since 1970-01-01T00:00:00 UTC. Here is an example of how to interpret an Excel time format represented by number of days since 1900-01-00, plus a fractional portion of a 24 hour day (i.e. ddddd.tttttt).

    (int(X) - 25569)*86400*1000 + (X - int(X))*86400*1000 //conversion function

Unit specification

For each column you associate a sensor channel to, you also need to specify the source unit. Because each sensor output unit is specified in the sensor specification, the source data will be automatically converted to this specified unit.

Column merging

In the "Merge on split" text box you can specify the number of the column split (starting from zero) on which you wish to merge two columns. This is interesting for example if your source has separate date and time columns, and you wish to merge them.

Row filtering

In the "row filter" text box you can specify a pattern to be filtered. The pattern is interpreted as a regular expression.


Constructor & Destructor Documentation

TemplateMakerPage::TemplateMakerPage ( FileSelectionModel model,
QWidget parent = 0 
)

    : FileUploadWizardPage(parent)
{
    setTitle("Template Maker");
    setObjectName("TemplateMakerPage");
    setSubTitle("Here you make a template for the kind of files you wish to import.");

    setWhatsThis("This is how you make a template for the kind of files you wish to import.\n"
                 "   1) Choose a file to make a template based on it.\n"
                 "   2) Setup the options so that the data of the file is displayed correctly as a table.\n"
                 "   3) For columns you wish to import: drag the corresponding sensorchannels over it.\n"
                 "   4) Adjust the column headers.\n"
                 "   5) If nothing more can be done, select save (or back to go back to the template selection page).");
    setToolTip(whatsThis());

    m_tagContainer = new TagContainer();
    m_form = new TemplateMakerPageGui(m_tagContainer, model, this);

    buttonLayout << QWizard::CustomButton2 << QWizard::Stretch << QWizard::CancelButton
            << QWizard::BackButton << QWizard::CustomButton1;

    setLayout(new QVBoxLayout());
    layout()->addWidget(m_form);

    // Connections
    connect(m_form, SIGNAL(signal_userInteraction(TagContainer::GeneralTag, QString)),
            m_tagContainer, SLOT(setGeneralTagValue(TagContainer::GeneralTag, QString)));
    connect(m_tagContainer, SIGNAL(signal_generalTagCache_Changed(TagContainer::GeneralTag, QString)),
            m_form, SLOT(slot_syncWithGeneralTags(TagContainer::GeneralTag, QString)));
}


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