//___________________________________________________
    bool Factory::reset(unsigned long changed)
    {

        if( changed & SettingColors )
        { shadowCache().invalidateCaches(); }

        // read in the configuration
        setInitialized( false );
        bool _configurationchanged = readConfig();
        setInitialized( true );

        if( _configurationchanged || (changed & (SettingDecoration | SettingButtons | SettingBorder)) )
        {

            // returning true triggers all decorations to be re-created
            return true;

        } else {

            // no need to re-create the decorations
            // trigger repaint only
            resetDecorations(changed);
            return false;

        }

    }
Ejemplo n.º 2
0
OperatorItem::OperatorItem(OperatorModel* model, QGraphicsItem * parent)
  : QGraphicsObject(parent),
    m_model(model)
{
    QPainterPath path;
    path.addRoundedRect(QRectF(-SIZE/2, -SIZE/2, SIZE, SIZE), RADIUS, RADIUS);
    m_opRect = new QGraphicsPathItem(path, this);
    QPen pen = m_opRect->pen();
    pen.setWidthF(WIDTH);
    m_opRect->setPen(pen);
    m_opRect->setBrush(Qt::white);
    setPos(m_model->pos());
    
    m_label = new QGraphicsTextItem(this);
    m_label->setPlainText(QString::fromStdString(m_model->op()->name()));
    m_label->setPos(-m_label->boundingRect().width()/2, SIZE/2 + LABEL_OFFSET);
    
    setFlag(ItemIsMovable, true);
    setFlag(ItemIsSelectable, true);
    setFlag(ItemIsFocusable, true);
    setFlag(ItemSendsScenePositionChanges, true);
    
    setInitialized(model->isInitialized());
    
    connect(m_model, SIGNAL(nameChanged(QString)), this, SLOT(setName(QString)));
    connect(m_model, SIGNAL(initializedChanged(bool)), this, SLOT(setInitialized(bool)));
    connect(m_model, SIGNAL(posChanged(QPointF)), this, SLOT(setOperatorPos(QPointF)));
    connect(m_model, SIGNAL(connectorOccupiedChanged(OperatorModel::ConnectorType,uint,bool)),
            this, SLOT(setConnectorOccupied(OperatorModel::ConnectorType,uint,bool)));
    connect(m_model, SIGNAL(activeChanged(bool)), this, SLOT(resetAllConnectors()));
}
Ejemplo n.º 3
0
void SwitchNode::uninitialize() 
{
	if (isInitialized() == true) {
		UninitializeSwitch(this);
		setInitialized(false);
	}
}
// Constructor with estimate and time.
HomogeneousPointParameterBlock::HomogeneousPointParameterBlock(
    const Eigen::Vector3d& point, uint64_t id, bool initialized) {
  setEstimate(Eigen::Vector4d(point[0], point[1], point[2], 1.0));
  setId(id);
  setInitialized(initialized);
  setFixed(false);
}
Ejemplo n.º 5
0
void ScriptNode::initialize() 
{
#ifdef SUPPORT_JSAI
	if (!isInitialized()) {

		if (mpJScriptNode) {
			delete mpJScriptNode;
			mpJScriptNode = NULL;
		}

		JScript *sjnode = new JScript(this);
	
		assert(sjnode);

		if (sjnode->isOK()) {
			mpJScriptNode = sjnode;
		}
		else
			delete sjnode;

		setInitialized(true);
	}

	if (mpJScriptNode) {
		mpJScriptNode->setValue(this);
		mpJScriptNode->initialize();
		mpJScriptNode->getValue(this);
	}

#endif
}
Ejemplo n.º 6
0
void KonquerorProfilesMenu::initialize()
{
   if (initialized()) clear();
   setInitialized(true);

   QStringList profiles = KGlobal::dirs()->findAllResources( "data", "konqueror/profiles/*", false, true );

   m_profiles.resize(profiles.count());
   int id=1;
   QStringList::ConstIterator pEnd = profiles.end();
   for (QStringList::ConstIterator pIt = profiles.begin(); pIt != pEnd; ++pIt )
   {
      QFileInfo info( *pIt );
      QString profileName = KIO::decodeFileName( info.baseName() );
      QString niceName=profileName;
      KSimpleConfig cfg( *pIt, true );
      if ( cfg.hasGroup( "Profile" ) )
      {
         cfg.setGroup( "Profile" );
         if ( cfg.hasKey( "Name" ) )
            niceName = cfg.readEntry( "Name" );

         insertItem(niceName, id);
         m_profiles[id-1]=profileName;
         id++;
      }
   }
}
Ejemplo n.º 7
0
    int OpenGLThread::initBPS() {
        //Initialize BPS library
        bps_initialize();
        m_api = GL_ES_1;
        //Create a screen context that will be used to create an EGL surface to to receive libscreen events
        if (EXIT_SUCCESS != screen_create_context(&m_screen_ctx, 0)) {
            fprintf(stderr, "screen_request_events failed\n");
            return EXIT_FAILURE;
        }

        // wait for rendering API to be set
        while (m_api == GL_UNKNOWN) {
            usleep(10);
        };

        // initialize EGL
        if (EXIT_SUCCESS != initEGL()) {
            fprintf(stderr, "initialize EGL failed\n");
            return EXIT_FAILURE;
        }

        //Signal BPS library that screen events will be requested
        if (BPS_SUCCESS != screen_request_events(m_screen_ctx)) {
            fprintf(stderr, "screen_request_events failed\n");
            return EXIT_FAILURE;
        }

        setInitialized(true);

        return EXIT_SUCCESS;
    }
Ejemplo n.º 8
0
AAFRESULT STDMETHODCALLTYPE 
  ImplEnumAAFStorablePropVals::Initialize(
    ImplAAFRefContainerValue* containerValue,
    OMReferenceContainerIterator* containerIterator)
{
  AAFRESULT result = AAFRESULT_SUCCESS;
  if (NULL == containerValue || NULL == containerIterator)
    return AAFRESULT_NULL_PARAM;
    
  ASSERTU(!isInitialized());
  if (isInitialized())
    return AAFRESULT_ALREADY_INITIALIZED;
  
  _elementType = containerValue->GetElementType();
  if (NULL == _elementType)
    return AAFRESULT_INVALID_OBJ;
  
  _containerIterator = containerIterator;
  _containerValue = containerValue;
  containerValue->AcquireReference();

  // This instance is now fully initialized.
  setInitialized();
  
  return result;
}
Ejemplo n.º 9
0
void nuVertexBuffer::update(void)
{
  if(!isInitialized()) {
    CHECK_GL_ERROR(glGenBuffers(1, &mVertexBufferID));
    NU_ASSERT(mVertexBufferID != 0, "Cannot generate vertex buffer object.\n");

    CHECK_GL_ERROR(glBindBuffer(GL_ARRAY_BUFFER, mVertexBufferID));
    CHECK_GL_ERROR(glBufferData(GL_ARRAY_BUFFER, mSize, mpBuffer, getResourceUsage()));
    
    if(getUsage() == nuGResource::STATIC_RESOURCE)
      releaseBuffer();

    mCommitSize = 0;
    setInitialized(true);
  } else {
    CHECK_GL_ERROR(glBindBuffer(GL_ARRAY_BUFFER, mVertexBufferID));

    if(mCommitSize > VERTEX_BUFFER_MAP_THRESHOLD) {
      void* p_buffer;
      CHECK_GL_ERROR(p_buffer = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY));
      memcpy(p_buffer, mpBuffer, mCommitSize);
      CHECK_GL_ERROR(glUnmapBuffer(GL_ARRAY_BUFFER));
    } else {
      CHECK_GL_ERROR(glBufferSubData(GL_ARRAY_BUFFER, 0, mCommitSize, mpBuffer));
    }

    mCommitSize = 0;
  }
}
Ejemplo n.º 10
0
void Node::initializeMember()
{
	mName				= mOrgName				= new String();
	mType				= mOrgType				= new String();
	mExposedField		= mOrgExposedField		= new Vector<Field>();
	mEventInField		= mOrgEventInField		= new Vector<Field>();
	mEventOutField		= mOrgEventOutField		= new Vector<Field>();
	mField				= mOrgField				= new Vector<Field>();
	mPrivateField		= mOrgPrivateField		= new Vector<Field>();

	mPrivateNodeVector	= new Vector<Node>();
	mInitialized		= new bool;

	mChildNodes			= new LinkedList<Node>();

	setName(NULL);
	setParentNode(NULL);
	setSceneGraph(NULL);
#ifdef SUPPORT_JSAI
	setJavaNodeObject(NULL);
#endif
	setValue(NULL);
	setInitialized(false);
	setName(NULL);
	setReferenceNode(NULL);
}
Ejemplo n.º 11
0
void MenuMedia::initialize()
{
	if(initialized())
	{
		return;
	}
	if (KickerSettings::menuEntryHeight() > -1)
	{
		insertItem(SmallIconSet("system",KickerSettings::menuEntryHeight()),
		           i18n("Storage Media"), this, SLOT(slotOpenMediaSlave() ));
	}
	else
	{
		insertItem( i18n("Storage Media"), this, SLOT(slotOpenMediaSlave() ));
	}

	insertSeparator();


	m_DirLister->stop();
	m_DirLister->clearMimeFilter();
	m_DirLister->setMimeExcludeFilter(m_ExcludedTypesList);
	m_DirLister->openURL(KURL("media:/"));

	setInitialized( true );
}
Ejemplo n.º 12
0
void SwitchNode::initialize() 
{
	if (isInitialized() == false) {
		InitializeSwitch(this);
		setInitialized(true);
	}
}
 //___________________________________________________
 Factory::Factory():
     _initialized( false ),
     _helper( "oxygenDeco" ),
     _shadowCache( _helper )
 {
     readConfig();
     setInitialized( true );
 }
void DeviceManager::uninitialize()
{
    if (initialized()) {
        if (watcher())
            watcher()->stop();
        setInitialized(false);
    }
}
bool DeviceManager::initialize()
{
    if (!initialized()) {
        if (watcher() && !watcher()->start())
            return false;
        setInitialized(true);
    }
    return true;
}
void ShardingInitializationMongoD::initializeFromShardIdentity(
    OperationContext* opCtx, const ShardIdentityType& shardIdentity) {
    invariant(serverGlobalParams.clusterRole == ClusterRole::ShardServer);
    invariant(opCtx->lockState()->isLocked());

    uassertStatusOKWithContext(
        shardIdentity.validate(),
        "Invalid shard identity document found when initializing sharding state");

    log() << "initializing sharding state with: " << shardIdentity;

    const auto& configSvrConnStr = shardIdentity.getConfigsvrConnectionString();

    auto const shardingState = ShardingState::get(opCtx);
    auto const shardRegistry = Grid::get(opCtx)->shardRegistry();

    stdx::unique_lock<stdx::mutex> ul(_initSynchronizationMutex);

    if (shardingState->enabled()) {
        uassert(40371, "", shardingState->shardId() == shardIdentity.getShardName());
        uassert(40372, "", shardingState->clusterId() == shardIdentity.getClusterId());

        auto prevConfigsvrConnStr = shardRegistry->getConfigServerConnectionString();
        uassert(40373, "", prevConfigsvrConnStr.type() == ConnectionString::SET);
        uassert(40374, "", prevConfigsvrConnStr.getSetName() == configSvrConnStr.getSetName());

        return;
    }

    auto initializationStatus = shardingState->initializationStatus();
    uassert(ErrorCodes::ManualInterventionRequired,
            str::stream() << "Server's sharding metadata manager failed to initialize and will "
                             "remain in this state until the instance is manually reset"
                          << causedBy(*initializationStatus),
            !initializationStatus);

    try {
        _initFunc(opCtx, shardIdentity, generateDistLockProcessId(opCtx));
        shardingState->setInitialized(shardIdentity.getShardName().toString(),
                                      shardIdentity.getClusterId());
    } catch (const DBException& ex) {
        shardingState->setInitialized(ex.toStatus());
    }
}
Ejemplo n.º 17
0
 //___________________________________________________
 Factory::Factory(QObject *parent):
     KDecorationFactory(parent),
     _initialized( false ),
     _helper(),
     _shadowCache( _helper )
 {
     readConfig();
     setInitialized( true );
     connect(options(), &KDecorationOptions::colorsChanged, [this]() {
         _shadowCache.invalidateCaches();
     });
     connect(options(), &KDecorationOptions::configChanged, [this]() {
         // read in the configuration
         setInitialized( false );
         readConfig();
         setInitialized( true );
         emit recreateDecorations();
     });
 }
Ejemplo n.º 18
0
 void andGate::init(unsigned int numInputs)
 {
    setInitialized();
    for(unsigned int x  = 0; x < numInputs;x++)
    {
    input newinput;
    newinput.ConnectedGate = NULL;
    newinput.isConnected = false;
    m_inputs.append(newinput);
    }
 }
Ejemplo n.º 19
0
void Database::init()
{
    qDebug() << "Initializing ...";
    if (isInitialized())
        return;

    qDebug() << "Not initialized";
    createTables();
    resetDefaults();
    setInitialized();
}
Ejemplo n.º 20
0
void
FsManager_c::init()
{
  isoaglib_assert (!initialized());

  m_commands.init();

  getSchedulerInstance().registerTask( *this, 0 );
  getIsoMonitorInstance4Comm().registerControlFunctionStateHandler(mc_saClaimHandler);

  setInitialized();
}
Ejemplo n.º 21
0
// Initialize the optimizer
void SolverGurobi::initialize()
{
    ProblemClass probClass = constraints->assessClass();
    if (probClass != ProblemClass::LP
            && probClass != ProblemClass::MILP)
    {
        cout << "Problem class not LP or MILP: cannot use Gurobi!" << endl;
        exit(1);
    }

    setInitialized(true);
}
Ejemplo n.º 22
0
 void connect( adicontroller::Instrument::Session * session, const char * token ) {
     if ( !isInitialized_ && ( session_ = session->pThis() ) ) {
         setInitialized( true );
         if ( ( receiver_ = std::make_shared< ReceiverImpl >( this ) ) ) {
             session_->connect( receiver_.get(), token );
             if ( auto observer = session_->getObserver() ) {
                 if ( ( observerEvents_ = std::make_shared< ObserverEventsImpl >( this ) ) )
                     observer->connect( observerEvents_.get(), adicontroller::SignalObserver::Realtime, token );
             }
             emit connected( this );
         }
     }
 }
Ejemplo n.º 23
0
void
BaseCommon_c::init()
{
  isoaglib_assert (!initialized());

  getSchedulerInstance().registerTask(mt_task, 0);
  // set configure values with call for config
  config_base (NULL, IsoAgLib::IdentModeImplement, 0 /* No individual PGN disabling */);
  // now let concrete specialized classes init their part...
  init_specialized();

  setInitialized();
}
Ejemplo n.º 24
0
void KateSessionMenu::slotExec( int id )
{
  if ( id < 0 )
    return;

  QStringList args;
  if ( id > 0 )
    args << "--start";

  // If a new session is requested we try to ask for a name.
  if ( id == 1 )
  {
    bool ok (false);
    QString name = KInputDialog::getText( i18n("Session Name"),
                                          i18n("Please enter a name for the new session"),
                                          QString::null,
                                          &ok, 0, 0, new Validator( m_parent ) );
    if ( ! ok )
      return;

    if ( name.isEmpty() && KMessageBox::questionYesNo( 0,
                          i18n("An unnamed session will not be saved automatically. "
                               "Do you want to create such a session?"),
                          i18n("Create anonymous session?"),
                          KStdGuiItem::yes(), KStdGuiItem::cancel(),
                          "kate_session_button_create_anonymous" ) == KMessageBox::No )
      return;

    if ( m_sessions.contains( name ) &&
         KMessageBox::warningYesNo( 0,
                                    i18n("You allready have a session named %1. Do you want to open that session?").arg( name ),
                                    i18n("Session exists") ) == KMessageBox::No )
      return;
    else
      // mark the menu as dirty so that it gets rebuild at next display
      // to show the new session
      setInitialized( false );

    args << name;
  }

  else if ( id == 2 )
    args << "";

  else if ( id > 2 )
    args << m_sessions[ id-3 ];

  kapp->kdeinitExec("kate", args);
}
FastSerial::FastSerial(const uint8_t portNumber, volatile uint8_t *ubrrh, volatile uint8_t *ubrrl,
					   volatile uint8_t *ucsra, volatile uint8_t *ucsrb, const uint8_t u2x,
					   const uint8_t portEnableBits, const uint8_t portTxBits) :
					   BufferedStream(&__FastSerial__rxBuffer[portNumber], &__FastSerial__txBuffer[portNumber]),
					   _ubrrh(ubrrh),
					   _ubrrl(ubrrl),
					   _ucsra(ucsra),
					   _ucsrb(ucsrb),
					   _u2x(u2x),
					   _portEnableBits(portEnableBits),
					   _portTxBits(portTxBits)
{
	setInitialized(portNumber);
	begin(57600);
}
Ejemplo n.º 26
0
void REIXSXESScanController::onInitialSetupMoveSucceeded() {


	// remember the state of the beamline at the beginning of the scan.
	AMControlInfoList positions(REIXSBeamline::bl()->exposedControls()->toInfoList());
	// add the spectrometer grating selection, since it's not a "control" anywhere.
	AMControlInfo grating("spectrometerGrating", REIXSBeamline::bl()->spectrometer()->specifiedGrating(), 0, 0, "[choice]", 0.1, "Spectrometer Grating");
	grating.setEnumString(REIXSBeamline::bl()->spectrometer()->spectrometerCalibration()->gratingAt(int(grating.value())).name());
	positions.insert(0, grating);

	scan_->setScanInitialConditions(positions);

	// tell the controller API we're now ready to go.
	setInitialized();
}
Ejemplo n.º 27
0
void ScriptNode::uninitialize() 
{
	setInitialized(false);

#ifdef SUPPORT_JSAI

	if (hasScript()) {
		JScript *jscript = getJavaNode();
		jscript->setValue(this);
		jscript->shutdown();
		jscript->getValue(this);
	}

#endif
}
Ejemplo n.º 28
0
AAFRESULT STDMETHODCALLTYPE
    ImplAAFRIFFChunk::Initialize (
      aafUInt32  chunkID)
{
	if( isInitialized() )
    {
        return AAFRESULT_ALREADY_INITIALIZED;
    }
	_chunkID = chunkID;

	AAFRESULT ar = AAFRESULT_SUCCESS;
    setInitialized();

  	return ar;
}
Ejemplo n.º 29
0
AAFRESULT ImplAAFWeakRefArrayValue::Initialize (
	  const ImplAAFTypeDefArray *containerType,
	  bool fixed)
{
  AAFRESULT result = AAFRESULT_SUCCESS;

  result = ImplAAFRefArrayValue::Initialize(containerType, fixed);
  
  if (AAFRESULT_SUCCEEDED(result))
  {
    // This instance is now fully initialized.
    setInitialized();
  }
  
  return result;
}
Ejemplo n.º 30
0
AAFRESULT ImplAAFWeakRefValue::Initialize (
  const ImplAAFTypeDefWeakObjRef *referenceType,    
  OMProperty *property)
{
  AAFRESULT result = AAFRESULT_SUCCESS;
  
  result = ImplAAFRefValue::Initialize(referenceType, property);
  
  if (AAFRESULT_SUCCEEDED(result))
  {
    // This instance is now fully initialized.
    setInitialized();
  }
  
  return result;
}