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

die ersten gui anwendungen mit ramen auswählen eingefügt

parent 7d8d1f11
No related branches found
No related tags found
No related merge requests found
#ifndef ELEKTROMOTOR_H
#define ELEKTROMOTOR_H
#include "aktoren.h"
class elektromotor
class elektromotor : aktoren
{
public:
elektromotor();
......
#ifndef GEWICHTSENSOR_H
#define GEWICHTSENSOR_H
#include "sensoren.h"
class Gewichtssensor {
class Gewichtssensor : sensoren {
public:
Gewichtssensor();
int zeigeGewicht(int typ);
......
......@@ -3,3 +3,5 @@
heizelement::heizelement() {}
void heizelement::erhitzen(){}
void heizelement::regeln(){}
#ifndef HEIZELEMENT_H
#define HEIZELEMENT_H
#include "aktoren.h"
class heizelement
class heizelement : public aktoren
{
public:
heizelement();
void erhitzen();
void regeln() override;
};
#endif // HEIZELEMENT_H
......@@ -11,6 +11,7 @@ CONFIG += c++17
SOURCES += \
aktoren.cpp \
ausgabefach.cpp \
dialog1.cpp \
display.cpp \
elektromagnetischer_sensor.cpp \
elektromotor.cpp \
......@@ -33,11 +34,9 @@ SOURCES += \
produkt.cpp \
ramenabteilung.cpp \
ramenart.cpp \
ramenautomat.cpp \
rohre.cpp \
scherenhebebuehne.cpp \
schieber.cpp \
schieber2.cpp \
sensoren.cpp \
sossenabteilung.cpp \
sossenart.cpp \
......@@ -51,6 +50,7 @@ SOURCES += \
HEADERS += \
aktoren.h \
ausgabefach.h \
dialog1.h \
display.h \
elektromagnetischer_sensor.h \
elektromotor.h \
......@@ -72,11 +72,9 @@ HEADERS += \
produkt.h \
ramenabteilung.h \
ramenart.h \
ramenautomat.h \
rohre.h \
scherenhebebuehne.h \
schieber.h \
schieber2.h \
sensoren.h \
sossenabteilung.h \
sossenart.h \
......@@ -88,9 +86,17 @@ HEADERS += \
zubereitung.h
FORMS += \
dialog1.ui \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
RESOURCES += \
Ramenautomat.qrc \
ressource.qrc
DISTFILES += \
../../../../../Pictures/Screenshots/Screenshot 2024-05-12 214014.png
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 13.0.0, 2024-04-24T19:15:03. -->
<!-- Written by QtCreator 13.0.0, 2024-05-17T13:04:28. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
......
#ifndef LICHTSENSOR_H
#define LICHTSENSOR_H
#include "sensoren.h"
class lichtsensor
class lichtsensor : sensoren
{
public:
lichtsensor();
......
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <iostream>
#include "dialog1.h"
#include <QPixmap>
#include <QMessageBox>
#include <QRadioButton>
using namespace std;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
, secondwindow(nullptr)
{
ui->setupUi(this);
radiobutton = ui->radioButton;
QPixmap ramen("C:/Users/mikai/Downloads/ramenautomat1.png");
int w = ui->ramen_pic->width();
int h = ui->ramen_pic->height();
ui->ramen_pic->setPixmap(ramen.scaled(w,h,Qt::KeepAspectRatio));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
/* ui->ramenautomat->show();
//hide();
if(ui->radioButton->isChecked())
secondwindow = new Dialog1(this);
secondwindow->show();
if(!radiobutton->isChecked()){
QMessageBox::warning(this, "Warning", "You must select the radio button to proceed.");
return;
}*/
if (!secondwindow) {
secondwindow = new Dialog1(this);
connect(secondwindow, &Dialog1::closed, this, &MainWindow::handleDialog1);
}
secondwindow->show();
this->hide();
}
void MainWindow::handleDialog1()
{
this->show();
}
......@@ -2,7 +2,8 @@
#define MAINWINDOW_H
#include <QMainWindow>
#include "dialog1.h"
#include "qradiobutton.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
......@@ -17,7 +18,14 @@ public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_pushButton_clicked();
void handleDialog1();
private:
Ui::MainWindow *ui;
Dialog1 *secondwindow;
QRadioButton *radiobutton;
};
#endif // MAINWINDOW_H
......@@ -6,23 +6,136 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
<width>657</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget"/>
<widget class="QWidget" name="centralwidget">
<widget class="QListView" name="listView">
<property name="geometry">
<rect>
<x>320</x>
<y>20</y>
<width>251</width>
<height>231</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Segoe UI</family>
</font>
</property>
</widget>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>410</x>
<y>160</y>
<width>80</width>
<height>18</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Press</string>
</property>
</widget>
<widget class="QRadioButton" name="radioButton">
<property name="geometry">
<rect>
<x>420</x>
<y>230</y>
<width>69</width>
<height>18</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>RadioButton</string>
</property>
</widget>
<widget class="QLabel" name="ramen_pic">
<property name="geometry">
<rect>
<x>130</x>
<y>20</y>
<width>191</width>
<height>231</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QTextEdit" name="textEdit">
<property name="geometry">
<rect>
<x>380</x>
<y>40</y>
<width>141</width>
<height>91</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
hr { height: 1px; border-width: 0; }
li.unchecked::marker { content: &quot;\2610&quot;; }
li.checked::marker { content: &quot;\2612&quot;; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Herzlich Willkommen&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Bitte drücken Sie auf den Bildschirm&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<zorder>listView</zorder>
<zorder>ramen_pic</zorder>
<zorder>pushButton</zorder>
<zorder>radioButton</zorder>
<zorder>textEdit</zorder>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>657</width>
<height>17</height>
</rect>
</property>
<widget class="QMenu" name="menujpko">
<property name="title">
<string>Menu</string>
</property>
</widget>
<addaction name="menujpko"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
......
#ifndef MOTOR_H
#define MOTOR_H
#include "aktoren.h"
class motor
class motor : aktoren
{
public:
motor();
......
#include <iostream>
#include "ramenart.h"
int main() {
Ramenart ramen = Ramenart::Tonkotsu;
// Beispiel: Zuweisen einer Ramenart und Ausgabe
ramen = Ramenart::Vegetarische_Shoyu;
std::cout << "Bestellte Ramenart: ";
#include <iostream>
#include <string>
// Beispiel: Switch-Anweisung zur Behandlung verschiedener Ramenarten
switch (ramen) {
// Eine Funktion, die den Namen einer Ramenart zurückgibt
std::string ramenartToString(Ramenart art) {
switch (art) {
case Ramenart::Tonkotsu:
std::cout << "Tonkotsu" << std::endl;
break;
return "Tonkotsu";
case Ramenart::Black_Garlic_Oil_Tonkotsu:
std::cout << "Black Garlic Oil Tonkotsu" << std::endl;
break;
return "Black Garlic Oil Tonkotsu";
case Ramenart::Meeresfrüchte:
std::cout << "Meeresfrüchte" << std::endl;
break;
// Fügen Sie weitere Fälle für die anderen Ramenarten hinzu
return "Meeresfrüchte";
case Ramenart::Spicy_kimchi:
return "Spicy Kimchi";
case Ramenart::Spicy_Kimchi_Beef:
return "Spicy Kimchi Beef";
case Ramenart::Spicy_Kimshi_Miso:
return "Spicy Kimshi Miso";
case Ramenart::Shoyu_Chicken:
return "Shoyu Chicken";
case Ramenart::Shio:
return "Shio";
case Ramenart::Vegetarische_Shoyu:
return "Vegetarische Shoyu";
case Ramenart::Champon:
return "Champon";
case Ramenart::Seitan:
return "Seitan";
case Ramenart::Tantan:
return "Tantan";
default:
std::cout << "Unbekannte Ramenart" << std::endl;
return "Unknown";
}
return 0;
}
#ifndef TEMPERATURSENSOR_H
#define TEMPERATURSENSOR_H
#include "sensoren.h"
class Temperatursensor {
class Temperatursensor : sensoren{
private:
int temperatur; // Annahme: Temperatur wird als Ganzzahl gespeichert
......
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