homoefeld berechnung und animation sollten grundlegend funktionieren
git-svn-id: http://svn.lsim.tuxzone.org/trunk@3 4bec179b-ab65-46ed-a5f8-55b8b5c735d0
This commit is contained in:
@@ -74,32 +74,25 @@ SimulScene::SimulScene ( QObject* parent ) : QGraphicsScene ( parent ) {
|
||||
|
||||
addItem(ellipse1);
|
||||
|
||||
timer = new QTimeLine( (200e-3/8.0e+6) *1000 * 2e+8);
|
||||
timer = new QTimeLine( 30000);
|
||||
//qDebug()<< (200e-3/8.0e+6) *1000 * 2e+8;
|
||||
timer->setFrameRange(0,100);
|
||||
timer->setUpdateInterval(25);
|
||||
timer->setCurveShape(QTimeLine::LinearCurve);
|
||||
//timer->toggleDirection();
|
||||
QGraphicsItemAnimation *ani = new QGraphicsItemAnimation();
|
||||
ani = new QGraphicsItemAnimation();
|
||||
ani->setItem(ellipse1);
|
||||
ani->setTimeLine(timer);
|
||||
|
||||
qreal E = 40/(2e-2);
|
||||
qreal q = -1.6022e-19;
|
||||
qreal m = 9.1094e-31;
|
||||
qreal vx = 8.0e+6;
|
||||
qreal ax=0;
|
||||
qreal ay=q*E/m;
|
||||
|
||||
for (int i=0; i<=200; ++i) {
|
||||
qreal x=i;
|
||||
ani->setPosAt(i/200.0, QPointF(x , 0.5 * ay * pow(( (x/1000) /vx),2) *1000 ));
|
||||
//ani->setPosAt((t+360)/720.0, QPointF((t), 80*abs(t/180.0*3.14) ));
|
||||
//qDebug()<<QPointF(x , 0.5 * ay * pow(( (x/1000) /vx),2) *1000 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SimulScene::startTimer() {
|
||||
for (int i=0; i<getSteps(); ++i) {
|
||||
//ani->setPosAt(i/200.0, QPointF(x , 0.5 * ay * pow(( (x/1000) /vx),2) *1000 ));
|
||||
ani->setPosAt(i/(double)getSteps(), ellipse1->getCurrProbePath()->at(i) );
|
||||
//qDebug()<< getSteps();
|
||||
}
|
||||
timer->start();
|
||||
}
|
||||
|
||||
@@ -497,7 +490,7 @@ void SimulScene::setTimePerStep(double time) {
|
||||
\fn SimulScene::startCalculation()
|
||||
*/
|
||||
void SimulScene::startCalculation() {
|
||||
ellipse1->calculateProbePath();
|
||||
ellipse1->calculateProbePath(ellipse1->pos());
|
||||
}
|
||||
|
||||
|
||||
@@ -519,8 +512,8 @@ void SimulScene::setSteps(int steps) {
|
||||
|
||||
}
|
||||
|
||||
long double SimulScene::getPowerAt(QPointF point, long double charge, char xy) {
|
||||
long double dPower = 0;
|
||||
double SimulScene::getPowerAt(QPointF point, double charge, char xy) {
|
||||
double dPower = 0;
|
||||
for(int i = 0; i < items(point).size(); ++i) {
|
||||
//HomoEFieldItems Abarbeiten
|
||||
if (qgraphicsitem_cast<HomoEFieldItem*> (items(point).at(i)) != 0) {
|
||||
@@ -550,6 +543,7 @@ double SimulScene::getMeterPerPx() const {
|
||||
void SimulScene::setMeterPerPx ( double theValue ) {
|
||||
if (theValue == meterPerPx) return;
|
||||
meterPerPx = theValue;
|
||||
emit meterPerPxChanged(theValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user