Beispiel #1
0
 private void ReloadData()
 {
     //初始化MissionList
     missionList = FunClass.GetMissionList(IP + UrlOfGetMissionList);
     if (missionList == null)
     {
         MessageBox.Show("网络异常or任务列表数据异常or任务为空");
         return;
     }
     //加载第一个mission的stationList
     stationList = FunClass.GetStationData(IP + UrlOfChartRead, missionList[0]);
     if (stationList == null)
     {
         MessageBox.Show("网络异常or站点列表数据异常or站点为空");
         return;
     }
     //赋予当前站点
     NowStation = stationList[0];
     //初始化datagridview,加载站点信息
     RefreshDataGridView();
     //下拉框选择任务初始化
     comboBox1.DataSource    = missionList;
     comboBox1.ValueMember   = "missionID";
     comboBox1.DisplayMember = "missionName";
     pictureForm.ChangePicture(FunClass.GetPicture(IP + UrlOfMeteoPicture, NowStation.photoHead, 1, NowMission.forecastFilesHead), NowStation);
 }
Beispiel #2
0
 /// <summary>
 /// 任务下拉框进行选择时的操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     selectedID = comboBox1.SelectedIndex;
     NowMission = missionList[selectedID];
     //加载相应stationlist
     stationList = FunClass.GetStationData(IP + UrlOfChartRead, NowMission);
     if (stationList == null)
     {
         MessageBox.Show("网络异常or站点列表数据异常or站点为空");
         ReloadData();
         return;
     }
     //赋予当前站点
     NowStation = stationList[0];
     RefreshDataGridView();
     pictureForm.ChangePicture(FunClass.GetPicture(IP + UrlOfMeteoPicture, NowStation.photoHead, 1, NowMission.forecastFilesHead), NowStation);
 }