-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
155 lines (143 loc) · 3.58 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PLC HMI Interface</title>
<style>
#container {
position: relative;
width: 100%;
max-width: 600px;
margin: 0 auto;
text-align: center;
}
#plc-image {
width: 60%;
}
#status-text {
position: absolute;
top: 10px;
right: 10px;
font-size: 24px;
font-weight: bold;
padding: 5px 10px;
border-radius: 4px;
transition: all 0.3s;
}
div#status-text.connected {
color: white !important;
background-color: green !important;
}
div#status-text.disconnected {
color: yellow !important;
background-color: red !important;
}
.button {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
border: none;
cursor: pointer;
transition: opacity 0.3s;
}
.button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
#blue-led {
bottom: 20px;
left: 30%;
background-color: blue;
}
#red-estop {
bottom: 20px;
right: 30%;
background-color: red;
}
.write-button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
margin-top: 20px;
}
.write-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.error-message {
color: red;
margin-top: 20px;
}
.retry-button {
margin-top: 20px;
}
.status-label {
font-size: 18px;
margin: 10px;
font-weight: bold;
}
.circle {
width: 50px;
height: 50px;
border-radius: 50%;
display: inline-block;
transition: all 0.3s;
}
/* Red Circle (E-Stop) styles */
.red-circle {
background-color: #ff0000;
}
/* Flashing animation for Safety Error */
@keyframes flash-safety {
0% { background-color: #ff0000; }
50% { background-color: #ffff00; }
100% { background-color: #ff0000; }
}
.red-circle.safety-error {
animation: flash-safety 1s infinite;
}
/* Blue Circle (LED) styles */
.blue-circle {
background-color: #000066; /* Darker blue when off */
box-shadow: none;
transition: all 0.3s;
}
.blue-circle.led-on {
background-color: #0066ff; /* Brighter blue when on */
box-shadow:
0 0 10px #0066ff,
0 0 20px #0066ff,
0 0 30px #0066ff;
}
/* Add inside your existing <style> tag */
#circles-container {
display: flex;
justify-content: center;
gap: 20px; /* Space between circles */
margin-top: 20px; /* Space below PLC image */
}
</style>
</head>
<body>
<h1>PLC Base Module</h1>
<div id="container">
<!-- Connection Status Text -->
<div id="status-text" style="color: red;">Connecting...</div>
<!-- Siemens S7-1200 Image -->
<img id="plc-image" src="assets/s7-1200.png" alt="Siemens S7-1200">
<!-- Status Circles Container -->
<div id="circles-container">
<div id="led-circle" class="circle blue-circle"></div>
<div id="estop-circle" class="circle red-circle"></div>
</div>
</div>
<p id="plc-data">PLC Data: Waiting for connection...</p>
<!-- Add error message display -->
<div id="error-message" class="error-message"></div>
<!-- Add connection retry button -->
<button id="retry-connection" class="retry-button" disabled>Retry Connection</button>
<script src="renderer.js"></script>
</body>
</html>