Пример #1
0
///////////////////////////////////////////////////////////////////////////
//	Name:	AddData
//
//	Description:
//	Add a multiple data record to the database (this can be either writing a new one
//	or rewriting an existing one)
//
//	Declaration:
//	int CGrandData::AddData(CString &pstrErrorMsg)
//
//	Input:
//			mbFillingExitingRec		true(rewriting an existing record)/false(creating a new record)
//			mpdbFloatDataRec		record that is to be written
//
//	Output:	pstrErrorMsg	error msg from problem, if any
//
//			mbFillingExistingRec	set to false if wrote an existing record
//
//	Return:	true (data successfully written) / false (some kind of error, see miErrorNum and pstrErroMsg)
//
//  date    /	author	revision
//  -----------------	--------
//	17-Dec-2001	SFK		Created from part of ImportData in DbImport.cpp
//////////////////////////////////////////////////////////////////
bool CGrandData::AddData(CString *pstrErrorMsg)
{

    bool bSuccess = true;
    int dbvstat = S_OKAY;
    if (!mbFillingExistingRec)
    {
        if ((dbvstat = d_fillnew(DB_FLOAT_DATA_REC,(char *)&mdbFloatDataRec, CURR_DB)) != S_OKAY)
            bSuccess = false;

        if (bSuccess)
        {
            if ((dbvstat = d_connect(DAY_TO_FLOAT_DATA_SET, CURR_DB)) != S_OKAY)
                bSuccess = false;
        }
    }
    else
    {   // special case if adding to an existing record in the dat
        if ((dbvstat = d_recwrite((char *)&mdbFloatDataRec, CURR_DB)) !=S_OKAY)
            bSuccess = false;
        mbFillingExistingRec = false;
    }
    if (!bSuccess)
    {
        miErrorNum = iDB_BAD;
        NewDbVistaError(pstrErrorMsg, false, dbvstat);
        return(false);
    }
    return(true);
}
Пример #2
0
VlcMediaPlayer::VlcMediaPlayer() :
    QObject()
{
    d = new VlcMediaPlayerPrivate(VlcInstance::globalInstance());

    d_connect();
}
Пример #3
0
VlcMediaPlayer::VlcMediaPlayer(libvlc_media_player_t *player) :
    QObject()
{
    d = VlcMediaPlayerPrivate::instance(player);

    if (d != nullptr)
        d_connect();
}
Пример #4
0
VlcMediaListPlayer::VlcMediaListPlayer(libvlc_media_list_player_t *p_mlp) :
    AbstractMediaListPlayer()
{
    d = VlcMediaListPlayerPrivate::instance(p_mlp);

    if (d != nullptr)
        d_connect();
}
Пример #5
0
// constructor / assignment
VlcMediaPlayer::VlcMediaPlayer(const VlcMediaPlayer &o) :
    QObject(), d(o.d)
{
    if (d != nullptr)
    {
        d->retain();
        d_connect();
    }
}
Пример #6
0
VlcMediaListPlayer::VlcMediaListPlayer(const VlcMediaListPlayer &o) :
    AbstractMediaListPlayer(), d(o.d)
{
    if (d != nullptr)
    {
        d->retain();
        d_connect();
    }
}
Пример #7
0
VlcMediaPlayer &VlcMediaPlayer::operator =(libvlc_media_player_t *player)
{
    if (d != nullptr)
    {
        disconnect(d);
        d->release();
    }

    d = VlcMediaPlayerPrivate::instance(player);

    if (d != nullptr)
        d_connect();

    return *this;
}
Пример #8
0
VlcMediaPlayer &VlcMediaPlayer::operator =(const VlcMediaPlayer &o)
{
    if (d != nullptr)
    {
        disconnect(d);
        d->release();
    }

    d = o.d;

    if (d != nullptr)
    {
        d->retain();
        d_connect();
    }

    return *this;
}
Пример #9
0
///////////////////////////////////////////////////////////////////////////
//	Name:	CreateDayRecInMainDb
//
//	Description:
//	Create a new day record for the given station and insert in the Rad dbVista main db.
//  If the day already exists in the db, do nothing.
//	Uses unadjusted times.
//
//	Declaration:
//	int CreateDayRecInMainDb(short sSta, DATE dDay)
//
//	Input:	sSta	number of station want to find day for
//			dDay	day (DATE format) searching for
//			
//	Output: none
//
//	Return: TRUE - day exists
//		    uiDAY_NOT_IN_DB	- day does not exist
//		    STA_NOT_IN_DB - sSta does not exist
//			DB_BAD - unexpected db error
//	
//  date    /	author	revision
//  -----------------	--------
//  23-May-1995 SFK	Created
//	02-Aug-2002	SFK		Changed to use DATE timebase (doubles in event rec)
//////////////////////////////////////////////////////////////////
int CDbDay::CreateDayRecInMainDb(short sSta, DATE dDay)
{
    struct db_day_rec dbDay;
    int status, db_stat;
    
   /* ------------------------------------------------------------------
    *	If the day is already in the db do nothing.
    * ----------------------------------------------------------------*/
	status = FindDayRecInMainDb(sSta, dDay);
    if (status != uiDAY_NOT_IN_DB_STATUS) 
		return(status);
       
   /* ------------------------------------------------------------------
    *	Find the sSta that will own this day and make it the owner of
    *	the set.
    * ----------------------------------------------------------------*/
	db_stat = d_keyfind(S_STA_NUM_KEY, (char *)&sSta, CURR_DB);
    if (db_stat != S_OKAY) goto db_exit;
	db_stat = d_setor(STATION_TO_DAY_SET, CURR_DB);
    if (db_stat != S_OKAY) goto db_exit;
       
   /* ------------------------------------------------------------------
    *	Fill the new record you want to write and connect into the database
    * ----------------------------------------------------------------*/
    dbDay.d_day_beg_time_key = dDay;
	dbDay.d_day_beg_time = dDay;
    dbDay.d_day_end_time = 0.0;
    dbDay.ul_day_total_pts = 0;
	db_stat = d_fillnew(DB_DAY_REC,(char *)&dbDay, CURR_DB);
    if (db_stat != S_OKAY) goto db_exit;
	db_stat = d_connect(STATION_TO_DAY_SET, CURR_DB);
    if (db_stat != S_OKAY) goto db_exit;
    return(TRUE);

db_exit:
    RadReviewMsg(uiDB_BAD_ERR, "CreateDayRecInMainDb", db_stat);	// had unexpected db error if get here
    return(uiDB_BAD_ERR);
}
Пример #10
0
d_connect::d_connect(QString *u, QString *p){
    d_connect();
    usrname = u;
    pswd = p;
}
Пример #11
0
VlcMediaPlayer::VlcMediaPlayer(libvlc_instance_t *instance) :
    QObject()
{
    d = new VlcMediaPlayerPrivate(instance);
    d_connect();
}
Пример #12
0
VlcMediaPlayer::VlcMediaPlayer(const VlcInstance &instance) :
    QObject()
{
    d = new VlcMediaPlayerPrivate(getref<VlcInstance>(instance)->data());
    d_connect();
}