예제 #1
0
int myclianttest::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: readyRead(); break;
        case 1: bytesWritten((*reinterpret_cast< qint64(*)>(_a[1]))); break;
        case 2: disconnected(); break;
        case 3: list((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 4: connected(); break;
        case 5: test(); break;
        case 6: mycomputer((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 7: doubleClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 8: doubleClickedServer((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 9: setpath((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 10: getpath(); break;
        case 11: servercomputer((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 12: serverfiledown((*reinterpret_cast< QByteArray(*)>(_a[1]))); break;
        case 13: getserverpath(); break;
        case 14: download(); break;
        case 15: Serverclicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 16: gotomotherpath(); break;
        case 17: gotoservermotherpath(); break;
        default: ;
        }
        _id -= 18;
    }
    return _id;
}
예제 #2
0
int main(int argc, char* argv[])
{

  if (argc < 3) {  
     usage();
     return 1;
  }

  signal(31, signalhandler);  // kill -31 to end this

  int choice1 = atoi(argv[1]);
  int choice2 = atoi(argv[2]);
  int NUMEVT;
  NUMEVT =200;
  if (argc > 3) NUMEVT = atoi(argv[3]);

  if (choice1 == 1) {  // CODA File

// CODA file "snippet.dat" is a disk file of CODA data.  
      TString filename("snippet.dat");

      if (choice2 == 1) { // Two types of THaCodaFile constructors 
         coda = new THaCodaFile();
         if (coda->codaOpen(filename) != 0) {
            cout << "ERROR:  Cannot open CODA data" << endl;
            return 1;
         }
      } else {  // 2nd type of c'tor
         coda = new THaCodaFile(filename);
      }

  } else {         // Online ET connection

      int mymode = 1;
      TString mycomputer("adaql1");
      TString mysession("par1");

      if (choice2 == 1) {   // Three different types of constructor 
         coda = new THaEtClient();
         if (coda->codaOpen(mycomputer, mysession, mymode) != 0) {
            cout << "ERROR:  Cannot open ET connection" << endl;
            return 1;
          }
      } else if (choice2 == 2) {
         coda = new THaEtClient(mycomputer, mymode); 
      } else {
         coda = new THaEtClient(mycomputer, mysession, mymode);  
      }

  }

// Loop over events
  int status;

  for (int iev = 0; iev < NUMEVT; iev++) {

      status = coda->codaRead();  

      if (status != 0 || stop_it == 1) {
        if (stop_it) cout << "External kill signal seen " <<endl;
        if ( status == -1) {
           if (choice1 == 1) cout << "End of CODA file. Bye bye." << endl;
           if (choice1 == 2) cout << "CODA/ET not running. Bye bye." << endl;
        } else {
	   if (!stop_it) cout << "ERROR: codaRread status = " << hex << status << endl;
        }
        coda->codaClose();
        return 0;

      } else {
        
        do_something( coda->getEvBuffer() );

      }
  }

  cout << "closing CODA connection"<<endl<<flush;
  coda->codaClose();
  return 0;
};