private void sureClick(object sender, RoutedEventArgs e)//三次循环存储圈层 { try { float a = (float)double.Parse(alarm1.Text); float b = (float)double.Parse(alarm2.Text); float c = (float)double.Parse(alarm3.Text); if (a > rule1.Max || a < rule1.Min || b > rule2.Max || b < rule2.Min || c > rule3.Max || c < rule3.Min) { MessageBoxX.Show("提示", "数据超出范围!"); } else if (a < b && b < c) { //color. MonitoringX.updataProtectZoneBack("201", "驱逐区", alarm1.Text, color1.SelectedColorText); MonitoringX.updataProtectZoneBack("202", "警戒区", alarm2.Text, color2.SelectedColorText); MonitoringX.updataProtectZoneBack("203", "预警区", alarm3.Text, color3.SelectedColorText); MainWindow.opeation.OptionName = "圈层信息修改"; MainWindow.opeation.LogType = 2; MainWindow.opeation.OptionTime = GetTime(GetTimeStamp().ToString()); MainWindow.OperationLogData.WriteOperationLog(MainWindow.opeation); //操作日志 this.Close(); //关闭窗口 } else { MessageBoxX.Show("提示", "半径值需要递增!"); } } catch (Exception ex) { MessageBoxX.Show("警告", "输入数据有误!请重新输入!"); } }
void longFocusPointRight(object sender, System.Windows.Forms.MouseEventArgs e)//追踪(开关) { int a = GetTimeStamp(); MonitoringX.photoClose(a); //this.Close();不关闭窗口 videoEndTime = (long)GetTimeStamp(); TrackEvent smtp = new TrackEvent(); Application.Current.MainWindow = smtp; smtp.ShowDialog(); }
private void captureClick(object sender, RoutedEventArgs e) { MonitoringX.captureImages(); //截取长焦视频,保留到指定路径 MonitoringX.eventCaputureTime = GetTimeStamp(); //获取截图时间 // CaptureImages._mmsi = MonitoringX.linkageTarget.TargetMMSI; 该为由link_auto直接控制 CaptureImages w = new CaptureImages();//打开新窗口,展示图片 w.Closed += CaptureClosed; System.Windows.Application.Current.MainWindow = w; // this.Visibility = Visibility.Collapsed;//隐藏当前窗口 w.Topmost = true; Thread.Sleep(1000 * 1); w.ShowDialog(); }
void longFocusPointLeft(object sender, System.Windows.Forms.MouseEventArgs e)//追踪(开关) { if (MonitoringX.deviceControlState == 0) { System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { MessageBoxX.Show("提示", "无光电控制权"); } )); } else { short x = (short)e.Location.X; short y = (short)e.Location.Y; int a = GetTimeStamp(); MonitoringX.photoPoint(a, x, y); startime = GetTime(GetTimeStamp().ToString()); } }
private void ConfirmClick(object sender, RoutedEventArgs e) { if (startTime.Text == null || endTime.Text == null) { MessageBoxX.Show("提示", "时间不能为空!"); } else if (target.Text == "") { MessageBoxX.Show("提示", "查询目标不能为空!"); } else { System.DateTime time = Convert.ToDateTime(startTime.Text); //string转datatime(star) start = (long)GetTimeStamp(time); //datatime时间戳(star) System.DateTime timer = Convert.ToDateTime(endTime.Text); //string转datatime(end) end = (long)GetTimeStamp(timer); //datatime时间戳(end) if (trackType == "radar1") { targetInfor = (int)double.Parse(target.Text); MonitoringX.radarTrackBack(start, end, targetInfor, 1);//调用雷达航迹查询 } else if (trackType == "radar2") { targetInfor = (int)double.Parse(target.Text); MonitoringX.radarTrackBack(start, end, targetInfor, 2);//调用雷达航迹查询 } else if (trackType == "AIS") { targetInfor = (int)double.Parse(target.Text); MonitoringX.AISTrackBack(start, end, targetInfor);//调用AIS航迹查询 } else if (trackType == "Mix") { targetInfor = (int)double.Parse(target.Text); MonitoringX.mixTrackBack(start, end, targetInfor);//调用融合航迹查询 } this.Close(); } }
private void comfirmClick(object sender, RoutedEventArgs e)//确定 { try { if (int.Parse(Azimuth1.Text) > rule1.Max || int.Parse(Azimuth1.Text) < rule1.Min || int.Parse(Pitch1.Text) > rule2.Max || int.Parse(Pitch1.Text) < rule2.Min || int.Parse(Azimuth2.Text) > rule3.Max || int.Parse(Azimuth2.Text) < rule3.Min || int.Parse(Pitch2.Text) > rule4.Max || int.Parse(Pitch2.Text) < rule4.Min || float.Parse(Height.Text) > rule5.Max || float.Parse(Height.Text) < rule5.Min) { MessageBoxX.Show("提示", "数据超出范围!"); } else { MonitoringX.azimuthgyroDriveDriftCompensate(int.Parse(Azimuth1.Text)); MonitoringX.pitchgyroDriveDriftCompensate(int.Parse(Pitch1.Text)); MonitoringX.AzimuthDriveDriftCompensate(int.Parse(Azimuth2.Text)); MonitoringX.PitchDriveDriftCompensate(int.Parse(Pitch2.Text)); PhotoelectricParas data = new PhotoelectricParas(); data.AzimuthDriverCompensation = int.Parse(Azimuth2.Text); data.PitchDriveCompensation = int.Parse(Pitch2.Text); data.AzimuthGyroCompensation = int.Parse(Azimuth1.Text); data.PitchgGyroCompensation = int.Parse(Pitch1.Text); data.SetHeight = float.Parse(Height.Text); MonitoringX.photoHeight = float.Parse(Height.Text); photo.UpdatePhotoelectricPara(data); this.Close(); } } catch (Exception ex) { MessageBoxX.Show("警告", "存在非法或为空的数据!"); } }
private void yesClick(object sender, RoutedEventArgs e) { try { if ( float.Parse(xyzParameter.Text) > rule1.Max || float.Parse(xyzParameter.Text) < rule1.Min || float.Parse(abrDistance.Text) > rule2.Max || float.Parse(abrDistance.Text) < rule2.Min || float.Parse(abrAngle.Text) > rule3.Max || float.Parse(abrAngle.Text) < rule3.Min || long.Parse(radarDisappearTime.Text) > rule4.Max || long.Parse(radarDisappearTime.Text) < rule4.Min || long.Parse(AISDisappearTime.Text) > rule5.Max || long.Parse(AISDisappearTime.Text) < rule5.Min ) { MessageBoxX.Show("提示", "数据超出范围!"); } else { sc.write_string("fusion", "xyz", xyzParameter.Text); sc.write_string("fusion", "abrDistance", abrDistance.Text); sc.write_string("fusion", "abrAngle", abrAngle.Text); sc.write_string("fusion", "radarMiss", radarDisappearTime.Text); sc.write_string("fusion", "AISMiss", AISDisappearTime.Text); sc.write_string("fusion", "IM", IMParameter.Text); sc.write_string("fusion", "IN", INParameter.Text); sc.write_bool("fusionRadio", "prompt", (bool)prompt.IsChecked); sc.write_bool("fusionRadio", "warn", (bool)warn.IsChecked); sc.write_bool("fusionRadio", "optimal", (bool)RadioB3.IsChecked); sc.write_bool("fusionRadio", "weighted", (bool)RadioB4.IsChecked); sc.write_bool("fusionRadio", "SF", (bool)RadioB5.IsChecked); fXYZThreshold = (float)double.Parse(xyzParameter.Text); fDisThreshold = (float)double.Parse(abrDistance.Text); fAngleThreshold = (float)double.Parse(abrAngle.Text); if ((bool)prompt.IsChecked) { ucAlarmThreshold = 1; } else { ucAlarmThreshold = 2; } lRdDieTime = (long)double.Parse(radarDisappearTime.Text); lAISDieTime = (long)double.Parse(AISDisappearTime.Text); lM = (long)double.Parse(IMParameter.Text); lN = (long)double.Parse(INParameter.Text); if ((bool)RadioB3.IsChecked) { UcEstiArith = 1; } else if ((bool)RadioB4.IsChecked) { UcEstiArith = 2; } else if ((bool)RadioB5.IsChecked) { UcEstiArith = 3; } MonitoringX.FusionBack(); MainWindow.opeation.OptionName = "设置融合参数"; MainWindow.opeation.LogType = 2; MainWindow.opeation.OptionTime = GetTime(GetTimeStamp().ToString()); MainWindow.OperationLogData.WriteOperationLog(MainWindow.opeation);//操作入库 MessageBoxX.Show("提示信息", "参数保存成功!"); this.Close(); } } catch (Exception ex) { MessageBoxX.Show("警告", "输入数据有误!请重新输入!"); } }
private void Delete_Click(object sender, RoutedEventArgs e)//行删除 { try { Button b = sender as Button; int index = int.Parse(b.Tag.ToString()); App app = (App)App.Current; if (!polygonBtn.IsEnabled) { //MainWindow.data.removePolygonAeraByName(MainWindow.mycon, polygonAreaList[index].Name);//数据库删除多边形 YimaWF.data.ForbiddenZone fz = new YimaWF.data.ForbiddenZone(); fz.ID = Convert.ToInt32(polygonAreaList[index].ID); (new dataAnadll.PolygonAreaManager()).DeletePolygonArea(fz); int num = (int)double.Parse(polygonAreaList[index].ID) - 210; MonitoringX.deleteForbiddenZone(polygonAreaList[index].Name, num);//显控同步+海图删除 polygonAreaList[index].ID = null; polygonAreaList[index].Name = null; polygonAreaList[index].Level = null; polygonAreaList[index].Description = null; polygonAreaList[index].ReadOnly = true; polyID[index] = 0; } else { //MainWindow.data.removeProtectAeraByName(MainWindow.mycon, pipelineAreaList[index].Name);//数据库删除管道 YimaWF.data.Pipeline pl = new YimaWF.data.Pipeline(); pl.ID = Convert.ToInt32(pipelineAreaList[index].ID); (new dataAnadll.PipeLineProtectAreaManager()).DeletePipeLineProtectArea(pl); int num = (int)double.Parse(pipelineAreaList[index].ID) - 220; MonitoringX.deletePipeline(pipelineAreaList[index].Name, num);//显控同步+海图删除 pipelineAreaList[index].ID = null; pipelineAreaList[index].Name = null; pipelineAreaList[index].Width = null; pipelineAreaList[index].Level = null; pipelineAreaList[index].Description = null; pipelineAreaList[index].ReadOnly = true; pipeID[index] = 0; } Update_PolyAndPipe_FromDB(); if (!polygonBtn.IsEnabled) { for (int i = 0; i < 5; i++) { ToggleButton tb = FindName("tb" + i.ToString()) as ToggleButton; Button bt = FindName("b" + i.ToString()) as Button; if (String.IsNullOrWhiteSpace(polygonAreaList[i].ID)) { tb.IsChecked = false; tb.IsEnabled = false; bt.IsEnabled = false; } else { tb.IsChecked = false; tb.IsEnabled = true; bt.IsEnabled = true; } } } else { for (int i = 0; i < 5; i++) { ToggleButton tb = FindName("tb" + i.ToString()) as ToggleButton; Button bt = FindName("b" + i.ToString()) as Button; if (String.IsNullOrWhiteSpace(pipelineAreaList[i].ID)) { tb.IsChecked = false; tb.IsEnabled = false; bt.IsEnabled = false; } else { tb.IsChecked = false; tb.IsEnabled = true; bt.IsEnabled = true; } } } } catch (Exception ee) { } }
private void PullDownClick(object sender, RoutedEventArgs e) { targetPopup.IsOpen = true; if (startTime.Text == null || endTime.Text == null) { MessageBoxX.Show("提示", "时间不能为空!"); } else { System.DateTime time = Convert.ToDateTime(startTime.Text); //string转datatime(star) start = (long)GetTimeStamp(time); //datatime时间戳(star) System.DateTime timer = Convert.ToDateTime(endTime.Text); //string转datatime(end) end = (long)GetTimeStamp(timer); //datatime时间戳(end) if (start >= end) { MessageBoxX.Show("提示", "时间选择有误!"); } else if (end - start >= 60 * 24 * 60 * 60) { MessageBoxX.Show("提示", "时间不超过两个月!"); } else { if (trackType == "radar1") { tl.Clear(); List <int[]> a = MonitoringX.radarTargetListBack(start, end, 1); //雷达列表获取 for (int i = 0; i < a.Count; i++) //添加当前的列表 { tl.Add(a[i][0]); } nowListCount = tl.Count; } else if (trackType == "radar2") { tl.Clear(); List <int[]> a = MonitoringX.radarTargetListBack(start, end, 2); //雷达列表获取 for (int i = 0; i < a.Count; i++) //添加当前的列表 { tl.Add(a[i][0]); } nowListCount = tl.Count; } else if (trackType == "AIS") { tl.Clear(); List <int> a = MonitoringX.AISTargetListBack(start, end); //AIS列表获取 for (int i = 0; i < a.Count; i++) //添加当前的列表 { tl.Add(a[i]); } nowListCount = tl.Count; } else if (trackType == "Mix") { tl.Clear(); List <int> a = MonitoringX.fuseTargetListBack(start, end); //融合列表获取 for (int i = 0; i < a.Count; i++) //添加当前的列表 { tl.Add(a[i]); } nowListCount = tl.Count; } } } }
private void restartClick(object sender, RoutedEventArgs e)//控制杆重启 { MonitoringX.restart(); }