Skip to content

Commit 203c319

Browse files
committed
remvoe unused comment
1 parent 7225c6d commit 203c319

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

icmp_monitoring.py

-10
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
import tkinter as tk
1010
from tkinter import simpledialog
1111

12-
# تنظیم فونت پیش‌فرض برای matplotlib به Tahoma
1312
rcParams['font.family'] = 'Tahoma'
1413
rcParams['font.size'] = 12
1514

16-
# تابع برای دریافت IP‌ها از کاربر با استفاده از یک پنجره گرافیکی
1715
def get_ips():
1816
root = tk.Tk()
1917
root.withdraw() # مخفی کردن پنجره اصلی
@@ -23,13 +21,11 @@ def get_ips():
2321
else:
2422
return []
2523

26-
# دریافت IP‌ها از کاربر
2724
ips = get_ips()
2825
if not ips:
2926
print("هیچ IP وارد نشد. برنامه خاتمه یافت.")
3027
exit(1)
3128

32-
# تابع برای پینگ کردن IP‌ها
3329
def ping_ips():
3430
while True:
3531
responses = []
@@ -44,12 +40,10 @@ def ping_ips():
4440
ping_results.pop(0)
4541
time.sleep(1)
4642

47-
# تنظیمات اولیه برای نمودار
4843
fig, ax = plt.subplots()
4944
ping_results = []
5045
max_display_time = 100 # حداکثر تعداد نقاط زمانی که در نمودار نمایش داده می‌شود
5146

52-
# تابع برای به‌روزرسانی نمودار
5347
def update_graph(i):
5448
ax.clear()
5549
# استفاده از arabic_reshaper و bidi برای پشتیبانی از حروف فارسی و عربی
@@ -69,17 +63,13 @@ def update_graph(i):
6963
ax.set_xlim(left=max(0, len(ping_results) - max_display_time), right=len(ping_results))
7064
ax.set_ylim(-0.1, 1.1)
7165

72-
# تنظیم فونت و استفاده از arabic_reshaper و bidi برای برچسب‌ها
7366
labels = [get_display(arabic_reshaper.reshape(ip)) for ip in ips]
7467
ax.legend(labels=labels, prop={'family': 'Tahoma'}, loc='upper right')
7568

76-
# شروع پینگ کردن IP‌ها در یک ترد جداگانه
7769
ping_thread = threading.Thread(target=ping_ips)
7870
ping_thread.daemon = True
7971
ping_thread.start()
8072

81-
# شروع رسم نمودار به صورت پویا
8273
ani = animation.FuncAnimation(fig, update_graph, interval=500, save_count=100, cache_frame_data=False)
8374

84-
# نمایش نمودار به صورت زنده
8575
plt.show()

0 commit comments

Comments
 (0)