private void recognitionClick(object sender, RoutedEventArgs e) //识别 { MainWindow.opeation.OptionName = "航迹识别"; //日志入库 MainWindow.opeation.LogType = 2; MainWindow.opeation.OptionTime = GetTime(GetTimeStamp().ToString()); MainWindow.OperationLogData.WriteOperationLog(MainWindow.opeation); Recongize shopRecongnize = Recongize.GetInstance(MainWindow.dbIP, MainWindow.dbUser, MainWindow.dbPassword, MainWindow.dbName);//数据识别实例化,需要数据库数据 string str = ""; try { Convert.ToInt32(MMSIText.Text); str = shopRecongnize.Ship_Find(MMSIText.Text); } catch { } if (str == "") { System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { //识别失败返回空字符 MessageBoxX.Show("舷号识别", "识别失败,请手动录入船舷号!"); } )); } else { boatNumber.Text = str;//识别成功返回str } }
private void Update_ShipName() { UpdateWell = false; Recongize shopRecongnize = Recongize.GetInstance(MainWindow.dbIP, MainWindow.dbUser, MainWindow.dbPassword, MainWindow.dbName); //数据识别实例化,需要数据库数据 shopRecongnize.Date_update(filePath); //上传 UpdateWell = true; }