classe step
This commit is contained in:
parent
cb03e1f91f
commit
fd004988d6
@ -10,10 +10,12 @@ CONFIG += c++17
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
mainwindow.cpp
|
||||
mainwindow.cpp \
|
||||
step.cpp
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h
|
||||
mainwindow.h \
|
||||
step.h
|
||||
|
||||
FORMS += \
|
||||
mainwindow.ui
|
||||
|
||||
22
step.cpp
Normal file
22
step.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include "step.h"
|
||||
|
||||
Step::Step() {
|
||||
latitude = 0.0;
|
||||
longitude = 0.0;
|
||||
response = 0;
|
||||
}
|
||||
|
||||
Step::Step(QTextStream &in)
|
||||
{}
|
||||
void Step::setLatitude(int degree, float minute, QChar NS)
|
||||
{
|
||||
latitude = degree + minute / 60.0;
|
||||
if (NS.toUpper() == 'S')
|
||||
latitude = -latitude;
|
||||
}
|
||||
void Step::setLongitude(int degree, float minute, QChar EW)
|
||||
{
|
||||
longitude = degree + minute / 60.0;
|
||||
if (EW.toUpper() == 'W')
|
||||
longitude = -longitude;
|
||||
}
|
||||
22
step.h
Normal file
22
step.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef STEP_H
|
||||
#define STEP_H
|
||||
#include <QString>
|
||||
#include <QTextStream>
|
||||
class Step
|
||||
{
|
||||
|
||||
private:
|
||||
QString title;
|
||||
float latitude;
|
||||
float longitude;
|
||||
QString text;
|
||||
int response;
|
||||
|
||||
public:
|
||||
Step();
|
||||
Step(QTextStream &in);
|
||||
void setLatitude(int degree,float minute,QChar NS);
|
||||
void setLongitude(int degree,float minute,QChar EW);
|
||||
};
|
||||
|
||||
#endif // STEP_H
|
||||
Loading…
x
Reference in New Issue
Block a user