Fusion develop into product + résolution conflits
This commit is contained in:
14
.idea/workspace.xml
generated
14
.idea/workspace.xml
generated
@@ -5,9 +5,10 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="a12d9762-568e-4ace-91c1-148c598387a7" name="Changes" comment=""Ajout bt impression rapports et dossier PDF crée"">
|
<list default="true" id="a12d9762-568e-4ace-91c1-148c598387a7" name="Changes" comment=""Ajout bt impression rapports et dossier PDF crée"">
|
||||||
|
<change afterPath="$PROJECT_DIR$/tools/deploy_product.sh" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Chat-Id.py" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/Scripts/.deploy.sh" beforeDir="false" afterPath="$PROJECT_DIR$/Scripts/.deploy.sh" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Chaufferie.py" beforeDir="false" />
|
<change beforePath="$PROJECT_DIR$/domo91.py" beforeDir="false" afterPath="$PROJECT_DIR$/domo91.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -21,10 +22,13 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
<component name="Git.Merge.Settings">
|
||||||
|
<option name="BRANCH" value="develop" />
|
||||||
|
</component>
|
||||||
<component name="Git.Settings">
|
<component name="Git.Settings">
|
||||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||||
<map>
|
<map>
|
||||||
<entry key="$PROJECT_DIR$" value="product" />
|
<entry key="$PROJECT_DIR$" value="develop" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
@@ -88,7 +92,7 @@
|
|||||||
"Python.test.executor": "Run",
|
"Python.test.executor": "Run",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"git-widget-placeholder": "product",
|
"git-widget-placeholder": "Merging product",
|
||||||
"ignore.virus.scanning.warn.message": "true",
|
"ignore.virus.scanning.warn.message": "true",
|
||||||
"last_opened_file_path": "C:/Users/miche/PycharmProjects/Gestion sondes",
|
"last_opened_file_path": "C:/Users/miche/PycharmProjects/Gestion sondes",
|
||||||
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
|
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
|
||||||
@@ -136,7 +140,7 @@
|
|||||||
<component name="SharedIndexes">
|
<component name="SharedIndexes">
|
||||||
<attachedChunks>
|
<attachedChunks>
|
||||||
<set>
|
<set>
|
||||||
<option value="bundled-python-sdk-4f4e415b4190-aa17d162503b-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-243.26053.29" />
|
<option value="bundled-python-sdk-348a24fa61fa-5312c7369657-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-251.23774.444" />
|
||||||
</set>
|
</set>
|
||||||
</attachedChunks>
|
</attachedChunks>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
56
domo91.py
56
domo91.py
@@ -171,6 +171,20 @@ if st.session_state["authenticated"]:
|
|||||||
sonde_choisie = st.selectbox("🧪 Choisissez une sonde :", sondes)
|
sonde_choisie = st.selectbox("🧪 Choisissez une sonde :", sondes)
|
||||||
df_sonde = df[df["Sonde"] == sonde_choisie]
|
df_sonde = df[df["Sonde"] == sonde_choisie]
|
||||||
|
|
||||||
|
# Ajouter une colonne Heure pour faciliter les filtres
|
||||||
|
df_sonde["Heure"] = df_sonde["Date"].dt.hour
|
||||||
|
|
||||||
|
# Filtrage par tranche horaire
|
||||||
|
tranche = st.radio("🕒 Tranche horaire :",
|
||||||
|
["Toute la journée", "Matin (6h-12h)", "Après-midi (12h-18h)", "Nuit (18h-6h)"])
|
||||||
|
|
||||||
|
if tranche == "Matin (6h-12h)":
|
||||||
|
df_sonde = df_sonde[(df_sonde["Heure"] >= 6) & (df_sonde["Heure"] < 12)]
|
||||||
|
elif tranche == "Après-midi (12h-18h)":
|
||||||
|
df_sonde = df_sonde[(df_sonde["Heure"] >= 12) & (df_sonde["Heure"] < 18)]
|
||||||
|
elif tranche == "Nuit (18h-6h)":
|
||||||
|
df_sonde = df_sonde[(df_sonde["Heure"] >= 18) | (df_sonde["Heure"] < 6)]
|
||||||
|
|
||||||
cursor.execute("SELECT Temp_Max FROM Chambres_froides WHERE Lieu = %s AND Sonde = %s", (site_selectionne, sonde_choisie))
|
cursor.execute("SELECT Temp_Max FROM Chambres_froides WHERE Lieu = %s AND Sonde = %s", (site_selectionne, sonde_choisie))
|
||||||
seuil = cursor.fetchone()
|
seuil = cursor.fetchone()
|
||||||
seuil_temp = seuil["Temp_Max"] if seuil else 10
|
seuil_temp = seuil["Temp_Max"] if seuil else 10
|
||||||
@@ -178,7 +192,21 @@ if st.session_state["authenticated"]:
|
|||||||
st.subheader("📊 Tableau des relevés")
|
st.subheader("📊 Tableau des relevés")
|
||||||
df_filtré = df_sonde.copy()
|
df_filtré = df_sonde.copy()
|
||||||
df_filtré = df_filtré.drop(columns="Id", errors="ignore")
|
df_filtré = df_filtré.drop(columns="Id", errors="ignore")
|
||||||
st.dataframe(df_filtré, use_container_width=True)
|
|
||||||
|
|
||||||
|
def surlignage_temp(val):
|
||||||
|
try:
|
||||||
|
if float(val) > seuil_temp:
|
||||||
|
return "color: red; font-weight: bold"
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
# Appliquer le style uniquement à la colonne "Temperature"
|
||||||
|
styled_df = df_filtré.style.applymap(surlignage_temp, subset=["Temperature"])
|
||||||
|
|
||||||
|
st.dataframe(styled_df, use_container_width=True)
|
||||||
|
|
||||||
st.subheader("📈 Évolution de la température")
|
st.subheader("📈 Évolution de la température")
|
||||||
fig, ax = plt.subplots(figsize=(10, 4))
|
fig, ax = plt.subplots(figsize=(10, 4))
|
||||||
@@ -190,6 +218,32 @@ if st.session_state["authenticated"]:
|
|||||||
ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
|
ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
|
||||||
ax.legend()
|
ax.legend()
|
||||||
st.pyplot(fig)
|
st.pyplot(fig)
|
||||||
|
# --- Affichage des alertes du jour ---
|
||||||
|
afficher_alertes = st.toggle("🚨 Afficher les alertes du jour")
|
||||||
|
|
||||||
|
if afficher_alertes:
|
||||||
|
try:
|
||||||
|
conn = mysql.connector.connect(**db_config)
|
||||||
|
cursor = conn.cursor(dictionary=True)
|
||||||
|
|
||||||
|
table_alertes = f"Alertes_{site_selectionne}"
|
||||||
|
cursor.execute(
|
||||||
|
f"SELECT Sonde, Debut_defaut, Status FROM `{table_alertes}` WHERE DATE(Debut_defaut) = %s",
|
||||||
|
(selected_date.strftime("%Y-%m-%d"),)
|
||||||
|
)
|
||||||
|
alertes = cursor.fetchall()
|
||||||
|
|
||||||
|
if alertes:
|
||||||
|
df_alertes = pd.DataFrame(alertes)
|
||||||
|
st.subheader("🚨 Alertes enregistrées")
|
||||||
|
st.dataframe(df_alertes, use_container_width=True)
|
||||||
|
else:
|
||||||
|
st.info("Aucune alerte enregistrée pour cette date.")
|
||||||
|
|
||||||
|
cursor.close()
|
||||||
|
conn.close()
|
||||||
|
except Exception as e:
|
||||||
|
st.error(f"Erreur lors de la récupération des alertes : {e}")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
st.warning("Aucune donnée trouvée pour cette date.")
|
st.warning("Aucune donnée trouvée pour cette date.")
|
||||||
|
|||||||
31
tools/deploy_product.sh
Normal file
31
tools/deploy_product.sh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
LOG="/home/debian/travail/Logs/deploy_product.log"
|
||||||
|
REPO_PATH="/home/debian/travail/Gestion_sondes"
|
||||||
|
DATE=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
|
echo "[$DATE] 🚀 Déploiement de la branche develop vers product" >> $LOG
|
||||||
|
|
||||||
|
cd $REPO_PATH
|
||||||
|
|
||||||
|
# 1. Récupérer les dernières modifs
|
||||||
|
git fetch origin >> $LOG 2>&1
|
||||||
|
|
||||||
|
# 2. Basculer sur la branche product
|
||||||
|
git checkout product >> $LOG 2>&1
|
||||||
|
|
||||||
|
# 3. Mettre à jour tous les .py depuis develop
|
||||||
|
git checkout origin/develop -- *.py >> $LOG 2>&1
|
||||||
|
|
||||||
|
# 4. Commit et push
|
||||||
|
git commit -am "🧩 Déploiement auto : maj des fichiers .py depuis develop" >> $LOG 2>&1
|
||||||
|
git push origin product >> $LOG 2>&1
|
||||||
|
|
||||||
|
# 5. Redémarrage des services Supervisor
|
||||||
|
for service in Cuisine_Saclay Monitor cuisine_meudon domo91 Interface
|
||||||
|
do
|
||||||
|
supervisorctl restart $service >> $LOG 2>&1
|
||||||
|
done
|
||||||
|
|
||||||
|
DATE_END=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
|
echo "[$DATE_END] ✅ Déploiement terminé avec succès." >> $LOG
|
||||||
Reference in New Issue
Block a user