Skip to content

Commit

Permalink
Added event name to scheduler event for script 'End'
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Mar 19, 2019
1 parent df67e55 commit ade244e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions BaseFiles/Common/html/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@
zuix.field('output').html(html+row);
//writeToScreen(row);

var scroll = zuix.field('output').get();
scroll.scrollTop = scroll.scrollHeight;
scrollToBottom();
}

function onError(evt)
Expand All @@ -129,6 +128,11 @@
pre.style.wordWrap = "break-word";
pre.innerHTML = message;
zuix.field('output').append(pre);
scrollToBottom()
}
function scrollToBottom() {
var scroll = zuix.field('output').get();
scroll.scrollTop = scroll.scrollHeight;
}

window.addEventListener("load", init, false);
Expand Down
6 changes: 3 additions & 3 deletions HomeGenie/Automation/Scheduler/SchedulerScriptingEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ public void StartScript()
if (result != null && result.Exception != null && result.Exception.GetType() != typeof(TargetException))
homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler,
eventItem.Name, Properties.SchedulerScriptStatus,
"Error (" + result.Exception.Message.Replace('\n', ' ').Replace('\r', ' ') + ")");
eventItem.Name + ":Error (" + result.Exception.Message.Replace('\n', ' ').Replace('\r', ' ') + ")");
}
catch (ThreadAbortException)
{
programThread = null;
isRunning = false;
homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name,
Properties.SchedulerScriptStatus, "Interrupted");
Properties.SchedulerScriptStatus, eventItem.Name + ":Interrupted");
}
homegenie.RaiseEvent(this, Domains.HomeAutomation_HomeGenie, SourceModule.Scheduler, eventItem.Name,
Properties.SchedulerScriptStatus, "End");
Properties.SchedulerScriptStatus, eventItem.Name + ":End");
});

try
Expand Down

0 comments on commit ade244e

Please sign in to comment.