예제 #1
0
파일: net.cpp 프로젝트: FoxMarts/qucs
// DEBUG function: Lists the netlist.
void net::list (void) {
  logprint (LOG_STATUS, "DEBUG: netlist `%s' (%d circuits, "
	    "%d ports, %d nodes)\n", getName (), countPorts (),
	    countPorts (), countNodes ());
  // go through circuit list
  for (circuit * c = root; c != NULL; c = (circuit *) c->getNext ()) {
    // list each circuit
    logprint (LOG_STATUS, "       %s[", c->getName ());
    for (int i = 0; i < c->getSize (); i++) {
      logprint (LOG_STATUS, "%s-%d",
		c->getNode(i)->getName (), c->getNode(i)->getNode ());
      if (i < c->getSize () - 1)
	logprint (LOG_STATUS, ",");
    }
    logprint (LOG_STATUS, "] { %s }\n", c->propertyList ());
  }
}
예제 #2
0
파일: QuaJoystick.cpp 프로젝트: dakyri/qua
int32
QuaJoystickManager::Update()
{
	readerRunning = true;
	while(readerRunning) {
		bool		nothinDoin = true;
		for (short i=0; i<countPorts(); i++) {
			if (Port(i)->isOpen)
				nothinDoin = false;
		}
		if (nothinDoin) {
			std::unique_lock<std::mutex> lk(updateMux);
			updateCV.wait(lk /*, []{return ready;}*/);
		}
		for (short i=0; i<countPorts(); i++) {
			Port(i)->Update();
		}
		std::this_thread::sleep_for(std::chrono::milliseconds(0));
	}
	return B_ERROR;
}
예제 #3
0
파일: QuaJoystick.cpp 프로젝트: dakyri/qua
QuaJoystickManager::~QuaJoystickManager()
{
	status_t	exit_val;
	
	readerRunning = false;
	resumeUpdater();
	updateThread.join();

	int nd = countPorts();
	for (short i=0; i<nd; i++) {
		delete (QuaJoystickPort *)Port(0);
		removePort(0);
	}

	fprintf(stderr, "deleted joystick manager\n");
}