コード例 #1
0
ファイル: AIDA_Info.cpp プロジェクト: apfeiffer1/iAIDA
void AIDA_Info::addText(const std::string& text)
{
  if (!rep) { 
    crisis();
    return;
  }
  rep->addText(text);
}
コード例 #2
0
ファイル: AIDA_Info.cpp プロジェクト: apfeiffer1/iAIDA
void AIDA_Info::clear()
{
  if (!rep) { 
    crisis();
    return;
  }
  rep->clear();
}
コード例 #3
0
ファイル: AIDA_Info.cpp プロジェクト: apfeiffer1/iAIDA
void AIDA_Info::addLegend(const AIDA::IFillStyle& aistyle, 
			    const std::string& description)
{
  if (!rep) { 
    crisis();
    return;
  }
  const AIDA_FillStyle* pr = dynamic_cast<const AIDA_FillStyle*>(&aistyle);
  if (pr == 0) return;
  AIDA_FillStyle* ncpr = const_cast<AIDA_FillStyle*>(pr);
  FillStyle* theRealStyle = ncpr->theRep();
  if (theRealStyle == 0) return;
  rep->addLegend(description,*theRealStyle);
}
コード例 #4
0
ファイル: ofApp.cpp プロジェクト: helenabantula/BlueProject
//--------------------------------------------------------------
void ofApp::update(){
    
    //DISPLAYEJAR COMPTADOR-------------------------------------------
    
    if (isCounterOn)
    {
        timer = ofGetElapsedTimef()- counter;
        
        if (timer!= prevTimer)
            digit3+=1;
        if (digit3 == 10)
        {
            digit3 = 0;
            digit2 += 1;
            
            if (digit2 == 6)
            {
                digit2 = 0;
                digit1+=1;
                
            }
        }
        
        prevTimer = ofGetElapsedTimef()-counter;
    }
    
    if (timer == 0)
    {
        digit1 = 0;
        digit2 = 0;
        digit3 = 0;
        prevTimer = 0;
        
    }
    
    
    clock = std::string("0")+std::to_string(digit1)+":"+std::to_string(digit2)+std::to_string(digit3);
    // ---------------------------------------------------------------

    
    switch(appState){
        case STATE_IDLE:
            idle();
            break;
        case STATE_WARMING:
            warming();
            break;
        case STATE_PLAY:
            play();
            break;
        case STATE_POSTPLAY:
            postPlay();
            break;
        case STATE_CRISIS:
            crisis();
            break;
    }
    
    
    
    //gpio17.getval_gpio(state_buttonON);
    
    
    /////////// SERIAL ///////
    //unsigned char lectura[3];
    unsigned char* lectura;
	lectura = new unsigned char(' '); //[2] = {' ', ' '};
    serial.readBytes(lectura, 1);  //int readBytes(unsigned char * buffer, int length);
    
   cout << *lectura << endl;
    
   
    if (*lectura == 'Y'){
        buttonON = true;
        cout << "HE REBUT ON!!!!" << endl;
    }
    else {
        buttonON = false;
    
    }
    
    if (*lectura == 'N'){
        buttonOFF = true;
        cout << "HE REBUT OFF!!!!" << endl;
    }
    else {
        buttonOFF = false;
        
    }
    
//    if (ofToInt(state_buttonON) == 1){
//        buttonON = true;
//        cout << "ON!!" << endl;
//    }
//    else
//        buttonON = false;
//
//    gpio21.getval_gpio(state_button);
//    
//    
//    
//    if (ofToInt(state_button) == 1){
//        buttonOFF = true;
//        cout << "OFF!!" << endl;
//    }
//    else
//        buttonOFF = false;
    
    
    // LIGHT
    Light::getInstance().getInfo();
    
    //cout << appState << endl;
    
}