viel zeugs usw.
git-svn-id: http://svn.lsim.tuxzone.org/trunk@11 4bec179b-ab65-46ed-a5f8-55b8b5c735d0
This commit is contained in:
Binary file not shown.
29
lsim.kdevses
29
lsim.kdevses
@@ -1,7 +1,7 @@
|
|||||||
<?xml version = '1.0' encoding = 'UTF-8'?>
|
<?xml version = '1.0' encoding = 'UTF-8'?>
|
||||||
<!DOCTYPE KDevPrjSession>
|
<!DOCTYPE KDevPrjSession>
|
||||||
<KDevPrjSession>
|
<KDevPrjSession>
|
||||||
<DocsAndViews NumberOfDocuments="23" >
|
<DocsAndViews NumberOfDocuments="24" >
|
||||||
<Doc0 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefielditem.cpp" >
|
<Doc0 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefielditem.cpp" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc0>
|
</Doc0>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc1>
|
</Doc1>
|
||||||
<Doc2 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsellipseitem.h" >
|
<Doc2 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsellipseitem.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="30" Type="Source" />
|
||||||
</Doc2>
|
</Doc2>
|
||||||
<Doc3 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/simulscene.cpp" >
|
<Doc3 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/simulscene.cpp" >
|
||||||
<View0 Encoding="UTF-8" Type="Source" />
|
<View0 Encoding="UTF-8" Type="Source" />
|
||||||
@@ -18,25 +18,25 @@
|
|||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc4>
|
</Doc4>
|
||||||
<Doc5 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefielditem.h" >
|
<Doc5 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefielditem.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="31" Type="Source" />
|
||||||
</Doc5>
|
</Doc5>
|
||||||
<Doc6 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/lsim.cpp" >
|
<Doc6 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/lsim.cpp" >
|
||||||
<View0 Encoding="" line="171" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc6>
|
</Doc6>
|
||||||
<Doc7 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/simulscene.h" >
|
<Doc7 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/simulscene.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="81" Type="Source" />
|
||||||
</Doc7>
|
</Doc7>
|
||||||
<Doc8 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/lsim.h" >
|
<Doc8 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/lsim.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="41" Type="Source" />
|
||||||
</Doc8>
|
</Doc8>
|
||||||
<Doc9 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/probechargewidget.cpp" >
|
<Doc9 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/probechargewidget.cpp" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc9>
|
</Doc9>
|
||||||
<Doc10 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/probechargewidget.h" >
|
<Doc10 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/probechargewidget.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="31" Type="Source" />
|
||||||
</Doc10>
|
</Doc10>
|
||||||
<Doc11 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefieldwidget.h" >
|
<Doc11 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefieldwidget.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="33" Type="Source" />
|
||||||
</Doc11>
|
</Doc11>
|
||||||
<Doc12 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefieldwidget.cpp" >
|
<Doc12 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefieldwidget.cpp" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
@@ -45,10 +45,10 @@
|
|||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc13>
|
</Doc13>
|
||||||
<Doc14 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsview.h" >
|
<Doc14 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsview.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="15" Type="Source" />
|
||||||
</Doc14>
|
</Doc14>
|
||||||
<Doc15 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/expdoublespinbox.cpp" >
|
<Doc15 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/expdoublespinbox.cpp" >
|
||||||
<View0 Encoding="" line="110" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc15>
|
</Doc15>
|
||||||
<Doc16 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/fielditem.h" >
|
<Doc16 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/fielditem.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
@@ -60,17 +60,20 @@
|
|||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc18>
|
</Doc18>
|
||||||
<Doc19 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homobfielditem.h" >
|
<Doc19 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homobfielditem.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" line="29" Type="Source" />
|
||||||
</Doc19>
|
</Doc19>
|
||||||
<Doc20 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homobfieldwidget.h" >
|
<Doc20 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homobfieldwidget.h" >
|
||||||
<View0 Encoding="" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc20>
|
</Doc20>
|
||||||
<Doc21 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsview.cpp" >
|
<Doc21 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsview.cpp" >
|
||||||
<View0 Encoding="" line="4" Type="Source" />
|
<View0 Encoding="" line="36" Type="Source" />
|
||||||
</Doc21>
|
</Doc21>
|
||||||
<Doc22 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/expdoublespinbox.h" >
|
<Doc22 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/expdoublespinbox.h" >
|
||||||
<View0 Encoding="" line="49" Type="Source" />
|
<View0 Encoding="" Type="Source" />
|
||||||
</Doc22>
|
</Doc22>
|
||||||
|
<Doc23 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homobfielditem.cpp" >
|
||||||
|
<View0 Encoding="" line="32" Type="Source" />
|
||||||
|
</Doc23>
|
||||||
</DocsAndViews>
|
</DocsAndViews>
|
||||||
<pluginList>
|
<pluginList>
|
||||||
<kdevdebugger>
|
<kdevdebugger>
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ ExpDoubleSpinBox::~ExpDoubleSpinBox() {
|
|||||||
|
|
||||||
|
|
||||||
double ExpDoubleSpinBox::valueFromText ( const QString& text ) const {
|
double ExpDoubleSpinBox::valueFromText ( const QString& text ) const {
|
||||||
return text.toDouble();
|
QString myText(text);
|
||||||
|
myText.chop(suffix().size());
|
||||||
|
myText.remove(prefix().size());
|
||||||
|
return myText.toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ExpDoubleSpinBox::textFromValue ( double val ) const {
|
QString ExpDoubleSpinBox::textFromValue ( double val ) const {
|
||||||
@@ -58,13 +61,17 @@ QString ExpDoubleSpinBox::textFromValue ( double val ) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QValidator::State ExpDoubleSpinBox::validate ( QString & input, int & pos ) const {
|
QValidator::State ExpDoubleSpinBox::validate ( QString & input, int & pos ) const {
|
||||||
|
QString myInput(input);
|
||||||
|
myInput.chop(suffix().size());
|
||||||
|
myInput.remove(prefix().size());
|
||||||
|
|
||||||
QLocale loc;
|
QLocale loc;
|
||||||
QChar decpoint = loc.decimalPoint(); //Locale abhaengiger dezimaltrenner
|
QChar decpoint = loc.decimalPoint(); //Locale abhaengiger dezimaltrenner
|
||||||
QString regExpString =QString("[\\-,\\+]?\\d*\\%1?\\d+([e,E][\\-,\\+]\\d+)?").arg(decpoint);
|
QString regExpString =QString("[\\-,\\+]?\\d*\\%1?\\d+([e,E][\\-,\\+]\\d+)?").arg(decpoint);
|
||||||
QRegExp regExp(regExpString);
|
QRegExp regExp(regExpString);
|
||||||
QValidator *validator = new QRegExpValidator(regExp, 0);
|
QValidator *validator = new QRegExpValidator(regExp, 0);
|
||||||
//qDebug() << validator->validate(input,pos);
|
//qDebug() << validator->validate(input,pos);
|
||||||
return validator->validate(input,pos);
|
return validator->validate(myInput,pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
QDoubleSpinBox::StepEnabled ExpDoubleSpinBox::stepEnabled () const {
|
QDoubleSpinBox::StepEnabled ExpDoubleSpinBox::stepEnabled () const {
|
||||||
|
|||||||
@@ -33,9 +33,10 @@ GraphicsEllipseItem::GraphicsEllipseItem() {
|
|||||||
setFlag(ItemIsFocusable);
|
setFlag(ItemIsFocusable);
|
||||||
//setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
//setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||||
//startTimer(100);
|
//startTimer(100);
|
||||||
|
myProbeChargeWidget = new ProbeChargeWidget(0,0,this);
|
||||||
setMasse(9.10938188e-31);
|
setMasse(9.10938188e-31);
|
||||||
setCharge(-1.6e-19);
|
setCharge(-1.6e-19);
|
||||||
myProbeChargeWidget = new ProbeChargeWidget(0,0,this);
|
|
||||||
currProbePath = new QList<QPointF>;
|
currProbePath = new QList<QPointF>;
|
||||||
speedListX = new QList<double>;
|
speedListX = new QList<double>;
|
||||||
speedListY = new QList<double>;
|
speedListY = new QList<double>;
|
||||||
@@ -54,12 +55,23 @@ void GraphicsEllipseItem::mousePressEvent ( QGraphicsSceneMouseEvent *event ) {
|
|||||||
//QGraphicsEllipseItem::mousePressEvent(event);
|
//QGraphicsEllipseItem::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphicsEllipseItem::handleSceneChange(const QList<QRectF> & /*region*/) {
|
||||||
|
if (myScenePos != scenePos()) {
|
||||||
|
myScenePos = scenePos();
|
||||||
|
emit ScenePosChanged(myScenePos);
|
||||||
|
emit ScenePosXChanged(myScenePos.x());
|
||||||
|
emit ScenePosYChanged(myScenePos.y());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn GraphicsEllipseItem::calculateProbePath()
|
\fn GraphicsEllipseItem::calculateProbePath()
|
||||||
*/
|
*/
|
||||||
void GraphicsEllipseItem::calculateProbePath(QPointF startPoint, double startSpeedX , double startSpeedY) {
|
void GraphicsEllipseItem::calculateProbePath(QPointF startPoint) {
|
||||||
|
double startSpeedX = getStartSpeedX();
|
||||||
|
double startSpeedY = getStartSpeedY();
|
||||||
SimulScene* myScene = dynamic_cast<SimulScene*>(scene());
|
SimulScene* myScene = dynamic_cast<SimulScene*>(scene());
|
||||||
//wenn noch zu keiner scene gehoerend abbruch
|
//wenn noch zu keiner scene gehoerend abbruch
|
||||||
if (myScene == 0) return;
|
if (myScene == 0) return;
|
||||||
@@ -137,7 +149,7 @@ double GraphicsEllipseItem::getCharge() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GraphicsEllipseItem::setCharge ( const long double& theValue ) {
|
void GraphicsEllipseItem::setCharge ( const double& theValue ) {
|
||||||
if (charge == theValue) return;
|
if (charge == theValue) return;
|
||||||
charge = theValue;
|
charge = theValue;
|
||||||
emit chargeChanged(theValue);
|
emit chargeChanged(theValue);
|
||||||
@@ -174,3 +186,21 @@ void GraphicsEllipseItem::setStartSpeedY ( double theValue ) {
|
|||||||
startSpeedY = theValue;
|
startSpeedY = theValue;
|
||||||
emit startSpeedYChanged(theValue);
|
emit startSpeedYChanged(theValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn GraphicsEllipseItem::setScenePosY(double posY)
|
||||||
|
*/
|
||||||
|
void GraphicsEllipseItem::setScenePosY(double newPosY)
|
||||||
|
{
|
||||||
|
moveBy(0, newPosY - scenePos().y());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\fn GraphicsEllipseItem::setScenePosX(double posX)
|
||||||
|
*/
|
||||||
|
void GraphicsEllipseItem::setScenePosX(double newPosX)
|
||||||
|
{
|
||||||
|
moveBy(newPosX - scenePos().x(),0 );
|
||||||
|
}
|
||||||
|
|||||||
@@ -71,25 +71,33 @@ class GraphicsEllipseItem : public QObject , public QGraphicsEllipseItem {
|
|||||||
///Startgeschwindigkeit des teilchens in y-Richtung
|
///Startgeschwindigkeit des teilchens in y-Richtung
|
||||||
double startSpeedY;
|
double startSpeedY;
|
||||||
|
|
||||||
|
QPointF myScenePos;
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Berechnet die Bewegung der Probeladung
|
//! Berechnet die Bewegung der Probeladung
|
||||||
/*!
|
/*!
|
||||||
\param steps Anzahl der auszufürenden Schriite
|
\param steps Anzahl der auszufürenden Schriite
|
||||||
*/
|
*/
|
||||||
void calculateProbePath (QPointF startPoint = QPointF(0,0) , double startSpeedX = 0, double startSpeedY = 0);
|
void calculateProbePath (QPointF startPoint = QPointF(0,0));
|
||||||
|
|
||||||
void setMasse ( const double& theValue );
|
void setMasse ( const double& theValue );
|
||||||
|
|
||||||
void setCharge ( const long double& theValue );
|
void setCharge ( const double& theValue );
|
||||||
|
|
||||||
void setStartSpeedX ( double theValue );
|
void setStartSpeedX ( double theValue );
|
||||||
void setStartSpeedY ( double theValue );
|
void setStartSpeedY ( double theValue );
|
||||||
|
void setScenePosY(double newPosY);
|
||||||
|
void setScenePosX(double newPosX);
|
||||||
|
void handleSceneChange(const QList<QRectF> & /*region*/);
|
||||||
signals:
|
signals:
|
||||||
void startSpeedXChanged(double speed);
|
void startSpeedXChanged(double speed);
|
||||||
void startSpeedYChanged(double speed);
|
void startSpeedYChanged(double speed);
|
||||||
void masseChanged(double masse);
|
void masseChanged(double masse);
|
||||||
void chargeChanged(double Charge);
|
void chargeChanged(double Charge);
|
||||||
|
void ScenePosChanged(QPointF newpos);
|
||||||
|
void ScenePosXChanged(double newX);
|
||||||
|
void ScenePosYChanged(double newY);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -87,8 +87,9 @@ void HomoBFieldWidget::createWidget() {
|
|||||||
ExpDoubleSpinBox* fieldFluxDensityBox = new ExpDoubleSpinBox;
|
ExpDoubleSpinBox* fieldFluxDensityBox = new ExpDoubleSpinBox;
|
||||||
fieldFluxDensityBox->setRange(-1e+200,1e+200);
|
fieldFluxDensityBox->setRange(-1e+200,1e+200);
|
||||||
fieldFluxDensityBox->setDecimals(40);
|
fieldFluxDensityBox->setDecimals(40);
|
||||||
fieldFluxDensityBox->setDisplayDecimals(2);
|
fieldFluxDensityBox->setDisplayDecimals(3);
|
||||||
fieldFluxDensityBox->setKeyboardTracking(false);
|
fieldFluxDensityBox->setKeyboardTracking(false);
|
||||||
|
fieldFluxDensityBox->setSuffix(" T");
|
||||||
connect(homoBField ,SIGNAL(fluxDensityChanged(double)),fieldFluxDensityBox, SLOT(setValue(double)) );
|
connect(homoBField ,SIGNAL(fluxDensityChanged(double)),fieldFluxDensityBox, SLOT(setValue(double)) );
|
||||||
connect(fieldFluxDensityBox, SIGNAL(valueChanged(double)),homoBField ,SLOT(setFluxDensity(double)) );
|
connect(fieldFluxDensityBox, SIGNAL(valueChanged(double)),homoBField ,SLOT(setFluxDensity(double)) );
|
||||||
|
|
||||||
|
|||||||
@@ -112,14 +112,16 @@ void HomoEFieldWidget::createWidget()
|
|||||||
fieldPowerBox->setDecimals(35);
|
fieldPowerBox->setDecimals(35);
|
||||||
fieldPowerBox->setDisplayDecimals(3);
|
fieldPowerBox->setDisplayDecimals(3);
|
||||||
fieldPowerBox->setKeyboardTracking(false);
|
fieldPowerBox->setKeyboardTracking(false);
|
||||||
|
fieldPowerBox->setSuffix(" V/m");
|
||||||
connect(homoEField ,SIGNAL(fieldPowerChanged(double)),fieldPowerBox, SLOT(setValue(double)) );
|
connect(homoEField ,SIGNAL(fieldPowerChanged(double)),fieldPowerBox, SLOT(setValue(double)) );
|
||||||
connect(fieldPowerBox, SIGNAL(valueChanged(double)),homoEField ,SLOT(setFieldPower(double)) );
|
connect(fieldPowerBox, SIGNAL(valueChanged(double)),homoEField ,SLOT(setFieldPower(double)) );
|
||||||
|
|
||||||
ExpDoubleSpinBox* voltageBox = new ExpDoubleSpinBox;
|
ExpDoubleSpinBox* voltageBox = new ExpDoubleSpinBox;
|
||||||
voltageBox->setRange(-1e+200,1e+200);
|
voltageBox->setRange(-1e+200,1e+200);
|
||||||
fieldPowerBox->setDecimals(35);
|
voltageBox->setDecimals(35);
|
||||||
fieldPowerBox->setDisplayDecimals(3);
|
voltageBox->setDisplayDecimals(3);
|
||||||
voltageBox->setKeyboardTracking(false);
|
voltageBox->setKeyboardTracking(false);
|
||||||
|
voltageBox->setSuffix(" V");
|
||||||
|
|
||||||
QGridLayout* constGridLayout = new QGridLayout;
|
QGridLayout* constGridLayout = new QGridLayout;
|
||||||
//constGridLayout->setSizeConstraint(QLayout::SetFixedSize);
|
//constGridLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
ProbeChargeWidget::ProbeChargeWidget ( QWidget* parent, Qt::WindowFlags f, GraphicsEllipseItem* ellipse ) : QWidget (parent, f ) {
|
ProbeChargeWidget::ProbeChargeWidget ( QWidget* parent, Qt::WindowFlags f, GraphicsEllipseItem* ellipse ) : QWidget (parent, f ) {
|
||||||
|
ellipseItem = ellipse;
|
||||||
createWidget();
|
createWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,72 +44,90 @@ void ProbeChargeWidget::createWidget()
|
|||||||
rotationDial->setWrapping(true);
|
rotationDial->setWrapping(true);
|
||||||
|
|
||||||
|
|
||||||
QDoubleSpinBox *heightBox = new QDoubleSpinBox;
|
ExpDoubleSpinBox *startSpeedYBox = new ExpDoubleSpinBox;
|
||||||
|
startSpeedYBox->setDecimals(50);
|
||||||
|
startSpeedYBox->setDisplayDecimals(3);
|
||||||
|
startSpeedYBox->setRange(-3e+8, 3e+8);
|
||||||
|
startSpeedYBox->setKeyboardTracking(false);
|
||||||
|
connect(startSpeedYBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setStartSpeedY(double)) );
|
||||||
|
connect(ellipseItem, SIGNAL(startSpeedYChanged(double)), startSpeedYBox, SLOT(setValue(double)) );
|
||||||
|
|
||||||
|
ExpDoubleSpinBox *startSpeedXBox = new ExpDoubleSpinBox;
|
||||||
|
startSpeedXBox->setDecimals(50);
|
||||||
QDoubleSpinBox *widthBox = new QDoubleSpinBox;
|
startSpeedXBox->setDisplayDecimals(3);
|
||||||
|
startSpeedXBox->setRange(-3e+8, 3e+8);
|
||||||
|
startSpeedXBox->setKeyboardTracking(false);
|
||||||
|
connect(startSpeedXBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setStartSpeedX(double)) );
|
||||||
|
connect(ellipseItem, SIGNAL(startSpeedXChanged(double)), startSpeedXBox, SLOT(setValue(double)) );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QLabel* xLabel = new QLabel(tr("x:"));
|
QLabel* xLabel = new QLabel(tr("x:"));
|
||||||
QLabel* yLabel = new QLabel(tr("y:"));
|
QLabel* yLabel = new QLabel(tr("y:"));
|
||||||
QLabel* widthLabel = new QLabel(tr("Breite(l):"));
|
QLabel* startSpeedYLabel = new QLabel(tr("Startgeschwindigkeit y:"));
|
||||||
QLabel* heightLabel = new QLabel(tr("H\366he(d):"));
|
QLabel* startSpeedXLabel = new QLabel(tr("Startgeschwindigkeit x:"));
|
||||||
QLabel* rotationLabel = new QLabel(tr("Rotation:"));
|
|
||||||
|
|
||||||
QDoubleSpinBox *posXBox = new QDoubleSpinBox;
|
QDoubleSpinBox *posXBox = new QDoubleSpinBox;
|
||||||
posXBox->setRange(-5000, 5000);
|
posXBox->setRange(-5000, 5000);
|
||||||
|
posXBox->setKeyboardTracking(false);
|
||||||
|
connect(posXBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setScenePosX(double)) );
|
||||||
|
connect(ellipseItem, SIGNAL(ScenePosXChanged(double)), posXBox, SLOT(setValue(double)) );
|
||||||
|
|
||||||
|
|
||||||
QDoubleSpinBox *posYBox = new QDoubleSpinBox;
|
QDoubleSpinBox *posYBox = new QDoubleSpinBox;
|
||||||
posYBox->setRange(-5000, 5000);
|
posYBox->setRange(-5000, 5000);
|
||||||
|
posYBox->setKeyboardTracking(false);
|
||||||
|
connect(posYBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setScenePosY(double)) );
|
||||||
QSpinBox* rotationBox = new QSpinBox;
|
connect(ellipseItem, SIGNAL(ScenePosYChanged(double)), posYBox, SLOT(setValue(double)) );
|
||||||
rotationBox->setRange(0,359);
|
|
||||||
rotationBox->setSuffix("\260");
|
|
||||||
rotationBox->setWrapping(true);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QGridLayout* geomGridLayout = new QGridLayout;
|
QGridLayout* geomGridLayout = new QGridLayout;
|
||||||
//geomGridLayout->setSizeConstraint(QLayout::SetFixedSize);
|
//geomGridLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
|
||||||
geomGridLayout->addWidget(heightBox,4,1);
|
geomGridLayout->addWidget(startSpeedYBox,4,1);
|
||||||
geomGridLayout->addWidget(rotationBox,0,1);
|
|
||||||
geomGridLayout->addWidget(posYBox,2,1);
|
geomGridLayout->addWidget(posYBox,2,1);
|
||||||
geomGridLayout->addWidget(posXBox,1,1);
|
geomGridLayout->addWidget(posXBox,1,1);
|
||||||
geomGridLayout->addWidget(xLabel,1,0,Qt::AlignRight);
|
geomGridLayout->addWidget(xLabel,1,0,Qt::AlignRight);
|
||||||
geomGridLayout->addWidget(yLabel,2,0,Qt::AlignRight);
|
geomGridLayout->addWidget(yLabel,2,0,Qt::AlignRight);
|
||||||
geomGridLayout->addWidget(heightLabel,4,0,Qt::AlignRight);
|
geomGridLayout->addWidget(startSpeedYLabel,4,0,Qt::AlignRight);
|
||||||
geomGridLayout->addWidget(widthLabel,3,0,Qt::AlignRight);
|
geomGridLayout->addWidget(startSpeedXLabel,3,0,Qt::AlignRight);
|
||||||
geomGridLayout->addWidget(rotationLabel,0,0,Qt::AlignRight);
|
geomGridLayout->addWidget(startSpeedXBox,3,1);
|
||||||
geomGridLayout->addWidget(widthBox,3,1);
|
|
||||||
//geomGridLayout->addWidget(rotationDial, 1,0,2,2);
|
//geomGridLayout->addWidget(rotationDial, 1,0,2,2);
|
||||||
|
|
||||||
QGroupBox* geometryBox = new QGroupBox(tr("Geometrie"));
|
QGroupBox* geometryBox = new QGroupBox(tr("Geometrie"));
|
||||||
geometryBox->setLayout(geomGridLayout);
|
geometryBox->setLayout(geomGridLayout);
|
||||||
|
|
||||||
|
|
||||||
QLabel* fieldPowerLabel = new QLabel(tr("Feldst\344rke:"));
|
QLabel* chargeLabel = new QLabel(tr("Ladung:"));
|
||||||
QLabel* voltageLabel = new QLabel(tr("Spannung:"));
|
QLabel* masseLabel = new QLabel(tr("Masse:"));
|
||||||
|
|
||||||
ExpDoubleSpinBox* fieldPowerBox = new ExpDoubleSpinBox;
|
ExpDoubleSpinBox* chargeBox = new ExpDoubleSpinBox;
|
||||||
fieldPowerBox->setRange(-1e+200,1e+200);
|
chargeBox->setRange(-1e+200,1e+200);
|
||||||
|
chargeBox->setDecimals(50);
|
||||||
|
chargeBox->setDisplayDecimals(3);
|
||||||
|
chargeBox->setKeyboardTracking(false);
|
||||||
|
chargeBox->setSuffix(" As");
|
||||||
|
connect(chargeBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setCharge(double)) );
|
||||||
|
connect(ellipseItem, SIGNAL(chargeChanged(double)), chargeBox, SLOT(setValue(double)) );
|
||||||
|
|
||||||
|
|
||||||
ExpDoubleSpinBox* voltageBox = new ExpDoubleSpinBox;
|
ExpDoubleSpinBox* masseBox = new ExpDoubleSpinBox;
|
||||||
voltageBox->setRange(-1e+200,1e+200);
|
masseBox->setRange(-1e+200,1e+200);
|
||||||
|
masseBox->setDecimals(50);
|
||||||
|
masseBox->setDisplayDecimals(3);
|
||||||
|
masseBox->setKeyboardTracking(false);
|
||||||
|
masseBox->setSuffix(" kg");
|
||||||
|
connect(masseBox, SIGNAL(valueChanged(double)), ellipseItem, SLOT(setMasse(double)) );
|
||||||
|
connect(ellipseItem, SIGNAL(masseChanged(double)), masseBox, SLOT(setValue(double)) );
|
||||||
|
|
||||||
QGridLayout* constGridLayout = new QGridLayout;
|
QGridLayout* constGridLayout = new QGridLayout;
|
||||||
//constGridLayout->setSizeConstraint(QLayout::SetFixedSize);
|
//constGridLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
constGridLayout->addWidget(fieldPowerBox,0,1);
|
constGridLayout->addWidget(chargeBox,0,1);
|
||||||
constGridLayout->addWidget(voltageBox,1,1);
|
constGridLayout->addWidget(masseBox,1,1);
|
||||||
constGridLayout->addWidget(fieldPowerLabel,0,0,Qt::AlignRight);
|
constGridLayout->addWidget(chargeLabel,0,0,Qt::AlignRight);
|
||||||
constGridLayout->addWidget(voltageLabel,1,0,Qt::AlignRight);
|
constGridLayout->addWidget(masseLabel,1,0,Qt::AlignRight);
|
||||||
|
|
||||||
QGroupBox* fieldConstantsBox = new QGroupBox(tr("Feldkonstanten"));
|
QGroupBox* fieldConstantsBox = new QGroupBox(tr("Konstanten"));
|
||||||
fieldConstantsBox->setLayout(constGridLayout);
|
fieldConstantsBox->setLayout(constGridLayout);
|
||||||
|
|
||||||
|
|
||||||
@@ -117,10 +136,9 @@ void ProbeChargeWidget::createWidget()
|
|||||||
mainLayout -> addWidget(fieldConstantsBox);
|
mainLayout -> addWidget(fieldConstantsBox);
|
||||||
mainLayout -> addStretch();
|
mainLayout -> addStretch();
|
||||||
|
|
||||||
QWidget::setTabOrder (rotationBox, posXBox);
|
|
||||||
QWidget::setTabOrder (posXBox, posYBox);
|
QWidget::setTabOrder (posXBox, posYBox);
|
||||||
QWidget::setTabOrder (posYBox, widthBox);
|
QWidget::setTabOrder (posYBox, startSpeedYBox);
|
||||||
QWidget::setTabOrder (widthBox, heightBox);
|
QWidget::setTabOrder (startSpeedYBox, startSpeedXBox);
|
||||||
|
|
||||||
this -> setLayout(mainLayout);
|
this -> setLayout(mainLayout);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ SimulScene::SimulScene ( QObject* parent ) : QGraphicsScene ( parent ) {
|
|||||||
ellipse1->setBrush(Qt::red);
|
ellipse1->setBrush(Qt::red);
|
||||||
ellipse1->setZValue(1);
|
ellipse1->setZValue(1);
|
||||||
//ellipse1->scale(4,4);
|
//ellipse1->scale(4,4);
|
||||||
ellipse1->setAcceptDrops(true);
|
ellipse1->setAcceptDrops(true);
|
||||||
|
connect(this,SIGNAL(changed(QList<QRectF>)),ellipse1,SLOT(handleSceneChange(QList<QRectF>)));
|
||||||
|
|
||||||
|
|
||||||
addItem(ellipse1);
|
addItem(ellipse1);
|
||||||
@@ -629,9 +630,9 @@ double SimulScene::getPowerAt(QPointF point, double charge, double speedX, doubl
|
|||||||
|
|
||||||
double PowerRadAngle; //Winkel des Lorentzkraftvektors zur x-Achse im Bogenmass
|
double PowerRadAngle; //Winkel des Lorentzkraftvektors zur x-Achse im Bogenmass
|
||||||
if (myHomoBFieldItem->getIsDirectionIntoPlane()) {
|
if (myHomoBFieldItem->getIsDirectionIntoPlane()) {
|
||||||
PowerRadAngle = speedRadAngle - PI/2.0;
|
|
||||||
} else {
|
|
||||||
PowerRadAngle = speedRadAngle + PI/2.0;
|
PowerRadAngle = speedRadAngle + PI/2.0;
|
||||||
|
} else {
|
||||||
|
PowerRadAngle = speedRadAngle - PI/2.0;
|
||||||
}
|
}
|
||||||
//qDebug()<< PowerRadAngle;
|
//qDebug()<< PowerRadAngle;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user