Skip to content

Commit e14b0dc

Browse files
author
Jessica Shi
committed
move scheduling errors
1 parent 6262e14 commit e14b0dc

File tree

2 files changed

+8
-29
lines changed

2 files changed

+8
-29
lines changed

codegen.html

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,9 @@ <h6 style="margin-bottom: 0px; margin-top: 18px">Input a tensor algebra expressi
132132
<div class="mdl-grid" style="padding-top: 6px">
133133
<div class="mdl-layout-spacer"></div>
134134
<div class="mdl-cell mdl-cell--9-col">
135-
<div>
136-
<button id="btnSchedule" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect demo-btn" style="margin-bottom:10px; width: 30%">
137-
Add Scheduling Command
138-
</button>
139-
<div class="mdl-textfield" style="width: 69%">
140-
<span id="scheduleError" class="mdl-textfield__error"
141-
style="font-size: 14px;margin-left: 50px">
142-
</span>
143-
</div>
144-
</div>
135+
<button id="btnSchedule" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect demo-btn" style="margin-bottom:10px; width: 30%">
136+
Add Scheduling Command
137+
</button>
145138
<table class="mdl-data-table mdl-js-data-table" style="width: 100%;
146139
margin-bottom: 8px">
147140
<tbody id="tblSchedule">

javascripts/demo.js

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ function demo() {
66
error: ""
77
},
88
schedule: {
9-
scheduleMsg: "Cannot implement schedule: ",
109
indices: [],
1110
resultAccesses: [],
1211
},
@@ -99,9 +98,6 @@ function demo() {
9998
},
10099
getError: function() {
101100
return (model.output.error !== "") ? model.output.error : model.input.error;
102-
},
103-
hasInputOutputError: function() {
104-
return model.getError() && !model.getError().includes(model.schedule.scheduleMsg);
105101
}
106102
};
107103

@@ -111,22 +107,12 @@ function demo() {
111107
updateView: function(timeout) {
112108
clearTimeout(txtExprView.timerEvent);
113109
if (model.getError() !== "") {
114-
var markError = function() {
115-
var scheduleMsg = "Cannot implement schedule: ";
116-
var error = model.getError();
117-
if (error.includes(model.schedule.scheduleMsg)) {
118-
error = error.substring(error.indexOf(model.schedule.scheduleMsg)
119-
+ model.schedule.scheduleMsg.length);
120-
$("#scheduleError").html(error);
121-
$("#scheduleError").parent().addClass('is-invalid');
122-
} else {
123-
$("#lblError").html(error);
124-
$("#txtExpr").parent().addClass('is-invalid');
125-
}
126-
};
110+
var markError = function() {
111+
$("#lblError").html(model.getError());
112+
$("#txtExpr").parent().addClass('is-invalid');
113+
}
127114
txtExprView.timerEvent = setTimeout(markError, timeout);
128115
} else {
129-
$("#scheduleError").parent().removeClass('is-invalid');
130116
$("#txtExpr").parent().removeClass('is-invalid');
131117
}
132118
}
@@ -241,7 +227,7 @@ function demo() {
241227
},
242228
updateView: function(timeout) {
243229
clearTimeout(tblFormatsView.timerEvent);
244-
if (model.hasInputOutputError()) {
230+
if (model.getError() !== "") {
245231
var hideTables = function() {
246232
$("#tblFormats").hide();
247233
$("#tblSchedule").hide();

0 commit comments

Comments
 (0)