Skip to content
Snippets Groups Projects
Commit cfe9d008 authored by s90532's avatar s90532
Browse files

bearbeitung der ui und einfühen von payment und bearbeitung vo

zubereitung
parent 011db06e
No related branches found
No related tags found
No related merge requests found
Showing with 1626 additions and 148 deletions
ICON/Champon.jpg

99.5 KiB

ICON/Seitan.jpg

218 KiB

ICON/Shio.jpg

174 KiB

ICON/Shoyu.png

2.03 MiB

ICON/Shoyu_Chicken.png

311 KiB

ICON/Spicy_Kimshi_Miso.png

104 KiB

ICON/Tantan.png

87.5 KiB

ICON/beefkimchiramenbowl.jpg

56.7 KiB

ICON/japanische-meeresfruechte-ramen-mit-tintenfischsauce_1205-11089.png

91.6 KiB

ICON/veg_shoyu.png

134 KiB

#include "bezahlen.h"
#include <iostream>
#ifndef BEZAHLEN_H
#define BEZAHLEN_H
#endif // BEZAHLEN_H
/*#ifndef BEZAHLEN_H
#define BEZAHLEN_H
#include <string>
class bezahlen
{
public:
bezahlen();
struct Kartenzahlungdetails {
std::string kartennummer;
std::string kartenholder;
std::string verfallsdatum;
std::string cvv;
double betrag;
};
struct Barzahlungdetails {
double bezahlterbetrag;
double offenerbetrag;
};
bool prozessKartenzahlung(const Kartenzahlungdetails& details);
bool prozessBarzahlung(const Barzahlungdetails& details);
bool makePayment(const std::string& bezahlungsmethode, double offenerBetrag);
};
#endif // BEZAHLEN_H
*/
QT += core gui
QT += core gui testlib
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
......@@ -8,9 +8,11 @@ CONFIG += c++17
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
aktoren.cpp \
ausgabefach.cpp \
bezahlen.cpp \
dialog1.cpp \
display.cpp \
elektromagnetischer_sensor.cpp \
......@@ -30,6 +32,8 @@ SOURCES += \
mitarbeiter.cpp \
motor.cpp \
muenzentyp.cpp \
payment_test.cpp \
paymentprocessor.cpp \
preis.cpp \
produkt.cpp \
ramenabteilung.cpp \
......@@ -43,6 +47,7 @@ SOURCES += \
steuerung.cpp \
tank.cpp \
temperatursensor.cpp \
testmainwindow.cpp \
wartung.cpp \
wassererhitzungssystem.cpp \
zubereitung.cpp
......@@ -50,6 +55,7 @@ SOURCES += \
HEADERS += \
aktoren.h \
ausgabefach.h \
bezahlen.h \
dialog1.h \
display.h \
elektromagnetischer_sensor.h \
......@@ -68,6 +74,8 @@ HEADERS += \
mitarbeiter.h \
motor.h \
muenzentyp.h \
payment_test.h \
paymentprocessor.h \
preis.h \
produkt.h \
ramenabteilung.h \
......@@ -81,6 +89,7 @@ HEADERS += \
steuerung.h \
tank.h \
temperatursensor.h \
testmainwindow.h \
wartung.h \
wassererhitzungssystem.h \
zubereitung.h
......@@ -100,3 +109,15 @@ RESOURCES += \
DISTFILES += \
../../../../../Pictures/Screenshots/Screenshot 2024-05-12 214014.png
SOURCES += \
payment_test.cpp
HEADERS += \
payment_test.h
# Konfiguration für die Tests
CONFIG += testcase
# Konfiguration für die MOC-Datei
AUTOMOC += payment_test.cpp
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 13.0.0, 2024-06-04T00:21:18. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{c1d2f2d0-12ad-4c7f-9139-0b959e7b7f09}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="qlonglong">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">8</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
<valuemap type="QVariantMap" key="CppEditor.QuickFix">
<value type="bool" key="UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.7.0 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.7.0 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.670.win64_mingw_kit</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\mikai\Documents\TI\5 Sem\Se2\hii\build\Desktop_Qt_6_7_0_MinGW_64_bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/mikai/Documents/TI/5 Sem/Se2/hii/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Erstellen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Erstellen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Bereinigen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Bereinigen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\mikai\Documents\TI\5 Sem\Se2\hii\build\Desktop_Qt_6_7_0_MinGW_64_bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/mikai/Documents/TI/5 Sem/Se2/hii/build/Desktop_Qt_6_7_0_MinGW_64_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Erstellen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Erstellen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Bereinigen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Bereinigen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\mikai\Documents\TI\5 Sem\Se2\hii\build\Desktop_Qt_6_7_0_MinGW_64_bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/mikai/Documents/TI/5 Sem/Se2/hii/build/Desktop_Qt_6_7_0_MinGW_64_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Erstellen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Erstellen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Bereinigen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Bereinigen</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deployment</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deployment</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph &quot;dwarf,4096&quot; -F 250</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">hii2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/mikai/Documents/TI/ramenautomat/hii.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/mikai/Documents/TI/ramenautomat/hii.pro</value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">true</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/mikai/Documents/TI/5 Sem/Se2/hii/build/Desktop_Qt_6_7_0_MinGW_64_bit-Debug</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <iostream>
#include "dialog1.h"
#include <QPixmap>
#include <QMessageBox>
#include <QRadioButton>
#include <QDebug> // Für Debugging-Ausgaben
#include "paymentprocessor.h"
#include "zubereitung.h"
using namespace std;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
, secondwindow(nullptr)
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
secondwindow(nullptr),
//paymentProcessor(new PaymentProcessor()), // Initialisierung von paymentProcessor
selectedRamen(Tonkotsu),
selectedSauce(Soy)
{
ui->setupUi(this);
Zubereitung *zubereitung = new Zubereitung(selectedRamen, selectedSauce);
//radiobutton = ui->radioButton;
// Überprüfen Sie, ob das Zubereitung-Objekt erfolgreich erstellt wurde
if (zubereitung != nullptr) {
// Initialisieren Sie den PaymentProcessor mit dem Zubereitung-Objekt
paymentProcessor = new PaymentProcessor(zubereitung);
QPixmap ramen("C:/Users/mikai/Downloads/ramenautomat1.png");
// Weitere Initialisierungen und Signal-Slot-Verbindungen
// ...
// Debugging-Ausgabe zur Überprüfung der Initialisierung
qDebug() << "PaymentProcessor initialized: " << (paymentProcessor != nullptr);
// ...
updateLabels();
} else {
qDebug() << "Error: Failed to create Zubereitung object!";
// Möglicherweise müssen Sie hier eine Fehlerbehandlung hinzufügen
}
qDebug() << "PaymentProcessor initialized: " << (paymentProcessor != nullptr);
// Debugging-Ausgabe zur Überprüfung der Initialisierung
qDebug() << "PaymentProcessor initialized: " << (paymentProcessor != nullptr);
paymentProcessor->setTotalAmount(0.0);
ui->cardButtonsWidget->setVisible(false);
ui->cashButtonsWidget->setVisible(false);
ui->labelTotalAmount->setText(QString::number(paymentProcessor->getTotalAmount()) + " €");
ui->labelPaidAmount->setText(QString::number(paymentProcessor->getPaidAmount()) + " €");
// Signal-Slot-Verbindungen
connect(paymentProcessor, &PaymentProcessor::paymentUpdated, this, &MainWindow::updatePaidAmount);
connect(paymentProcessor, &PaymentProcessor::paymentSuccessful, this, &MainWindow::showPaymentSuccessMessage);
connect(ui->buttonCard1, &QPushButton::clicked, this, &MainWindow::on_cardButton_clicked);
connect(ui->buttonCard2, &QPushButton::clicked, this, &MainWindow::on_cardButton_clicked);
connect(ui->buttonCard3, &QPushButton::clicked, this, &MainWindow::on_cardButton_clicked);
connect(ui->buttonCash10, &QPushButton::clicked, this, &MainWindow::on_cashButton_clicked);
connect(ui->buttonCash5, &QPushButton::clicked, this, &MainWindow::on_cashButton_clicked);
connect(ui->buttonCash2, &QPushButton::clicked, this, &MainWindow::on_cashButton_clicked);
connect(ui->buttonCash1, &QPushButton::clicked, this, &MainWindow::on_cashButton_clicked);
connect(ui->bestaetigen_2, &QPushButton::clicked, this, &MainWindow::on_bestaetigen_2_clicked);
//connect(ui->buttonConfirmSelection, &QPushButton::clicked, this, &MainWindow::on_buttonConfirmSelection_clicked);
connect(ui->buttonCheckCashBalance, &QPushButton::clicked, this, &MainWindow::checkCashBalance);
connect(ui->buttonClearCashBalance, &QPushButton::clicked, this, &MainWindow::clearCashBalance);
updateLabels(); connect(ui->buttonCheckCashBalance, &QPushButton::clicked, this, &MainWindow::checkCashBalance);
connect(ui->buttonClearCashBalance, &QPushButton::clicked, this, &MainWindow::clearCashBalance);
QPixmap ramen(":/ramenautomat2.png");
int w = ui->ramen_pic->width();
int h = ui->ramen_pic->height();
ui->ramen_pic->setPixmap(ramen.scaled(w,h,Qt::KeepAspectRatio));
......@@ -39,42 +97,45 @@ MainWindow::MainWindow(QWidget *parent)
int h3 = ui->garlic_pic->height();
ui->garlic_pic->setPixmap(garlic.scaled(w3,h3,Qt::KeepAspectRatio));
QPixmap spicy(":/new/ramen_menu/ICON/spicy_kimchi.png");
int w4 = ui->spicy_pic->width();
int h4 = ui->spicy_pic->height();
ui->spicy_pic->setPixmap(spicy.scaled(w4,h4,Qt::KeepAspectRatio));
QPixmap spicy_miso(":/new/ramen_menu/ICON/Spicy_Kimshi_Miso.png");
int w4 = ui->Spicy_Kimchi_Miso_pic->width();
int h4 = ui->Spicy_Kimchi_Miso_pic->height();
ui->Spicy_Kimchi_Miso_pic->setPixmap(spicy_miso.scaled(w4,h4,Qt::KeepAspectRatio));
QPixmap spicy_beef(":/new/ramen_menu/ICON/spicy_kimchi.png");
int w5 = ui->Spicy_Kimshi_Beef_pic->width();
int h5 = ui->Spicy_Kimshi_Beef_pic->height();
ui->Spicy_Kimshi_Beef_pic->setPixmap(spicy_beef.scaled(w5,h5,Qt::KeepAspectRatio));
QPixmap Shoyu_Chicken(":/new/ramen_menu/ICON/Shoyu.png");
int w6 = ui->Shoyu_Chicken_pic->width();
int h6 = ui->Shoyu_Chicken_pic->height();
ui->Shoyu_Chicken_pic->setPixmap(Shoyu_Chicken.scaled(w6,h6,Qt::KeepAspectRatio));
QPixmap Shio(":/new/ramen_menu/ICON/Shio.jpg");
int w7 = ui->Shio_pic->width();
int h7 = ui->Shio_pic->height();
ui->Shio_pic->setPixmap(Shio.scaled(w7,h7,Qt::KeepAspectRatio));
QPixmap Vegetarische_Shoyu(":/new/ramen_menu/ICON/veg_shoyu.png");
int w8 = ui->Vegetarische_Shoyu_pic->width();
int h8 = ui->Vegetarische_Shoyu_pic->height();
ui->Vegetarische_Shoyu_pic->setPixmap(Vegetarische_Shoyu.scaled(w8,h8,Qt::KeepAspectRatio));
ui->stackedWidget->setCurrentIndex(0);
}
MainWindow::~MainWindow()
{
delete ui;
delete paymentProcessor; // Sicherstellen, dass der Speicher freigegeben wird
}
void MainWindow::on_pushButton_clicked()
{
ui->stackedWidget->setCurrentIndex(1);
/*if (ui->radioButton->isChecked()) {
ui->stackedWidget->setCurrentIndex(1);
}
else
QMessageBox::warning(this, "Warning", "You must select the radio button to proceed.");*/
/* ui->ramenautomat->show();
//hide();
if(ui->radioButton->isChecked())
secondwindow = new Dialog1(this);
secondwindow->show();
if(!radiobutton->isChecked()){
return;
}*/
//if (!secondwindow) {
// secondwindow = new Dialog1(this);
// connect(secondwindow, &Dialog1::closed, this, &MainWindow::handleDialog1);
//}
//secondwindow->show();
//this->hide();
ui->stackedWidget->setCurrentIndex(1);
}
void MainWindow::handleDialog1()
......@@ -86,20 +147,300 @@ void MainWindow::on_bestaetigen_2_clicked()
{
if(ui->tonkotsu->isChecked())
{
//QDialog::accept(); // Schließt das Dialogfenste
}
else if (ui->kimchi_button->isChecked()){
selectedRamen = Tonkotsu;
}
else if (ui->garlic_button->isChecked()){
else if (ui->kimchi_button->isChecked())
{
selectedRamen = Spicy_kimchi;
}
else if (ui->garlic_button->isChecked())
{
selectedRamen = Black_Garlic_Oil_Tonkotsu;
}
else if (ui->spicy_button->isChecked()){
else if (ui->Spicy_Kimshi_Beef_button->isChecked())
{
selectedRamen = Spicy_Kimchi_Beef;
}
else if (ui->Spicy_Kimchi_Miso_button->isChecked())
{
selectedRamen = Spicy_Kimshi_Miso;
}
else if (ui->Meeresfruechte_button->isChecked())
{
selectedRamen = Meeresfrüchte;
}
else if (ui->Shio_button->isChecked())
{
selectedRamen = Shio;
}
else if (ui->Vegetarische_Shoyu_button->isChecked())
{
selectedRamen = Vegetarische_Shoyu;
}
else if (ui->Champon_button->isChecked())
{
selectedRamen = Champon;
}
else if (ui->Seitan_button->isChecked())
{
selectedRamen = Seitan;
}
else if (ui->Tantan_button->isChecked())
{
selectedRamen = Tantan;
}
else if (ui->Shoyu_Chicken_button->isChecked())
{
selectedRamen = Shoyu_Chicken;
}
else
{
QMessageBox::warning(this, tr("Warnung"), tr("Bitte wählen Sie den Ramen aus, um fortzufahren."));
return;
}
ui->stackedWidget->setCurrentIndex(2);
}
void MainWindow::on_pushButton_2_clicked()
{
ui->stackedWidget->setCurrentIndex(0);
}
void MainWindow::on_radioButtonCard_toggled(bool checked)
{
ui->cardButtonsWidget->setVisible(checked);
ui->cashButtonsWidget->setVisible(!checked);
}
void MainWindow::on_radioButtonCash_toggled(bool checked)
{
ui->cashButtonsWidget->setVisible(checked);
ui->cardButtonsWidget->setVisible(!checked);
}
void MainWindow::on_cardButton_clicked()
{
//qDebug() << "Card button clicked"; // Debugging-Ausgabe
//paymentProcessor->processCardPayment();
QPushButton* button = qobject_cast<QPushButton*>(sender());
if (button)
{
QString buttonText = button->text();
qDebug() << "Card button clicked: " << buttonText; // Debugging-Ausgabe
paymentProcessor->processCardPayment();
// ui->labelCardStatus->setText("Card button clicked: " + buttonText);
}
}
void MainWindow::on_cashButton_clicked()
{
QPushButton* button = qobject_cast<QPushButton*>(sender());
if (button)
{
double amount = button->text().replace("€", "").toDouble();
qDebug() << "Cash button clicked: " << amount; // Debugging-Ausgabe
paymentProcessor->processCashPayment(amount);
}
}
void MainWindow::updatePaidAmount(double amount)
{
ui->labelPaidAmount->setText(QString::number(amount) + " €");
}
void MainWindow::showPaymentSuccessMessage()
{
QMessageBox::information(this, "Bezahlung erfolgreich", "Vielen Dank für Ihre Zahlung!");
paymentProcessor->reset();
updatePaidAmount(paymentProcessor->getPaidAmount());
}
void MainWindow::on_pushButton_7_clicked()
{
if(ui->soy_button->isChecked())
{
selectedSauce = Soy;
}
else if (ui->fish_button->isChecked())
{
selectedSauce = Fish;
}
else if (ui->hoisin_button->isChecked())
{
selectedSauce = Hoisin;
}
else if (ui->sambal_button->isChecked())
{
selectedSauce = Sambal;
}
else if (ui->chilioil_button->isChecked())
{
selectedSauce = Chili_Oil;
}
else if (ui->chilicrisp_button->isChecked())
{
selectedSauce = Chili_Crisp;
}
else
{
QMessageBox::warning(this, tr("Warnung"), tr("Bitte wählen Sie den Ramen aus, um fortzufahren."));
return;
}
updateLabels();
ui->stackedWidget->setCurrentIndex(3);
}
//Zubereitung
void MainWindow::on_buttonSelectRamen_clicked()
{
// Beispielcode zur Auswahl einer Ramenart
// Hier sollten Sie einen Dialog oder ein Auswahlmenü öffnen
// Für dieses Beispiel setzen wir einfach einen Wert
selectedRamen = Black_Garlic_Oil_Tonkotsu; // Beispielauswahl
updateLabels();
}
void MainWindow::on_buttonSelectSauce_clicked()
{
// Beispielcode zur Auswahl einer Soßeart
// Hier sollten Sie einen Dialog oder ein Auswahlmenü öffnen
// Für dieses Beispiel setzen wir einfach einen Wert
selectedSauce = Hoisin; // Beispielauswahl
updateLabels();
}
void MainWindow::updateLabels()
{
// Update labels to show the selected Ramen and Sauce
QString ramenName;
switch (selectedRamen) {
case Tonkotsu:
ramenName = "Tonkotsu";
break;
case Black_Garlic_Oil_Tonkotsu:
ramenName = "Black Garlic Oil Tonkotsu";
break;
case Spicy_Kimchi_Beef:
ramenName = "Black Garlic Oil Tonkotsu";
break;
case Meeresfrüchte:
ramenName = "Meeresfrüchte";
break;
case Spicy_kimchi:
ramenName = "Spicy_Kimchi_Beef";
break;
case Spicy_Kimshi_Miso:
ramenName = "Spicy_Kimshi_Miso";
break;
case Shoyu_Chicken:
ramenName = "Shoyu_Chicken";
break;
case Shio:
ramenName = "Shio";
break;
case Vegetarische_Shoyu:
ramenName = "Vegetarische_Shoyu";
break;
case Champon:
ramenName = "Champon";
break;
case Seitan:
ramenName = "Seitan";
break;
case Tantan:
ramenName = "Tantan";
break;
default: ramenName = "Unbekannte Ramenart"; break;
}
QString sauceName;
switch (selectedSauce) {
case Soy: sauceName = "Soy"; break;
case Hoisin: sauceName = "Hoisin"; break;
case Fish: sauceName = "Fish"; break;
case Chili_Oil: sauceName = "Chili_Oil"; break;
case Sambal: sauceName = "Sambal"; break;
case Chili_Crisp: sauceName = "Chili_Crisp"; break;
// Weitere Fälle hier hinzufügen...
default: sauceName = "Unbekannte Soßeart"; break;
}
//double final = price +preis;
Zubereitung zubereitung(selectedRamen, selectedSauce);
double final = zubereitung.getprice();
paymentProcessor->setTotalAmount(final);
ui->labelTotalAmount->setText(QString::number(paymentProcessor->getTotalAmount()) + " €");
ui->labelSelectedRamen->setText("Selected Ramen: " + ramenName);
ui->labelSelectedSauce->setText("Selected Sauce: " + sauceName);
}
void MainWindow::on_buttonConfirmSelection_clicked()
{
Zubereitung *zubereitung = new Zubereitung(selectedRamen, selectedSauce);
if (paymentProcessor != nullptr) {
delete paymentProcessor; // Vorherige Instanz löschen, um Speicherlecks zu vermeiden
}
paymentProcessor = new PaymentProcessor(zubereitung, this);
updateLabels();
// Hier können Sie den Preis anzeigen oder andere Aktionen durchführen
ui->labelTotalAmount->setText(QString::number(paymentProcessor->getTotalAmount()) + " €");
ui->labelPaidAmount->setText(QString::number(paymentProcessor->getPaidAmount()) + " €");
}
/*
void MainWindow::on_buttonCash5_clicked()
{
int amount = 5; // Der Wert 5 entspricht dem 5€-Schein
paymentProcessor->processCashPayment(amount);
}
*/
void MainWindow::on_pushButton_3_clicked()
{
if (ui->radioButton_2->isChecked())
selectedGeldschein = GeldscheinTyp::Zehn;
}
void MainWindow::checkCashBalance()
{
double cashBalance = paymentProcessor->getCashBalance();
QMessageBox::information(this, tr("Cash Balance"), tr("Current cash balance: %1 €").arg(cashBalance));
}
void MainWindow::clearCashBalance()
{
paymentProcessor->clearCashBalance();
QMessageBox::information(this, tr("Cash Balance Cleared"), tr("The cash balance has been cleared."));
}
void MainWindow::on_pushButton_4_clicked()
{
ui->stackedWidget->setCurrentIndex(0);
}
......@@ -3,9 +3,11 @@
#include <QMainWindow>
#include "dialog1.h"
#include "preis.h"
#include "qradiobutton.h"
#include <QStackedWidget>
#include <QWidget>
#include "paymentprocessor.h"
QT_BEGIN_NAMESPACE
namespace Ui {
......@@ -18,7 +20,8 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
......@@ -27,11 +30,44 @@ private slots:
void on_bestaetigen_2_clicked();
void on_pushButton_2_clicked();
//für paymentprocessor
void on_radioButtonCard_toggled(bool checked);
void on_radioButtonCash_toggled(bool checked);
void on_cardButton_clicked();
void on_cashButton_clicked();
void updatePaidAmount(double amount);
void showPaymentSuccessMessage();
//ende paymentprocessor
void on_pushButton_7_clicked();
//zubereitung
void on_buttonSelectRamen_clicked();
void on_buttonSelectSauce_clicked();
void on_buttonConfirmSelection_clicked();
void updateLabels();
void checkCashBalance(); // Neuer Slot
void clearCashBalance();
// void on_buttonCash5_clicked();
void on_pushButton_3_clicked();
void on_pushButton_4_clicked();
private:
Ui::MainWindow *ui;
Dialog1 *secondwindow;
QRadioButton *radiobutton;
PaymentProcessor *paymentProcessor;
Ramenart selectedRamen;
Soßeart selectedSauce;
GeldscheinTyp selectedGeldschein;
};
......
This diff is collapsed.
/*#include "payment_test.h"
#include "mainwindow.h"
void payment_test::initTestCase()
{
// Initialisierung, die einmal vor allen Tests ausgeführt wird
}
void payment_test::cleanupTestCase()
{
// Bereinigung, die einmal nach allen Tests ausgeführt wird
}
void payment_test::init()
{
// Initialisierung, die vor jedem Test ausgeführt wird
}
void payment_test::cleanup()
{
// Bereinigung, die nach jedem Test ausgeführt wird
}
void payment_test::testCardButton1()
{
MainWindow mainWindow;
mainWindow.show();
QPushButton* button = mainWindow.findChild<QPushButton*>("buttonCard1");
QVERIFY(button != nullptr);
//QSignalSpy spy(&mainWindow, &MainWindow::updatePaidAmount);
//QTest::mouseClick(button, Qt::LeftButton);
// QCOMPARE(spy.count(), 1);
// QCOMPARE(mainWindow.findChild<QLabel*>("labelCardStatus")->text(), "Card button clicked: " + button->text());
}
void payment_test::testCardButton2()
{
MainWindow mainWindow;
mainWindow.show();
QPushButton* button = mainWindow.findChild<QPushButton*>("buttonCard2");
QVERIFY(button != nullptr);
//QSignalSpy spy(&mainWindow, &MainWindow::updatePaidAmount);
//QTest::mouseClick(button, Qt::LeftButton);
// QCOMPARE(spy.count(), 1);
//QCOMPARE(mainWindow.findChild<QLabel*>("labelCardStatus")->text(), "Card button clicked: " + button->text());
}
void payment_test::testCardButton3()
{
MainWindow mainWindow;
mainWindow.show();
QPushButton* button = mainWindow.findChild<QPushButton*>("buttonCard3");
QVERIFY(button != nullptr);
//QSignalSpy spy(&mainWindow, &MainWindow::updatePaidAmount);
//QTest::mouseClick(button, Qt::LeftButton);
//QCOMPARE(spy.count(), 1);
//QCOMPARE(mainWindow.findChild<QLabel*>("labelCardStatus")->text(), "Card button clicked: " + button->text());
}
QTEST_MAIN(payment_test)
*/
/*#ifndef PAYMENT_TEST_H
#define PAYMENT_TEST_H
#include <QObject>
#include <QtTest/QtTest>
class payment_test : public QObject
{
Q_OBJECT
private slots:
void initTestCase(); // Wird einmal vor allen Tests aufgerufen
void cleanupTestCase(); // Wird einmal nach allen Tests aufgerufen
void init(); // Wird vor jedem Test aufgerufen
void cleanup(); // Wird nach jedem Test aufgerufen
void testCardButton1(); // Test für den ersten Card-Button
void testCardButton2(); // Test für den zweiten Card-Button
void testCardButton3(); // Test für den dritten Card-Button
};
#endif // PAYMENT_TEST_H
*/
#include "paymentprocessor.h"
/*PaymentProcessor::PaymentProcessor(QObject *parent)
: QObject(parent), zubereitung(Tonkotsu, Soy), totalAmount(0), paidAmount(0) // Initialisierung von zubereitung mit Standardwerten
{
}*/
PaymentProcessor::PaymentProcessor(Zubereitung* zubereitung, QObject *parent)
: QObject(parent), zubereitung(zubereitung), totalAmount(0), paidAmount(0)
{
}
PaymentProcessor::~PaymentProcessor()
{
delete zubereitung; // Speicher freigeben
}
//PaymentProcessor::PaymentProcessor(const Zubereitung &zubereitung, QObject *parent)
// : QObject(parent), totalAmount(0.0), paidAmount(0.0) {}
/*const Zubereitung& PaymentProcessor::getZubereitung() const {
return zubereitung;
}
*/
double PaymentProcessor::getTotalAmount() const
{
return totalAmount;
}
double PaymentProcessor::getPaidAmount() const
{
return paidAmount;
}
void PaymentProcessor::processCardPayment()
{
// Beispielhafte Logik für Kartenzahlung
paidAmount = totalAmount;
emit paymentUpdated(paidAmount);
emit paymentSuccessful();
}
void PaymentProcessor::processCashPayment(double amount)
{
paidAmount += amount;
emit paymentUpdated(paidAmount);
if (paidAmount >= totalAmount)
{
cashBalance += paidAmount;
emit paymentSuccessful();
}
}
void PaymentProcessor::reset()
{
totalAmount = 0;
paidAmount = 0;
emit paymentUpdated(paidAmount);
}
void PaymentProcessor::setTotalAmount(double amount)
{
totalAmount = amount;
}
double PaymentProcessor::getCashBalance() const
{
return cashBalance;
}
void PaymentProcessor::clearCashBalance()
{
cashBalance = 0.0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment