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; }
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; }
void ThresholdPanel::quietlySetThreshold(int low, int high) { if (low != getLow() || high != getHigh()) { lowSlider->setValue(low); highSlider->setValue(high); } }
void pushDbl(double a){ unsigned int ah, al; ah=getHigh(a); al=getLow(a); push(ah,0); push(al,'D'); }
void ThresholdPanel::setThreshold(int low, int high) { if (low != getLow() || high != getHigh()) { lowSlider->setValue(low); highSlider->setValue(high); emit thresholdChanged(low, high); } }
NESNumber& NESNumber::operator += (const NESNumber& rhs) { const unsigned int oldLow = getLow(); high += rhs.getHigh(); low += rhs.getLow(); // Check for overflow // If there's an overflow we adjust the high accordingly if(oldLow > low) { // TODO: What if the rhs is negative? high++; } return *this; }
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(); } } } }
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())); }
bool NESNumber::operator == (const NESNumber& other) const { return (getHigh() == other.getHigh()) && (getLow() == other.getLow()); }
NESNumber NESNumber::operator-() const { return NESNumber(-getHigh(), getLow()); }
void biconn(int node, int parent) { Ncalls++; if(DEBUG) printStack(FALSE); if(DEBUG) printVertices(); //eS_left is local int eS_left = eS_right; cv++; if(DEBUG) printEdgeStack(TREE_EDGE, eS_left); int i, index, test_node, test_node_index, node_color, new_parent, parent_index; index = node - 1; cv++; parent_index = parent - 1; cv++; cvi[index]++; vertices[index]->color = GRAY; cv++; cvi[index]++; vertices[index]->num = Gnum; cv++; cvi[index]++; vertices[index]->low = vertices[index]->num; cv++; cvi[index]++; new_parent = node; cv++; cvi[index]++; Gnum++; cv++; cvi[index]++; //Push it onto the vertex stack vertexStack[stackEnd] = node; cv++; cvi[index]++; vertices[index]->stackPos = stackEnd; cv++; cvi[index]++; stackEnd++; cv++; //Loop over the vertices in the adjacency list for this node for(i = 1; i < nEdges[index] + 1; i++) { ce += 2; test_node = adjlist[index][i]; ce++; test_node_index = test_node - 1; ce++; node_color = vertices[test_node_index]->color; ce++; ce++; if(node_color == WHITE) //forward edge { edgeStack[eS_right]->tail = node; ce++; edgeStack[eS_right]->head = test_node; ce++; eS_right++; ce++; biconn(test_node, new_parent); ce++; } else if(node_color == GRAY && test_node != parent) //Back edge not to the parent { ce++; if(vertices[test_node_index]->num < vertices[index]->num) //The vertex was visited before the current vertex { ce++; //Lesser but not parent, pass on the goodness vertices[index]->low = getLow(vertices[index]->low , vertices[test_node_index]->num); ce++; //Push edge on to the stack edgeStack[eS_right]->tail = node; ce++; edgeStack[eS_right]->head = test_node; ce++; eS_right++; ce++; if(DEBUG) printEdgeStack(FORWARD_EDGE, eS_left); } else { printf("debug_info : I deduce that this will never occur\n"); } } } //Backtracking to parent if(parent != DUMMY_PARENT) { vertices[parent_index]->low = getLow(vertices[parent_index]->low, vertices[index]->low); cv++; cvi[index]++; if(vertices[index]->low < vertices[parent_index]->num ) { cv++; cvi[index]++; //Move back the current element stack pointer if(DEBUG) printEdgeStack(BACKWARD_EDGE, eS_left); } else //Break the bond { cv += 2; cvi[index] += 2; //Parent is an articulation point //Search if it is already present in the articulation points list. Else add the vertex. artPoints[artIndex] = parent; cv++; cvi[index]++; artIndex++; cv++; cvi[index]++; //Strip out the edges corresponding to this articulatio point if(DEBUG) printBiconn(eS_left-1, eS_right); //Add biconnected components vertices. //Search the array to check if the vertex is already there. Else add the vertex storeBiconnVerts(eS_left-1, eS_right); cv += 5*(eS_right-eS_left+1); cvi[index] += 5*(eS_right-eS_left+1); eS_right = eS_left-1; cv++; cvi[index]++; if(DEBUG) printEdgeStack(ARTICULATE_EDGE, eS_left); } //When all nodes reachable from a particular node are reached, color the node black vertices[index]->color = BLACK; cv++; cvi[index]++; } }
void ContainerViewUI::drawBknd() { surface->rect(getLow(), getHgh(), theme.bknd); }
void ThresholdPanel::refreshThreshold() { emit thresholdChanged(getLow(), getHigh()); }
void ThresholdPanel::setHigh(int high) { highSlider->setValue(high); emit thresholdChanged(getLow(), getHigh()); }
void ThresholdPanel::setLow(int low) { lowSlider->setValue(low); emit thresholdChanged(getLow(), getHigh()); }