예제 #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);
}