LennardJonesCapped(real _epsilon, real _sigma,
		   real _cutoff, real _caprad, real _shift)
	: epsilon(_epsilon), sigma(_sigma), caprad(_caprad) {
        setShift(_shift);
        setCutoff(_cutoff);
        preset();
      }
 ReactionFieldGeneralized()
 : prefactor(1), kappa(0.0),
  epsilon1(1.0), epsilon2(80.0),
  rc(1.0){
     setShift(0.0);
     setCutoff(infinity);
     initialize();
 }
Example #3
0
void Distance::send_ir_sonar_pulse()
{
  startPwm();
  setShift(FS_BIT | LS_BIT | RS_BIT | BS_BIT | IR_BIT, PULSE_TIME);
  delay(1000);
  stopPwm();
  //delay(250);
}
 ReactionFieldGeneralizedTI()
 : prefactor(0.0), kappa(0.0),
  epsilon1(1.0), epsilon2(80.0),
  rc(1.0), lambdaTI(0.0), annihilate(1) {
     setShift(0.0);
     autoShift = false;
     setCutoff(infinity);
     initialize();
 }
void ccShiftAndScaleCloudDlg::onLoadIndexChanged(int index)
{
	if (index < 0 || index >= static_cast<int>(m_defaultInfos.size()))
		return;

	setShift(m_defaultInfos[index].shift);
	if (m_ui->scaleSpinBox->isVisible())
		setScale(m_defaultInfos[index].scale);
}
Example #6
0
Palette::Palette(const QColor &color, qreal shift)
{
	_h = 0; _s = 0; _v = 0; _a = 1.0;

	setColor(color);
	setShift(shift);

	_state = _h;
}
Example #7
0
///////////////////////
// Internal functions
///////////////////////
int Distance::checkModule(uint8_t module)
{
  long duration, distance;
  startPwm();
  setShift(module, PULSE_TIME);
  duration = pulseIn(ULTRASOUND_RECEIVE_PIN, HIGH);
  distance = (duration * CM_PER_MICROSECOND) + FIXED_OFFSET;
  //distance = (.13077*pow(duration,1-.2421));
  stopPwm();
  delay(250);
  return (int)distance;
}
Example #8
0
void FChart3d::Update()
{
    double MaxX = DataMap3d->AddressZ.GetSizeX();
    double MaxY = DataMap3d->AddressZ.GetSizeY();

    if(DataMap3d->Data->IsEmply() || DataMap3d->AddressZ.IsEmpty())
    {
        Surface3d->setMesh(3, 3);
        Surface3d->setDomain(0, 1, 0 , 1);
        Surface3d->create();
        updateData();
        updateGL();
        return;
    }

    double MaxZ = GetMaxZ();

    setTitle(DataMap3d->TitleGraf.isEmpty() ? "3D Map" : DataMap3d->TitleGraf);

    setRotation(30,0,15);
    setScale(MaxZ / MaxX, MaxZ / MaxY, 1);
    setShift(0,0,0); // Deslocamento
    setZoom(0.5);

    Surface3d->setMesh(MaxX+1, MaxY+1);
    Surface3d->setDomain(0, MaxX-1, 0 ,MaxY-1);
    Surface3d->create();


    for (unsigned i=0; i!=coordinates()->axes.size(); ++i)
    {
      coordinates()->axes[i].setMajors(4);
      coordinates()->axes[i].setMinors(2);
    }

    coordinates()->setAutoScale(true);


    double Tic = (coordinates()->second() - coordinates()->first()).length() / MaxZ;
            Tic = Tic * 0.5;
            coordinates()->setTicLength(Tic,0.6*Tic);


    coordinates()->axes[X1].setLabelString("x-axis");
    coordinates()->axes[Y1].setLabelString("y-axis");
    //coordinates()->axes[Z1].setLabelString(QChar(0x38f)); // Omega - see http://www.unicode.org/charts/


    //setCoordinateStyle(BOX);

    updateData();
    updateGL();
}
                ReactionFieldGeneralized(   
                        real _prefactor,
                        real _kappa,
                        real _eps1,
                        real _eps2,
                        real _cutoff,
                        real _shift)
                : prefactor(_prefactor),kappa(_kappa),
                  epsilon1(_eps1), epsilon2(_eps2),
                  rc(_cutoff) {
                    setShift(_shift);//setShift(_shift);
                    setCutoff(_cutoff);

                    initialize();
                }
Example #10
0
bool callFunction(std::string get, int scramblers[3+1][26], int shift[3], int rotor[3]){

    // make input string lower case
    for(size_t i = 0, n = get.length(); i < n; i++)
        get[i] = tolower(get[i]);

    if(get.compare("end") == 0)
        return false;
    if(get.compare("help") == 0)
        help();
    else if(get.compare("generate_key") == 0 or get.compare("gk") == 0)
        generateKey();
    else if(get.compare("generate_scrambler") == 0 or get.compare("gs") == 0)
        generateScrambler(scramblers);
    else if(get.compare("set_key") == 0 or get.compare("sk") == 0)
        setKey(scramblers);
    else if(get.compare("encrypt") == 0 or get.compare("e") == 0)
        encrypt(scramblers, shift, rotor);
    else if(get.compare("set_shift") == 0 or get.compare("ss") == 0)
        setShift(shift);
    else if(get.compare("set_rotor") == 0 or get.compare("sr") == 0)
        setRotor(rotor);
    else if(get.compare("reset_shift") == 0 or get.compare("rs") == 0)
        resetShift(shift);
    else if(get.compare("print_shift") == 0 or get.compare("ps") == 0)
        printShift(shift);
    else if(get.compare("print_rotor") == 0 or get.compare("pr") == 0)
        printRotor(rotor);
    else if(get.compare("encrypt_file") == 0 or get.compare("ef") == 0)
        encryptFile(scramblers, shift, rotor);
    else if(get.compare("capitalize") == 0 or get.compare("c") == 0)
        capitalize();
    else if(get.compare("set_plugboard") == 0 or get.compare("sp") == 0)
        setPlugboard();
    else if(get.compare("save") == 0 or get.compare("s") == 0)
        save(scramblers, shift, rotor);
    else if(get.compare("load") == 0 or get.compare("l") == 0)
        load(scramblers, shift, rotor);
    else
        unrecognized();


    return true;
}
Example #11
0
void Plot3D::SetData(QMap< QPair< int, int >, double > &points, int nx, int ny, int dx, int dy)
{

	QualityFunc func(this, points, dx, dy);
    
    func.setMesh(nx, ny);

	QList< QPair< int, int> > arguments = points.keys();

	qSort(arguments);

	int xStart	= arguments[0].first;
	int xEnd	= xStart + (nx-1)*dx;
	int yStart	= arguments[0].second;
	int yEnd	= yStart + (ny-1)*dy;

	func.setDomain(xStart, xEnd, yStart, yEnd);

    func.create();

    setRotation(30,0,15);
    setScale( 1.0 / (double)(xEnd-xStart)*100.0 , 1.0 / (double)(yEnd - yStart)*100.0 , 100);
    setShift(0.15,0,0);
    setZoom(0.9);

    for (unsigned i=0; i!=coordinates()->axes.size(); ++i)
    {
      coordinates()->axes[i].setMajors(7);
      coordinates()->axes[i].setMinors(4);
    }


	coordinates()->axes[Qwt3D::X1].setLabelString(QObject::trUtf8("Окно"));
    coordinates()->axes[Qwt3D::Y1].setLabelString(QObject::trUtf8("Шаг"));
    coordinates()->axes[Qwt3D::Z1].setLabelString(QString(QChar(0x03A3)) + QString(QChar(0x0394)) + QString("y"));


    setCoordinateStyle(Qwt3D::BOX);

    updateData();
    updateGL();

}
 ReactionFieldGeneralizedTI(   
         real _prefactor,
         real _kappa,
         real _eps1,
         real _eps2,
         real _cutoff,
         real _lambdaTI,
         bool _annihilate)
 : prefactor(_prefactor),kappa(_kappa),
   epsilon1(_eps1), epsilon2(_eps2),
   rc(_cutoff), lambdaTI(_lambdaTI), 
   annihilate(_annihilate) {
     setShift(0.0);
     autoShift = false;
     /*Note: AutoShift cannot be used here since the shift
      *  has to depend on the product of charges */
     setCutoff(_cutoff);
     initialize();
 }
Example #13
0
Jenia::Jenia() : Qwt3D::SurfacePlot() {
    for (unsigned i=0; i!=coordinates()->axes.size(); ++i)
    {
      coordinates()->axes[i].setMajors(7);
      coordinates()->axes[i].setMinors(4);
    }

    coordinates()->axes[Qwt3D::X1].setLabelString("x");
    coordinates()->axes[Qwt3D::Y1].setLabelString("y");
    coordinates()->axes[Qwt3D::Z1].setLabelString("z");

    setCoordinateStyle(Qwt3D::BOX);

    setPlotStyle(Qwt3D::WIREFRAME);
    Qwt3D::RGBA color(1, 0, 0, 1);
    setMeshColor(color);

    setRotation(30,0,15);
    setScale(1,1,1);
    setShift(0.15,0,0);
    setZoom(0.9);

    resize(800, 600);
}
Example #14
0
 FENE()
   : K(0.0), r0(0.0), rMax(0.0) {
   setShift(0.0);
   setCutoff(infinity);
 }
      MirrorLennardJones(real _epsilon, real _sigma)
        : epsilon(_epsilon), sigma(_sigma) {
        setShift(-epsilon);
        setCutoff(2*pow(2.,1./6.)*sigma);
	preset();
      }
 // Setter and getter
 void setEpsilon(real _epsilon) {
   epsilon = _epsilon;
   setShift(-epsilon);
   preset();
 }
Example #17
0
      FENECapped(real _K, real _r0, real _rMax,
		   real _cutoff, real _caprad, real _shift)
        : K(_K), r0(_r0), rMax(_rMax), caprad(_caprad) {
        setShift(_shift);
        setCutoff(_cutoff);
      }
Example #18
0
 FENECapped()
   : K(0.0), r0(0.0), rMax(0.0), caprad(0.0) {
   setShift(0.0);
   setCutoff(infinity);
 }
 //Takes shift and hourly pay rate
 ProductionWorker16(int s, float hpr)
 {   setShift(s);
     setHrPayRt(hpr);
 }
Example #20
0
 Quartic(): K(0.0), r0(0.0) {
   setShift(0.0);
   setCutoff(infinity);
 }
Example #21
0
      VSpherePair(real _epsilon, real _cutoff, real _shift)
	: epsilon(_epsilon) {
        setShift(_shift);
        setCutoff(_cutoff);
        preset();
      }
Example #22
0
      VSpherePair()
	: epsilon(0.0) {
        setShift(0.0);
        setCutoff(infinity);
        preset();
      }
Example #23
0
      FENE(real _K, real _r0, real _rMax, 
		   real _cutoff, real _shift) 
        : K(_K), r0(_r0), rMax(_rMax) {
        setShift(_shift);
        setCutoff(_cutoff);
      }
Example #24
0
 Quartic(real _K, real _r0, real _cutoff, real _shift) : K(_K), r0(_r0) {
   setShift(_shift);
   setCutoff(_cutoff);
 }
      LennardJonesCapped()
	: epsilon(0.0), sigma(0.0) {
        setShift(0.0);
        setCutoff(infinity);
        preset();
      }