Skip to content
Snippets Groups Projects
Commit 6ac3785e authored by Malaurie Bernard's avatar Malaurie Bernard
Browse files

/bin/bash: line 1: q: command not found

parent c27f90e5
No related branches found
No related tags found
1 merge request!17Malaurie's work on UI + CLI interface + AccelStepper interface
......@@ -344,6 +344,14 @@ void setup()
{
Serial.printf("FS: could not be started\n");
}
//Json
syringe_filled.read_Json();
syringe.read_Json();
}
......
......@@ -102,33 +102,32 @@ bool Syringe :: check_configuration(String name)
//Example : File f = ({ InterruptLock lock; filesystem->open(filename, "w"); }); and the f becomes the argument output_stream
//Example : File f = ({ InterruptLock lock; filesystem->open(filename, "w"); }); and the f becomes the argument input_stream
//useful in web.cpp via a button to save data
void Syringe :: write_Json (Stream& output_stream)
{
void Syringe :: write_Json ()
/***
-Argument : output_stream (= serial or a file)
-Argument : input_stream (= serial or a file)
-Return : /
-Action : Save the Json structure in a file (convert it to text)
***/
{
InterruptLock lock; //useful thanks to its constructor (so a is not visible in the code)
serializeJson(syringe_json, output_stream);
File f = filesystem->open("syringe_json", "w"); //Creation du fichier
serializeJson(syringe_json, f);
}
//useful in setup of pousse-seringue.cpp(to check at the begining what has already been saved) and web.cpp via a button to recover data
void Syringe :: read_Json (Stream& input_stream)
{
void Syringe :: read_Json ()
/***
-Argument : input_stream (= serial or a file)
-Argument : output_stream (= serial or a file)
-Return : /
-Action : Check if a Json Document alredy exist or not
-Action : Check if a Json Document alredy exist or not, if it does it is load
***/
{
InterruptLock lock; //useful thanks to its constructor (so a is not visible in the code)
deserializeJson(syringe_json, input_stream);
File f = filesystem->open("syringe_json", "r"); //Creation du fichier
deserializeJson(syringe_json, f);
}
......
......@@ -11,6 +11,8 @@ using InterruptLock = esp8266::InterruptLock;
using namespace std;
#include "fs.h"
class Syringe
{
private :
......@@ -50,8 +52,8 @@ class Syringe
bool check_configuration(String name);
//JSON METHODS
void write_Json (Stream& output_stream);
void read_Json (Stream& input_stream);
void write_Json ();
void read_Json ();
};
......
......@@ -343,7 +343,7 @@ void SyringeFilled :: read_Json ()
/***
-Argument : output_stream (= serial or a file)
-Return : /
-Action : Check if a Json Document alredy exist or not
-Action : Check if a Json Document alredy exist or not, if it does it is load
***/
{
InterruptLock lock; //useful thanks to its constructor (so a is not visible in the code)
......
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