Esempio n. 1
0
static int releaseSanity(struct gbRelease* release, char *database)
/* Run sanity checks on a release */
{
unsigned orgCats;
int checkedSetCnt = 0;

/* check if native, and/or xeno should be included */
orgCats = getLoadOrgCats(database, release->srcDb, GB_MRNA);
if (orgCats != 0)
    {
    if (checkRelease(release, database, GB_MRNA, orgCats, NULL))
        checkedSetCnt++;
    }

orgCats = getLoadOrgCats(database, release->srcDb, GB_EST);
if (orgCats != 0)
    {
    struct slName* prefixes, *prefix;
    boolean checkedSome = FALSE;
    if (gOptions.accPrefixRestrict != NULL)
        prefixes = newSlName(gOptions.accPrefixRestrict);
    else
        prefixes = gbReleaseGetAccPrefixes(release, GB_PROCESSED, GB_EST);
    for (prefix = prefixes; prefix != NULL; prefix = prefix->next)
        {
        if (checkRelease(release, database, GB_EST, orgCats, prefix->name))
            checkedSome = TRUE;
        }
    slFreeList(&prefixes);
    if (checkedSome)
        checkedSetCnt++;
    }
return checkedSetCnt;
}
void listenIR(void)
{
	//Serial.println("\r\nReady to decode IR!");    

	uint16_t highpulse, lowpulse; // temporary storage timing
	highpulse = lowpulse = 0; // start out with no pulse length
	unsigned long start;

	start = micros();
	while (IRpin_PIN & (1 << IRpin))
	{
		//pin is still HIGH
		highpulse++;

		//timeout
		if (highpulse >= MAXPULSE)
		{
			checkRelease();
			if (currentpulse != 0)
			{
				onCodeFinish();
				currentpulse=0;
				return;
			}
		}
	}

	// we didn't time out so lets stash the reading
	pulses[currentpulse][0] = micros() - start;

	// same as above
	start = micros();  
	while (! (IRpin_PIN & _BV(IRpin)))
	{
		// pin is still LOW
		lowpulse++;

		if (lowpulse >= MAXPULSE)
		{
			checkRelease();
			if (currentpulse != 0)
			{
				onCodeFinish();
				currentpulse=0;
				return;
			}
		}
	}
	pulses[currentpulse][1] = micros() - start;

	// we read one high-low pulse successfully, continue!
	currentpulse++;
	
	if (currentpulse >= MAX_PULSE_IDX)
	{
		Serial.println("pulse too long, truncating");
		onCodeFinish();
	}
}
Esempio n. 3
0
  void UpdateManager::replyFinished(QNetworkReply* reply)
  {
    // finished after this
    m_finished = true;

    if (reply){
      // don't delete here
      reply->deleteLater();

      m_error = (reply->error() != QNetworkReply::NoError);
      if (!m_error){

        // create xml document to read the response
        QDomDocument document;
        document.setContent(reply->readAll());
        QDomNodeList openstudioelements = document.elementsByTagName("openstudio");

        if (openstudioelements.size() > 0)
        {
          // Only process the first one for now
          QDomNodeList nodes = openstudioelements.at(0).childNodes();

          // all child nodes will be releases
          for(int i = 0; i < nodes.size(); ++i){
            QDomElement release = nodes.at(i).toElement();
            if (!release.isNull()){
              if (!checkRelease(release)){
                // break if not newer than current 
                break;
              }
            }
          }
        }
      }else{
        LOG(Error, "QNetworkReply " << reply->error());
      }
    }

    emit processed();
  }
Esempio n. 4
0
 // Checks the major.minor.version string alone and with all
 // possible combinations of release identifiers and metadata.
 //
 void check (std::string const& input, bool shouldPass = true)
 {
     checkRelease (input, shouldPass);
 }