Example #1
0
void ProbeAlarm::updateStatus(int value)
{
  // Low: Arming point >= Thresh + 1.0f, Trigger point < Thresh
  // A low alarm set for 100 enables at 101.0 and goes off at 99.9999...
  if (getLowEnabled())
  {
    if (value >= (getLow() + 1))
      Armed[ALARM_IDX_LOW] = true;
    else if (value < getLow() && Armed[ALARM_IDX_LOW])
      Ringing[ALARM_IDX_LOW] = true;
  }

  // High: Arming point < Thresh - 1.0f, Trigger point >= Thresh
  // A high alarm set for 100 enables at 98.9999... and goes off at 100.0
  if (getHighEnabled())
  {
    if (value < (getHigh() - 1))
      Armed[ALARM_IDX_HIGH] = true;
    else if (value >= getHigh() && Armed[ALARM_IDX_HIGH])
      Ringing[ALARM_IDX_HIGH] = true;
  }

  if (pid.isLidOpen())
    Ringing[ALARM_IDX_LOW] = Ringing[ALARM_IDX_HIGH] = false;
}
Example #2
0
void HSV::save() {
	std::ofstream o(DIRECTORY + name + FILE_EXTENSION);
	std::string content = "";
	content += std::to_string((int)getLow()[0]) + ";";
	content += std::to_string((int)getLow()[1]) + ";";
	content += std::to_string((int)getLow()[2]) + ";";
	content += std::to_string((int)getHigh()[0]) + ";";
	content += std::to_string((int)getHigh()[1]) + ";";
	content += std::to_string((int)getHigh()[2]) + ";";

	o << content << std::endl;
}
int MAX::renew()
{

  BufIn(GPSBuf);
  int i = getPhrase(GPSBuf, GPSPhr);
  if(i == 1) return 0;  //not renewed 
  else{
    String tempLat = getLat(GPSPhr);
    String tempLng = getLong(GPSPhr);
    String temphgt = getHigh(GPSPhr);

    int a = spellCheck(tempLat);
    int b = spellCheck(tempLng);
    int c = spellCheck(temphgt);

    if(a == 0) {sLatitude = tempLat;}
    if(b == 0) sLongitude = tempLng;
    if(c == 0) sHeight = temphgt;
    int r = StoF();
    
    if(r==0){
      count ++;
      return 1;
    }
    else if(r==-1) {return 0;}
  }
}
Example #4
0
void ThresholdPanel::quietlySetThreshold(int low, int high)
{
	if (low != getLow() || high != getHigh()) {
		lowSlider->setValue(low);
		highSlider->setValue(high);
	}
}
Example #5
0
File: stack.c Project: clarac/jvmg3
void pushDbl(double a){
	unsigned int ah, al;
	ah=getHigh(a);
	al=getLow(a);
	push(ah,0);
	push(al,'D');
}
Example #6
0
void ThresholdPanel::setThreshold(int low, int high)
{
	if (low != getLow() || high != getHigh()) {
		lowSlider->setValue(low);
		highSlider->setValue(high);
		emit thresholdChanged(low, high);
	}
}
Example #7
0
File: util.c Project: clarac/jvmg3
int isNaN(double d){

	unsigned int dh = getHigh(d);
	unsigned int t=0x7FF00000;
	dh&=t;
	if(dh == t){
		return 1;
	}
	else return 0;
}
void btAngularLimit::fit(btScalar& angle) const
{
	if (m_halfRange > 0.0f)
	{
		btScalar relativeAngle = btNormalizeAngle(angle - m_center);
		if (!btEqual(relativeAngle, m_halfRange))
		{
			if (relativeAngle > 0.0f)
			{
				angle = getHigh();
			}
			else
			{
				angle = getLow();
			}
		}
	}
}
Example #9
0
void readIn( int argc, char * argv[] ){

    int filesRead = 0;
    hashTable ** tables = malloc( sizeof( hashTable * ) * argc -1 );
    wordCounter *** top20s = malloc( sizeof( wordCounter** ) * argc - 1 );
    
    for( int i = 1; i < argc; i++ ){
        
        fprintf( stderr, "\nThe file is: %s\n", argv[ i ] );
        int file = open( argv[ i ], O_RDONLY );
        hashTable * tab = createHashTable( TABLESIZE );
        tables[ i ] = tab;
        
        if( file == -1 ){
            fprintf( stderr, "%s could not be opened\n", argv[ i ] );
            exit( -1 );
        }
        
        processFile( file, tables[ i ], argv[ i ] );
        close( file );
        filesRead++;
        top20s[ i ] = getTop20( tables[ i ] );
        
        for( int j = 0; j < 20; j++ ){
            fprintf( stderr, "%s : %d\n", top20s[ i ][ j ]->word, top20s[ i ][ j ]->count );
        }
    }
    if( argc > 2 ){
        wordCounter ** finalArr = top20s[ 1 ];
        for( int e = 2; e < argc; e++ ){
            fprintf( stderr, "Intersecting finalArr and %d\n", e  );
            finalArr = intersect( finalArr, top20s[ e ] );
        }
        getHigh( finalArr );
    }
    

   // printTable( final );
   // printTable( tables[ 1 ] );
    
    printf( "\n# of files read %d\n", filesRead );
}
Example #10
0
 int NESNumber::toInt() const {
     return getHigh();
 }
Example #11
0
 bool NESNumber::operator == (const NESNumber& other) const {
     return (getHigh() == other.getHigh()) && (getLow() == other.getLow());
 }
Example #12
0
 bool NESNumber::operator > (const NESNumber& other) const {
     // If the high bits are >, then return that.
     // If not, the high bits have to be equal and the low bits > to be >.
     return getHigh() > other.getHigh() || 
         ((getHigh() == other.getHigh()) && (getLow() > other.getLow()));
 }
Example #13
0
 NESNumber NESNumber::operator-() const {
     return NESNumber(-getHigh(), getLow());
 }
Example #14
0
 double UInt64::toNumber()
 {
     return (getHigh() * 4294967296) + low;
 }
Example #15
0
void ThresholdPanel::setLow(int low) {
	lowSlider->setValue(low);
	emit thresholdChanged(getLow(), getHigh());
}
Example #16
0
void ThresholdPanel::setHigh(int high)
{
	highSlider->setValue(high);
	emit thresholdChanged(getLow(), getHigh());
}
Example #17
0
void ThresholdPanel::refreshThreshold()
{
	emit thresholdChanged(getLow(), getHigh());
}