Пример #1
0
ThingSpeakClient::ThingSpeakClient()
{
    m_bNewErrMsg = false;
    memset(m_szLastError,0,sizeof(m_szLastError));
    resetFields();

}
Пример #2
0
bool Data::fromData(DataReader &dataReader) {
    try {
        readFields(dataReader);
        return true;
    } catch (DataReader::EndOfFile &eof) {
        resetFields();
    }
    return false;
}
Пример #3
0
MainWindow::MainWindow(dataStorageInterface* dataStorageType,QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    this->dataStorageType = dataStorageType;
    ui->setupUi(this);

    //Reset all the input fields
    resetFields();
    ui->dateEdit->setDisplayFormat("dd - MMMM - yyyy");

    //Display today's Occasion from the existing data
    displayOccasions();

    //Connecting to the Slots
    connect(ui->pushAdd, SIGNAL(clicked()),this, SLOT(validateData()));
    connect(ui->pushAdd, SIGNAL(clicked()),this, SLOT(resetFields()));
    connect(ui->pushSave, SIGNAL(clicked()),this, SLOT(saveData()));
    connect(ui->pushReset, SIGNAL(clicked()),this, SLOT(resetFields()));
    connect(ui->pushRevert, SIGNAL(clicked()),this, SLOT(revert()));
}
Пример #4
0
DataCluster::DataCluster(Drive* d , ClusterNo no,char* fname):Cluster(d,no){

	CurrField			=		0;
	FirstLevelData		=		0;
	SecondLevelField	=		0;
	SecondLevelData		=		0;
	indexClusterNo		=	   no;
	numOfDataClusters	=		0;
	putanjaFajla	=	fname;	// zbog buffer-a
	
	readFieldFD(no);	// upisuje vrednosti pocetnog indeksnog kastera u fields
	resetFields();

}
Пример #5
0
bool ThingSpeakClient::writeFields(const char *wrApiKey)
{
    m_httpClient.httpRequest()->setMethod("POST");
    m_httpClient.httpRequest()->setHost(THINGSPEAK_HOSTNAME);
    m_httpClient.httpRequest()->setVersion("HTTP/1.1");
    m_httpClient.httpRequest()->setURI(THINGSPEAK_UPDATE_URI);
    m_httpClient.httpRequest()->addHeaderItem("Content-Type","application/x-www-form-urlencoded");
    m_httpClient.httpRequest()->addHeaderItem("X-THINGSPEAKAPIKEY", wrApiKey);

    fieldDataToStr();
    m_httpClient.httpRequest()->addContent(m_szFieldDataStr.c_str());
    m_httpClient.httpRequest()->setHost(THINGSPEAK_HOSTNAME);

    if(false ==  m_httpClient.SendRequest())
    {
        m_bNewErrMsg = true;
        strcpy(m_szLastError, "Failed to upload data.");
        strcat(m_szLastError,m_httpClient.GetLastError());
        return false;
    }


    if(strcmp(m_httpClient.httpResponse()->statusCode(),"200") != 0)
    {
        m_bNewErrMsg = true;
        strcpy(m_szLastError, "Failed to update field(s). HTTP error");
        return false;
    }

    if(strcmp(m_httpClient.httpResponse()->content(),"0") == 0)
    {
        m_bNewErrMsg = true;
        strcpy(m_szLastError, "Failed to update field(s). Possibly too short update interval.");
        return false;
    }

    resetFields();

    return true;

}
Пример #6
0
	void NewProjectDialog::showDialog()
	{
		resetFields();
		show();
	}
Пример #7
0
void CollationWidget::hideEvent(QHideEvent *event)
{
	resetFields();
	BaseObjectWidget::hideEvent(event);
}