Error unknown typ name 'DS18B20'
-
@AlexKrammer
Hi
So it works fine the first time you run ?
Have you checked with debugger what happens when you read and set
R.actualTemp1 ?Its hard to guess from this code.
@mrjj
yes it works. its still working. Thats a other problem.
So R.actualTemp is the temperature from the sensor.
if i show the R.actualTemp is changing his value.
So if i show S.getHystTemperature(); its changing the value too.But if i show e.g. TempEin its not changing the Value its always the value as i run the program.
A other example. If i put R,actualTemp into a variable in this class and im going to show the variable. its dont change the value too. If i show R.actualTemp its changing.
Are you understanding my problem?
-
@mrjj
yes it works. its still working. Thats a other problem.
So R.actualTemp is the temperature from the sensor.
if i show the R.actualTemp is changing his value.
So if i show S.getHystTemperature(); its changing the value too.But if i show e.g. TempEin its not changing the Value its always the value as i run the program.
A other example. If i put R,actualTemp into a variable in this class and im going to show the variable. its dont change the value too. If i show R.actualTemp its changing.
Are you understanding my problem?
@AlexKrammer
Hi
Your naming confuses me a bit. :)
So S.getHystTemperature(); changes but
TempEin = S.getHystTemperature(); dont ? -
@AlexKrammer
Hi
Your naming confuses me a bit. :)
So S.getHystTemperature(); changes but
TempEin = S.getHystTemperature(); dont ?@mrjj
Ohhh im sry TempEin means TempOn, TempAus means TempOff:)
I like to show you my completely code but i dont know how:Pyes if i try to: qDebug() << S.getHystTemperature(); in mainwindow.cpp
the value is changing in relation when im moving the horizontal slider.
The same with R.actualTemp.
But if i try to: qDebug() << S.getHystTemperature(); in checktemperature.cpp
its taking the value of the veriable when i run the program. e.g. i declared in setTemperature.h "float HystTemperature;" So its got value 0;
So qDebug() just show 0.In conclusion it can be said that in class CheckTemperature the variable and values do not adapt to the current values. They stuck on the values when the program start to run.
-
@mrjj
Ohhh im sry TempEin means TempOn, TempAus means TempOff:)
I like to show you my completely code but i dont know how:Pyes if i try to: qDebug() << S.getHystTemperature(); in mainwindow.cpp
the value is changing in relation when im moving the horizontal slider.
The same with R.actualTemp.
But if i try to: qDebug() << S.getHystTemperature(); in checktemperature.cpp
its taking the value of the veriable when i run the program. e.g. i declared in setTemperature.h "float HystTemperature;" So its got value 0;
So qDebug() just show 0.In conclusion it can be said that in class CheckTemperature the variable and values do not adapt to the current values. They stuck on the values when the program start to run.
@AlexKrammer
And you only have one instance of the CheckTemperature class?
since S.getHystTemperature(); in mainwindow.cpp Works
it should also in CheckTemperature so i wonder if you have 2 of them or something like that ? -
@AlexKrammer
And you only have one instance of the CheckTemperature class?
since S.getHystTemperature(); in mainwindow.cpp Works
it should also in CheckTemperature so i wonder if you have 2 of them or something like that ?@mrjj
no i only have one instance.
i only have one checktemp in class CheckTemperature, one gethysttemperature() in class SetTemperature, and one actualTemp in class ReadTemperature.
thats why im wondering too.
cause im calling checktemp() every 500ms in loop mainwindow.Is there any possibility that i can't call object in a method of a single class. But there is no sense
-
@mrjj
no i only have one instance.
i only have one checktemp in class CheckTemperature, one gethysttemperature() in class SetTemperature, and one actualTemp in class ReadTemperature.
thats why im wondering too.
cause im calling checktemp() every 500ms in loop mainwindow.Is there any possibility that i can't call object in a method of a single class. But there is no sense
@AlexKrammer
That is very odd then.
The 500ms loop is a QTimer?Sorry I cant guess what could be wrong. It sounds like the parts are working but
not in all use cases. -
@AlexKrammer
That is very odd then.
The 500ms loop is a QTimer?Sorry I cant guess what could be wrong. It sounds like the parts are working but
not in all use cases.@mrjj yes for sure. other thing in the loop are working. e.g. if i call directly in the loop every 500ms "ui->temperature4lable->setText(QString::number(S.getHystTemperature()));"
the value changes every 500ms if i change the horizontal slider. -
@mrjj yes for sure. other thing in the loop are working. e.g. if i call directly in the loop every 500ms "ui->temperature4lable->setText(QString::number(S.getHystTemperature()));"
the value changes every 500ms if i change the horizontal slider.Hi
Ok but that
S.getHystTemperature()
seems out side of the CheckTemperature class, correct ?so you have
SetTemperature S;
ReadTemperature R;in mainwindow too ? and those works but
inside the CheckTemperature they are not ? -
Hi
Ok but that
S.getHystTemperature()
seems out side of the CheckTemperature class, correct ?so you have
SetTemperature S;
ReadTemperature R;in mainwindow too ? and those works but
inside the CheckTemperature they are not ?@mrjj yes. right.
but i have:
SetTemperature S;
ReadTemperature R;in CheckTemperature too
-
@mrjj yes. right.
but i have:
SetTemperature S;
ReadTemperature R;in CheckTemperature too
@AlexKrammer
and that's the part that really bugs me as if those classes work alone in MainWindow, i cannot see a reason they should not work in that other class just the same ??void CheckTemperature::CheckTemp()
could just have well beenvoid MainWindow::CheckTemp()
and the difference is really small.
-
@AlexKrammer
and that's the part that really bugs me as if those classes work alone in MainWindow, i cannot see a reason they should not work in that other class just the same ??void CheckTemperature::CheckTemp()
could just have well beenvoid MainWindow::CheckTemp()
and the difference is really small.
@mrjj no in MainWindow is no CheckTemp() methode.
-
@mrjj no in MainWindow is no CheckTemp() methode.
@AlexKrammer
Yes that is ganz klar.
Im just saying its odd that inside CheckTemperature the
same classes dont work but outside in mainwindow it seems fine.
I cant guess on why. Seems odd. -
@AlexKrammer
Yes that is ganz klar.
Im just saying its odd that inside CheckTemperature the
same classes dont work but outside in mainwindow it seems fine.
I cant guess on why. Seems odd.@mrjj
Is there a possibility to share a code with you?
I just created a simple code to show my problem. -
@mrjj
Is there a possibility to share a code with you?
I just created a simple code to show my problem.@AlexKrammer
Yes even i cant really run it i can look it over and see if i get a hint.
use https://wetransfer.com/
click the (...) button and switch to link type
then drag zipped project to there
and paste link here. -
@AlexKrammer
Yes even i cant really run it i can look it over and see if i get a hint.
use https://wetransfer.com/
click the (...) button and switch to link type
then drag zipped project to there
and paste link here.Now i created the project on Windows.
You should be able to run it.The two commented debug lines in checktemperature.cpp and mainwindow.cpp show the misstake.
if you are uncomment one in checktemperature.cpp its still stay at 0.
Also if you uncomment this: //qDebug() << C.TempEin; //must be the value of the horizontal slider in mainwindow.cpp. its still stay at 0.Try to run that example
-
Now i created the project on Windows.
You should be able to run it.The two commented debug lines in checktemperature.cpp and mainwindow.cpp show the misstake.
if you are uncomment one in checktemperature.cpp its still stay at 0.
Also if you uncomment this: //qDebug() << C.TempEin; //must be the value of the horizontal slider in mainwindow.cpp. its still stay at 0.Try to run that example
@AlexKrammer
Super. I will later tonight. I have to drive now :)
had a fast look.
You are not setting anything to C. only reading from it.
Nothing changes the S and R inside C.
Only the ones you have free in main.
So that is why it stays at zero. -
@AlexKrammer
Super. I will later tonight. I have to drive now :)
had a fast look.
You are not setting anything to C. only reading from it.
Nothing changes the S and R inside C.
Only the ones you have free in main.
So that is why it stays at zero.@mrjj
For sure. I'm trying to use this class to compare something.
So yeah nothing changes S and R inside C but S.getHystTemperature(); will be changed if the Slider moved. and R.actualTemp1 will be changed, if cnt hit 3 in MainWindow::LOOP
or rather in real if the sensor will be evaluated.
So if i call the methode C.CheckTemp(); S.getHystTemperature() and R.actualTemp1 do have values who could be compare.
if i code:TempEin = S.getHystTemperature(); Test = R.actualTemp1;
i'm going to set the Variable TempEin equal to S.getHystTemperature() (Which is changed when the slider moved)
and i'm going to set Test equal to R.actualTemp1 (Which every times change when cnt hits 3 in MainWindow)
Or isnt that the correct way to compare something or rather put values from a other class into a class? -
@mrjj
For sure. I'm trying to use this class to compare something.
So yeah nothing changes S and R inside C but S.getHystTemperature(); will be changed if the Slider moved. and R.actualTemp1 will be changed, if cnt hit 3 in MainWindow::LOOP
or rather in real if the sensor will be evaluated.
So if i call the methode C.CheckTemp(); S.getHystTemperature() and R.actualTemp1 do have values who could be compare.
if i code:TempEin = S.getHystTemperature(); Test = R.actualTemp1;
i'm going to set the Variable TempEin equal to S.getHystTemperature() (Which is changed when the slider moved)
and i'm going to set Test equal to R.actualTemp1 (Which every times change when cnt hits 3 in MainWindow)
Or isnt that the correct way to compare something or rather put values from a other class into a class?Hi
Just so we agree. Nothing you do in mainwindow with S/R
will have any effect on the S and R in C.- C.CheckTemp(); S.getHystTemperature() and R.actualTemp1 do have values who could be compare.
Yes if in real code something actually changes them.
In the Demo, they will always stay zero as the slider changes S/R in main and
those new values are not out into C.
so in demo code
C.TempEin will never change.Else i see nothing wrong but I not sure why you have both
SetTemperature S;
ReadTemperature R;
in maniwindowand then also in C. could those in C not be enough ?
-
Hi
Just so we agree. Nothing you do in mainwindow with S/R
will have any effect on the S and R in C.- C.CheckTemp(); S.getHystTemperature() and R.actualTemp1 do have values who could be compare.
Yes if in real code something actually changes them.
In the Demo, they will always stay zero as the slider changes S/R in main and
those new values are not out into C.
so in demo code
C.TempEin will never change.Else i see nothing wrong but I not sure why you have both
SetTemperature S;
ReadTemperature R;
in maniwindowand then also in C. could those in C not be enough ?
@mrjj
No that is not true.
In mainwindow i change the slider. So i change HystTemperature.
That will change S.getHystTemperature(); too. Doesnt it?Also every 2.5 second when the cnt hit 3 in mainwindow. The actualTemp1 will be incremented with 1. So R.actualTemp will be greater then before. Doesnt it?
So why are in Class C the Variable not changing?In order to to change the varibale like in my fault. I must have this in MainWindow. When i move the slider im going to change the variable HystTemperature.
Here in the demo its the same like in real. Every 2.5 second the sensor will be evaluated. So here in the demo only incremented with 1.Im changing the Variable R.actualTemp1 and S.getHystTemperature in MainWindow.
In order to compare both varibales i created a new class.
So why arent in Class CheckTemperature the variables changed? -
@mrjj
No that is not true.
In mainwindow i change the slider. So i change HystTemperature.
That will change S.getHystTemperature(); too. Doesnt it?Also every 2.5 second when the cnt hit 3 in mainwindow. The actualTemp1 will be incremented with 1. So R.actualTemp will be greater then before. Doesnt it?
So why are in Class C the Variable not changing?In order to to change the varibale like in my fault. I must have this in MainWindow. When i move the slider im going to change the variable HystTemperature.
Here in the demo its the same like in real. Every 2.5 second the sensor will be evaluated. So here in the demo only incremented with 1.Im changing the Variable R.actualTemp1 and S.getHystTemperature in MainWindow.
In order to compare both varibales i created a new class.
So why arent in Class CheckTemperature the variables changed?-
That will change S.getHystTemperature(); too. Doesnt it?
Hi
Not at all. the S/R in mainwindow are on its own and will not affect those in C. -
So why arent in Class CheckTemperature the variables changed?
As nothing changes them.
Maybe this is why i get confused about what is not working.
The slider changes the values of S/R in MainWin. Not in C.s / C.r so
did you expect the values in C to also change ? -