/// <summary> /// 设置为重点监控 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void button_click4(object sender, RoutedEventArgs args) { string StrGuid = Guid.NewGuid().ToString(); XmlNode nodepar = XmlNodeManage.GetDocumentNode("", StrGuid, "KeymonitorInfo"); XmlNodeManage.SetSubValue(nodepar, "Guid", StrGuid); XmlNodeManage.SetSubValue(nodepar, "BoatGuid", PopupGuidFlag); FunSetData_CallBack("test", TaskGuid, StrGuid, "KeymonitorInfo", nodepar); }
/// <summary> /// 轨迹回放 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> void button_click1(object sender, RoutedEventArgs args) { if (!string.IsNullOrWhiteSpace(PopupGuidFlag)) { MessageBox.Show("当前点选的物标为:" + PopupGuidFlag); XmlNode node = XmlNodeManage.GetDocumentNode(TaskGuid, PopupGuidFlag, "TrajectoryPlayback "); XmlNodeManage.SetSubValue(node, "BoatGuid", PopupGuidFlag); FunSetData_CallBack("test", TaskGuid, PopupGuidFlag, "TrajectoryPlayback", node); } }
void SetData_CallBack(string UserID, string TaskGuid, string DataGuid, string DataType, string xmlDate) { XmlNode node = LoadXmlToNode(xmlDate);//先转换成Node MessageBox.Show(node.OuterXml); string strGuid = ""; try { strGuid = XmlNodeManage.GetSubValue(node, "@DataGuid"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); strGuid = SetPointGuid; } switch (DataType.ToLower()) { case "setcoordinate": //标注物标 #region 标注物标 //标注这个点位(给一个小红旗) #region 拼接出一个画点的数据规范 XmlNode DrawNode = XmlNodeManage.GetDocumentNode(TaskGuid, strGuid, "DrawPoint"); XmlNodeManage.SetSubValue(DrawNode, "LName", "TEXT", "Top"); XmlNodeManage.SetSubValue(DrawNode, "AutoZoom", "TEXT", 0); XmlNodeManage.SetSubValue(DrawNode, "AutoPan", "TEXT", 0); XmlNodeManage.SetSubValue(DrawNode, "Transpatecy", 0.8); XmlNodeManage.SetSubValue(DrawNode, "IsCluster", 0); XmlNode cnode = XmlNodeManage.CreateNode("PData"); XmlNodeManage.SetSubValue(cnode, "Guid", strGuid); // <Guid Type=”GUID”>船舶ID</Guid> //XmlNodeManage.SetSubValue(cnode, "BoatGuid", XmlNodeManage.GetSubValue(list, "BoatGuid")); // <Label Type = "TEXT">点位显示名称</Label> XmlNodeManage.SetSubValue(cnode, "Label", "point"); // <LON Type = "SINGLE">经度</LON> string sLon = node.SelectSingleNode("//LON").SafeInnerText(); //string s = XmlNodeManage.GetSubValue(node, "LON"); XmlNodeManage.SetSubValue(cnode, "LON", sLon); // <LAT Type = "SINGLE">纬度</LAT> string sLat = node.SelectSingleNode("//LAT").SafeInnerText(); XmlNodeManage.SetSubValue(cnode, "LAT", sLat); // <Time Type = "DATE">点位时间(可选)</Time> //MessageBox.Show(XmlNodeManage.GetSubValue(list, "TimeStamp")); DateTime dtNode = DateTime.Now; XmlNodeManage.SetSubValue(cnode, "Time", dtNode); // <Speed Type = "DOUBLE">速度(可选)</Speed> //XmlNodeManage.SetSubValue(cnode, "Speed", XmlNodeManage.GetSubValue(list, "BoatSOG")); XmlNodeManage.SetSubValue(cnode, "Speed", 0); // <Direction Type = "LONG">方向</Direction> XmlNodeManage.SetSubValue(cnode, "Direction", ""); // <Status Type=”TEXT”>状态</Status> XmlNodeManage.SetSubValue(cnode, "Status", ""); // <Remark Type = "TEXT">备注(中文,可选)</Remark> XmlNodeManage.SetSubValue(cnode, "Remark", ""); XmlNodeManage.SetSubValue(cnode, "DetailURL", " "); XmlNodeManage.SetSubValue(cnode, "IsLabel", 1); XmlNodeManage.SetSubValue(cnode, "Angle", 0); String StartupPath = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); // XmlNodeManage.SetSubValue(cnode, "Icon", StartupPath+"\\Falg.ico"); XmlNodeManage.SetSubValue(cnode, "Icon", "1012"); DrawNode.AppendChild(cnode); //MessageBox.Show(DrawNode.OuterXml); gis.SetData("test", TaskGuid, strGuid, "DrawPoint", DrawNode.OuterXml); #endregion //将该信息透传给外部 // FunSetData_CallBack(UserID, TaskGuid, SetPointGuid, DataType, node); #endregion return; } //MessageBox.Show(xmlDate); // FunSetData_CallBack(UserID, TaskGuid, DataGuid, DataType, node); }