svg smooth line draw pen mousemove how to? - svg

function mouseDown(event) {
isMouseDown = true;
var shape = document.createElementNS(NS, "path");
shape.setAttribute("id", "pen" + penCount);
.
lastPoint = {
x: event.offsetX,
y: event.offsetY
};
stage.append(shape);
++penCount;
}
function mouseMove(event) {
if (isMouseDown) {
var depth = jQuery('#pen' + (penCount - 1)).attr("d");
//// how do i do this part /////////////////
jQuery('#pen' + (penCount - 1)).attr("d", depth + "L " + event.offsetX + " " + event.offsetY + " ");
lastPoint = {
x: event.offsetX,
y: event.offsetY
};
}
}
In canvas, it worked well using QuadraticCurveTo. But in SVG, I want to know how to make a smooth curve. Help me ^^
How should I apply it in the bottom part?
var midPoint = [(lastPoint.x + event.offsetX) / 2, (lastPoint.y + event.offsetY) / 2];
console.log( 'Q' + lastPoint.x + ',' + lastPoint.y + ' ' + midPoint[0] + ',' + midPoint[1]);
jQuery('#pen' + (penCount - 1)).attr("d", depth + "L " + event.offsetX + " " + event.offsetY + " ");
lastPoint = {
x: event.offsetX,
y: event.offsetY
};

Related

How to solve report generation issue on Azure?

I am facing some issue when I published over azure it's not working please tell me if any person have a solution about it.
public ActionResult GenerateReport(string ReportName)
{
LocalReport localReport = new LocalReport();
localReport.ReportPath = Server.MapPath(#"~/Areas/RemoteAnalysis/rptAlarm.rdlc");
List<clsReport> lstOverallData = new List<clsReport>();
using (DBClass context = new DBClass())
{
context.AddParameter("#FileID", Convert.ToInt32(Session["FileID"]));
context.AddParameter("#UserID", Session["UserName"]);
DataTable dtReportData = context.getData("GetRouteDetailForReport", CommandType.StoredProcedure);
if (dtReportData.Rows.Count > 0)
{
foreach (DataRow dr in dtReportData.Rows)
{
try
{
lstOverallData.Add(new clsReport
{
FileID = Convert.ToInt32(dr["Fileid"]),
PlantID = Convert.ToString(dr["PlantID"]),
PlantName = Convert.ToString(dr["PlantName"]),
AreaID = Convert.ToString(dr["AreaID"]),
AreaName = Convert.ToString(dr["AreaName"]),
TrainID = Convert.ToString(dr["TrainID"]),
TrainName = Convert.ToString(dr["TrainName"]),
MachineID = Convert.ToString(dr["MachineID"]),
MachineName = Convert.ToString(dr["MachineName"]),
PointID = Convert.ToString(dr["PointID"]),
PointName = Convert.ToString(dr["PointName"]),
AalrmID = Convert.ToInt32(dr["PointAlarmID"]),
AlarmName = Convert.ToString(dr["AlarmName"]),
HighValue = Convert.ToDouble(dr["HighValue"]),
LowValue = Convert.ToDouble(dr["LowValue"]),
MeasurementTime = Convert.ToDateTime("2018-04-17 14:44:02.293"),
OverallChnlA = Convert.ToDouble(dr["OverallValueChnlA"]),
UnitChnlA = Convert.ToString(dr["OverallUnitChnlA"]),
OverallChnlB = Convert.ToDouble(dr["OverallValueChnlB"]),
UnitChnlB = Convert.ToString(dr["OverallUnitChnlB"]),
DataID = Convert.ToInt32(dr["DataID"])
});
}
catch (Exception ex)
{
throw ex;
}
}
}
}
//code changes from here on 5 march 2021..
ReportDataSource reportDataSource = new ReportDataSource("dsOverall", lstOverallData);
localReport.DataSources.Add(reportDataSource);
localReport.Refresh();
string reportType = ""; //"PDF"; //Enter downloading format according to your choice/if condition
string mimeType;
string encoding;
string fileNameExtension;
string format = "";
string filename = "";
string deviceInfo = "";
//The DeviceInfo settings should be changed based on the reportType
if (ReportName == "pdf")
{
reportType = "PDF";
format = "application/pdf";
filename = "AlaramReport.pdf";
deviceInfo = "<DeviceInfo>" +
" <OutputFormat>pdf</OutputFormat>" +
" <PageTitle> Report</PageTitle>" +
" <PageWidth>9.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.5in</MarginTop>" +
" <MarginLeft>0.5in</MarginLeft>" +
" <MarginRight>0.5in</MarginRight>" +
" <MarginBottom>0.5in</MarginBottom>" +
"</DeviceInfo>";
}
else if (ReportName == "doc")
{
reportType = "Word";
format = "application/doc";
filename = "AlaramReport.doc";
deviceInfo = "<DeviceInfo>" +
" <OutputFormat>doc</OutputFormat>" +
" <PageTitle> Report</PageTitle>" +
" <PageWidth>9.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.5in</MarginTop>" +
" <MarginLeft>0.5in</MarginLeft>" +
" <MarginRight>0.5in</MarginRight>" +
" <MarginBottom>0.5in</MarginBottom>" +
"</DeviceInfo>";
}
else if (ReportName == "xls")
{
reportType = "Excel";
format = "application/xls";
filename = "AlaramReport.xls";
deviceInfo = "<DeviceInfo>" +
" <OutputFormat>xls</OutputFormat>" +
" <PageTitle> Report</PageTitle>" +
" <PageWidth>9.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.5in</MarginTop>" +
" <MarginLeft>0.5in</MarginLeft>" +
" <MarginRight>0.5in</MarginRight>" +
" <MarginBottom>0.5in</MarginBottom>" +
"</DeviceInfo>";
}
else if (ReportName == "jpg")
{
reportType = "Image";
format = "application/jpg";
filename = "AlaramReport.jpg";
deviceInfo = "<DeviceInfo>" +
" <OutputFormat>jpg</OutputFormat>" +
" <PageTitle> Report</PageTitle>" +
" <PageWidth>9.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.5in</MarginTop>" +
" <MarginLeft>0.5in</MarginLeft>" +
" <MarginRight>0.5in</MarginRight>" +
" <MarginBottom>0.5in</MarginBottom>" +
"</DeviceInfo>";
}
else
{
reportType = "PDF";
format = "application/pdf";
filename = "AlaramReport.pdf";
deviceInfo = "<DeviceInfo>" +
" <OutputFormat>pdf</OutputFormat>" +
" <PageTitle> Report</PageTitle>" +
" <PageWidth>9.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.5in</MarginTop>" +
" <MarginLeft>0.5in</MarginLeft>" +
" <MarginRight>0.5in</MarginRight>" +
" <MarginBottom>0.5in</MarginBottom>" +
"</DeviceInfo>";
}
//Render the report
Warning[] warnings;
string[] streams;
byte[] renderedBytes;
renderedBytes = localReport.Render(reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);
ViewBag.Title = "Alarm Report";
return File(renderedBytes, format, filename);
}
The above one is my code which is used to generate a report on local serer but when I publish on Azure then it was not working and shows me an error like server error. How to resolve this issue please anyone tell me. tried lots of code for this issue but nothing to work.

Async calls in c#

When I execute the code I developed to call an Async method of the linq2Twitter, I am getting a System.Aggregate Exception, the code is below:
static async Task<List<myTwitterStatus>> getRetweets(ulong tweetID, TwitterContext twitterCtx)
{
List<myTwitterStatus> reTweets = new List<myTwitterStatus>();
var publicTweets =
await
(from tweet in twitterCtx.Status
where tweet.Type == StatusType.Retweets &&
tweet.ID == tweetID
select tweet)
.ToListAsync();
if (publicTweets != null)
publicTweets.ForEach(tweet =>
{
if (tweet != null && tweet.User != null)
{
myTwitterStatus tempStatus = new myTwitterStatus();
tempStatus.Country = tweet.Place.Country;
tempStatus.createdAt = tweet.CreatedAt;
tempStatus.FavoriteCount = long.Parse(tweet.FavoriteCount.ToString());
tempStatus.ID = tweet.ID;
tempStatus.isTruncated = tweet.Truncated;
tempStatus.Lang = tweet.Lang;
tempStatus.MaxID = tweet.MaxID;
tempStatus.PlaceFullname = tweet.Place.FullName;
tempStatus.RetweetCount = tweet.RetweetCount;
tempStatus.ScreenName = tweet.ScreenName;
tempStatus.Text = tweet.Text;
tempStatus.UserFriends = tweet.User.FriendsCount;
tempStatus.UserCreated = tweet.User.CreatedAt;
tempStatus.UserFollowers = tweet.User.FollowersCount;
tempStatus.UserFavorities = tweet.User.FavoritesCount;
tempStatus.UserFriends = tweet.User.FriendsCount;
tempStatus.UserLocation = tweet.User.Location;
tempStatus.UserName = tweet.User.Name;
tempStatus.UserTweetCount = tweet.User.StatusesCount;
reTweets.Add(tempStatus);
}
});
return reTweets;
}
The issue is when I called the method
var authorizer = new SingleUserAuthorizer
{
CredentialStore = new InMemoryCredentialStore
{
ConsumerKey = SM.Default.Consumer_key2.ToString(),
ConsumerSecret = SM.Default.Consumer_secret2.ToString(),
OAuthToken = SM.Default.Access_token2.ToString(),
OAuthTokenSecret = SM.Default.Access_secret2.ToString()
}
};
TwitterContext twitterCtx = new TwitterContext(authorizer);
Task<List<myTwitterStatus>> task = Task<List<myTwitterStatus>>.Factory.StartNew(() => getRetweets(ulong.Parse(tweet.StringId), twitterCtx).Result);
task.Wait();
List<myTwitterStatus> tempList = task.Result.ToList<myTwitterStatus>();
foreach (var ret in tempList)
{
un = file.RemoveSpecialCharacters(ret.UserName);
sn = file.RemoveSpecialCharacters(ret.ScreenName);
tweets.AppendLine(account + "," + getWE(ret.createdAt) + "," + Text + "," + un + "," + sn + "," + ret.createdAt + "," +
file.RemoveSpecialCharacters(ret.UserLocation) + ",,,1,," + ret.UserTweetCount + "," +
ret.RetweetCount + "," + ret.FavoriteCount + "," + ret.UserFollowers);
I would appreciate any kind of assistance about it, I have no idea how to solve it.
Can you add a try/catch so see what the inner exception is.
try
{
//Perform your operation here
}
catch (AggregateException aex)
{
//Dive into inner exception
}
Thanks to all for the help, I activate the breakpoints for the specific exception and an additional validation was added, the issue was not in the async process, it was because it was trying to handle a null as an string, to hendle this error this line was modified sn = file.RemoveSpecialCharacters(ret.ScreenName ?? string.Empty);
The full code is below:
private void getRetweets(TwitterStatus tweet)
{
Text = file.RemoveSpecialCharacters(tweet.Text);
tweetID = tweet.StringId;
#region Get retweets
RetweetsOptions retOpt = new RetweetsOptions();
if (int.Parse(tweet.RetweetCountString.ToString()) > 1)
retOpt.Count = int.Parse(tweet.RetweetCountString.ToString()) + 1;
else
retOpt.Count = 1;
String errorText = "";
DateTime fromDate, toDate;
if (radDate.Checked == true)
{
fromDate = dtpFrom.Value;
toDate = dtpTo.Value;
}
else
{
fromDate = tweet.CreatedDate;
toDate = DateTime.Now;
}
TwitterResponse<TwitterStatusCollection> retweet = null;
if (int.Parse(tweet.RetweetCountString.ToString()) > 100)
{
var authorizer = new SingleUserAuthorizer
{
CredentialStore = new InMemoryCredentialStore
{
ConsumerKey = SM.Default.Consumer_key2.ToString(),
ConsumerSecret = SM.Default.Consumer_secret2.ToString(),
OAuthToken = SM.Default.Access_token2.ToString(),
OAuthTokenSecret = SM.Default.Access_secret2.ToString()
}
};
TwitterContext twitterCtx = new TwitterContext(authorizer);
//HELPER: https://www.youtube.com/watch?v=IONqMWGn9-w
try
{
Task<List<myTwitterStatus>> task = null;
Parallel.Invoke(
() =>
{
task = getRetweets(ulong.Parse(tweet.StringId), twitterCtx);
while (!task.IsCompleted)
{
Thread.Sleep(250);
}
});
List<myTwitterStatus> tempList = task.Result.ToList<myTwitterStatus>();
foreach (var ret in tempList)
{
un = file.RemoveSpecialCharacters(ret.UserName);
sn = file.RemoveSpecialCharacters(ret.ScreenName ?? string.Empty);
tweets.AppendLine(account + "," + getWE(ret.createdAt) + "," + Text + "," + un + "," + sn + "," + ret.createdAt + "," +
file.RemoveSpecialCharacters(ret.UserLocation) + ",,,1,," + ret.UserTweetCount + "," +
ret.RetweetCount + "," + ret.FavoriteCount + "," + ret.UserFollowers);
}
}catch(Exception ex){
Console.WriteLine("Error: " + ex.Message+ Environment.NewLine + ex.StackTrace);
}
return;
}
else
retweet= TwitterStatus.Retweets(tokensRet, Decimal.Parse(tweet.Id.ToString()), retOpt);
if (retweet.Result.ToString() == "Success" && retweet.ResponseObject.Count > 0 && retweet!=null)
{
int retPages = int.Parse(tweet.RetweetCountString.ToString()) + 1 / 20;
for (int page = 0; page <= retPages; page++)
{
try
{
//List<TwitterStatus> retList = new List<TwitterStatus>(retweet.ResponseObject.Page = page);
retweet.ResponseObject.Page = page;
List<TwitterStatus> retList = retweet.ResponseObject.ToList<TwitterStatus>();
foreach (var ret in retList)
{
try
{
if (ret.CreatedDate.CompareTo(fromDate) >= 0 && ret.CreatedDate.CompareTo(toDate) <= 0)
{
#region Get UN Sync
getUN(ret, ref un, ref sn);
#endregion
tweets.AppendLine(account + "," + getWE(ret.CreatedDate) + "," + Text + "," + un + "," + sn + "," + ret.CreatedDate + "," +
file.RemoveSpecialCharacters(ret.User.Location.ToString()) + ",,,1,," + ret.User.NumberOfStatuses.ToString() + "," +
ret.RetweetCount + "," + ret.User.NumberOfFavorites.ToString() + "," + ret.User.NumberOfFollowers.ToString());
}
else if (tweet.CreatedDate.CompareTo(toDate) <= 0)//if the tweet's created date is lower than the from's date, exits the loop
break;
}
catch (NullReferenceException ex)
{
errorText = ex.Source + Environment.NewLine + ex.StackTrace;
continue;
}
}
}
catch (Exception ex)
{
errorText = ex.Source + Environment.NewLine + ex.StackTrace;
//MessageBox.Show(ex.Message + Environment.NewLine + "Rate Limit was reached!" + Environment.NewLine +
// "Wait an hour or try a shorter date range", "Rate Limit Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
else if (error == false && retweet.Result.ToString() != "Success")
{
errorText = retweet.Result.ToString();
MessageBox.Show("Retweets: Something went wrong!" + Environment.NewLine + errorText, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
error = true;
}
#endregion
}

How can I make 2 different elements in a SVG group have different drag behaviours?

I have a group of 2 elements in d3.js. The javascript code is:
function onDragDrop(dragHandler, dropHandler) {
var drag = d3.behavior.drag();
drag.on("drag", dragHandler).on("dragstart", startHandler).on("dragend", dropHandler);
return drag;
}
function startHandler(d) {
d3.select('body').style('cursor', 'move');
d.moveX = d.x;
d.moveY = d.y;
console.log(d.moveX + "," + d.moveY);
}
function dropHandler(d) {
d3.selectAll(".temp").remove();
d3.select('body').style('cursor', 'default');
}
function dragmove(d) {
d.moveX += d3.event.dx;
d.moveY += d3.event.dy;
d.x = Math.round(d.moveX / 50) * 50;
d.y = Math.round(d.moveY / 50) * 50;
d3.select(this).attr("transform", "translate(" + d.x + "," + d.y + ")");
document.getElementById('lblCoord').innerHTML = "[" + (d.x) + "," + (d.y) + "]";
}
function mouseenter(d) {
document.getElementById('lblCoord').innerHTML = "[" + (d.x) + "," + (d.y) + "]";
}
function Otherdragmove(d) {
d.moveX += d3.event.dx;
d.moveY += d3.event.dy;
d3.selectAll(".temp").remove();
d3.selectAll("svg").append("line").attr("x1", d3.event.dx + 60).attr("y1", d3.event.dy + 10).attr("x2", d.moveX).attr("y2", d.moveY).attr("stroke", "black").attr("stroke-width", 2).attr("class", "temp");
}
var DrawCircle = function(container) {
var d = [{ x: 0, y: 0, moveX: 0, moveY: 0 }];
var circle = container.data(d).append("g").attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })//.call(onDragDrop(dragmove, dropHandler)).on("mouseenter", mouseenter);
circle.append("ellipse").attr("cx", 20).attr("cy", 20).attr("rx", 20).attr("ry", 20).attr("stroke", "#FF0000").attr("stroke-width", 1).attr("fill", "#FF0000");
circle.append("ellipse").attr("cx", 60).attr("cy", 20).attr("rx", 20).attr("ry", 20).attr("stroke", "#00FF00").attr("stroke-width", 1).attr("fill", "#00FF00").call(onDragDrop(Otherdragmove, dropHandler));
}
d3.selectAll("svg").remove();
var svgContainer = d3.select("#MainDiv").append("svg").attr("width", 800).attr("height", 600).attr("version", 1.1).attr("xmlns", "http://www.w3.org/2000/svg").attr("viewBox", "-40, -40, 1600, 1200");
DrawCircle(svgContainer);
I have created a fiddle here: http://jsfiddle.net/oqu8j072/6/
I want it so that if I click and drag the red circle the group of 2 circles can be moved. I also want that if I click and drag on the green circle a different action should occur, in this example it draws a line.
I can't get both to happen in the same instance.
As the code is, it generates the line being dragged from the green circle. If I uncomment the code on this line:
var circle = container.data(d).append("g").attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })//.call(onDragDrop(dragmove, dropHandler)).on("mouseenter", mouseenter);
Then clicking and dragging on any of the two circles will move them.
How is it possible to achieve the effect I want?
The solution is only very little additional code.
In the start handler simply put the line:
d3.event.sourceEvent.stopPropagation();
I have a fiddle here:
http://fiddle.jshell.net/Lytuno8y/1/

CRM 2011 adding a dialog button to the ribbon

I have just created a Ribbon button and pointed it to a webresource js. However my code doesnt seem to launch my dialog. Any pointers would be very much appreciated.
function TestRibbon(sLeadID)
{
var DialogGUID = "6D128DF9-F51A-4D97-912D-C5A1FA4CEAFB";
var serverUrl = "https://xxx.xxx.co.uk:444/";
serverUrl = serverUrl + "cs/dialog/rundialog.aspx?DialogId=" + "{" + DialogGUID + "}" + "&EntityName=lead&ObjectId=" + sLeadID;
PopupCenter(serverUrl, "mywindow", 400, 400);
window.location.reload(true);
}
function PopupCenter(pageURL, title, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
var targetWin = window.showModalDialog(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
Your server URL is static. Use this code that generates URL dynamically, also with new release we figured out that URL with status=no is not opening correctly, so we started to use status: no and it became to work as expected. See the following code:
function TestRibbon(sLeadID) {
var DialogGUID = "6D128DF9-F51A-4D97-912D-C5A1FA4CEAFB";
// Get the CRM URL
var serverUrl = Xrm.Page.context.getServerUrl();
// Cater for URL differences between onpremise and online
if (serverUrl.match(/\/$/)) {
serverUrl = serverUrl.substring(0, serverUrl.length - 1);
}
serverUrl = serverUrl + "/cs/dialog/rundialog.aspx?DialogId=" + "%7b" + DialogGUID + "%7d" + "&EntityName=lead&ObjectId=" + sLeadID;
PopupCenter(serverUrl, "mywindow", 600, 500);
window.location.reload();
}
function PopupCenter(pageUrl, title, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
window.showModalDialog(pageUrl, title, 'status:no; scroll:no; resizable:no; dialogWidth: ' + w + 'px; dialogHeight: ' + h + 'px; dialogTop: ' + top + 'px; dialogLeft: ' + left + 'px;');
}
During investigation found this post for Ribbon Workbench for CRM 2011 Solution

how to block nodejs for result of query

I am pretty new to nodejs.
What I want my code to do it to query a database a number of times, collect data from all the queries in one variable and then use it somewhere.
But I guess nodejs instead of waiting for the result of the queries, execute without blocking.
This is what I think is happening. Sorry if I am wrong.
for (var i = step_min; i < (step_max); i += step) {
query = 'select count(' + colName + ') as num_count from ' +
rows[0].tablename + ' where ' + 'dictionaryid=' +
rows[0].dictionaryid + ' and ' + colName + ' between ' + i +
' and ' + (i + step);
connection.query(query, function(err, rows1, fields) {
if (err) {
console.log(err);
throw err;
}
try {
console.log("$$$$$$$$$$$$$$$ pushed : "+ rows1[0].num_count);
contents.push(rows1[0].num_count);
console.log('contents : '+ contents+'\n');
} catch (e) {
if (e instanceof SyntaxError) {
console.log("Syntax Error for input function");
}
}
});
console.log("##################### " + query + "\n");
console.log('contents : '+ contents+'\n');
}
Any advice either on how to block nodejs till the result from query is obtained or otherwise a way to restructure my code ?
Thanks in advance.
You are correct that it is not waiting for your queries before executing. You can look at the node-mysql-queues module which you can use to queue queries, and execute the given callback after all have executed (it will also allow you do perform transactions)
Another (hack) approach is to set a counter of the number of queries you are executing. In the callback of each transaction save the result into your return object and decrement the counter. If it is <= 0 then all your queries have completed, and you can execute your main callback with the return object.
Also, watch out for SQL injection.
try this:
https://github.com/luciotato/waitfor
your code with wait.for:
for (var i = step_min; i < (step_max); i += step) {
query = 'select count(' + colName + ') as num_count from ' +
rows[0].tablename + ' where ' + 'dictionaryid=' +
rows[0].dictionaryid + ' and ' + colName + ' between ' + i +
' and ' + (i + step);
var rows1 = wait.forMethod(connection,"query",query); //waits until callback
console.log("$$$$$$$$$$$$$$$ pushed : "+ rows1[0].num_count);
contents.push(rows1[0].num_count);
}
console.log("##################### " + query + "\n");
console.log('contents : '+ contents+'\n');
} catch (e) {
if (e instanceof SyntaxError) {
console.log("Syntax Error for input function");
}
....
}
Doing something like below could be a work around.
//Its just a test code whatever came to mind first so I'll tune it later...
var contents = [];
var lock = 0;
for (var i = step_min; i < (step_max + step); i += step) {
lock++;
}
for (var i = step_min; i < (step_max + step); i += step) {
query = 'select count(' + colName + ') as num_count from ' + rows[0].tablename + ' where ' + 'dictionaryid=' + rows[0].dictionaryid + ' and ' + colName + ' between ' + i + ' and ' + (i + step);
connection.query(query, function(err, rows1, fields) {
if (err) {
console.log(err);
throw err;
}
try {
console.log("$$$$$$$$$$$$$$$ pushed : " + rows1[0].num_count);
contents.push(rows1[0].num_count);
console.log('contents : ' + contents + '\n');
} catch (e) {
if (e instanceof SyntaxError) {
console.log("Syntax Error for input function");
}
}
lock--;
if (lock == 0) {
queryDone();
}
});
}
function queryDone() {
console.log("##################### " + query + "\n");
console.log('contents : ' + contents + '\n');
var id = obj.exptID + '.' + obj.exptITR + '.' + obj.nodeID + '.' + obj.resourceName + '.' + colName;
serie = {
name: colName,
data: contents,
id: id
};
console.log("--------------------\n " + step_max + "\n" + step_min + "\n------------------------\n");
}
The approach is to fire a function when all queries are done as Nick said...

Resources