-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathindex.html
288 lines (283 loc) · 11.3 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="en">
<head>
<!-- BOOTSTRAP STUFF -->
<meta charset="utf-8">
<meta name="description"
content="A logic circuit simulator made with p5.js library, useful for educational use. It can be used to simulate combinational and sequential circuits.">
<meta name="author" content="drendog">
<link rel="stylesheet" href="vendor/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="simulator/css/simstyle.css">
<script src="vendor/js/jquery-3.3.1.slim.min.js"></script>
<script src="vendor/js/popper.min.js"></script>
<script src="vendor/js/bootstrap.min.js"></script>
<!-- p5 stuff -->
<script src="vendor/js/p5.min.js"></script>
<!-- Simulator stuff -->
<script type="module" src="simulator/js/simulator.js"></script>
<title>Logic Circuit Simulator</title>
</head>
<body>
<!-- Fixed navbar -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<a class="navbar-brand text-center" href="#">
Logic Circuit
<br>Simulator
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<!-- TODO
<div class="navGroupTools"><button type="button" class="btn btn-outline-light" disabled><i class="fa fa-arrow-circle-left"></i>
Undo
</button><button type="button" class="btn btn-outline-light" disabled><i class="fa fa-arrow-circle-right"></i>
Redo
</button></div>-->
<div class="navGroupTools">
<button type="button" class="btn btn-outline-light Edit active" tool="Edit"
onclick="activeTool(this)">
<i class="fa fa-edit"></i>
Edit
</button>
<button type="button" class="btn btn-outline-light" tool="Move" onclick="activeTool(this)">
<i class="fa fa-arrows"></i>
Move
</button>
<button type="button" class="btn btn-outline-light" tool="Delete" onclick="activeTool(this)"">
<i class=" fa fa-trash-o"></i>
Delete
</button>
</div>
<div class="navGroupTools">
<label type="button" class="btn btn-outline-light" style="margin:0px">
<input id="projectFile" type="file"></input>
<i class="fa fa-upload"></i>
Load
</label>
<a download="LogicCircuit00" href="#" id="saveProjectFile">
<button type="button" class="btn btn-outline-light">
<i class="fa fa-save"></i>
Save
</button>
</a>
</div>
<div class="githubSection">
<button type="button" class="btn btn-outline-light"
onclick="window.location.href='https://git.io/fjHIF'">
<i class="fa fa-github"></i>
</button>
</div>
</a>
</li>
</ul>
</div>
</nav>
<!-- Begin page content -->
<div class="container-fluid pt-3">
<div class="row">
<div class="tools col-0 ml-3 pr-0 overflow-scroll" style="overflow-y: scroll;height: calc(100vh - 5rem);">
<div class="list-group float-right" style="min-width: 50px; max-width: 60px">
<button type="button" tool="LogicInput" title="Logic Input" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/LogicInput.svg" class="ml-2" width="32">
</button>
<button type="button" tool="LogicOutput" title="Logic Output" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/LogicOutput.svg" class="ml-2" width="32">
</button>
<button type="button" data-target="#ClockSettings" data-toggle="modal" title="Clock"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/Clock.svg" width="50">
</button>
<button type="button" tool="NOT" isGate="true" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/NOT.svg" width="50">
</button>
<button type="button" tool="AND" isGate="true" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/AND.svg" width="50">
</button>
<button type="button" tool="NAND" isGate="true" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/NAND.svg" width="50">
</button>
<button type="button" tool="OR" isGate="true" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/OR.svg" width="50">
</button>
<button type="button" tool="NOR" isGate="true" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/NOR.svg" width="50">
</button>
<button type="button" tool="XOR" isGate="true" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/XOR.svg" width="50">
</button>
<button type="button" tool="XNOR" isGate="true" onclick="activeTool(this)"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/XNOR.svg" width="50">
</button>
<button type="button" data-target="#SR_LatchSettings" title="Latch SR NOR-NAND Sync-Async"
data-toggle="modal" class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/SR_Latch.svg" width="50">
</button>
<button type="button" data-target="#FF_D-TypeSettings" title="Flip Flop D Single or Master-Slave"
data-toggle="modal" class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/FF_D_MS.svg" width="50">
</button>
<button type="button" data-target="#FF_T-TypeSettings"
title="Flip Flop T Positive-Negative Edge Triggered" data-toggle="modal"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/FF_T.svg" width="50">
</button>
<button type="button" data-target="#FF_JK-TypeSettings"
title="Flip Flop JK Positive-Negative Edge Triggered" data-toggle="modal"
class="list-group-item list-group-item-action pl-1">
<img src="simulator/img/FF_JK.svg" width="50">
</button>
</div>
</div>
<div class="col-10 pl-0">
<!-- Simulator Canvas -->
<div id="canvas-sim"></div>
</div>
</div>
</div>
</body>
<!-- Modal for Clock Settings -->
<div class="modal fade" id="ClockSettings" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Clock Settings</h5>
</div>
<div class="modal-body">
<h6>Clock period</h6>
<div class="input-group mb-3">
<input type="number" class="form-control period" value="1000" min="0">
<div class="input-group-append">
<span class="input-group-text">ms</span>
</div>
</div>
<h6>Duty Cycle</h6>
<div class="input-group mb-3">
<input type="number" class="form-control duty-cycle" value="50" min="0" max="100">
<div class="input-group-append">
<span class="input-group-text">%</span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" tool="Clock" onclick="activeTool(this)"
data-dismiss="modal">Create</button>
</div>
</div>
</div>
</div>
<!-- End Modal for Clock Settings-->
<!-- Modal for SR Latch Settings -->
<div class="modal fade" id="SR_LatchSettings" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">SR Latch Settings</h5>
</div>
<div class="modal-body">
<h6>Choose SR Latch type</h6>
<select class="custom-select SR_Latch-gate">
<option selected>NOR</option>
<option>NAND</option>
</select>
<br>
<select class="custom-select SR_Latch-sync">
<option selected>Asynchronous</option>
<option>Synchronous</option>
</select>
<input type="checkbox" class="SR_stabilize" checked>
<label>Stabilize - Without this, the outputs may pulsate.</label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" tool="SR_Latch" onclick="activeTool(this)"
data-dismiss="modal">Create</button>
</div>
</div>
</div>
</div>
<!-- End Modal for SR Latch Settings-->
<!-- Modal for D-Type FF Settings -->
<div class="modal fade" id="FF_D-TypeSettings" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">D-Type Flip-Flop Settings</h5>
</div>
<div class="modal-body">
<h6>Choose the type</h6>
<select class="custom-select FF_D-Setting">
<option selected>SINGLE</option>
<option>MASTER-SLAVE</option>
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" tool="FF_D" onclick="activeTool(this)"
data-dismiss="modal">Create</button>
</div>
</div>
</div>
</div>
<!-- End Modal for Clock Settings-->
<!-- Modal for T-Type FF Settings -->
<div class="modal fade" id="FF_T-TypeSettings" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">T-Type Flip-Flop Settings</h5>
</div>
<div class="modal-body">
<h6>Choose the type</h6>
<select class="custom-select FF_T-Setting">
<option selected>Positive Edge-Triggered</option>
<option>Negative Edge-Triggered</option>
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" tool="FF_T" onclick="activeTool(this)"
data-dismiss="modal">Create</button>
</div>
</div>
</div>
</div>
<!-- End Modal for T-Type FF Settings-->
<!-- Modal for JK-Type FF Settings -->
<div class="modal fade" id="FF_JK-TypeSettings" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">JK-Type Flip-Flop Settings</h5>
</div>
<div class="modal-body">
<h6>Choose the type</h6>
<select class="custom-select FF_JK-Setting">
<option selected>Positive Edge-Triggered</option>
<option>Negative Edge-Triggered</option>
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" tool="FF_JK" onclick="activeTool(this)"
data-dismiss="modal">Create</button>
</div>
</div>
</div>
</div>
<!-- End Modal for JK-Type FF Settings-->
</html>