Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pousseseringue-arduino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FabLAAS
PousseSeringue
pousseseringue-arduino
Commits
6ac3785e
Commit
6ac3785e
authored
1 year ago
by
Malaurie Bernard
Browse files
Options
Downloads
Patches
Plain Diff
/bin/bash: line 1: q: command not found
parent
c27f90e5
No related branches found
Branches containing commit
No related tags found
1 merge request
!17
Malaurie's work on UI + CLI interface + AccelStepper interface
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pousseseringue-arduino.cpp
+8
-0
8 additions, 0 deletions
pousseseringue-arduino.cpp
syringe.cpp
+13
-14
13 additions, 14 deletions
syringe.cpp
syringe.h
+4
-2
4 additions, 2 deletions
syringe.h
syringefilled.cpp
+1
-1
1 addition, 1 deletion
syringefilled.cpp
with
26 additions
and
17 deletions
pousseseringue-arduino.cpp
+
8
−
0
View file @
6ac3785e
...
...
@@ -344,6 +344,14 @@ void setup()
{
Serial
.
printf
(
"FS: could not be started
\n
"
);
}
//Json
syringe_filled
.
read_Json
();
syringe
.
read_Json
();
}
...
...
This diff is collapsed.
Click to expand it.
syringe.cpp
+
13
−
14
View file @
6ac3785e
...
...
@@ -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
out
put_stream
//Example : File f = ({ InterruptLock lock; filesystem->open(filename, "w"); }); and the f becomes the argument
in
put_stream
//useful in web.cpp via a button to save data
void
Syringe
::
write_Json
(
Stream
&
output_stream
)
{
void
Syringe
::
write_Json
()
/***
-Argument :
out
put_stream (= serial or a file)
-Argument :
in
put_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 :
in
put_stream (= serial or a file)
-Argument :
out
put_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
);
}
...
...
This diff is collapsed.
Click to expand it.
syringe.h
+
4
−
2
View file @
6ac3785e
...
...
@@ -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
();
};
...
...
This diff is collapsed.
Click to expand it.
syringefilled.cpp
+
1
−
1
View file @
6ac3785e
...
...
@@ -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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment