BOOL LLFloaterNotificationConsole::postBuild()
{
	// these are in the order of processing
	addChannel("Unexpired");
	addChannel("Ignore");
	addChannel("VisibilityRules");
	addChannel("Visible", true);
	// all the ones below attach to the Visible channel
	addChannel("Persistent");
	addChannel("Alerts");
	addChannel("AlertModal");
	addChannel("Group Notifications");
	addChannel("Notifications");
	addChannel("NotificationTips");

//	getChild<LLButton>("add_notification")->setClickedCallback(onClickAdd, this);

	LLComboBox* notifications = getChild<LLComboBox>("notification_types");
	LLNotifications::TemplateNames names = LLNotifications::instance().getTemplateNames();
	for (LLNotifications::TemplateNames::iterator template_it = names.begin();
		template_it != names.end();
		++template_it)
	{
		notifications->add(*template_it);
	}
	notifications->sortByName();

	return TRUE;
}
//______________________________________________________________________________
void beamPositionMonitorInterface::initBPMChids()
{
    message( "\n", "Searching for bpm chids..." );
    // monitor objects
    for( auto && it1 : bpmObj.dataObjects )
        for( auto && it2 : it1.second.pvMonStructs )
            addChannel( it1.second.pvRoot, it2.second );
    // command objects
    for( auto && it1 : bpmObj.dataObjects )
        for( auto && it2 : it1.second.pvComStructs )
            addChannel( it1.second.pvRoot, it2.second );
    // send
    int status = sendToEpics( "ca_create_channel", "Found bpm chids.", "!!TIMEOUT!! Not all bpm ChIds found." );
    if( status == ECA_TIMEOUT )
    {
        std::this_thread::sleep_for(std::chrono::milliseconds( 500 )); /// MAGIC NUMBERR
        for( auto && it1 : bpmObj.dataObjects )
        {
            for( auto && it2 : it1.second.pvMonStructs )
                checkCHIDState( it2.second.CHID, it2.second.pvSuffix  );
            for( auto && it2 : it1.second.pvComStructs )
                checkCHIDState( it2.second.CHID, it2.second.pvSuffix  );
        }
        message("");
    }
    else if ( status == ECA_NORMAL )
        allChidsInitialised = true;  /// interface base class member
}
//______________________________________________________________________________
void shutterInterface::initChids()
{
    message( "\n", "Searching for Shutter chids...");
    for( auto && it1 : allShutterData )
    {
        addILockChannels( it1.second.numIlocks, it1.second.pvRoot, it1.second.name, it1.second.iLockPVStructs );
        for( auto && it2 : it1.second.pvComStructs )
            addChannel( it1.second.pvRoot, it2.second );
        for( auto && it2 : it1.second.pvMonStructs  )
            addChannel( it1.second.pvRoot, it2.second );
    }
    int status = sendToEpics( "ca_create_channel", "Found Shutter chids.", "!!TIMEOUT!! Not all shutter ChIds found." );
    if( status == ECA_TIMEOUT )
    {
        std::this_thread::sleep_for(std::chrono::milliseconds( 500 ));
        for( const auto & it : allShutterData )
        {
            message("\n", "Checking Chids for ", it.first );
            for( auto & it2 : it.second.pvMonStructs )
                checkCHIDState( it2.second.CHID, it2.second.pvSuffix );
            for( auto & it2 : it.second.pvComStructs )
                checkCHIDState( it2.second.CHID, it2.second.pvSuffix );
            for( auto & it2 : it.second.iLockPVStructs )
                checkCHIDState( it2.second.CHID, it2.second.pv );
        }
        message("");
    }
    else if ( status == ECA_NORMAL )
        allChidsInitialised = true;  /// interface base class member
}
Beispiel #4
0
void initChannels() {
    channelHead = malloc(sizeof(channelNode));

    channelHead->next = channelHead->prev = NULL;
    channelHead->name[0] = '\0';
    
    addChannel("#CHANNEL1");
    addChannel("#CHANNEL2");
}
GrayAU8ColorSpace::GrayAU8ColorSpace(const QString &name, KoColorProfile *p)
    : LcmsColorSpace<GrayAU8Traits>(colorSpaceId(), name,  TYPE_GRAYA_8, cmsSigGrayData, p)
{
    addChannel(new KoChannelInfo(i18n("Gray"), 0, 0, KoChannelInfo::COLOR, KoChannelInfo::UINT8));
    addChannel(new KoChannelInfo(i18n("Alpha"), 1, 1, KoChannelInfo::ALPHA, KoChannelInfo::UINT8));

    init();

    addStandardCompositeOps<GrayAU8Traits>(this);
}
XyzF32ColorSpace::XyzF32ColorSpace(const QString &name, KoColorProfile *p) :
    LcmsColorSpace<KoXyzF32Traits>(colorSpaceId(), name, TYPE_XYZA_FLT, cmsSigXYZData, p)
{
    addChannel(new KoChannelInfo(i18n("X"),     KoXyzF32Traits::x_pos     * sizeof(float), KoXyzF32Traits::x_pos,     KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, sizeof(float), Qt::cyan));
    addChannel(new KoChannelInfo(i18n("Y"),     KoXyzF32Traits::y_pos     * sizeof(float), KoXyzF32Traits::y_pos,     KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, sizeof(float), Qt::magenta));
    addChannel(new KoChannelInfo(i18n("Z"),     KoXyzF32Traits::z_pos     * sizeof(float), KoXyzF32Traits::z_pos,     KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, sizeof(float), Qt::yellow));
    addChannel(new KoChannelInfo(i18n("Alpha"), KoXyzF32Traits::alpha_pos * sizeof(float), KoXyzF32Traits::alpha_pos, KoChannelInfo::ALPHA, KoChannelInfo::FLOAT32, sizeof(float)));
    init();

    addStandardCompositeOps<KoXyzF32Traits>(this);
}
Beispiel #7
0
LabU16ColorSpace::LabU16ColorSpace(const QString &name, KoColorProfile *p)
    : LcmsColorSpace<KoLabU16Traits>(colorSpaceId(), name, TYPE_LABA_16, cmsSigLabData, p)
{
    addChannel(new KoChannelInfo(i18n("Lightness"), 0 * sizeof(quint16), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), QColor(100, 100, 100)));
    addChannel(new KoChannelInfo(i18n("a*"),        1 * sizeof(quint16), 1, KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), QColor(150, 150, 150)));
    addChannel(new KoChannelInfo(i18n("b*"),        2 * sizeof(quint16), 2, KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), QColor(200, 200, 200)));
    addChannel(new KoChannelInfo(i18n("Alpha"),     3 * sizeof(quint16), 3, KoChannelInfo::ALPHA, KoChannelInfo::UINT16, sizeof(quint16)));

    init();

    addStandardCompositeOps<KoLabU16Traits>(this);
}
XyzU16ColorSpace::XyzU16ColorSpace(const QString &name, KoColorProfile *p) :
        LcmsColorSpace<KoXyzU16Traits>(colorSpaceId(), name, TYPE_XYZA_16, cmsSigXYZData, p)
{
    addChannel(new KoChannelInfo(i18n("X"), KoXyzU16Traits::x_pos * sizeof(quint16), KoXyzU16Traits::x_pos, KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::cyan));
    addChannel(new KoChannelInfo(i18n("Y"), KoXyzU16Traits::y_pos * sizeof(quint16), KoXyzU16Traits::y_pos, KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::magenta));
    addChannel(new KoChannelInfo(i18n("Z"), KoXyzU16Traits::z_pos * sizeof(quint16), KoXyzU16Traits::z_pos, KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::yellow));
    addChannel(new KoChannelInfo(i18n("Alpha"), KoXyzU16Traits::alpha_pos * sizeof(quint16), KoXyzU16Traits::alpha_pos, KoChannelInfo::ALPHA, KoChannelInfo::UINT16, sizeof(quint16)));
    init();

    // ADD, ALPHA_DARKEN, BURN, DIVIDE, DODGE, ERASE, MULTIPLY, OVER, OVERLAY, SCREEN, SUBTRACT
    addStandardCompositeOps<KoXyzU16Traits>(this);
}
Beispiel #9
0
YCbCrU8ColorSpace::YCbCrU8ColorSpace(const QString &name, KoColorProfile *p)
    : LcmsColorSpace<KoYCbCrU8Traits>(colorSpaceId(), name, TYPE_YCbCrA_8, cmsSigXYZData, p)
{
    addChannel(new KoChannelInfo(i18n("Y"),     KoYCbCrU8Traits::Y_pos     * sizeof(quint8), KoYCbCrU8Traits::Y_pos,     KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::cyan));
    addChannel(new KoChannelInfo(i18n("Cb"),    KoYCbCrU8Traits::Cb_pos    * sizeof(quint8), KoYCbCrU8Traits::Cb_pos,    KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::magenta));
    addChannel(new KoChannelInfo(i18n("Cr"),    KoYCbCrU8Traits::Cr_pos    * sizeof(quint8), KoYCbCrU8Traits::Cr_pos,    KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::yellow));
    addChannel(new KoChannelInfo(i18n("Alpha"), KoYCbCrU8Traits::alpha_pos * sizeof(quint8), KoYCbCrU8Traits::alpha_pos, KoChannelInfo::ALPHA, KoChannelInfo::UINT8, sizeof(quint8)));

    init();

    addStandardCompositeOps<KoYCbCrU8Traits>(this);
}
Beispiel #10
0
CmykU8ColorSpace::CmykU8ColorSpace(const QString &name, KoColorProfile *p)
    : LcmsColorSpace<CmykU8Traits>(colorSpaceId(), name,  TYPE_CMYKA_8, cmsSigCmykData, p)
{
    addChannel(new KoChannelInfo(i18n("Cyan"), 0 * sizeof(quint8), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::cyan));
    addChannel(new KoChannelInfo(i18n("Magenta"), 1 * sizeof(quint8), 1, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::magenta));
    addChannel(new KoChannelInfo(i18n("Yellow"), 2 * sizeof(quint8), 2, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::yellow));
    addChannel(new KoChannelInfo(i18n("Black"), 3 * sizeof(quint8), 3, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::black));
    addChannel(new KoChannelInfo(i18n("Alpha"), 4 * sizeof(quint8), 4, KoChannelInfo::ALPHA, KoChannelInfo::UINT8, sizeof(quint8)));

    init();

    addStandardCompositeOps<CmykU8Traits>(this);
}
Beispiel #11
0
CmykU8ColorSpace::CmykU8ColorSpace(KoColorProfile *p) :
        LcmsColorSpace<CmykU8Traits>("CMYK", i18n("CMYK (8-bit integer/channel)"),  TYPE_CMYK5_8, icSigCmykData, p)
{
    addChannel(new KoChannelInfo(i18n("Cyan"), 0 * sizeof(quint8), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::cyan));
    addChannel(new KoChannelInfo(i18n("Magenta"), 1 * sizeof(quint8), 1, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::magenta));
    addChannel(new KoChannelInfo(i18n("Yellow"), 2 * sizeof(quint8), 2, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::yellow));
    addChannel(new KoChannelInfo(i18n("Black"), 3 * sizeof(quint8), 3, KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), Qt::black));
    addChannel(new KoChannelInfo(i18n("Alpha"), 4 * sizeof(quint8), 4, KoChannelInfo::ALPHA, KoChannelInfo::UINT8, sizeof(quint8)));
    init();

    // ADD, ALPHA_DARKEN, BURN, DIVIDE, DODGE, ERASE, MULTIPLY, OVER, OVERLAY, SCREEN, SUBTRACT
    addStandardCompositeOps<CmykU8Traits>(this);
}
RgbU16ColorSpace::RgbU16ColorSpace(const QString &name, KoColorProfile *p) :
    LcmsColorSpace<KoBgrU16Traits>(colorSpaceId(), name, TYPE_BGRA_16, cmsSigRgbData, p)
{
    addChannel(new KoChannelInfo(i18n("Blue") , 0 * sizeof(quint16), 2, KoChannelInfo::COLOR, KoChannelInfo::UINT16, 2, QColor(0, 0, 255)));
    addChannel(new KoChannelInfo(i18n("Green"), 1 * sizeof(quint16), 1, KoChannelInfo::COLOR, KoChannelInfo::UINT16, 2, QColor(0, 255, 0)));
    addChannel(new KoChannelInfo(i18n("Red")  , 2 * sizeof(quint16), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT16, 2, QColor(255, 0, 0)));
    addChannel(new KoChannelInfo(i18n("Alpha"), 3 * sizeof(quint16), 3, KoChannelInfo::ALPHA, KoChannelInfo::UINT16, 2));
    init();

    addStandardCompositeOps<KoBgrU16Traits>(this);

    addCompositeOp(new RgbCompositeOpIn<KoBgrU16Traits>(this));
    addCompositeOp(new RgbCompositeOpOut<KoBgrU16Traits>(this));
    addCompositeOp(new RgbCompositeOpBumpmap<KoBgrU16Traits>(this));
}
Beispiel #13
0
bool SampleBase::onInit()
{
	m_frameCount = 0;
	m_fps = 0.0f;

	addChannel( MSG_DEV );

	if ( !WinFrame::create( "Sample Test" , g_ScreenWidth , g_ScreenHeight ,
		   SysMsgHandler::MsgProc , false ) )
		return false;

	if ( !CFly::initSystem() )
		return  false;
	mWorld =  WorldManager::getInstance().createWorld( getHWnd() , g_ScreenWidth , g_ScreenHeight , 32 , false );

	CFly::PluginManager::getInstance().registerLinker( "CW3" , new Cw3FileLinker );

	if ( !mWorld )
		return false;

	mWorld->setDir( DIR_OBJECT , SAMPLE_DATA_DIR );
	mWorld->setDir( DIR_ACTOR  , SAMPLE_DATA_DIR"/NPC" );
	mWorld->setDir( DIR_TEXTURE, SAMPLE_DATA_DIR );
	mWorld->setDir( DIR_SHADER , SAMPLE_DATA_DIR"/Shader" );
	mMainViewport = mWorld->createViewport( 0 , 0 , g_ScreenWidth , g_ScreenHeight );
	mMainScene    = mWorld->createScene( 1 );
	mMainScene->setAmbientLight( Color4f(1,1,1) );

	mMainCamera = mMainScene->createCamera();
	mMainCamera->setAspect( float(  g_ScreenWidth ) / g_ScreenHeight );
	mMainCamera->setNear(5.0f);
	mMainCamera->setFar(100000.0f);

	return onSetupSample();
}
Beispiel #14
0
Animation::Channel* Animation::createChannel(AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned long* keyTimes, float* keyValues, float* keyInValue, float* keyOutValue, unsigned int type)
{
    unsigned int propertyComponentCount = target->getAnimationPropertyComponentCount(propertyId);
    assert(propertyComponentCount > 0);

    Curve* curve = new Curve(keyCount, propertyComponentCount);
    if (target->_targetType == AnimationTarget::TRANSFORM)
        setTransformRotationOffset(curve, propertyId);
    
    unsigned long lowest = keyTimes[0];
    unsigned long duration = keyTimes[keyCount-1] - lowest;

    float* normalizedKeyTimes = new float[keyCount];
    
    normalizedKeyTimes[0] = 0.0f;
    curve->setPoint(0, normalizedKeyTimes[0], keyValues, (Curve::InterpolationType) type, keyInValue, keyOutValue);

    unsigned int pointOffset = propertyComponentCount;
    unsigned int i = 1;
    for (; i < keyCount - 1; i++)
    {
        normalizedKeyTimes[i] = (float) (keyTimes[i] - lowest) / (float) duration;
        curve->setPoint(i, normalizedKeyTimes[i], (keyValues + pointOffset), (Curve::InterpolationType) type, (keyInValue + pointOffset), (keyOutValue + pointOffset));
        pointOffset += propertyComponentCount;
    }
    i = keyCount - 1;
    normalizedKeyTimes[i] = 1.0f;
    curve->setPoint(i, normalizedKeyTimes[i], keyValues + pointOffset, (Curve::InterpolationType) type, keyInValue + pointOffset, keyOutValue + pointOffset);

    SAFE_DELETE(normalizedKeyTimes);

    Channel* channel = new Channel(this, target, propertyId, curve, duration);
    addChannel(channel);
    return channel;
}
Beispiel #15
0
XyzF32ColorSpace::XyzF32ColorSpace(const QString &name, KoColorProfile *p) :
    LcmsColorSpace<KoXyzF32Traits>(colorSpaceId(), name, TYPE_XYZA_FLT, cmsSigXYZData, p)
{
    const IccColorProfile *icc_p = dynamic_cast<const IccColorProfile *>(p);
    Q_ASSERT(icc_p);
    QVector<KoChannelInfo::DoubleRange> uiRanges(icc_p->getFloatUIMinMax());
    Q_ASSERT(uiRanges.size() == 3);

    addChannel(new KoChannelInfo(i18n("X"),     KoXyzF32Traits::x_pos     * sizeof(float), KoXyzF32Traits::x_pos,     KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, sizeof(float), Qt::cyan, uiRanges[0]));
    addChannel(new KoChannelInfo(i18n("Y"),     KoXyzF32Traits::y_pos     * sizeof(float), KoXyzF32Traits::y_pos,     KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, sizeof(float), Qt::magenta, uiRanges[1]));
    addChannel(new KoChannelInfo(i18n("Z"),     KoXyzF32Traits::z_pos     * sizeof(float), KoXyzF32Traits::z_pos,     KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, sizeof(float), Qt::yellow, uiRanges[2]));
    addChannel(new KoChannelInfo(i18n("Alpha"), KoXyzF32Traits::alpha_pos * sizeof(float), KoXyzF32Traits::alpha_pos, KoChannelInfo::ALPHA, KoChannelInfo::FLOAT32, sizeof(float)));
    init();

    addStandardCompositeOps<KoXyzF32Traits>(this);
}
Beispiel #16
0
void MorseConnection::whenPhoneCodeRequired()
{
    qDebug() << Q_FUNC_INFO;

    Tp::DBusError error;

    //Registration
    Tp::BaseChannelPtr baseChannel = Tp::BaseChannel::create(this, TP_QT_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION);

    Tp::BaseChannelServerAuthenticationTypePtr authType
            = Tp::BaseChannelServerAuthenticationType::create(TP_QT_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION);
    baseChannel->plugInterface(Tp::AbstractChannelInterfacePtr::dynamicCast(authType));

    saslIface = Tp::BaseChannelSASLAuthenticationInterface::create(QStringList() << QLatin1String("X-TELEPATHY-PASSWORD"),
                                                                   /* hasInitialData */ false,
                                                                   /* canTryAgain */ true,
                                                                   /* authorizationIdentity */ m_selfPhone,
                                                                   /* defaultUsername */ QString(),
                                                                   /* defaultRealm */ QString(),
                                                                   /* maySaveResponse */ false);

    saslIface->setStartMechanismWithDataCallback( Tp::memFun(this, &MorseConnection::startMechanismWithData));

    baseChannel->setRequested(false);
    baseChannel->plugInterface(Tp::AbstractChannelInterfacePtr::dynamicCast(saslIface));

    baseChannel->registerObject(&error);

    if (!error.isValid()) {
        addChannel(baseChannel);
    }
}
Beispiel #17
0
void TGen::Engine::Sound::LocalSource::trigger(TGen::Engine::TriggerContext & context, TriggerMode mode) {
	TGen::Engine::Symbol methodSymbol = context.getFunctionSymbol();
	
	if (methodSymbol == symbolPlaySound) {
		int soundId = context.getParameter<int>(0);
		TGen::Engine::Sound::Sound * sound = TGen::union_cast<TGen::Engine::Sound::Sound *>(soundId);
		
		std::cout << "SOUND: " << std::hex << soundId << " " << sound << std::hex <<" " << context.getParameter<int>(0) << std::endl;
		
		if (!sound)
			throw TGen::RuntimeException("Sound::Source::trigger", "NULL sound sent");
		
		TGen::Engine::Sound::Channel * newChannel = sound->spawnChannel(false);
		newChannel->set3D(true);		// det som är felet!		blir override i localsource... KOLLA SEN HUR CALL OCH MOVE kan förbättras så de bara använder ComponentLink!
		newChannel->set3DMinMaxDistance(minDistance, maxDistance);
		newChannel->setVolume(volume);
		
		addChannel(newChannel);
		
		context.setRegister<TGen::Engine::Triggerable *>(context.getReturnRegister(), newChannel);
	}
	else {
		TGen::Engine::Sound::Source::trigger(context, mode);
	}
	
}
int QLCInputProfile_Test::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: manufacturer(); break;
        case 1: model(); break;
        case 2: name(); break;
        case 3: addChannel(); break;
        case 4: removeChannel(); break;
        case 5: remapChannel(); break;
        case 6: channel(); break;
        case 7: channels(); break;
        case 8: channelNumber(); break;
        case 9: copy(); break;
        case 10: assign(); break;
        case 11: load(); break;
        case 12: loadNoProfile(); break;
        case 13: loader(); break;
        case 14: save(); break;
        default: ;
        }
        _id -= 15;
    }
    return _id;
}
/*!
    Construct a new multi-port multiplexer object and attach it to \a parent.
    The \c{primary} channel will be set to \a device.  Further channels
    can be added by calling addChannel().  Ownership of \a device will
    pass to this object; it will be deleted when this object is deleted.
*/
QMultiPortMultiplexer::QMultiPortMultiplexer
        ( QSerialIODevice *device, QObject *parent )
    : QSerialIODeviceMultiplexer( parent )
{
    d = new QMultiPortMultiplexerPrivate();
    addChannel( "primary", device );
}
Beispiel #20
0
	DevLog()
	{
		addChannel( MSG_DEV );
		setLevel( 3 );

		pos = 0;
	}
Beispiel #21
0
void moduleDialog::loadSavedData(const QByteArray &inData)
{
    const int Header = 9;
    unsigned char highByte,lowByte;
    int overallSize,numberOfModules,i,j,k;
    int numberOfChunks = inData[8];
    char chunkID;
    int tempCounter;
    int fileLocation = 0;
    moduleList.clear();
    ui->moduleListView->clear();
    ui->channelListView->clear();
    ui->moduleChannelListView->clear();
    numberOfChannels=0;
    int channelCount;
    module tempMod;

    k=0;
    while(k<numberOfChunks)
    {
        chunkID = inData[fileLocation+Header];
        switch(chunkID)
        {
        case 0x06:
            numberOfModules = inData[fileLocation+Header+3];
            channelCount=inData[fileLocation+Header+4];

            i=0;
            while(i<channelCount)
            {
                addChannel();
                i++;
            }

            tempCounter=0;
            i=0;
            while(i<numberOfModules)
            {
                tempMod.clearAll();
                tempCounter+=tempMod.setSavedData(inData,fileLocation+Header+tempCounter+5);
                moduleList.push_back(tempMod);
                ui->moduleListView->addItem(QString("Module %1").arg(moduleList.at(moduleList.size()-1).getID()));
                i++;
            }
            highByte=inData[fileLocation+Header+1];
            lowByte=inData[fileLocation+Header+2];
            overallSize=(highByte<<8) | lowByte;
            fileLocation+=overallSize;
            break;
        default:
            highByte=inData[fileLocation+Header+1];
            lowByte=inData[fileLocation+Header+2];
            overallSize=(highByte<<8) | lowByte;
            fileLocation+=overallSize;
            break;
        }
        k++;
    }
}
Beispiel #22
0
bool SuplaDeviceClass::addDimmer(void) {

    int c = addChannel(0, 0, false, false);
    if ( c == -1 ) return false;

    Params.reg_dev.channels[c].Type = SUPLA_CHANNELTYPE_DIMMER;
    setRGBWvalue(c, Params.reg_dev.channels[c].value);
}
Beispiel #23
0
bool SuplaDeviceClass::addRgbController(void) {

    int c = addChannel(0, 0, false, false);
    if ( c == -1 ) return false;

    Params.reg_dev.channels[c].Type = SUPLA_CHANNELTYPE_RGBLEDCONTROLLER;
    setRGBWvalue(c, Params.reg_dev.channels[c].value);
}
Beispiel #24
0
void joinChannel(char *chName, clientNode *client) {
   channelNode *channel = searchChannel(chName);

   if(channel == NULL)
       channel = addChannel(chName);

   addRef(client, &(channel->refHead));
}
int ChannelInfoManager::getLastChannelMessage(int id)
{
	if (!channels.contains(id))
	{
		addChannel(id);
		save();
	}
	return channels.value(id).messageId;
}
bool ChannelInfoManager::getChannelNotifications(int id)
{
	if (!channels.contains(id))
	{
		addChannel(id);
		save();
	}
	return channels[id].isNotify;
}
 inline ChannelData *addChannel(const std::string &server,
     const std::string &channel,
     ChannelController *user_data){
     return addChannel(server.c_str(),
         server.length(),
         channel.c_str(),
         channel.length(),
         user_data);
 }
Beispiel #28
0
bool SuplaDeviceClass::addDistanceSensor(void) {

    int c = addChannel(0, 0, false, false);
    if ( c == -1 ) return false;

    Params.reg_dev.channels[c].Type = SUPLA_CHANNELTYPE_DISTANCESENSOR;
    channel_pin[c].last_val_dbl1 = -1;
    channelSetDoubleValue(c, channel_pin[c].last_val_dbl1);

}
Beispiel #29
0
bool SuplaDeviceClass::addDS18B20Thermometer(void) {

    int c = addChannel(0, 0, false, false);
    if ( c == -1 ) return false;

    Params.reg_dev.channels[c].Type = SUPLA_CHANNELTYPE_THERMOMETERDS18B20;
    channel_pin[c].last_val_dbl1 = -275;
    channelSetDoubleValue(c, channel_pin[c].last_val_dbl1);

}
void ChannelInfoManager::setLastChannelMessage(int id, int messageId)
{
	if (!channels.contains(id))
	{
		addChannel(id);
	}
	channels[id].messageId = messageId;

	save();
}