private void PaintRain(string strSTCD,Point point)
{
double P1 = 0;
double P2 = 0;
clsACCP objACCP = new clsACCP();
DateTime TMe,TMnow;
TMnow = System.DateTime.Now;
TMe = Convert.ToDateTime(TMnow.Year.ToString() + "-" + TMnow.Month.ToString() + "-" + TMnow.Day.ToString() + " 08:00:00");
P1 = objACCP.getDayP(strSTCD, TMe);
P2 = objACCP.getACCP(strSTCD, TMe, TMnow);
if (P1 == 0 && P2 == 0)
{
}
else
{
double Tmep1 = 0;
if (P1 > P2)
{
Tmep1 = P1;
}
else
{
Tmep1 = P2;
}
int RectangleW = 40;
int RectangleH = 50;
int RectangleX = point.X-RectangleW-3;
int RectangleY = point.Y-RectangleH-3;
int Yunit = 0;
Yunit = Convert.ToInt32(RectangleH / Tmep1);
Pen MyPen = new Pen(Color.Black, 2);
G.DrawLine(MyPen, Convert.ToInt32(RectangleX), Convert.ToInt32(RectangleY + RectangleH), Convert.ToInt32(RectangleX + RectangleW ), Convert.ToInt32(RectangleY + RectangleH));
myBrush = new SolidBrush(Color.Blue);
G.FillRectangle(myBrush, Convert.ToInt32(RectangleX), Convert.ToInt32(RectangleY - (P1 * Yunit) + RectangleH), Convert.ToInt32(RectangleW / 2), Convert.ToInt32(P1 * Yunit));
myBrush = new SolidBrush(Color.Red);
G.FillRectangle(myBrush, Convert.ToInt32(RectangleX + RectangleW / 2 + 1), Convert.ToInt32(RectangleY - (P2 * Yunit) + RectangleH), Convert.ToInt32(RectangleW / 2 - 1), Convert.ToInt32(P2 * Yunit));
Point objPoint = new Point();
Font drawFont = new Font("宋体", 10);
objPoint.X = Convert.ToInt32(RectangleX);
objPoint.Y = Convert.ToInt32(RectangleY - (P1 * Yunit) + RectangleH - 15);
G.DrawString(P1.ToString(), drawFont, myBrush, objPoint);
objPoint.X = Convert.ToInt32(RectangleX + RectangleW / 2 + 1);
objPoint.Y = Convert.ToInt32(RectangleY - (P2 * Yunit) + RectangleH - 15);
G.DrawString(P2.ToString(), drawFont, myBrush, objPoint);
}
}