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YXRzIC8gc2VsZi5kZXRlY3RlZF90aHJlYXRzKSAqIDEwMAogICAgICAgICAgICBzZWxmLnN1Y2Nlc3NfcmF0ZV9sYWJlbC5zZXRUZXh0KGYmcXVvdDtTdWNjZXNzIFJhdGU6IHtzdWNjZXNzX3JhdGU6LjJmfSUmcXVvdDspCiAgICAgICAgICAgIHNlbGYuc3RhdHVzX2xhYmVsLnNldFRleHQoJnF1b3Q7U3lzdGVtIFN0YXR1czogVGhyZWF0IE5ldXRyYWxpemVkJnF1b3Q7KQogICAgICAgICAgICBzZWxmLnN0YXR1c19sYWJlbC5zZXRTdHlsZVNoZWV0KCZxdW90O2ZvbnQtc2l6ZTogMThweDsgY29sb3I6IGdyZWVuOyZxdW90OykKCmlmIF9fbmFtZV9fID09ICZxdW90O19fbWFpbl9fJnF1b3Q7OgogICAgYXBwID0gUUFwcGxpY2F0aW9uKHN5cy5hcmd2KQogICAgd2luZG93ID0gSXJvbkRvbWVDb250cm9sUGFuZWwoKQogICAgd2luZG93LnNob3coKQogICAgc3lzLmV4aXQoYXBwLmV4ZWNfKCkp
import sys
import random
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget,
QPushButton, QProgressBar, QHBoxLayout, QFrame
)
from PyQt5.QtCore import QTimer, Qt
class IronDomeControlPanel(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Iron Dome Control Panel Simulation")
self.setGeometry(100, 100, 800, 600)
# Ana widget ve layout
self.central_widget = QWidget()
self.setCentralWidget(self.central_widget)
self.layout = QVBoxLayout(self.central_widget)
# Başlık
self.title_label = QLabel("Iron Dome Active Defense System", self)
self.title_label.setAlignment(Qt.AlignCenter)
self.title_label.setStyleSheet("font-size: 24px; font-weight: bold;")
self.layout.addWidget(self.title_label)
# Durum göstergesi
self.status_label = QLabel("System Status: Initializing...", self)
self.status_label.setAlignment(Qt.AlignCenter)
self.status_label.setStyleSheet("font-size: 18px; color: blue;")
self.layout.addWidget(self.status_label)
# Tehdit ve imha sayaçları için yatay layout
self.counter_layout = QHBoxLayout()
self.layout.addLayout(self.counter_layout)
# Tehdit sayacı
self.threat_count_label = QLabel("Detected Threats: 0", self)
self.threat_count_label.setAlignment(Qt.AlignCenter)
self.threat_count_label.setStyleSheet("font-size: 18px;")
self.counter_layout.addWidget(self.threat_count_label)
# Dikey ayırıcı çizgi
self.separator = QFrame()
self.separator.setFrameShape(QFrame.VLine)
self.separator.setFrameShadow(QFrame.Sunken)
self.counter_layout.addWidget(self.separator)
# İmha edilen tehdit sayacı
self.neutralized_count_label = QLabel("Neutralized Threats: 0", self)
self.neutralized_count_label.setAlignment(Qt.AlignCenter)
self.neutralized_count_label.setStyleSheet("font-size: 18px;")
self.counter_layout.addWidget(self.neutralized_count_label)
# Başarı oranı göstergesi
self.success_rate_label = QLabel("Success Rate: 0%", self)
self.success_rate_label.setAlignment(Qt.AlignCenter)
self.success_rate_label.setStyleSheet("font-size: 18px; color: green;")
self.layout.addWidget(self.success_rate_label)
# Tehdit algılama butonu
self.detect_button = QPushButton("Simulate Threat Detection", self)
self.detect_button.clicked.connect(self.simulate_threat_detection)
self.layout.addWidget(self.detect_button)
# İmha işlemi ilerleme çubuğu
self.progress_bar = QProgressBar(self)
self.progress_bar.setValue(0)
self.layout.addWidget(self.progress_bar)
# Zamanlayıcı
self.timer = QTimer(self)
self.timer.timeout.connect(self.update_progress)
# Tehdit ve imha sayıları
self.detected_threats = 0
self.neutralized_threats = 0
def simulate_threat_detection(self):
self.detected_threats += 1
self.threat_count_label.setText(f"Detected Threats: {self.detected_threats}")
self.status_label.setText("System Status: Threat Detected!")
self.status_label.setStyleSheet("font-size: 18px; color: red;")
self.progress_bar.setValue(0)
self.timer.start(100) # 100 ms aralıklarla güncelle
def update_progress(self):
current_value = self.progress_bar.value()
if current_value < 100:
self.progress_bar.setValue(current_value + random.randint(5, 15))
else:
self.timer.stop()
self.neutralized_threats += 1
self.neutralized_count_label.setText(f"Neutralized Threats: {self.neutralized_threats}")
success_rate = (self.neutralized_threats / self.detected_threats) * 100
self.success_rate_label.setText(f"Success Rate: {success_rate:.2f}%")
self.status_label.setText("System Status: Threat Neutralized")
self.status_label.setStyleSheet("font-size: 18px; color: green;")
if __name__ == "__main__":
app = QApplication(sys.argv)
window = IronDomeControlPanel()
window.show()
sys.exit(app.exec_())