Ejemplo n.º 1
0
        public string API_GetShipsInfoReturnJsonStringByTimeOrRect(bool bGetAllShip, int iStartPos, int iGetShipCount, bool bCheckTime, string strDateTime, bool bCheckRect, int iRectMinGeoX, int iRectMaxGeoX, int iRectMinGeoY, int iRectMaxGeoY)
        {
            if (iStartPos < 0)
            {
                iStartPos = 0;
            }
            string strResult = SHIP_MAN.GetShipsInfoReturnJsonStringByTimeOrRect(bGetAllShip, iStartPos, iGetShipCount, bCheckTime, strDateTime, bCheckRect, iRectMinGeoX, iRectMaxGeoX, iRectMinGeoY, iRectMaxGeoY);

            return(strResult);
        }
Ejemplo n.º 2
0
        public string API_GetShipsInfoReturnJsonStringByTime(bool bGetAllShip, int iStartPos, int iGetShipCount, string strDateTime)
        {
            if (iStartPos < 0)
            {
                iStartPos = 0;
            }
            string strResult = SHIP_MAN.GetShipsInfoReturnJsonStringByTime(bGetAllShip, iStartPos, iGetShipCount, strDateTime);

            return(strResult);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 添加船舶
        /// </summary>
        /// <param name="strCurShipInfos">船舶信息字符串,格式为:shipid,mmsi,name,geoX,geoY,course,speed,state,time_....</param>
        /// <returns>返回值:true=添加成功,false=添加失败</returns>
        public static bool AddShipsByStringInfos(string strCurShipInfos)
        {
            bool bResult = false;

            if (!strCurShipInfos.Equals(""))
            {
                string[] arrShipInfoValue = strCurShipInfos.Split(new char[1] {
                    '_'
                });;
                int iCurAddShipCount = arrShipInfoValue.Length;

                for (int i = 0; i < iCurAddShipCount; i++)
                {
                    string[] arrCurShipAtrr = arrShipInfoValue[i].Split(new char[1] {
                        ','
                    });
                    int      iCurShipAtrrCount = arrCurShipAtrr.Length;
                    ShipInfo curShipInfo       = new ShipInfo();

                    if (iCurShipAtrrCount > 8)
                    {
                        curShipInfo.iShipId     = Convert.ToInt32(arrCurShipAtrr[0]);    //shipid
                        curShipInfo.iShipMmsi   = Convert.ToInt32(arrCurShipAtrr[1]);    //mmsi;
                        curShipInfo.strShipName = arrCurShipAtrr[2].ToString();          //name
                        curShipInfo.iShipGeoX   = Convert.ToInt32(arrCurShipAtrr[3]);    //geoX
                        curShipInfo.iShipGeoY   = Convert.ToInt32(arrCurShipAtrr[4]);    //geoY
                        curShipInfo.dShipCourse = Convert.ToDouble(arrCurShipAtrr[5]);   //course
                        curShipInfo.dShipSpeed  = Convert.ToDouble(arrCurShipAtrr[6]);   //speed
                        curShipInfo.iShipState  = Convert.ToInt32(arrCurShipAtrr[7]);    //state
                        curShipInfo.dtInfoTime  = Convert.ToDateTime(arrCurShipAtrr[8]); //time

                        SHIP_MAN.AddOneShip(curShipInfo);
                        bResult = true;
                    }
                }
            }

            return(bResult);
        }
Ejemplo n.º 4
0
        public bool API_AddShipsByStringInfos(string strCurShipInfos)
        {
            bool bResult = SHIP_MAN.AddShipsByStringInfos(strCurShipInfos);

            return(bResult);
        }