Skip to content

Commit 239c5d2

Browse files
committed
Added a bunch of comments
1 parent 39ddf83 commit 239c5d2

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

CPU_Scheduler.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Class: COM 310
121121
text-align: center;
122122
}
123123

124+
/*Style for the numbers below the chart*/
124125
.lower {
125126
margin-top: 9px;
126127
margin-left: -5px;

CPU_Scheduler.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
2727
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
2828

29-
<!--Include mouse wheel functions for jQuery-->
29+
<!--Include mousewheel functions for jQuery-->
3030
<script src="https://jqueryui.com/resources/demos/external/jquery-mousewheel/jquery.mousewheel.js"></script>
3131

3232
<!--Include Project CSS and JS file-->
@@ -36,6 +36,7 @@
3636
<body>
3737
<h2 id="title">CPU Scheduler Simulator</h2>
3838

39+
<!--Input Options-->
3940
<form>
4041
<p>
4142
<label for="processSpinner">Select the number of processes:</label>
@@ -62,6 +63,7 @@ <h2 id="title">CPU Scheduler Simulator</h2>
6263
</p>
6364
</form>
6465

66+
<!--Table-->
6567
<div id="div-resize">
6668
<div id="div-input">
6769
<div id="div-head">
@@ -84,8 +86,8 @@ <h2 id="title">CPU Scheduler Simulator</h2>
8486
<p>Average Wait Time: <span id="avgwaittime">0</span></p>
8587
<p>Average Turnaround Time: <span id="avgturntime">1</span></p>
8688

89+
<!--Gantt Chart-->
8790
<h2 id="h2">Gantt Chart</h2>
88-
<div id="gantt">
89-
</div>
91+
<div id="gantt"></div>
9092
</body>
9193
</html>

CPU_Scheduler.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*jshint camelcase: true, quotmark: single, undef: false, unused: vars, latedef: nofunc, asi: false, boss: false, laxbreak: false, laxcomma: false, multistr: false, sub: false, supernew: false, browser: true, devel: true, jquery: true, indent: 4*/
2-
// JSHint settings on first line
2+
// JSHint settings on first line (JSHint is used to find errors in JavaScript)
33

44
/*
55
@@ -13,12 +13,12 @@ Class: COM 310
1313
1414
*/
1515

16-
// Not used currently
16+
// Used to make the subscripts used on the table and the gantt chart
1717
function generateSubscript(num) {
1818
return 'P<span class="sub">' + num + '</span>';
1919
}
2020

21-
// Returns true or false depending on weather a number is an int and not a double
21+
// Returns true or false depending on weather number is an int or double
2222
function isInt(number) {
2323
return Math.floor(number) == number;
2424
}
@@ -31,6 +31,7 @@ function round(number) {
3131

3232
////////////////////////////////////////////////////////////////////////////////
3333

34+
// GUI object used for controling the user interface
3435
var GUI = {
3536
numberOfProcesses: 1,
3637
selectedAlgorithm: 0,
@@ -434,7 +435,7 @@ GUI.updateGUI = function () {
434435

435436
////////////////////////////////////////////////////////////////////////////////
436437

437-
// This function executes once the page finishes loading
438+
// This function will execute once the page is finished loading
438439
$(function () {
439440
GUI.generateGantt();
440441

@@ -518,7 +519,7 @@ $(function () {
518519
$('#div-resize').height(100);
519520
});
520521

521-
// Regenerate the Gantt Chart on window resize
522+
// Update the user interface when the window is resized
522523
$(window).resize(function() {
523524
GUI.updateGUI();
524525
});

0 commit comments

Comments
 (0)