Skip to content

Commit 3174923

Browse files
committed
Version 0.9
1 parent cdd246a commit 3174923

File tree

11 files changed

+398
-96
lines changed

11 files changed

+398
-96
lines changed

BeCG/BeCG.h

100644100755
Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,35 @@
4646
#define DEBUG_WEB // debug des interractions web
4747
//#define DEBUG_WEB_VALUE // debug des appels de valeurs web
4848

49-
#define ORG_NAME "fra589"
50-
#define APP_NAME "BeCG"
51-
#define APP_VERSION_MAJOR "0"
52-
#define APP_VERSION_MINOR "8"
53-
#define APP_VERSION_DATE "20231122"
54-
#define APP_VERSION_STRING "v" APP_VERSION_MAJOR "." APP_VERSION_MINOR "." APP_VERSION_DATE
55-
#define APP_NAME_VERSION APP_NAME " - " APP_VERSION_STRING "\0"
56-
#define COPYRIGHT "G.Bri\x8Are 2023-2023"
57-
58-
#define NAME_VERSION_LEN 32
59-
extern char nameVersion[NAME_VERSION_LEN];
49+
#define COPYRIGHT "G.Bri\x8Are 2023-2023"
50+
#define ORG_NAME "fra589"
51+
#define APP_NAME "BeCG"
52+
#define APP_VERSION_MAJOR "0"
53+
#define APP_VERSION_MINOR "9"
54+
#define APP_VERSION_DATE "20231130"
55+
#define APP_VERSION_STRING "v" APP_VERSION_MAJOR "." APP_VERSION_MINOR "." APP_VERSION_DATE
56+
#define APP_NAME_VERSION APP_NAME " - " APP_VERSION_STRING "\0"
57+
#define EEPROM_VERSION_MAJOR "0"
58+
#define EEPROM_VERSION_MINOR "9"
59+
#define EEPROM_VERSION_REVIS "0"
60+
#define EEPROM_VERSION APP_NAME " EEPROM v" EEPROM_VERSION_MAJOR "." EEPROM_VERSION_MINOR "." EEPROM_VERSION_REVIS
61+
62+
#define EEPROM_VERSION_LEN 32
63+
extern char EEPROM_Version[EEPROM_VERSION_LEN];
6064

6165
// Adresses EEProm pour sauvegarde des paramètres
6266
#define EEPROM_LENGTH 512
63-
#define ADDR_NAME_VERSION 0 // = 32 caractères de long
67+
#define ADDR_EEPROM_VERSION 0 // = 32 caractères de long
6468
#define ADDR_SCALE_BA 32 // = 0 + 32 longueur 4 octets
6569
#define ADDR_SCALE_BF 36 // = 32 + 4 longueur 4 octets
6670
#define ADDR_CLI_SSID 40 // = 36 + 4 longueur 32 octets
6771
#define ADDR_CLI_PWD 56 // = 40 + 32 longueur 63 octets
6872
#define ADDR_AP_SSID 119 // = 56 + 63 longueur 32 octets
6973
#define ADDR_AP_PWD 151 // = 119 + 32 longueur 63 octets
70-
#define ADDR_ENTRAXE 214 // = 151 + 63 longueur 4 octets
71-
#define ADDR_PAF_BA 218 // = 214 + 4 longueur 4 octets
72-
#define ADDR_MASSE_ETALON 222 // = 218 + 4 longueur 2 octets
74+
#define ADDR_AP_CHANNEL 214 // = 151 + 63 longueur 2 octets
75+
#define ADDR_ENTRAXE 216 // = 214 + 2 longueur 4 octets
76+
#define ADDR_PAF_BA 220 // = 216 + 4 longueur 4 octets
77+
#define ADDR_MASSE_ETALON 224 // = 220 + 4 longueur 2 octets
7378

7479
// Données mécanique de la balance
7580
#define DEFAULT_ENTAXE 125.0 // (mm) Distance entre las appuis BA et BF
@@ -100,10 +105,11 @@
100105
#define APPUIS_LONG 2 // 2 secondes
101106

102107
// Valeurs des paramètres par défauts
103-
#define DEFAULT_CLI_SSID "" // SSID client (la balance se connecte si défini)
104-
#define DEFAULT_CLI_PWD "" // WPA-PSK/WPA2-PSK client
105-
#define DEFAULT_AP_SSID "BeCG_" // SSID de l'AP balance
106-
#define DEFAULT_AP_PWD "" // WPA-PSK/WPA2-PSK AP
108+
#define DEFAULT_CLI_SSID "" // SSID client (la balance se connecte si défini)
109+
#define DEFAULT_CLI_PWD "" // WPA-PSK/WPA2-PSK client
110+
#define DEFAULT_AP_SSID "BeCG_" // SSID de l'AP balance
111+
#define DEFAULT_AP_PWD "" // WPA-PSK/WPA2-PSK AP
112+
#define DEFAULT_AP_CHANNEL 3
107113

108114
// Variable globales pour le WiFi
109115
#define MAX_SSID_LEN 32 // Longueur maxi d'un SSID

BeCG/BeCG.ino

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// Variables globales
2727
//----------------------------------------------------------------------------
2828

29-
char nameVersion[NAME_VERSION_LEN];
29+
char EEPROM_Version[EEPROM_VERSION_LEN];
3030

3131
// Capteurs de masse
3232
HX711 hx711_ba;

BeCG/becgwifi.cpp

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void wifiApInit(void) {
6363
Serial.flush();
6464
#endif
6565
WiFi.softAPConfig(apIP, apIP, netMsk);
66-
WiFi.softAP(ap_ssid, ap_pwd, 11); // (AP ouverte si de mot de passe vide ou null)
66+
WiFi.softAP(ap_ssid, ap_pwd, DEFAULT_AP_CHANNEL); // (AP ouverte si de mot de passe vide ou null)
6767

6868
delay(500); // Without delay I've seen the IP address blank
6969
#ifdef DEBUG

BeCG/data/index.html

Lines changed: 77 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<link rel="stylesheet" media="screen" type="text/css" href="style.css"/>
3232
<script type="text/javascript" src="scripts.js"></script>
3333
</head>
34-
<body onload="page_onload()">
34+
<body onload="index_onload()">
3535
<input type="hidden" id="paf_ba" name="paf_ba" value="0.0" />
3636
<input type="hidden" id="entraxe" name="entraxe" value="0.0" />
3737
<input type="hidden" id="tare" name="tare" value="0" />
@@ -59,53 +59,83 @@ <h2>
5959
</tbody>
6060
</table>
6161
<div id="la_page">
62-
<h2>Masses mesurées</h2>
63-
<p>
64-
<table>
65-
<thead>
66-
<tr>
67-
<th>bord d'attaque</th>
68-
<th>bord de fuite</th>
69-
</tr>
70-
</thead>
71-
<tbody>
72-
<tr>
73-
<td id="ba">0.0 g</td>
74-
<td id="bf">0.0 g</td>
75-
</tr>
76-
</tbody>
77-
</table>
78-
</p>
79-
<h2>
80-
Masse totale
81-
</h2>
82-
<h3 id="total">0.0 g</h3>
83-
<p>
84-
&nbsp;
85-
</p>
86-
<h2>
87-
Position Centre de Gravité
88-
</h2>
89-
<h3 id="cg">~~~~</h3>
90-
<p>
91-
<img src="profil.svg" />
92-
</p>
93-
<div style="float: left;">
94-
<input type="checkbox" id="auto_refresh" name="auto_refresh" onclick="autoRefresh()" checked="checked" />
95-
<label for="auto_refresh">Auto refresh</label>
62+
<div id="onglets">
63+
<span id="onglet1" class="onglet selected" onclick="onglet_click('onglet1')">Mesures</span>
64+
<span id="onglet2" class="onglet" onclick="onglet_click('onglet2')">Calculs</span>
9665
</div>
97-
<!--------------------------------------------------------------------->
98-
<!-- Boutons tare / étalonnage -->
99-
<!--------------------------------------------------------------------->
100-
<p class="alignement-droit">
101-
<button id="bouton_tare" title="Remise à zéro" onclick="balance_tare()">
102-
Tare
103-
</button>
104-
&nbsp;
105-
<button id="bouton_etalonage" title="Etalonner la balance..." onclick="afficheDialog('dlgEtalonnage')">
106-
Etalonnage
107-
</button>
108-
</p>
66+
<div id="mesures">
67+
<h2>Masses mesurées</h2>
68+
<p>
69+
<table>
70+
<thead>
71+
<tr>
72+
<th>bord d'attaque</th>
73+
<th>bord de fuite</th>
74+
</tr>
75+
</thead>
76+
<tbody>
77+
<tr>
78+
<td id="ba">0.0 g</td>
79+
<td id="bf">0.0 g</td>
80+
</tr>
81+
</tbody>
82+
</table>
83+
</p>
84+
<h2>
85+
Masse totale
86+
</h2>
87+
<h3 id="total">0.0 g</h3>
88+
<p>
89+
&nbsp;
90+
</p>
91+
<h2>
92+
Position Centre de Gravité
93+
</h2>
94+
<h3 id="cg">~~~~</h3>
95+
<p>
96+
<img src="profil.svg" />
97+
</p>
98+
<div style="float: left;">
99+
<input type="checkbox" id="auto_refresh" name="auto_refresh" onclick="autoRefresh()" checked="checked" />
100+
<label for="auto_refresh">Auto refresh</label>
101+
</div>
102+
<!--------------------------------------------------------------------->
103+
<!-- Boutons tare / étalonnage -->
104+
<!--------------------------------------------------------------------->
105+
<p class="alignement-droit">
106+
<button id="bouton_tare" title="Remise à zéro" onclick="balance_tare()">
107+
Tare
108+
</button>
109+
&nbsp;
110+
<button id="bouton_etalonage" title="Etalonner la balance..." onclick="afficheDialog('dlgEtalonnage')">
111+
Etalonnage
112+
</button>
113+
</p>
114+
</div> <!-- id="mesures" -->
115+
<div id="calculs" class="noshow">
116+
<h2>Calculs lest de centrage</h2>
117+
<p>
118+
<label for="cg_mesure">Position CG mesurée (mm/ba)</label>
119+
<input type="number" id="cg_mesure" name="cg_mesure" lang="en" value="0.0" readonly />
120+
<br />
121+
<label for="masse_mesure">Masse mesurée (g)</label>
122+
<input type="number" id="masse_mesure" name="masse_mesure" lang="en" value="0.0" readonly />
123+
<br /><br />
124+
<label for="cg_voulu">Position CG désirée (mm/ba)</label>
125+
<input type="number" id="cg_voulu" name="cg_voulu" value="0.0" lang="en" step="0.1"/>
126+
<span id="info_cg_voulu">&nbsp;</span>
127+
<br />
128+
<label for="masse_lest">Masse du lest (g)</label>
129+
<input type="number" id="masse_lest" name="masse_lest" value="0.0" lang="en" step="0.1"/>
130+
<span id="info_masse_lest">&nbsp;</span>
131+
<br />
132+
<label for="levier_lest">Bras de levier du lest (mm/ba)</label>
133+
<input type="number" id="levier_lest" name="levier_lest" value="0.0" lang="en" step="0.1"/>
134+
<span id="info_levier_lest">&nbsp;</span>
135+
<br /><br />
136+
<i>(Bras de levier du lest : mesuré à partir du bord d'attaque, valeurs positives en arrière du bord d'attaque et négatives en avant.)</i>
137+
</p>
138+
</div> <!-- id="calculs" -->
109139
</div> <!-- id="la_page" -->
110140
<p id="heure" class="noshow">&nbsp;</p>
111141
<hr />
@@ -129,7 +159,6 @@ <h3 id="cg">~~~~</h3>
129159
<button id="btnSuite" title="Continuer" onclick="suite_clique()">
130160
Suivant
131161
</button>
132-
&nbsp;
133162
<button id="btnClose" title="Fermer cette boite de dialogue" onclick="closeDialog('dlgEtalonnage')">
134163
Fermer
135164
</button>

0 commit comments

Comments
 (0)