int main (int argc, char** argv){
    setTraceType (PAJE);
    initTrace ("gtg_color", 0, GTG_FLAG_NONE);
    addContType ("CT_NET", "0", "Network");
    addContType ("CT_NODE", "CT_NET", "Node");
    addContType ("CT_PROC", "CT_NODE", "Proc");
    addStateType ("ST_NodeState", "CT_NODE", "Node state");
    addStateType ("ST_ProcState", "CT_PROC", "Procstate");

    addEntityValue ("SN_0", "ST_NodeState", "black", GTG_BLACK);
    addEntityValue ("SN_1", "ST_NodeState", "red", GTG_RED);
    addEntityValue ("SN_2", "ST_NodeState", "green", GTG_GREEN);
    addEntityValue ("SN_3", "ST_NodeState", "blue", GTG_BLUE);
    addEntityValue ("SN_4", "ST_NodeState", "white", GTG_WHITE);
    addEntityValue ("SN_5", "ST_NodeState", "teal", GTG_TEAL);
    addEntityValue ("SN_6", "ST_NodeState", "darkgrey", GTG_DARKGREY);
    addEntityValue ("SN_7", "ST_NodeState", "yellow", GTG_YELLOW);
    addEntityValue ("SN_8", "ST_NodeState", "purple", GTG_PURPLE);
    addEntityValue ("SN_9", "ST_NodeState", "lightbrown", GTG_LIGHTBROWN);
    addEntityValue ("SN_10", "ST_NodeState", "lightgrey", GTG_LIGHTGREY);
    addEntityValue ("SN_11", "ST_NodeState", "darkblue", GTG_DARKBLUE);
    addEntityValue ("SN_12", "ST_NodeState", "pink", GTG_PINK);
    addEntityValue ("SN_13", "ST_NodeState", "darkpink", GTG_DARKPINK);
    addEntityValue ("SN_14", "ST_NodeState", "seablue", GTG_SEABLUE);
    addEntityValue ("SN_15", "ST_NodeState", "kaki", GTG_KAKI);
    addEntityValue ("SN_16", "ST_NodeState", "redblood", GTG_REDBLOOD);
    addEntityValue ("SN_17", "ST_NodeState", "brown", GTG_BROWN);
    addEntityValue ("SN_18", "ST_NodeState", "grenat", GTG_GRENAT);
    addEntityValue ("SN_19", "ST_NodeState", "orange", GTG_ORANGE);
    addEntityValue ("SN_20", "ST_NodeState", "mauve", GTG_MAUVE);
    addEntityValue ("SN_21", "ST_NodeState", "lightpink", GTG_LIGHTPINK);

    addContainer (0.00000, "C_Net0", "CT_NET", "0", "Ensemble0", "0");
    addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "0");


    addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", "0");

    int i;
    for(i=0; i<21;i++) {
	    char* nodeState = NULL;
	    asprintf(&nodeState, "SN_%d", i);
	    setState ((float)i, "ST_NodeState", "C_P0", nodeState);
    }

    endTrace ();
    return EXIT_SUCCESS;
}
Exemple #2
0
int PMComboAction::plug( QWidget* w, int index )
{
    if( !w->inherits( "KToolBar" ) )
        return -1;

    KToolBar* toolBar = ( KToolBar* ) w;

    int id = KAction::getToolButtonID( );

    QComboBox* comboBox = new PMComboBox( toolBar );
    if( m_minWidth > 0 )
        comboBox->setMinimumWidth( m_minWidth );
    if( m_maxWidth > 0 )
        comboBox->setMaximumWidth( m_maxWidth );

    toolBar->insertWidget( id, m_minWidth > 0 ? m_minWidth : 300,
                           comboBox, index );
    connect( comboBox, SIGNAL( activated( int ) ), m_receiver, m_member );

    addContainer( toolBar, id );

    connect( toolBar, SIGNAL( destroyed( ) ), this, SLOT( slotDestroyed( ) ) );

    //toolBar->setItemAutoSized( id, true );

    m_combo = comboBox;

    emit plugged( );

    QWhatsThis::add( comboBox, whatsThis( ) );

    return containerCount( ) - 1;
}
Exemple #3
0
int PMSpinBoxAction::plug( QWidget* w, int index )
{
    if( !w->inherits( "KToolBar" ) )
        return -1;

    KToolBar* toolBar = ( KToolBar* ) w;

    int id = KAction::getToolButtonID( );

    QSpinBox* spinBox = new QSpinBox( -1000, 1000, 1, w );
    toolBar->insertWidget( id, 70, spinBox, index );

    connect( spinBox, SIGNAL( valueChanged( int ) ), m_receiver, m_member );

    addContainer( toolBar, id );

    connect( toolBar, SIGNAL( destroyed( ) ), this, SLOT( slotDestroyed( ) ) );
    //toolBar->setItemAutoSized( id, false );

    m_spinBox = spinBox;

    emit plugged( );

    QWhatsThis::add( spinBox, whatsThis( ) );

    return containerCount( ) - 1;
}
void DockBarExtension::embedWindow(WId win, QString command, QString resName, QString resClass)
{
    if(win == 0)
        return;
    DockContainer *container = 0;
    bool ncmd = false;

    for(DockContainer::Vector::const_iterator it = containers.constBegin(); it != containers.constEnd(); ++it)
    {
        DockContainer *c = *it;
        if(c->embeddedWinId() == 0 && c->resName() == resName && c->resClass() == resClass && (command.isNull() || c->command() == command))
        {
            container = c;
            break;
        }
    }

    if(container == 0)
    {
        QString cmd = command.isNull() ? resClass : command;
        if(KStandardDirs::findExe(KShell::splitArgs(cmd).front()).isEmpty())
            ncmd = true;
        container = new DockContainer(cmd, this, resName, resClass);
        addContainer(container);
    }

    container->embed(win);
    layoutContainers();
    emit updateLayout();
    if(ncmd)
        container->askNewCommand();
}
void DockBarExtension::loadContainerConfig()
{
    KConfig *conf = config();
    conf->setGroup("General");
    QStringList applets = conf->readListEntry("Applets");

    QStringList fail_list;
    for(QStringList::Iterator it = applets.begin(); it != applets.end(); ++it)
    {
        if(!conf->hasGroup(*it))
            continue;
        conf->setGroup(*it);
        QString cmd = conf->readPathEntry("Command");
        QString resName = conf->readPathEntry("resName");
        QString resClass = conf->readEntry("resClass");
        if(cmd.isEmpty() || resName.isEmpty() || resClass.isEmpty())
            continue;

        DockContainer *c = new DockContainer(cmd, this, resName, resClass);
        addContainer(c);

        KProcess proc;
        proc << KShell::splitArgs(cmd);
        if(!proc.start(KProcess::DontCare))
        {
            fail_list.append(cmd);
            removeContainer(c);
        }
    }
    if(!fail_list.isEmpty())
        KMessageBox::queuedMessageBox(0, KMessageBox::Information,
                                      i18n("The following dockbar applets could not be started: %1").arg(fail_list.join(", ")),
                                      i18n("kicker: information"), 0);
    saveContainerConfig();
}
int TKAction::plug(QWidget* widget, int index)
{
  if ( widget->inherits("KToolBar") ) {
    KToolBar* bar = static_cast<KToolBar*>(widget);
    int id_ = KAction::getToolButtonID();
    KInstance *instance;

    if ( parentCollection() )
      instance = parentCollection()->instance();
    else
      instance = KGlobal::instance();

    TKToolBarButton* b = new TKToolBarButton(icon(),plainText(),bar,name(),instance);
    // we don't need clicked() and buttonClicked(), do we?
    // connect(b,SIGNAL(clicked()),SLOT(slotActivated()));
    b->setIconMode(m_imode);
    initToolBarButton(b);

    bar->insertWidget( id_, 100, b, index );
    addContainer(bar,id_);
    connect( bar, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );

    return containerCount() - 1;
  }
  return KAction::plug(widget,index);
}
Exemple #7
0
void Npc::init(const glm::ivec3* pos) {
	const glm::ivec3& randomPos = pos ? *pos : _world->randomPos();
	const int material = _world->getMaterial(randomPos.x, randomPos.y, randomPos.z);
	Log::info("spawn character %i with behaviour tree %s at position %i:%i:%i (material: %i)",
			ai()->getId(), ai()->getBehaviour()->getName().c_str(), randomPos.x, randomPos.y, randomPos.z, material);
	setHomePosition(randomPos);
	_ai->getCharacter()->setPosition(ai::Vector3f(randomPos.x, randomPos.y, randomPos.z));
	const char *typeName = network::messages::EnumNameNpcType(_type);
	addContainer(typeName);
	initAttribs();
}
CLandmarkContainer* CLandmarkOverlay::pickContainer()
{
  int __iCount = QTreeWidgetItem::childCount();
  if( !__iCount ) return addContainer( COverlay::newChildName( "Landmarks", 1, true ) );
  if( __iCount == 1 ) return (CLandmarkContainer*)QTreeWidgetItem::child( 0 );
  // else: we must have the user choose among the available containers
  COverlayObject* __poOverlayObject = 0;
  CLandmarkContainerPickView* __poLandmarkContainerPickView = new CLandmarkContainerPickView( this, &__poOverlayObject );
  __poLandmarkContainerPickView->exec();
  delete __poLandmarkContainerPickView;
  return (CLandmarkContainer*)__poOverlayObject;
}
        void Render::fillBuffers()
        {
            addGrid();
            addContainer();

            Model::Cube cube = Model::Cube();
            std::vector <glm::vec3> cubeVertices = cube.getVertices();
            std::vector <glm::vec3> cubeNormals = cube.getNormals();

            vertices.insert(vertices.end(), cubeVertices.begin(), cubeVertices.end());
            normals.insert(normals.end(), cubeNormals.begin(), cubeNormals.end());
        }
Exemple #10
0
/*
 * Fetches and parses the UPNP response
 */
bool MediaServer::fetchContents()
{
    IXML_Document* p_response = _browseAction( m_psz_objectId,
                                "BrowseDirectChildren",
                                "*",
                                // Some servers don't understand "0" as "no-limit"
                                "1000", /* RequestedCount */
                                "" /* SortCriteria */
                                             );
    if ( !p_response )
    {
        msg_Err( m_access, "No response from browse() action" );
        return false;
    }

    IXML_Document* p_result = parseBrowseResult( p_response );

    ixmlDocument_free( p_response );

    if ( !p_result )
    {
        msg_Err( m_access, "browse() response parsing failed" );
        return false;
    }

#ifndef NDEBUG
    msg_Dbg( m_access, "Got DIDL document: %s", ixmlPrintDocument( p_result ) );
#endif

    IXML_NodeList* containerNodeList =
        ixmlDocument_getElementsByTagName( p_result, "container" );

    if ( containerNodeList )
    {
        for ( unsigned int i = 0; i < ixmlNodeList_length( containerNodeList ); i++ )
            addContainer( (IXML_Element*)ixmlNodeList_item( containerNodeList, i ) );
        ixmlNodeList_free( containerNodeList );
    }

    IXML_NodeList* itemNodeList = ixmlDocument_getElementsByTagName( p_result,
                                  "item" );
    if ( itemNodeList )
    {
        for ( unsigned int i = 0; i < ixmlNodeList_length( itemNodeList ); i++ )
            addItem( (IXML_Element*)ixmlNodeList_item( itemNodeList, i ) );
        ixmlNodeList_free( itemNodeList );
    }

    ixmlDocument_free( p_result );
    return true;
}
Exemple #11
0
int PMLabelAction::plug( QWidget *widget, int index )
{
    //do not call the previous implementation here

    if( widget->inherits( "KToolBar" ) )
    {
        KToolBar* tb = ( KToolBar* ) widget;

        int id = KAction::getToolButtonID( );

        m_button = new PMToolBarLabel( text( ), widget );
        tb->insertWidget( id, m_button->width( ), m_button, index );

        addContainer( tb, id );

        connect( tb, SIGNAL( destroyed( ) ), this, SLOT( slotDestroyed( ) ) );

        return containerCount( ) - 1;
    }

    return -1;
}
Exemple #12
0
int TKBaseSelectAction::plug(QWidget* widget, int index)
{
  if ( widget->inherits("KToolBar") )
  {
    KToolBar* bar = static_cast<KToolBar*>( widget );
    int id_ = KAction::getToolButtonID();

    TKComboBox* cb = new TKComboBox(m_editable,bar);
    initComboBox(cb);
    cb->setMinimumWidth( cb->sizeHint().width() );
    QWidget* base = createLayout(bar,cb);

    bar->insertWidget( id_, 100, base, index );
    addContainer( bar, id_ );

    connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );

    setCurrentItem(currentItem());

    return containerCount() - 1;
  }
  return -1;
}
void
addContainer_i (varPrec * time,
		char *alias, int *s1,
		char *type, int *s2,
		char *container, int *s3,
		char *name, int *s4, char *filename, int *s5, int *err)
{
  char *a = (char *) malloc (sizeof (char) * (*s1 + 1));
  char *t = (char *) malloc (sizeof (char) * (*s2 + 1));
  char *c = (char *) malloc (sizeof (char) * (*s3 + 1));
  char *n = (char *) malloc (sizeof (char) * (*s4 + 1));
  char *f = (char *) malloc (sizeof (char) * (*s5 + 1));
  memcpy (a, alias, *s1);
  a[*s1] = '\0';
  memcpy (t, type, *s2);
  t[*s2] = '\0';
  memcpy (c, container, *s3);
  c[*s3] = '\0';
  memcpy (n, name, *s4);
  n[*s4] = '\0';
  memcpy (f, filename, *s5);
  f[*s5] = '\0';
  *err = addContainer (*time, a, t, c, n, f);
}
Exemple #14
0
void ExtensionManager::addExtension( const TQString& desktopFile )
{
    PluginManager* pm = PluginManager::the();
    ExtensionContainer *e = pm->createExtensionContainer(desktopFile,
                                                         false, // is not startup
                                                         TQString::null, // no config
                                                         uniqueId());
    

    kdDebug(1210) << "ExtensionManager::addExtension" << endl;

    if (e)
    {
        e->readConfig();
        // as a new panel, the position will be set to the preferred position
        // we just need to make sure this works with the rest of the panel layout
        e->setPosition(initialPanelPosition(e->position()));
        kdDebug(1210)<<"after e->readConfig(): pos="<<e->position()<<endl;
        addContainer(e);
        e->show();
        e->writeConfig();
        saveContainerConfig();
    }
}
Exemple #15
0
/*
 * This program should be used to parse the log file generated by FxT
 */
int
main (int argc, char **argv)
{
  int ret;
  int fd_in;

  load_modules(1);

  setTraceType (PAJE);

  /* parse the arguments passed to this program */
  parse_args (argc, argv);

#ifdef GTG_OUT_OF_ORDER
  ret = initTrace(output_filename, 0, GTG_FLAG_OUTOFORDER);
#else
  ret = initTrace(output_filename, 0, GTG_FLAG_NONE);
#endif
  if(ret != TRACE_SUCCESS) {
    fprintf(stderr, "fail to initialize GTG\n");
    return 1;
  }

  if(compress)
    if(setCompress(9) != TRACE_SUCCESS)
      fprintf(stderr, "Fail to enable trace compression\n");

  eztrace_initialize_gtg();

  __init_modules();


  int i;
  /* initialize the traces array */
  for(i=0;i< NB_TRACES; i++) {
    /* open the trace file */
    fxt_t fut = fxt_open (get_traces(i)->input_filename);
    if (!fut)
      {
	perror ("fxt_open:");
	exit (-1);
      }

    get_traces(i)->delay = 0;
    get_traces(i)->rank = i;
    get_traces(i)->id = i;
    get_traces(i)->done = 0;
    get_traces(i)->skip = 0;
    get_traces(i)->line_number = 0;

    eztrace_create_containers(i);

    /* if several traces are loaded, this means that MPI was used,
     * so let's skip all the first events until MPI_Init is detected
     */
    if(NB_TRACES > 1) {
      get_traces(i)->start = 0;
      get_traces(i)->trace_id = NULL;
    } else {
      CREATE_TRACE_ID_STR(get_traces(i)->trace_id, 0);
      get_traces(i)->start = 1;
      NB_START= 1;
      addContainer (0.00000, get_traces(i)->trace_id, "CT_Process", "C_Prog", get_traces(i)->trace_id, "0");
      eztrace_create_ids(get_traces(i)->rank);
    }

    get_traces(i)->block = fxt_blockev_enter (fut);

    ret = fxt_next_ev (get_traces(i)->block, FXT_EV_TYPE_64, (struct fxt_ev *) &get_traces(i)->ev);
    if (ret != FXT_EV_OK)
      {
	fprintf (stderr, "no more block ...\n");
	break;
      }

    get_traces(i)->start_time = get_traces(i)->ev.time;
  }

  /* todo: 0 or i ? */
  set_cur_trace(get_traces(0));
  set_cur_ev(&get_traces(i)->ev);

  struct eztrace_event_handler* h_info = NULL;
  h_info = get_handler_info();

  h_info->cur_trace_nb = 0;
  h_info->nb_done = 0;
  h_info->nb_handled = 0;
  sem_init(&h_info->events_processed, 0, 0);

  /* create the handler thread and wait until it completes */
  create_main_thread();
  wake_up_handler_thread();
  sem_wait(&h_info->events_processed);

  /* finalize the trace and close the file */
  endTrace ();
  eztrace_convert_finalize();
  printf("%d events handled\n", h_info->nb_handled);
  return 0;
}
void ExtensionManager::initialize()
{
//    kDebug(1210) << "ExtensionManager::loadContainerConfig()";
    KSharedConfig::Ptr config = KGlobal::config();
    PluginManager* pm = PluginManager::self();

    // set up the "main" panel
    if (config->hasGroup("Main Panel"))
    {
		KConfigGroup cg(config,"Main Panel");
        if (cg.hasKey("DesktopFile"))
        {
            m_mainPanel = pm->createExtensionContainer(cg.readPathEntry("DesktopFile", false),
                                                       true, cg.readPathEntry("ConfigFile", false),
                                                       "Main Panel");
        }
    }

    if (!m_mainPanel)
    {
        // fall back to a regular ol' PanelExtension
        m_mainPanel = pm->createExtensionContainer(
                            "childpanelextension.desktop",
                            true,
                            QString(KGlobal::mainComponent().aboutData()->appName()) + "rc",
                            "Main Panel");
    }

    if (!m_mainPanel)
    {
        KMessageBox::error(0, i18n("The KDE panel (kicker) could not load the main panel "
                                   "due to a problem with your installation. "),
                           i18n("Fatal Error"));
        exit(1);
    }

    configureMenubar(true);

    m_mainPanel->readConfig();
    m_mainPanel->show();
    kapp->processEvents();

    // read extension list
	KConfigGroup cg2(config, "General");
    QStringList elist = cg2.readEntry("Extensions2", QStringList() );

    // now restore the extensions
    foreach (QString extensionId, elist)
    {
        // create a matching applet container
        if (extensionId.indexOf("Extension") == -1)
        {
            continue;
        }

        // is there a config group for this extension?
        if (!config->hasGroup(extensionId))
        {
            continue;
        }

        // set config group
		KConfigGroup cg3(config, extensionId);

        ExtensionContainer* e =
            pm->createExtensionContainer(cg3.readPathEntry("DesktopFile", false),
                                         true, // is startup
                                         cg3.readPathEntry("ConfigFile", false),
                                         extensionId);

        if (e)
        {
            addContainer(e);
            e->readConfig();
            e->show();
            kapp->processEvents();
        }
    }

    pm->clearUntrustedLists();
    connect(Kicker::self(), SIGNAL(configurationChanged()), SLOT(configurationChanged()));

    QDBusInterface dbus("org.kde.ksmserver", "/ksmserver");
    dbus.call("resumeStartup", "kicker");
}
Exemple #17
0
int KAction::plug( QWidget *w, int index )
{
  //kdDebug(129) << "KAction::plug( " << w << ", " << index << " )" << endl;
  if (!w ) {
	kdWarning(129) << "KAction::plug called with 0 argument\n";
 	return -1;
  }

  // Ellis: print warning if there is a shortcut, but no KAccel available (often due to no widget available in the actioncollection)
  // David: Well, it doesn't matter much, things still work (e.g. Undo in koffice) via QAccel.
  // We should probably re-enable the warning for things that only KAccel can do, though - e.g. WIN key (mapped to Meta).
#if 0 //ndef NDEBUG
  KAccel* kaccel = kaccelCurrent();
  if( !d->m_cut.isNull() && !kaccel ) {
    kdDebug(129) << "KAction::plug(): has no KAccel object; this = " << this << " name = " << name() << " parentCollection = " << m_parentCollection << endl; // ellis
  }
#endif

  // Check if action is permitted
  if (kapp && !kapp->authorizeKAction(name()))
    return -1;

  plugShortcut();

  if ( ::qt_cast<QPopupMenu *>( w ) )
  {
    QPopupMenu* menu = static_cast<QPopupMenu*>( w );
    int id;
    // Don't insert shortcut into menu if it's already in a KAccel object.
    int keyQt = (d->m_kaccelList.count() || d->m_kaccel) ? 0 : d->m_cut.keyCodeQt();

    if ( d->hasIcon() )
    {
        KInstance *instance;
        if ( m_parentCollection )
          instance = m_parentCollection->instance();
        else
          instance = KGlobal::instance();
        id = menu->insertItem( d->iconSet( KIcon::Small, 0, instance ), d->text(), this,//dsweet
                                 SLOT( slotPopupActivated() ), keyQt,
                                 -1, index );
    }
    else
        id = menu->insertItem( d->text(), this,
                               SLOT( slotPopupActivated() ),
                               keyQt, -1, index );

    // If the shortcut is already in a KAccel object, then
    //  we need to set the menu item's shortcut text.
    if ( d->m_kaccelList.count() || d->m_kaccel )
        updateShortcut( menu, id );

    // call setItemEnabled only if the item really should be disabled,
    // because that method is slow and the item is per default enabled
    if ( !d->isEnabled() )
        menu->setItemEnabled( id, false );

    if ( !d->whatsThis().isEmpty() )
        menu->setWhatsThis( id, whatsThisWithIcon() );

    addContainer( menu, id );
    connect( menu, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );

    if ( m_parentCollection )
      m_parentCollection->connectHighlight( menu, this );

    return d->m_containers.count() - 1;
  }
  else if ( ::qt_cast<KToolBar *>( w ) )
  {
    KToolBar *bar = static_cast<KToolBar *>( w );

    int id_ = getToolButtonID();
    KInstance *instance;
    if ( m_parentCollection )
      instance = m_parentCollection->instance();
    else
      instance = KGlobal::instance();

    if ( icon().isEmpty() && !iconSet().pixmap().isNull() ) // old code using QIconSet directly
    {
        bar->insertButton( iconSet().pixmap(), id_, SIGNAL( buttonClicked(int, Qt::ButtonState) ), this,
                           SLOT( slotButtonClicked(int, Qt::ButtonState) ),
                           d->isEnabled(), d->plainText(), index );
    }
    else
    {
int main (int argc, char** argv){
    int rk;
    MPI_Init (&argc, &argv);
    MPI_Comm_rank (MPI_COMM_WORLD, &rk);

    setTraceType (VITE, BUFF);
    setComm (MPI_COMM_WORLD);
    initTrace ("cvite");
    if (rk==0){
        addContType ("CT_NET", "0", "Network");
        addContType ("CT_NODE", "CT_NET", "Node");
        addContType ("CT_PROC", "CT_NODE", "Proc");
        addStateType ("ST_NodeState", "CT_NODE", "Node state");
        addStateType ("ST_ProcState", "CT_PROC", "Procstate");
        addEntityValue ("SN_0", "ST_NodeState", "Sleep", "0.5 0.5 0.5");
        addEntityValue ("SN_1", "ST_NodeState", "WaitLocal", "0.0 0.5 0.9");
        addEntityValue ("SN_2", "ST_NodeState", "WaitDistant", "0.9 0.5 0.0");
        addEntityValue ("SP_3", "ST_ProcState", "Produit", "0.5 0.9 0.0");
        addEntityValue ("SP_4", "ST_ProcState", "Somme", "0.9 0.9 0.0");
        addEntityValue ("SP_5", "ST_ProcState", "Difference", "0.1 0.5 0.4");
        addLinkType ("L_0", "Fanin", "CT_NET", "CT_PROC", "CT_PROC");
        addLinkType ("L_1", "Bloc", "CT_NET", "CT_PROC", "CT_PROC");
        addVarType ("V_Mem", "Memoire", "CT_NODE");
        addEventType ("E_0", "CT_PROC", "Lapin");
        addEventType ("E_1", "CT_PROC", "Chocolat");
    
        addContainer (0.00000, "C_Net0", "CT_NET", "0", "Ensemble0", "0");
        addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "0");
        addContainer (0.00000, "C_N1", "CT_NODE", "C_Net0", "Node1", "0");
        addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", "cvite_proc0");
        addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", "cvite_proc1");
        addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", "cvite_proc2");

        addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", "cvite_proc3");
        addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", "cvite_proc4");
        addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", "cvite_proc5");
    }
    setVar (0.0111742, "V_Mem", "C_N0", 1.0000000);
    setState (0.01120000, "ST_NodeState", "C_N1", "SN_1");
    setState (0.02121000, "ST_NodeState", "C_N0", "SN_0");
    setVar (0.0212742, "V_Mem", "C_N0", 2.0000000);
    setState (0.03122000, "ST_NodeState", "C_N1", "SN_2");
    setState (0.04123000, "ST_NodeState", "C_N0", "SN_1");
    setVar (0.0313742, "V_Mem", "C_N0", 3.0000000);
    setVar (0.0414742, "V_Mem", "C_N1", 1.0000000);
    setState (0.05124000, "ST_NodeState", "C_N1", "SN_0");
    setVar (0.0515742, "V_Mem", "C_N1", 2.0000000);
    setState (0.06124500, "ST_NodeState", "C_N0", "SN_2");
    setVar (0.0616742, "V_Mem", "C_N1", 3.0000000);
    switch (rk){
    case 0:
    setState (0.00130000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.00150000, "ST_ProcState", "C_P0", "SP_5");
    setState (0.00230000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.00330000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.00830000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.03130000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.05130000, "ST_ProcState", "C_P0", "SP_4");
    setState (0.09130000, "ST_ProcState", "C_P0", "SP_3");
    startLink (0.040000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2");
    endLink (0.050000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2");
    addEvent (0.030000, "E_0", "C_P0", "11");
    break;
    case 1 :
    setState (0.00140000, "ST_ProcState", "C_P1", "SP_3");
    setState (0.00210000, "ST_ProcState", "C_P1", "SP_4");
    setState (0.00930000, "ST_ProcState", "C_P1", "SP_3");
    setState (0.01030000, "ST_ProcState", "C_P1", "SP_4");
    addEvent (0.070000, "E_1", "C_P1", "1");
    break;
    case 3 :
    setState (0.00160000, "ST_ProcState", "C_P3", "SP_5");
    setState (0.00200000, "ST_ProcState", "C_P3", "SP_4");
    setState (0.00630000, "ST_ProcState", "C_P3", "SP_5");
    setState (0.04130000, "ST_ProcState", "C_P3", "SP_3");
    startLink (0.050000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3");
    endLink (0.060000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3");
    break;
    case 4 :
    setState (0.00170000, "ST_ProcState", "C_P4", "SP_3");
    setState (0.00530000, "ST_ProcState", "C_P4", "SP_5");
    setState (0.07130000, "ST_ProcState", "C_P4", "SP_5");
    startLink (0.030000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1");
    endLink (0.030000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0");
    break;
    case 5 :
    setState (0.00180000, "ST_ProcState", "C_P5", "SP_4");
    setState (0.00430000, "ST_ProcState", "C_P5", "SP_4");
    setState (0.06130000, "ST_ProcState", "C_P5", "SP_5");
    addEvent (0.090000, "E_1", "C_P5", "3");
    break;
    case 2 :
    setState (0.00190000, "ST_ProcState", "C_P2", "SP_3");
    setState (0.00730000, "ST_ProcState", "C_P2", "SP_5");
    setState (0.02130000, "ST_ProcState", "C_P2", "SP_4");
    setState (0.08130000, "ST_ProcState", "C_P2", "SP_4");
    startLink (0.020000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0");
    endLink (0.040000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1");
    addEvent (0.050000, "E_0", "C_P2", "10");
    break;

    default :
        break;
    }
    endTrace ();
    MPI_Finalize ();
    return EXIT_SUCCESS;
}
Exemple #19
0
void ExtensionManager::initialize()
{
    m_loadingContainers = true;

//    kdDebug(1210) << "ExtensionManager::loadContainerConfig()" << endl;
    TDEConfig* config = TDEGlobal::config();
    PluginManager* pm = PluginManager::the();

    // set up the "main" panel
    if (config->hasGroup("Main Panel"))
    {
        config->setGroup("Main Panel");
        if (config->hasKey("DesktopFile"))
        {
            m_mainPanel = pm->createExtensionContainer(config->readPathEntry("DesktopFile"),
                                                       true, config->readPathEntry("ConfigFile"),
                                                       "Main Panel");
        }
    }

    if (!m_mainPanel)
    {
        // fall back to a regular ol' PanelExtension
        m_mainPanel = pm->createExtensionContainer(
                            "childpanelextension.desktop",
                            true,
                            TQString(kapp->aboutData()->appName()) + "rc",
                            "Main Panel");
    }

    if (!m_mainPanel)
    {
        KMessageBox::error(0, i18n("The TDE panel (kicker) could not load the main panel "
                                   "due to a problem with your installation. "),
                           i18n("Fatal Error!"));
        exit(1);
    }

    configureMenubar(true);

    Kicker::the()->setMainWidget(m_mainPanel);

    m_mainPanel->readConfig();
    m_mainPanel->show();
    kapp->processEvents();

    // read extension list
    config->setGroup("General");
    TQStringList elist = config->readListEntry("Extensions2");

    // now restore the extensions
    TQStringList::iterator itEnd = elist.end();
    for (TQStringList::iterator it = elist.begin(); it !=  elist.end(); ++it)
    {
        // last container?
        TQStringList::iterator lastcheck(it);
        lastcheck++;
        if (lastcheck == elist.end()) {
            m_loadingContainers = false;
        }

        // extension id
        TQString extensionId(*it);

        // create a matching applet container
        if (extensionId.find("Extension") == -1)
        {
            continue;
        }

        // is there a config group for this extension?
        if (!config->hasGroup(extensionId))
        {
            continue;
        }

        // set config group
        config->setGroup(extensionId);

        ExtensionContainer* e = pm->createExtensionContainer(config->readPathEntry("DesktopFile"),
                                                             true, // is startup
                                                             config->readPathEntry("ConfigFile"),
                                                             extensionId);
        if (e)
        {
            addContainer(e);
            e->readConfig();
            e->show();
            kapp->processEvents();
        }
    }
    m_loadingContainers = false;

    pm->clearUntrustedLists();
    connect(Kicker::the(), TQT_SIGNAL(configurationChanged()), TQT_SLOT(configurationChanged()));
    DCOPRef r( "ksmserver", "ksmserver" );
    r.send( "resumeStartup", TQCString( "kicker" ));
}
Exemple #20
0
int main (int argc, char** argv){
(void) argc;
(void) argv;
    setTraceType (PAJE);
    initTrace ("cpaje", 0, GTG_FLAG_NONE);
    addContType ("CT_NET", "0", "Network");
    addContType ("CT_NODE", "CT_NET", "Node");
    addContType ("CT_PROC", "CT_NODE", "Proc");
    addStateType ("ST_NodeState", "CT_NODE", "Node state");
    addStateType ("ST_ProcState", "CT_PROC", "Procstate");
    addEntityValue ("SN_0", "ST_NodeState", "Sleep", GTG_LIGHTPINK);
    addEntityValue ("SN_1", "ST_NodeState", "WaitLocal", GTG_PINK);
    addEntityValue ("SN_2", "ST_NodeState", "WaitDistant", GTG_BLUE);
    addEntityValue ("SP_3", "ST_ProcState", "Produit", GTG_ORANGE);
    addEntityValue ("SP_4", "ST_ProcState", "Somme", GTG_GREEN);
    addEntityValue ("SP_5", "ST_ProcState", "Difference", GTG_BLACK);
    addLinkType ("L_0", "Fanin", "CT_NET", "CT_PROC", "CT_PROC");
    addLinkType ("L_1", "Bloc", "CT_NET", "CT_PROC", "CT_PROC");
    addVarType ("V_Mem", "Memoire", "CT_NODE");
    addEventType ("E_0", "CT_PROC", "Lapin");
    addEventType ("E_1", "CT_PROC", "Chocolat");
    addContainer (0.00000, "C_Net0", "CT_NET", "0", "Ensemble0", "0");
    addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "0");
    addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", "0");
    addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", "0");
    addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", "0");
    addContainer (0.00000, "C_N1", "CT_NODE", "C_Net0", "Node1", "0");
    addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", "0");
    addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", "0");
    addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", "0");
    setVar (0.0111742, "V_Mem", "C_N0", 1.0000000);
    setState (0.01120000, "ST_NodeState", "C_N1", "SN_1");
    setState (0.02121000, "ST_NodeState", "C_N0", "SN_0");
    setVar (0.0212742, "V_Mem", "C_N0", 2.0000000);
    setState (0.03122000, "ST_NodeState", "C_N1", "SN_2");
    setState (0.04123000, "ST_NodeState", "C_N0", "SN_1");
    setVar (0.0313742, "V_Mem", "C_N0", 3.0000000);
    setVar (0.0414742, "V_Mem", "C_N1", 1.0000000);
    setState (0.05124000, "ST_NodeState", "C_N1", "SN_0");
    setVar (0.0515742, "V_Mem", "C_N1", 2.0000000);
    setState (0.06124500, "ST_NodeState", "C_N0", "SN_2");
    setVar (0.0616742, "V_Mem", "C_N1", 3.0000000);
    setState (0.00130000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.00140000, "ST_ProcState", "C_P1", "SP_3");
    setState (0.00150000, "ST_ProcState", "C_P0", "SP_5");
    setState (0.00160000, "ST_ProcState", "C_P3", "SP_5");
    setState (0.00170000, "ST_ProcState", "C_P4", "SP_3");
    setState (0.00180000, "ST_ProcState", "C_P5", "SP_4");
    setState (0.00190000, "ST_ProcState", "C_P2", "SP_3");
    setState (0.00200000, "ST_ProcState", "C_P3", "SP_4");
    setState (0.00210000, "ST_ProcState", "C_P1", "SP_4");
    setState (0.00230000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.00330000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.00430000, "ST_ProcState", "C_P5", "SP_4");
    setState (0.00530000, "ST_ProcState", "C_P4", "SP_5");
    setState (0.00630000, "ST_ProcState", "C_P3", "SP_5");
    setState (0.00730000, "ST_ProcState", "C_P2", "SP_5");
    setState (0.00830000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.00930000, "ST_ProcState", "C_P1", "SP_3");
    setState (0.01030000, "ST_ProcState", "C_P1", "SP_4");
    setState (0.02130000, "ST_ProcState", "C_P2", "SP_4");
    setState (0.03130000, "ST_ProcState", "C_P0", "SP_3");
    setState (0.04130000, "ST_ProcState", "C_P3", "SP_3");
    setState (0.05130000, "ST_ProcState", "C_P0", "SP_4");
    setState (0.06130000, "ST_ProcState", "C_P5", "SP_5");
    setState (0.07130000, "ST_ProcState", "C_P4", "SP_2");
    setState (0.08130000, "ST_ProcState", "C_P2", "SP_4");
    setState (0.09130000, "ST_ProcState", "C_P0", "SP_3");
    startLink (0.020000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0");
    startLink (0.030000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1");
    startLink (0.040000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2");
    startLink (0.050000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3");
    endLink (0.030000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0");
    endLink (0.040000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1");
    endLink (0.050000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2");
    endLink (0.060000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3");
    addEvent (0.030000, "E_0", "C_P0", "11");
    addEvent (0.050000, "E_0", "C_P2", "10");
    addEvent (0.070000, "E_1", "C_P1", "1");
    addEvent (0.090000, "E_1", "C_P5", "3");
    endTrace ();
    return EXIT_SUCCESS;
}