Skip to content

Commit

Permalink
Update cnlName
Browse files Browse the repository at this point in the history
  • Loading branch information
greenfoxx committed Apr 20, 2020
1 parent 66df46b commit 017e012
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,6 @@ public IEnumerable<TrendData> GetDataForGrafana([FromBody]GrafanaArg grafanaArg)
}
else
{
string cnlName = "";
InCnlProps inCnlProps = dataAccess.GetCnlProps(cnlNum);
if (inCnlProps != null)
cnlName = inCnlProps.CnlName;

foreach (DateTime date in EachDay (grafanaArg.range.from, grafanaArg.range.to))
{
Trend trend = GetTrend(date, cnlNum, isHour);
Expand All @@ -250,7 +245,7 @@ public IEnumerable<TrendData> GetDataForGrafana([FromBody]GrafanaArg grafanaArg)
{
long ofsValP = GetUnixTimeMs(trend.Points[i1 - 1].DateTime);

if ((ofsVal - ofsValP) > timeCoef * 60000)
if (ofsVal - ofsValP > timeCoef * 60000)
{
points.Add(new double?[] { null, ofsValP + timeCoef * 60000 });
}
Expand All @@ -272,6 +267,9 @@ public IEnumerable<TrendData> GetDataForGrafana([FromBody]GrafanaArg grafanaArg)
}
}

InCnlProps inCnlProps = dataAccess.GetCnlProps(cnlNum);
string cnlName = inCnlProps == null ? "" : inCnlProps.CnlName;

trends[i] = new TrendData { target = "[" + cnlNum + "] " + cnlName, datapoints = points };
Log.WriteAction("Channel data received " + cnlNum);
}
Expand Down

0 comments on commit 017e012

Please sign in to comment.