xAxes -= 9;//多加了一次所以减9
if (points.Count > 0)
{
GraphicsPath path = new GraphicsPath();
path.AddCurve(points.ToArray());
PointF[] pointfs = path.PathPoints;
points.Clear();
for (int i = 0; i <= xAxes; ++i)
{
bool found = false;
int x = i;
int j = 0;
int y = int.MinValue;
while (j < pointfs.Length)
{
float xValue = pointfs[j].X;
float iValue = Convert.ToSingle(i);
if (xValue.Equals(iValue))
{
y = (int)Math.Round(pointfs[j].Y, MidpointRounding.AwayFromZero);
found = true;
break;
}
else if (xValue > iValue)
break;
++j;
}
if (!found)
{
float x1 = pointfs[j - 1].X;
float y1 = pointfs[j - 1].Y;
float x2 = pointfs[j].X;
float y2 = pointfs[j].Y;
float result = (y1 * (x2 - x) + y2 * (x - x1)) / (x2 - x1);
y = (int)Math.Round(result, MidpointRounding.AwayFromZero);
System.Drawing.Point pt = new Point();
pt.X = x;
pt.Y = y;
points.Add(pt);
DataTable dt = table.Clone();
DateTime mdate = beginTime;
for (int i = 0; i < points.Count; ++i)
{
DataRow row = dt.NewRow();
row["MDate"] = mdate;
row["TideHeight"] = points[i].Y / 100.0f;
row["StationCode"] = stationNO;
dt.Rows.Add(row);
mdate = mdate.AddSeconds(UINTTIME);
return dt;
}
}
5、查询有实测数据的潮位站点数据
public DataTable GetHaveDataTideData_v2(DateTime tfNewDate)
{
IDatabaseExec dbexec = DBManager.GetDBExec(Setting.Sql_Station);
StringBuilder sb = new StringBuilder();
sb.Append(" SELECT DISTINCT B_Station_HLValue.StationName AS 站点名 , ");
sb.Append(" B_Station_HLValue.StationNO AS 站点编号 , B_Station_HLValue.Longitude AS 经度 ,B_Station_HLValue.Latitude AS 纬度 ,floor(B_Station_HLValue.HL_WarningLine) AS [警戒水位(黄零)] , ");
sb.Append(" floor((B_ActualSeaTideData_min.TideHeight - B_Station_HLValue.HL_value*0.01)*100) AS 实测潮位, ");
sb.Append(" floor(B_SeatideData.TideHeight * 100) AS 预报潮位, ");
sb.Append(" floor((B_ActualSeaTideData_min.TideHeight - B_Station_HLValue.HL_value*0.01 - B_SeatideData.TideHeight)*100) ");
sb.Append(" AS 增水, B_Station_HLValue.Type as 潮位站类型 ");
sb.Append(" FROM ( ");
sb.Append(" select B_Station_HLValue.StationName,B_Station_HLValue.StationNO,B_Station_HLValue.HL_value,B_Station_HLValue.Longitude,B_Station_HLValue.Latitude,B_Station_HLValue.HL_WarningLine, B_Station_HLValue.Type ");
sb.Append(" from ( select Code as StationNO, Name as StationName, ShiftValue as HL_value, lon as Longitude, lat as Latitude , HL_WarningLevel as HL_WarningLine, Type as Type ");
sb.Append(" from Strongsoft_OrganizationStuff.dbo.B_TideStation ) B_Station_HLValue");
sb.Append(" ) B_Station_HLValue LEFT OUTER JOIN ");
sb.Append(" B_ActualSeaTideData_min ON ");
sb.Append(" B_Station_HLValue.StationNO = B_ActualSeaTideData_min.StationNO AND ");
sb.Append(" B_ActualSeaTideData_min.MDate = CAST('" + tfNewDate + "' AS datetime) ");
sb.Append(" LEFT OUTER JOIN ");
sb.Append(" B_SeatideData ON B_SeatideData.StationCode = B_Station_HLValue.StationNO AND ");
sb.Append(" B_SeatideData.MDate = CAST('" + tfNewDate + "' AS datetime)
<< 上一页 [11] [12] [13] [14] [15] 下一页