Exemplo n.º 1
0
//--------------------------------------------------------------
void testApp::setup()
{
    ofSetFrameRate(15);
    cout<<"***********************ControlMotorProgram*********************************"<<endl;
    readXmlSetup();
    thisOscReceiver.setup(oscReceivePort);
    ofSetWindowTitle("Remote");
//nbDcMotors=14;
//nbStepperMotor=4;
//nbMemory=2;
//createMotors();
//createSteppers();
}
Exemplo n.º 2
0
void testApp::reloadXml()
{
    cout<<"reload app from XML"<<endl;
//emergencyStop();//stop all the dcMotors...already done in the dtor
    while(theDcMotors.size()!=0)
    {
        theDcMotors.pop_back();
    }
    while(theSteppers.size()!=0)
    {
        theSteppers.pop_back();
    }
    while(theMemories.size()!=0)
    {
        theMemories.pop_back();
    }
    readXmlSetup();
}
Exemplo n.º 3
0
bool ModuleStore::readXmlFile() {
  xmlDocPtr doc;
  xmlNodePtr n;
  std::string fname;
  bool setupLoaded=false;

  fname=m_path+"/version.xml";

  doc=xmlParseFile(fname.c_str());
  if (doc==NULL) {
    fprintf(stderr,
	    "ERROR: Could not load xml file [%s]\n",
	    fname.c_str());
    xmlFreeDoc(doc);
    return false;
  }

  n=xmlDocGetRootElement(doc);
  if (n==NULL) {
    fprintf(stderr,
	    "ERROR: No root element in xml file [%s]\n",
	    fname.c_str());
    xmlFreeDoc(doc);
    return false;
  }

  if (n->name && strcasecmp((const char*)(n->name), "setup")==0) {
    readXmlSetup(n);
    setupLoaded=true;
  }
  xmlFreeDoc(doc);

  if (!setupLoaded) {
    fprintf(stderr,
	    "ERROR: No setup element in xml file [%s]\n",
	    fname.c_str());
    return false;
  }

  return true;
}