Exemplo n.º 1
0
void particle::setRanges(float x, float y, float z, float r){
    float maxX = x + r;
    float maxY = y + r;
    float maxZ = z + r;
    float minX = x - r;
    float minY = y - r;
    float minZ = z - r;
    setMaxRange(maxX, maxY, maxZ);
    setMinRange(minX, minY, minZ);
}
Exemplo n.º 2
0
static void onRsnSetInfo( HWND hwnd, const RS_INFO *pInfo ) {

    setLower      ( hwnd, pInfo->_lower       );
    setUpper      ( hwnd, pInfo->_upper       );
    setSaveStart2 ( hwnd, pInfo->_lower       );
    setSaveEnd2   ( hwnd, pInfo->_upper       );
    setStart      ( hwnd, pInfo->_start       );
    setEnd        ( hwnd, pInfo->_end         );
    setMinRange   ( hwnd, pInfo->_minRange    );
    setGranularity( hwnd, pInfo->_granularity );

    invalidateRect( hwnd );
    invalidateCursor();
}
/*!
 * Description: General funtion for menus which set values
 *              (Such as Set Max Range). This calls the
 *              appropriate function, and transmits user messages.
 */
static void setValue(int input)
{
    char string[20] = " set to \0";
    char stringLcd[20] = {0};
    Direction dir;

    // Sends a new line
    sendNewLine(1);

    // Handle inpropper input values
    if (input < m_currentMenu.minVal || input > m_currentMenu.maxVal)
    {
        errOutOfRange(m_currentMenu.minVal, m_currentMenu.maxVal);
        sendNewLine(1);
        return;
    }

    // Handle Different cases
    // @TODO handle current values
    // @TODO Integrate
    switch (m_currentMenu.menuID)
    {
        case AZ_GOTO:
            dir.azimuth = input;
            dir.elevation = getDir().elevation;
            move(dir);
            sendROM(angleStr);
            break;
        case EL_GOTO:
            dir.azimuth = getDir().azimuth;
            dir.elevation = input;
            move(dir);
            sendROM(angleStr);
            break;
        case AZ_MIN:
            setMinAzimuthAngle((char) input);
            AzGoto.minVal = input;
            sendROM(angleStr);
            break;
        case AZ_MAX:
            setMaxAzimuthAngle((char) input);
            AzGoto.maxVal = input;
            sendROM(angleStr);
            break;
        case EL_MIN:
            setMinElevationAngle((char) input);
            ElGoto.minVal = input;
            sendROM(angleStr);
            break;
        case EL_MAX:
            setMaxElevationAngle((char) input);
            ElGoto.maxVal = input;
            sendROM(angleStr);
            break;
        case RANGE_MIN:
            setMinRange(input);
            sendROM(mmStr);
            break;
        case RANGE_MAX:
            setMaxRange(input);
            sendROM(mmStr);
            break;
        case US_SAMPLE_RATE:
            setUsSampleRate(input);
            sendROM(sampleRate);
            break;
        case US_SAMPLE_AVG:
            setNumSamples(input);
            sendROM(numPerSample);
            break;
    }

    // Transmit the final part of the sentence
    transmit(string);
    transmit(intToAscii(input));
    sendNewLine(1);

    //lcdWriteString(strcpypgm2ram(stringLcd, "OK!"), 2);
}
Exemplo n.º 4
0
void SpinBoxRangeSliderQt::setMinMaxRange(const int minRange, const int maxRange) {
    blockSignals(true);
    setMinRange(minRange);
    setMaxRange(maxRange);
    blockSignals(false);
}