Comments (1)
Es fehlte ein "datei.clear()" nach dem lesen der Datei. Zusätzlich wird jetzt eine Datei erstelle wenn diese nich existiert. Die Funktion sieht jetzt so aus:
void readWrite900(char *fileName, int NewValue)
{
int c;
int line[100];
char read[20];
char Path [128];
snprintf (Path, (size_t)128, "/home/pi/E3dcGui/Data/%s.txt", fileName);
fstream datei;
datei.open(Path, ios::in | ios::out);
if (datei.fail()){
datei.clear();
datei.open(Path, ios::out);
datei.close();
cout << "Datei Data/" << fileName << ".txt wurde erstellt!\n";
datei.clear();
datei.open(Path, ios::in | ios::out);
}
if (datei.good()){
for( c = 0; c < 97; ++c ){
datei.getline(read ,20, '\n');
if (read == NULL)
snprintf (read, (size_t)20, "0");
line[c] = atoi(read);
}
datei.clear();
datei.seekg (0, ios::beg);
for( c = 1; c < 96; ++c ){
datei << line[c] <<"\n";
}
datei << NewValue <<"\n";
datei.close();
}
else {
cout << "Konnte Datei Data/" << fileName << ".txt nicht erstellen!\n";
}
return;
}
from e3dcgui.
Related Issues (20)
- der befehl make schlägt fehl HOT 1
- Standards für Wallbox-Einstellung HOT 8
- Sonderinformationen aus S10 lesen HOT 2
- Steuerung S10 aus Homematic, z.B. Setzen Ladeleistung HOT 10
- DC Power je Tag je Tracker HOT 2
- Keine Anzeige externer Quelle HOT 2
- logo fehlt, Offset für DHT HOT 15
- [Installations Abbruch] Skriptfehler laut Ausgabe HOT 4
- Einstellung der Notstromreserve klappt nicht richtig HOT 1
- Seit V2.00 wird nur fix Schriftgröße 8 angezeigt und nicht 16 wie geplant HOT 1
- E3DCGui läuft aber keine Anzeige am PI Touchscreen HOT 1
- Ladepriosisierung für Wallbax HOT 5
- Eingabe von Werte als Popup HOT 1
- Ladesperrzeit und Entladesperrzeit setzen HOT 2
- E-Mail vom Watchdog werden nicht gesendet HOT 1
- Aktor wird nicht deaktiviert, wenn Zeitfenster gesetzt ist HOT 9
- Batterie-Limits am E3DC einstellen HOT 3
- Steuerung der Notstromfunktion via HM reagiert nicht richtig HOT 5
- Wallbox Stop-Button ohne Funktion
- Unknown tag 03840000 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from e3dcgui.