Esempio n. 1
0
QamTachymeter::QamTachymeter(QWidget* parent ) : QamFlightInstrument(parent)
{
	m_class = "QamTachymeter" ;
	
	setLabel(QString("TURBINE"), TURBINE ) ;
	setUnit(QString("x 1000"), TURBINE ) ;
	setMinMax(0, 40000, TURBINE ) ;
	setThresholds(32000, 35000, TURBINE ) ;
	setValue(0, TURBINE ) ;

	m_radius[TURBINE] = QFI_RADIUS ;
	m_start[TURBINE]  = 120 ;
	m_span[TURBINE]   = 300 ;
	m_min[TURBINE]    =   0 ;
	m_max[TURBINE]    =  40 ;
	m_step[TURBINE]   = m_span[TURBINE] / ( m_max[TURBINE] - m_min[TURBINE] ) ;

	setLabel(QString("ROTOR"), ROTOR ) ;	
	setUnit(QString("t/mn x 100"), ROTOR ) ;
	setMinMax(0, 450, ROTOR ) ;
	setThresholds(280, 420, ROTOR ) ;
	setValue(0, ROTOR ) ;
	
	m_radius[ROTOR] = 0.6 * QFI_RADIUS ;
	m_start[ROTOR]  = 120 ;
	m_span[ROTOR]   = 320 ;
	m_min[ROTOR]    =   0 ;
	m_max[ROTOR]    =  45 ;
	m_step[ROTOR]   = m_span[ROTOR] / ( m_max[ROTOR] - m_min[ROTOR] ) ;

	//	animation des aiguilles (pour tests)
	
	setAdjustable(100, 0, TURBINE ) ;
//	connect(this, SIGNAL( selectChanged() ), this, SLOT( selectChanged() ) ) ;
}
Esempio n. 2
0
StandardModel<Two_scale>::StandardModel(const StandardModel<Two_scale>& s)
   : yu(s.yu), yd(s.yd), ye(s.ye), g(s.g)
{
   setPars(numStandardModelPars);
   setMu(s.displayMu());
   setLoops(s.displayLoops());
   setThresholds(s.displayThresholds());
}
Esempio n. 3
0
StandardModel<Two_scale>::StandardModel()
   : yu(3, 3), yd(3, 3), ye(3, 3), g(3)
   , precision(1.0e-3)
{
   setPars(numStandardModelPars);
   setMu(0.0);
   setLoops(1);
   setThresholds(0);
}
Esempio n. 4
0
StandardModel<Two_scale>::StandardModel(const DoubleMatrix& SMu, const DoubleMatrix& SMd,
                                        const DoubleMatrix& SMe, const DoubleVector& g_)
   : yu(SMu), yd(SMd), ye(SMe), g(g_)
{
   setPars(numStandardModelPars);
   setMu(0.0);
   setLoops(1);
   setThresholds(0);
}
Esempio n. 5
0
void MssmSusy::setSusy(const MssmSusy & s) {
  setLoops(s.displayLoops());
  setThresholds(s.displayThresholds());
  setMu(s.displayMu());
  setYukawaMatrix(YU, s.displayYukawaMatrix(YU)); 
  setYukawaMatrix(YD, s.displayYukawaMatrix(YD)); 
  setYukawaMatrix(YE, s.displayYukawaMatrix(YE)); 
  setHvev(s.displayHvev());
  setTanb(s.displayTanb());
  setSusyMu(s.displaySusyMu());
  setAllGauge(s.displayGauge());
}
Esempio n. 6
0
const StandardModel<Two_scale>& StandardModel<Two_scale>::operator=(const StandardModel<Two_scale>& s)
{
   if (this == &s) return *this;
   yu = s.yu;
   yd = s.yd;
   ye = s.ye;
   g = s.g;
   setMu(s.displayMu());
   setLoops(s.displayLoops());
   setThresholds(s.displayThresholds());
   return *this;
}
Esempio n. 7
0
const QedQcd & QedQcd::operator=(const QedQcd & m) {
  if (this == &m) return *this;
  a = m.a;
  mf = m.mf;
  mbPole = m.mbPole;
  input = m.input;
  ckm = m.ckm;
  pmns = m.pmns;
  setLoops(m.displayLoops());
  setThresholds(m.displayThresholds());
  setMu(m.displayMu());
  return *this;
}
tResult CurveDetector::Init(tInitStage eStage, __exception)
{
    RETURN_IF_FAILED(cFilter::Init(eStage, __exception_ptr));

    switch (eStage)
    {
    case StageFirst:
        RETURN_IF_FAILED(createVideoInputPin("videoInput", this->videoInput));
        RETURN_IF_FAILED(createVideoOutputPin("rgbVideo", this->rgbOutput));
        break;

    case StageNormal:
        setThresholds();
        break;

    case StageGraphReady:
        break;
    }

    RETURN_NOERROR;
}
void Adafruit_MPR121::setThreshholds(uint8_t touch, uint8_t release) {

  setThresholds(touch, release);
  }
tResult CurveDetector::PropertyChanged(const char *propertyName)
{
    setThresholds();

    RETURN_NOERROR;
}
Esempio n. 11
0
int shapeDetector(BoundingBox* result, CvCapture* capture, int numberOfIntervals){

    int numberOfWindows = 0;
    int interval, start_t=45, end_t, span_t=65;
    int w_counter=0;
    int threshold[100];
    int i,j;
	int frameCounter=0;
    int totalNumberOfPatterns=0;
    int numberOfReducedPatterns=0;


    char dynamicThresholding=1;
    char run=1;
    char showWindow [100];
    char got_result = 0; //Used to know if we had great success of just got canceled

    struct Metric metric[100];
    IplImage* imgGrayScale;
    IplImage* img;

    Pattern allPatterns[100];
    Pattern reducedPatterns[10];

    CvPoint s_list[4];

    CvSeq*   contourArray[100];
    CvMemStorage *storage = cvCreateMemStorage(0); //storage area for all contours

    box = result;

    srand(time(NULL));

    for(i=0; i<100; i++) {
        showWindow[i] = 0;
    }

    //*********************  SET UP IMAGES AND DISPLAY WINDOWS  ***********************
    //*********************************************************************************

    img = cvQueryFrame(capture);
    imgGrayScale = cvCreateImage(cvGetSize(img), 8, 1);

    switch( numberOfWindows ) {
        case 3:
            cvNamedWindow("Threshold 2", CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_NORMAL);
        case 2:
            cvNamedWindow("Threshold 3", CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_NORMAL);
        case 1:
            cvNamedWindow("Threshold 1", CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_NORMAL);
    }

    cvNamedWindow("Tracked", CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_NORMAL);
    cvCreateTrackbar("Threshold lower",   "Tracked", &start_t, 255,    NULL);
    cvCreateTrackbar("Threshold upper",   "Tracked", &end_t,  255,    NULL);
    //---------------------------------------------------------------------------------

    span_t = end_t - start_t;
    interval = span_t/numberOfIntervals;

    for(i=0; i<numberOfIntervals; i++){
        threshold[i] = start_t+((i+1)*interval);
    }

    while(run){ //Main loop

        //*********************  IMAGE PRE-PROCESSING  ****************************
	frameCounter++;
        img = cvQueryFrame(capture);

        //converting the original image into grayscale
        cvCvtColor(img,imgGrayScale,CV_BGR2GRAY);

        //---------------------------------------------------------------------------

        // Awesome shapeProcessing function calls
        for(i=0; i<numberOfIntervals; i++){
            metric[i] = shapeProcessing(img, imgGrayScale, threshold[i]);
                
	        //Append patterns found in the layers to allPatterns list
	        for(j=0; j<metric[i].numberOfPatterns; j++){
	        
	            allPatterns[totalNumberOfPatterns] = metric[i].p_list[j];
	            totalNumberOfPatterns++;
	        }            
        }


        // Reduce patterns
        numberOfReducedPatterns = reducePatterns(allPatterns, reducedPatterns, totalNumberOfPatterns);
    
        for(i=0; i<numberOfReducedPatterns; i++){
            drawRect(reducedPatterns[i].cv_rect, img);
        }        

        if(numberOfReducedPatterns == 4){
        
            findBox_r(&reducedPatterns[0], &s_list[0]);

            box->topLeft = s_list[0];
            box->topRight = s_list[1];
            box->bottomLeft = s_list[2];
            box->bottomRight = s_list[3];
            got_result = 1;
            run = 0;
        }        
    
        // Adjust thresholds 
        if(dynamicThresholding) {
            setThresholds(&threshold[0], &metric[0], numberOfIntervals);
        }
        else{
            span_t = end_t - start_t;
            interval = span_t/numberOfIntervals;

            for(i=0; i<numberOfIntervals; i++){
                threshold[i] = start_t+((i+1)*interval);
            }
        }

        numberOfReducedPatterns=0;
        totalNumberOfPatterns=0;

        //show the image in which identified shapes are marked   
        cvShowImage("Tracked",img);

        int input;
        input = cvWaitKey(10) & 0xff; //wait for a key press. also needed to repaint windows. Masks away bits higher then interesting

        switch(input){

            case 27: //esc-key
            case 'q':
            case 'e': run=0; break;
            case 'd': draw = !draw; break;
        }

    } //end of main while(run) loop

    //cleaning up
    switch( numberOfWindows ) {
        case 3:
            cvDestroyWindow("Threshold 2");
        case 2:
            cvDestroyWindow("Threshold 3");
        case 1:
            cvDestroyWindow("Threshold 1");
    }
    cvDestroyWindow("Tracked");
    cvReleaseMemStorage(&storage);
    cvReleaseImage(&imgGrayScale);
    //cvReleaseImage(&img);
    printf("Number of frames: %d\n", frameCounter);
    return got_result;
}