DataAnalysisFun.cs 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using DevExpress.XtraGrid.Views.Grid;
  8. using DevExpress.XtraGrid;
  9. using Uninpho.DBOperation.Model;
  10. using Uninpho.DBOperation.Operation;
  11. using System.Windows.Forms;
  12. using DevExpress.XtraEditors;
  13. using MathWorks.MATLAB.NET.Arrays;
  14. using System.Threading;
  15. //数据库表重置;
  16. //TRUNCATE TABLE public.t_jihefenxi_boxing;//删除表内所有数据
  17. //ALTER TABLE public.t_jihefenxi_boxing DROP COLUMN id;//删除id序号
  18. //alter table public.t_jihefenxi_boxing add id serial PRIMARY KEY;//重置新加id序号
  19. namespace Uninpho.Tools.components.DataAnalysis
  20. {
  21. /// <summary>
  22. /// 进行算法处理的类
  23. /// </summary>
  24. public class DataAnalysisFun
  25. {
  26. static GridControl GC1; static GridControl GC2; static GridView GVJH; static GridView GVLGL;
  27. static bool tzxx = true;
  28. static int isuseDIYdisp = 0;
  29. static string fname_disp = "";
  30. /// <summary>
  31. ///
  32. /// </summary>
  33. /// <param name="whatfun">是那种算法;0几何;1微小;2轮轨力;</param>
  34. /// <param name="selectrow">选择条数</param>
  35. public static void resAsyncFun(int whatfun, int[] selectrow, ref GridControl GC1_, ref GridControl GC2_, ref GridView GVJH_, ref GridView GVLGL_)
  36. {
  37. if (!Directory.Exists(Application.StartupPath + "\\result\\jh"))
  38. {
  39. Directory.CreateDirectory(Application.StartupPath + "\\result\\jh");
  40. }
  41. if (!Directory.Exists(Application.StartupPath + "\\result\\lgl"))
  42. {
  43. Directory.CreateDirectory(Application.StartupPath + "\\result\\lgl");
  44. }
  45. isuseDIYdisp = 0;
  46. fname_disp = "";
  47. GC1 = GC1_; GC2 = GC2_; GVJH = GVJH_; GVLGL = GVLGL_;
  48. int iszhengc = 0;//错误码: 0:正常;1:文件找不到;2:检测车信息未录入;3:算法已执行;4:未选择文件
  49. List<int> ID = new List<int>();
  50. if (selectrow.Length >= 1)
  51. {
  52. for (int i = 0; i < selectrow.Length; i++)
  53. {
  54. if (whatfun == 0 || whatfun == 1)
  55. {
  56. if (GVJH.GetRowCellValue(selectrow[i], "Wjzt").ToString() == "正常")
  57. {
  58. ID.Add(Convert.ToInt32(GVJH.GetRowCellValue(selectrow[i], "Id").ToString()));
  59. }
  60. else
  61. {
  62. iszhengc = 1;
  63. break;
  64. }
  65. if (whatfun == 0)
  66. {
  67. if (GVJH.GetRowCellValue(selectrow[i], "Jccxx").ToString() == " " || GVJH.GetRowCellValue(selectrow[i], "Jccxx").ToString() == "")
  68. {
  69. iszhengc = 2;
  70. break;
  71. }
  72. if (GVJH.GetRowCellValue(selectrow[i], "Rwzt").ToString() == "几何算法执行完毕")
  73. {
  74. iszhengc = 3;
  75. break;
  76. }
  77. }
  78. if (whatfun == 1)
  79. {
  80. //微小算法一些前置条件:比如所选条数是否都没有执行过微小算法
  81. if (GVJH.GetRowCellValue(selectrow[i], "Rwzt").ToString() == "微小算法执行完毕")
  82. {
  83. iszhengc = 3;
  84. break;
  85. }
  86. }
  87. }
  88. else
  89. {
  90. if (GVLGL.GetRowCellValue(selectrow[i], "Wjzt").ToString() == "正常")
  91. {
  92. ID.Add(Convert.ToInt32(GVLGL.GetRowCellValue(selectrow[i], "Id").ToString()));
  93. }
  94. else
  95. {
  96. iszhengc = 1;
  97. break;
  98. }
  99. if (whatfun == 2 || whatfun == 0)
  100. {
  101. if (GVLGL.GetRowCellValue(selectrow[i], "Jccxx").ToString() == " " || GVLGL.GetRowCellValue(selectrow[i], "Jccxx").ToString() == "")
  102. {
  103. iszhengc = 2;
  104. break;
  105. }
  106. if (GVLGL.GetRowCellValue(selectrow[i], "Rwzt").ToString() == "轮轨力算法执行完毕")
  107. {
  108. iszhengc = 3;
  109. break;
  110. }
  111. }
  112. }
  113. }
  114. }
  115. else
  116. {
  117. iszhengc = 4;
  118. }
  119. if (iszhengc == 0)
  120. {
  121. if (whatfun == 0 || whatfun == 2)
  122. {
  123. SuanFaFrom frm = new SuanFaFrom();
  124. frm.StartPosition = FormStartPosition.CenterParent;
  125. frm.changeLabel(whatfun == 0 ? true : false);
  126. if (frm.ShowDialog() == DialogResult.OK)
  127. {
  128. DataAnalysisFun daf = new DataAnalysisFun();
  129. daf.AAAsync(daf, whatfun, selectrow, ID);
  130. }
  131. }
  132. else
  133. {
  134. DataAnalysisFun daf = new DataAnalysisFun();
  135. daf.AAAsync(daf, whatfun, selectrow, ID);
  136. }
  137. }
  138. else if (iszhengc == 1)
  139. {
  140. XtraMessageBox.Show("存在文件状态异常文件,请检查后在执行算法!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  141. }
  142. else if (iszhengc == 2)
  143. {
  144. XtraMessageBox.Show("没有选定检测车信息,请检查!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  145. }
  146. else if (iszhengc == 3)
  147. {
  148. if (XtraMessageBox.Show("此算法已执行,是否重新执行?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
  149. {
  150. if (whatfun == 0 || whatfun == 2)
  151. {
  152. SuanFaFrom frm = new SuanFaFrom();
  153. frm.StartPosition = FormStartPosition.CenterParent;
  154. frm.changeLabel(whatfun == 0 ? true : false);
  155. if (frm.ShowDialog() == DialogResult.OK)
  156. {
  157. DataAnalysisFun daf = new DataAnalysisFun();
  158. daf.AAAsync(daf, whatfun, selectrow, ID);
  159. }
  160. }
  161. else
  162. {
  163. DataAnalysisFun daf = new DataAnalysisFun();
  164. daf.AAAsync(daf, whatfun, selectrow, ID);
  165. }
  166. }
  167. }
  168. else if (iszhengc == 4)
  169. {
  170. XtraMessageBox.Show("请先选择要执行的文件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  171. }
  172. }
  173. private async Task AAAsync(DataAnalysisFun daf, int whatfun, int[] selectrow, List<int> ID)
  174. {
  175. string[] yswjm_ = new string[2];
  176. for (int i = 0; i < selectrow.Length; i++)
  177. {
  178. if (whatfun == 0)
  179. {
  180. //先删除已有的
  181. DataAnalysisToPG.DelUpdataData(GVJH.GetRowCellValue(selectrow[i], "Id").ToString(), "dd");
  182. //在做其他操作
  183. GVJH.SetRowCellValue(selectrow[i], "Rwzt", "正在执行几何算法...");
  184. yswjm_[0] = GVJH.GetRowCellValue(selectrow[i], "Yswjm").ToString();
  185. yswjm_[1] = "几何算法执行完毕";
  186. }
  187. else if (whatfun == 1)
  188. {
  189. GVJH.SetRowCellValue(selectrow[i], "Rwzt", "正在执行微小算法...");
  190. yswjm_[0] = GVJH.GetRowCellValue(selectrow[i], "Yswjm").ToString();
  191. yswjm_[1] = "微小算法执行完毕";
  192. }
  193. else if (whatfun == 2)
  194. {
  195. //先删除已有的
  196. DataAnalysisToPG.DelUpdataData(GVLGL.GetRowCellValue(selectrow[i], "Id").ToString(), "dd");
  197. //在做其他操作
  198. GVLGL.SetRowCellValue(selectrow[i], "Rwzt", "正在执行轮轨力算法...");
  199. yswjm_[0] = GVLGL.GetRowCellValue(selectrow[i], "Yswjm").ToString();
  200. yswjm_[1] = "轮轨力算法执行完毕";
  201. }
  202. else
  203. {
  204. }
  205. var boolyunx = true;
  206. //if (whatfun == 0)
  207. //{
  208. // OpenFileDialog op1 = new OpenFileDialog();
  209. // if (XtraMessageBox.Show("是否添加里程修正文件?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
  210. // {
  211. // if (op1.ShowDialog() == DialogResult.OK)
  212. // {
  213. // isuseDIYdisp = 1;
  214. // fname_disp = op1.FileName;
  215. // XtraMessageBox.Show("里程修正文件添加成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  216. // }
  217. // else
  218. // {
  219. // if (XtraMessageBox.Show("已取消添加里程修正文件!是否正常执行算法?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
  220. // {
  221. // boolyunx = false;
  222. // tzxx = false;
  223. // }
  224. // }
  225. // }
  226. //}
  227. //if (boolyunx)
  228. //{
  229. await Task.Run(() => daf.dataAnalysis(whatfun, ID[i]));
  230. //}
  231. if (whatfun == 0)
  232. {
  233. GVJH.SetRowCellValue(selectrow[i], "Rwzt", "几何算法执行完毕");
  234. if (!tzxx)
  235. {
  236. GVJH.SetRowCellValue(selectrow[i], "Rwzt", "算法未执行");
  237. }
  238. }
  239. else if (whatfun == 1)
  240. {
  241. GVJH.SetRowCellValue(selectrow[i], "Rwzt", "微小算法执行完毕");
  242. if (!tzxx)
  243. {
  244. GVJH.SetRowCellValue(selectrow[i], "Rwzt", "算法未执行");
  245. }
  246. }
  247. else if (whatfun == 2)
  248. {
  249. GVLGL.SetRowCellValue(selectrow[i], "Rwzt", "轮轨力算法执行完毕");
  250. if (!tzxx)
  251. {
  252. GVLGL.SetRowCellValue(selectrow[i], "Rwzt", "算法未执行");
  253. }
  254. }
  255. else
  256. {
  257. GVLGL.SetRowCellValue(selectrow[i], "Rwzt", "????????");
  258. if (!tzxx)
  259. {
  260. GVLGL.SetRowCellValue(selectrow[i], "Rwzt", "算法未执行");
  261. }
  262. }
  263. //更新数据库状态
  264. DataAnalysisToPG.updataRWZT(yswjm_);
  265. }
  266. if (selectrow.Length != 0 && tzxx)
  267. {
  268. //更新显示状态
  269. XtraMessageBox.Show("算法执行完毕!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  270. }
  271. }
  272. private void dataAnalysis(int whatfun, int idindex)
  273. {
  274. //DataAnalysisToPG.DelGetBX();
  275. T_file_account whichfile = (T_file_account)DataAnalysisToPG.QueryToPGById(idindex);
  276. switch (whatfun)
  277. {
  278. case 0:
  279. //JHTQ
  280. //JH_TQ(whichfile);
  281. JH_new(whichfile);
  282. break;
  283. case 1:
  284. //WXSF
  285. WXSFFun(whichfile);
  286. break;
  287. case 2:
  288. //LGLTQ
  289. LGL_new(whichfile);
  290. break;
  291. default:
  292. break;
  293. }
  294. //DataAnalysisToPG.DelUpdataData()
  295. }
  296. public void JH_new(T_file_account whichfile)
  297. {
  298. tzxx = true;
  299. List<T_daocha_account> daochabiao = (List<T_daocha_account>)DataAnalysisToPG.QueryDCTZ(whichfile.Xlm, whichfile.Yswjm.Split('-')[0].ToCharArray());
  300. List<T_quxian_account> quxianbiao = (List<T_quxian_account>)DataAnalysisToPG.QueryQXTZ(whichfile.Xlm, whichfile.Yswjm.Split('-')[0].ToCharArray());
  301. string fname_dir0 = Path.GetDirectoryName(whichfile.Srlj) + "\\";
  302. string fname0 = Path.GetFileName(whichfile.Srlj);
  303. T_xianlulicheng_sf sf = (T_xianlulicheng_sf)DataAnalysisToPG.QueryToString(fname0.Split('-')[0]);
  304. double mile_min = Convert.ToDouble(sf.Qslc);
  305. double mile_max = Convert.ToDouble(sf.Zzlc);
  306. int mile_id = DACommon.xzlcBool ? 0 : 1;
  307. string line_name = fname0.Split('-')[0];
  308. double[] tz_curv = getTZQX(quxianbiao,true);
  309. double[] tz_turnout = getTZDC(daochabiao);
  310. double[] distance_table = getTZJGJX();
  311. string carname = whichfile.Jccxx;
  312. try
  313. {
  314. var data = AnalysisAlgorithmcs.JHFX(fname_dir0, fname0, mile_id, line_name, mile_min, mile_max, tz_curv, tz_turnout, distance_table, carname);
  315. readJHFX(data, whichfile);
  316. }
  317. catch (Exception ex)
  318. {
  319. tzxx = false;
  320. XtraMessageBox.Show("文件:" + whichfile.Yswjm + "执行失败!" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  321. throw;
  322. }
  323. }
  324. public void LGL_new(T_file_account whichfile)
  325. {
  326. tzxx = true;
  327. List<T_daocha_account> daochabiao = (List<T_daocha_account>)DataAnalysisToPG.QueryDCTZ(whichfile.Xlm, whichfile.Yswjm.Split('_')[2].Split('.')[0].ToCharArray());
  328. List<T_quxian_account> quxianbiao = (List<T_quxian_account>)DataAnalysisToPG.QueryQXTZ(whichfile.Xlm, whichfile.Yswjm.Split('_')[2].Split('.')[0].ToCharArray());
  329. string fname_dir0 = Path.GetDirectoryName(whichfile.Srlj) + "\\";
  330. string fname0 = Path.GetFileName(whichfile.Srlj);
  331. string line_name = fname0.Split('_')[2].Split('.')[0];
  332. T_xianlulicheng_sf sf = (T_xianlulicheng_sf)DataAnalysisToPG.QueryToString(line_name);
  333. double mile_min = Convert.ToDouble(sf.Qslc);
  334. double mile_max = Convert.ToDouble(sf.Zzlc);
  335. double[] tz_curv = getTZQX(quxianbiao,false);
  336. double[] tz_turnout = getTZDC(daochabiao);
  337. double[] distance_table = getTZJGJX();
  338. string carname = whichfile.Jccxx;
  339. try
  340. {
  341. var data = AnalysisAlgorithmcs.LGLFX(fname_dir0, fname0, line_name, mile_min, mile_max, tz_curv, tz_turnout, distance_table, carname);
  342. readLGLFX(data, whichfile);
  343. }
  344. catch (Exception ex)
  345. {
  346. tzxx = false;
  347. if (quxianbiao.Count == 0)
  348. {
  349. XtraMessageBox.Show("曲线表缺少数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  350. }
  351. else if (daochabiao.Count == 0)
  352. {
  353. XtraMessageBox.Show("道岔表缺少数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  354. }
  355. else
  356. {
  357. XtraMessageBox.Show("文件:" + whichfile.Yswjm + "执行失败!" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  358. }
  359. throw;
  360. }
  361. }
  362. /// <summary>
  363. /// 微小算法
  364. /// </summary>
  365. /// <param name="whichfile"></param>
  366. public void WXSFFun(T_file_account whichfile)
  367. {
  368. tzxx = true;
  369. List<T_jihefenxi_account> jhfe_account = DataAnalysisToPG.QueryToPGByNameWXSF(whichfile.Id.ToString()) as List<T_jihefenxi_account>;
  370. string[] date = new string[jhfe_account.Count];
  371. string[] car = new string[jhfe_account.Count];
  372. double[] mile = new double[jhfe_account.Count];
  373. List<double> wave_data = new List<double>();
  374. List<double> id_wave_all = new List<double>();
  375. List<double> jx_loc_all = new List<double>();
  376. string[] line = new string[jhfe_account.Count];
  377. double[] velo = new double[jhfe_account.Count];
  378. string[] zc = new string[jhfe_account.Count];
  379. getdataWXSF(jhfe_account, ref date, ref car, ref mile, ref wave_data, ref id_wave_all, ref jx_loc_all, ref line, ref velo, ref zc);
  380. try
  381. {//存在问题,wave_data
  382. var data = AnalysisAlgorithmcs.WXSF(date, car, mile, wave_data.ToArray(), id_wave_all.ToArray(), jx_loc_all.ToArray(), line, velo, zc);
  383. //readWXSF(data, whichfile);
  384. }
  385. catch (Exception ex)
  386. {
  387. tzxx = false;
  388. XtraMessageBox.Show("文件:" + whichfile.Yswjm + "执行失败!" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  389. throw;
  390. }
  391. }
  392. private void getdataWXSF(List<T_jihefenxi_account> jhfe_account, ref string[] date, ref string[] car, ref double[] mile, ref List<double> wave_data, ref List<double> id_wave_all, ref List<double> jx_loc_all, ref string[] line, ref double[] velo, ref string[] zc)
  393. {
  394. int bxindex = 0;
  395. for (int i = 0; i < jhfe_account.Count; i++)
  396. {
  397. date[i] = jhfe_account[i].Riqi;
  398. car[i] = jhfe_account[i].Jcc.Split('-')[1];
  399. mile[i] = Convert.ToDouble(jhfe_account[i].Jgjlc);
  400. jx_loc_all.Add(Convert.ToDouble(jhfe_account[i].Jgjcydxh));
  401. jx_loc_all.Add(Convert.ToDouble(jhfe_account[i].Xgjcydxh));
  402. line[i] = ((T_file_account)DataAnalysisToPG.QueryToPGById(Convert.ToInt32(jhfe_account[i].Filename_jh.Trim()))).Yswjm.Split('-')[0];
  403. velo[i] = Convert.ToDouble(jhfe_account[i].Sudu_jhfx);
  404. zc[i] = jhfe_account[i].Zcx;
  405. getWXSFBXdata(jhfe_account[i].Yswjm_jhfx,ref bxindex, ref wave_data, ref id_wave_all);
  406. }
  407. }
  408. private void getWXSFBXdata(string ids, ref int index , ref List<double> wave_data, ref List<double> id_wave_all)
  409. {
  410. List<T_jihefenxi_boxing> bolist = DMControl.GetJHFX_BXDataByIDS(ids);
  411. index = index + 1;
  412. id_wave_all.Add(index);
  413. for (int i = 0; i < bolist.Count; i++)
  414. {
  415. wave_data.Add((double)(bolist[i].Licheng));
  416. wave_data.Add((double)(bolist[i].Sudu_jhbx));
  417. wave_data.Add((double)(bolist[i].Cthj));
  418. wave_data.Add((double)(bolist[i].Ctcj));
  419. wave_data.Add((double)(bolist[i].Gjzhy));
  420. wave_data.Add((double)(bolist[i].Gjyhy));
  421. wave_data.Add((double)(bolist[i].Zgd));
  422. wave_data.Add((double)(bolist[i].Ygd));
  423. wave_data.Add((double)(bolist[i].Zgx));
  424. wave_data.Add((double)(bolist[i].Ygx));
  425. wave_data.Add((double)(bolist[i].Gj));
  426. wave_data.Add((double)(bolist[i].Sp));
  427. wave_data.Add((double)(bolist[i].Sjk));
  428. wave_data.Add((double)(bolist[i].Cbzgd));
  429. wave_data.Add((double)(bolist[i].Cbygd));
  430. wave_data.Add((double)(bolist[i].Cbzgx));
  431. wave_data.Add((double)(bolist[i].Cbygx));
  432. wave_data.Add((double)(bolist[i].Dcdw));
  433. }
  434. index += bolist.Count - 1;
  435. id_wave_all.Add(index);
  436. }
  437. /// <summary>
  438. /// 从数据库获取对应符合要求的道岔台账信息
  439. /// </summary>
  440. private double[] getTZDC(List<T_daocha_account> taizhang)
  441. {
  442. //StreamWriter FileWriter = new StreamWriter("E://get2pgTZ.txt", true); //写文件
  443. string txtDetail = "";
  444. //StreamWriter sr = new StreamWriter("E://DDD.txt");
  445. List<double> result = new List<double>();
  446. for (int i = 0; i < taizhang.Count; i++)
  447. {
  448. result.Add(Convert.ToDouble(taizhang[i].Jgjlc));
  449. result.Add(Convert.ToDouble(taizhang[i].Zch));
  450. result.Add(Convert.ToDouble(taizhang[i].Quanchang));
  451. txtDetail += taizhang[i].Jgjlc + "\t" + taizhang[i].Zch + "\t" + taizhang[i].Quanchang + "\n";
  452. }
  453. //FileWriter.Write(txtDetail);//将字符串写入
  454. //FileWriter.Close(); //关闭StreamWriter对象k
  455. //******构造二维数组******
  456. double[] ret = new double[result.Count];
  457. for (int i = 0; i < result.Count; i++)
  458. {
  459. ret[i] = result[i];
  460. }
  461. return ret;
  462. }
  463. /// <summary>
  464. /// 从数据库获取对应符合要求的曲线台账信息
  465. /// </summary>
  466. private double[] getTZQX(List<T_quxian_account> taizhang,bool isjh)
  467. {
  468. List<double> result = new List<double>();
  469. for (int i = 0; i < taizhang.Count; i++)
  470. {
  471. result.Add(Convert.ToDouble(taizhang[i].Qzlc));
  472. result.Add(Convert.ToDouble(taizhang[i].Jslc));
  473. if (taizhang[i].Qxfx.Trim() == "左")
  474. {
  475. result.Add(1);
  476. }
  477. else
  478. {
  479. result.Add(-1);
  480. }
  481. if (isjh)
  482. {
  483. result.Add(Convert.ToDouble(taizhang[i].Chaogao));
  484. }
  485. else
  486. {
  487. result.Add(Convert.ToDouble(taizhang[i].Qxbj));
  488. }
  489. result.Add(Convert.ToDouble(taizhang[i].Qhhxc));
  490. result.Add(Convert.ToDouble(taizhang[i].Zhhxc));
  491. }
  492. //******构造二维数组******
  493. double[] ret = new double[result.Count];
  494. for (int i = 0; i < result.Count; i++)
  495. {
  496. ret[i] = result[i];
  497. }
  498. return ret;
  499. }
  500. /// <summary>
  501. /// 从数据库获取对应符合要求的曲线台账信息
  502. /// </summary>
  503. private double[] getTZJGJX()
  504. {
  505. List<T_jgjdistance_table> tabledata = new List<T_jgjdistance_table>();
  506. List<T_jgjdistance_table> tablelist = DataAnalysisToPG.QueryJGJXGJJ();
  507. List<T_jgjdistance_table> GS = tablelist.Where(i => i.Sudutype == 0).ToList();
  508. List<T_jgjdistance_table> DS = tablelist.Where(i => i.Sudutype == 1).ToList();
  509. if (DACommon.gdsBool == 0)
  510. {
  511. tabledata = GS;
  512. }
  513. else if (DACommon.gdsBool == 1)
  514. {
  515. tabledata = DS;
  516. }
  517. else
  518. {
  519. tabledata = tablelist;
  520. }
  521. List<double> result = new List<double>();
  522. for (int i = 0; i < tabledata.Count; i++)
  523. {
  524. result.Add(Convert.ToDouble(tabledata[i].Zch));
  525. result.Add(Convert.ToDouble(tabledata[i].Dcqc));
  526. result.Add(Convert.ToDouble(tabledata[i].Gdjxgjj));
  527. }
  528. //******构造二维数组******
  529. double[] ret = new double[result.Count];
  530. for (int i = 0; i < result.Count; i++)
  531. {
  532. ret[i] = result[i];
  533. }
  534. return ret;
  535. }
  536. private double[] getTZXX1(List<T_daocha_account> taizhang)
  537. {
  538. List<double> result = new List<double>();
  539. for (int i = 0; i < taizhang.Count; i++)
  540. {
  541. result.Add(Convert.ToDouble(taizhang[i].Jgjlc));
  542. }
  543. //******构造二维数组******
  544. double[] ret = new double[result.Count];
  545. for (int i = 0; i < result.Count; i++)
  546. {
  547. ret[i] = result[i];
  548. }
  549. return ret;
  550. }
  551. /// <summary>
  552. /// 几何读台账txt
  553. /// </summary>
  554. private double[] readtxt(string txtPath)
  555. {
  556. List<double> result = new List<double>();
  557. StreamReader SR = new StreamReader(txtPath);
  558. while (!SR.EndOfStream)
  559. {
  560. string[] str = SR.ReadLine().Replace("\t", " ").Split(' ');
  561. for (int i = 0; i < str.Length; i++)
  562. {
  563. result.Add(Convert.ToDouble(str[i]));
  564. }
  565. }
  566. //******构造二维数组******
  567. double[] ret = new double[result.Count];
  568. for (int i = 0; i < result.Count; i++)
  569. {
  570. ret[i] = result[i];
  571. }
  572. return ret;
  573. }
  574. /// <summary>
  575. /// 轮轨力读台账txt获取尖轨尖里程
  576. /// </summary>
  577. private double[] readtxt2(string txtPath)
  578. {
  579. List<double> result = new List<double>();
  580. StreamReader SR = new StreamReader(txtPath);
  581. while (!SR.EndOfStream)
  582. {
  583. string[] str = SR.ReadLine().Replace("\t", " ").Split(' ');
  584. result.Add(Convert.ToDouble(str[0]));
  585. }
  586. //******构造二维数组******
  587. double[] ret = new double[result.Count];
  588. for (int i = 0; i < result.Count; i++)
  589. {
  590. ret[i] = result[i];
  591. }
  592. return ret;
  593. }
  594. /// <summary>
  595. /// 读几何分析数据
  596. /// </summary>
  597. /// <param name="agrsOut"></param>
  598. /// <param name="whichfile"></param>
  599. private static void readJHFX(MWArray[] agrsOut, T_file_account whichfile)
  600. {
  601. MWCellArray output1 = agrsOut[0] as MWCellArray;//第1个输出参数
  602. MWNumericArray output2 = agrsOut[1] as MWNumericArray;//第2个输出参数
  603. MWArray output3 = agrsOut[2] as MWArray;//第3个输出参数
  604. MWCellArray output4 = agrsOut[3] as MWCellArray;//第4个输出参数
  605. MWCellArray output5 = agrsOut[4] as MWCellArray;//第5个输出参数
  606. MWNumericArray output6 = agrsOut[5] as MWNumericArray;//第6个输出参数
  607. MWCellArray output7 = agrsOut[6] as MWCellArray;//第7个输出参数
  608. MWCellArray output10 = agrsOut[7] as MWCellArray;//第7个输出参数
  609. MWCellArray output11 = agrsOut[8] as MWCellArray;//第7个输出参数
  610. MWNumericArray output8 = agrsOut[9] as MWNumericArray;//第8个输出参数
  611. MWNumericArray output9 = agrsOut[10] as MWNumericArray;//第9个输出参数
  612. MWNumericArray output12 = agrsOut[11] as MWNumericArray;//第12个输出参数
  613. var table_header = output1.ToArray();
  614. var table_data = (double[,])output2.ToArray();
  615. var table_zc = (object[,])output3.ToArray();
  616. var table_date = (object[,])output4.ToArray();
  617. var table_zf = (object[,])output5.ToArray();
  618. var table_tqi = (double[,])output6.ToArray();
  619. var table_car = (object[,])output7.ToArray();
  620. var table_name = (object[,])output10.ToArray();
  621. var table_xb = (object[,])output11.ToArray();
  622. var wave_id = (double[,])output8.ToArray();
  623. var wave_sw = (double[,])output9.ToArray();
  624. var wave_loc = (double[,])output12.ToArray();
  625. List<T_jihefenxi_account> JHobjs = new List<T_jihefenxi_account>();
  626. DataAnalysisToPG.InsertGetIdMAX(new T_jihefenxi_boxing() { Yswjm = "?????" });
  627. int idindex = DataAnalysisToPG.QueryMaxID("jh") + 1;
  628. #region 录入T_jihefenxi_account
  629. for (int i = 0; i < table_data.GetLength(0); i++)
  630. {
  631. int bxidq = (int)wave_id[i, 0];
  632. int bxidz = (int)wave_id[i, 1];
  633. int bxindex = bxidz - bxidq;
  634. T_jihefenxi_account jhojb = new T_jihefenxi_account();
  635. jhojb.Xuhao = table_data[i, 0].ToString();
  636. jhojb.Jgjlc = Convert.ToDecimal(table_data[i, 1]);
  637. jhojb.Sudu_jhfx = Convert.ToDecimal(table_data[i, 2]);
  638. jhojb.Cthjfz = Convert.ToDecimal(table_data[i, 3]);
  639. jhojb.Cthjffz = Convert.ToDecimal(table_data[i, 4]);
  640. jhojb.Ctcjfz = Convert.ToDecimal(table_data[i, 5]);
  641. jhojb.Ctcjffz = Convert.ToDecimal(table_data[i, 6]);
  642. jhojb.Zgjfz = Convert.ToDecimal(table_data[i, 7]);
  643. jhojb.Zgjffz_jhfx = Convert.ToDecimal(table_data[i, 8]);
  644. jhojb.Ygjfz = Convert.ToDecimal(table_data[i, 9]);
  645. jhojb.Ygjffz = Convert.ToDecimal(table_data[i, 10]);
  646. jhojb.Zgdfz = Convert.ToDecimal(table_data[i, 11]);
  647. jhojb.Ygdfz = Convert.ToDecimal(table_data[i, 12]);
  648. jhojb.Zgxfz = Convert.ToDecimal(table_data[i, 13]);
  649. jhojb.Ygxfz = Convert.ToDecimal(table_data[i, 14]);
  650. jhojb.Spfz = Convert.ToDecimal(table_data[i, 15]);
  651. jhojb.Sjkfz = Convert.ToDecimal(table_data[i, 16]);
  652. jhojb.Cbzgdfz = Convert.ToDecimal(table_data[i, 17]);
  653. jhojb.Cbygdfz = Convert.ToDecimal(table_data[i, 18]);
  654. jhojb.Cbzgxfz = Convert.ToDecimal(table_data[i, 19]);
  655. jhojb.Cbygxfz = Convert.ToDecimal(table_data[i, 20]);
  656. jhojb.Zcx = Char2String((char[,])table_zc[i, 0]);
  657. jhojb.Riqi = Char2String((char[,])table_date[i, 0]);
  658. jhojb.Zfx = Char2String((char[,])table_zf[i, 0]);
  659. jhojb.Dcqtqi = Convert.ToDecimal(table_tqi[i, 0]);
  660. jhojb.Jcc = Char2String((char[,])table_car[i, 0]);
  661. jhojb.Filename_jh = whichfile.Id.ToString();
  662. jhojb.Boxingid_jhfx = wave_id[i, 0].ToString() + "," + wave_id[i, 1].ToString();
  663. jhojb.Jgjcydxh = Convert.ToDecimal(wave_loc[i, 0]);
  664. jhojb.Xgjcydxh = Convert.ToDecimal(wave_loc[i, 1]);
  665. jhojb.Xlm = whichfile.Xlm;
  666. //jhojb.Xlm = Char2String((char[,])table_name[i, 0]);
  667. jhojb.Yswjm_jhfx = idindex.ToString() + "," + (idindex + bxindex).ToString();
  668. jhojb.Xingbie = whichfile.Hangbie;
  669. //jhojb.Xingbie = Char2String((char[,])table_xb[i, 0]);
  670. jhojb.Gjhy = Math.Abs(jhojb.Zgjfz) > Math.Abs(jhojb.Ygjfz) ? jhojb.Zgjfz : jhojb.Ygjfz;
  671. jhojb.Gjhyffz = Math.Abs(jhojb.Zgjffz_jhfx) > Math.Abs(jhojb.Ygjffz) ? jhojb.Zgjffz_jhfx : jhojb.Ygjffz;
  672. jhojb.Gdfz = Math.Abs(jhojb.Zgdfz) > Math.Abs(jhojb.Ygdfz) ? jhojb.Zgdfz : jhojb.Ygdfz;
  673. jhojb.Gxfz = Math.Abs(jhojb.Zgxfz) > Math.Abs(jhojb.Ygxfz) ? jhojb.Zgxfz : jhojb.Ygxfz;
  674. jhojb.Cbgdfz = Math.Abs(jhojb.Cbzgdfz) > Math.Abs(jhojb.Cbygdfz) ? jhojb.Cbzgdfz : jhojb.Cbygdfz;
  675. jhojb.Cbgxfz = Math.Abs(jhojb.Cbzgxfz) > Math.Abs(jhojb.Cbygxfz) ? jhojb.Cbzgxfz : jhojb.Cbygxfz;
  676. JHobjs.Add(jhojb);
  677. idindex += bxindex + 1;
  678. }
  679. DataAnalysisToPG.InsertJHDataToPG(JHobjs);
  680. #endregion
  681. #region 录入波形
  682. List<T_jihefenxi_boxing> Bolist = new List<T_jihefenxi_boxing>();
  683. for (int i = 0; i < wave_sw.GetLength(0); i++)
  684. {
  685. T_jihefenxi_boxing bolist = new T_jihefenxi_boxing();
  686. bolist.Licheng = Convert.ToDecimal(wave_sw[i, 0]);
  687. bolist.Sudu_jhbx = Convert.ToDecimal(wave_sw[i, 1]);
  688. bolist.Cthj = Convert.ToDecimal(wave_sw[i, 2]);
  689. bolist.Ctcj = Convert.ToDecimal(wave_sw[i, 3]);
  690. bolist.Gjzhy = Convert.ToDecimal(wave_sw[i, 4]);
  691. bolist.Gjyhy = Convert.ToDecimal(wave_sw[i, 5]);
  692. bolist.Zgd = Convert.ToDecimal(wave_sw[i, 6]);
  693. bolist.Ygd = Convert.ToDecimal(wave_sw[i, 7]);
  694. bolist.Zgx = Convert.ToDecimal(wave_sw[i, 8]);
  695. bolist.Ygx = Convert.ToDecimal(wave_sw[i, 9]);
  696. bolist.Gj = Convert.ToDecimal(wave_sw[i, 10]);
  697. bolist.Sp = Convert.ToDecimal(wave_sw[i, 11]);
  698. bolist.Sjk = Convert.ToDecimal(wave_sw[i, 12]);
  699. bolist.Cbzgd = Convert.ToDecimal(wave_sw[i, 13]);
  700. bolist.Cbygd = Convert.ToDecimal(wave_sw[i, 14]);
  701. bolist.Cbzgx = Convert.ToDecimal(wave_sw[i, 15]);
  702. bolist.Cbygx = Convert.ToDecimal(wave_sw[i, 16]);
  703. bolist.Dcdw = Convert.ToDecimal(wave_sw[i, 17]);
  704. bolist.Bxid = i + 1;
  705. Bolist.Add(bolist);
  706. }
  707. DataAnalysisToPG.InsertJHBXDataToPG(Bolist);
  708. #endregion
  709. }
  710. /// <summary>
  711. /// 读轮轨力分析数据
  712. /// </summary>
  713. /// <param name="agrsOut"></param>
  714. /// <param name="whichfile"></param>
  715. private static void readLGLFX(MWArray[] agrsOut, T_file_account whichfile)
  716. {
  717. MWCellArray output1 = agrsOut[0] as MWCellArray;//第1个输出参数
  718. MWNumericArray output2 = agrsOut[1] as MWNumericArray;//第2个输出参数
  719. MWNumericArray output3 = agrsOut[6] as MWNumericArray;//第3个输出参数
  720. MWNumericArray output4 = agrsOut[7] as MWNumericArray;//第4个输出参数
  721. MWCellArray output5 = agrsOut[2] as MWCellArray;//第3个输出参数
  722. MWCellArray output6 = agrsOut[4] as MWCellArray;//第4个输出参数
  723. MWCellArray output7 = agrsOut[5] as MWCellArray;//第4个输出参数
  724. MWCellArray output8 = agrsOut[3] as MWCellArray;//第4个输出参数
  725. var table_header = (object[,])output1.ToArray();
  726. var table_data = (double[,])output2.ToArray();
  727. var table_name = (object[,])output5.ToArray();
  728. var table_xb = (object[,])output6.ToArray();
  729. var table_date = (object[,])output7.ToArray();
  730. var wave_sw = (double[,])output4.ToArray();
  731. var boxingid = (double[,])output3.ToArray();
  732. var table_car = (object[,])output8.ToArray();
  733. List<T_lunguili_account> JHobjs = new List<T_lunguili_account>();
  734. DataAnalysisToPG.InsertGetIdMAX(new T_lunguili_boxing() { Yswjm = "?????" });
  735. int idindex = DataAnalysisToPG.QueryMaxID("lgl") + 1;
  736. for (int i = 0; i < table_data.GetLength(0); i++)
  737. {
  738. int bxidq = (int)boxingid[i, 0];
  739. int bxidz = (int)boxingid[i, 1];
  740. int bxindex = bxidz - bxidq;
  741. T_lunguili_account jhojb = new T_lunguili_account();
  742. jhojb.Xuhao = table_data[i, 0].ToString();
  743. jhojb.Jgjlc = Convert.ToDecimal(table_data[i, 1]);
  744. jhojb.Sudu_lgl = Convert.ToDecimal(table_data[i, 2]);
  745. jhojb.Zzcfz = Convert.ToDecimal(table_data[i, 3]);
  746. jhojb.Zzhfz = Convert.ToDecimal(table_data[i, 4]);
  747. jhojb.Yzcfz = Convert.ToDecimal(table_data[i, 5]);
  748. jhojb.Yzhfz = Convert.ToDecimal(table_data[i, 6]);
  749. jhojb.Lzlfz = Convert.ToDecimal(table_data[i, 7]);
  750. jhojb.Lzjzl = Convert.ToDecimal(table_data[i, 8]);
  751. jhojb.Ztgxs = Convert.ToDecimal(table_data[i, 9]);
  752. jhojb.Ytgxs = Convert.ToDecimal(table_data[i, 10]);
  753. jhojb.Filename_lgl = whichfile.Id.ToString();
  754. jhojb.Boxingid_lgl = bxidq.ToString() + "," + bxidz.ToString();
  755. //jhojb.Xlm = Char2String((char[,])table_name[i, 0]);
  756. jhojb.Xlm = whichfile.Xlm;
  757. //jhojb.Xingbie = Char2String((char[,])table_xb[i, 0]);
  758. jhojb.Xingbie = whichfile.Hangbie;
  759. jhojb.Yswjm = idindex.ToString() + "," + (idindex + bxindex).ToString();
  760. jhojb.Jcrq = Char2String((char[,])table_date[i, 0]);
  761. jhojb.Lgcxl = Math.Abs(jhojb.Zzcfz) > Math.Abs(jhojb.Yzcfz) ? jhojb.Zzcfz : jhojb.Yzcfz;
  762. jhojb.Lghxl = Math.Abs(jhojb.Zzhfz) > Math.Abs(jhojb.Yzhfz) ? jhojb.Zzhfz : jhojb.Yzhfz;
  763. jhojb.Tgxs = jhojb.Ztgxs > jhojb.Ytgxs ? jhojb.Ztgxs : jhojb.Ytgxs;
  764. JHobjs.Add(jhojb);
  765. idindex += bxindex + 1;
  766. }
  767. DataAnalysisToPG.InsertLGLDataToPG(JHobjs);
  768. #region 录入波形
  769. List<T_lunguili_boxing> Bolist = new List<T_lunguili_boxing>();
  770. for (int i = 0; i < wave_sw.GetLength(0); i++)
  771. {
  772. T_lunguili_boxing bolist = new T_lunguili_boxing();
  773. bolist.Licheng = Convert.ToDecimal(wave_sw[i, 0]);
  774. bolist.Sudu_lglbx = Convert.ToDecimal(wave_sw[i, 1]);
  775. bolist.Zzc = Convert.ToDecimal(wave_sw[i, 2]);
  776. bolist.Zzh = Convert.ToDecimal(wave_sw[i, 3]);
  777. bolist.Yzc = Convert.ToDecimal(wave_sw[i, 4]);
  778. bolist.Yzh = Convert.ToDecimal(wave_sw[i, 5]);
  779. bolist.Bxid = i + 1;
  780. Bolist.Add(bolist);
  781. }
  782. DataAnalysisToPG.InsertLGLBXDataToPG(Bolist);
  783. #endregion
  784. }
  785. //读取微小算法分析数据
  786. private static void readWXSF(MWArray[] agrsOut, T_file_account whichfile)
  787. {
  788. MWCellArray output1 = agrsOut[0] as MWCellArray;//第1个输出参数
  789. MWCellArray output2 = agrsOut[1] as MWCellArray;//第2个输出参数
  790. MWCellArray output3 = agrsOut[2] as MWCellArray;//第3个输出参数
  791. MWNumericArray output4 = agrsOut[3] as MWNumericArray;//第4个输出参数
  792. MWNumericArray output5 = agrsOut[4] as MWNumericArray;//第5个输出参数
  793. MWCellArray output6 = agrsOut[5] as MWCellArray;//第6个输出参数
  794. MWCellArray output7 = agrsOut[6] as MWCellArray;//第7个输出参数
  795. MWNumericArray output8 = agrsOut[7] as MWNumericArray;//第8个输出参数
  796. MWNumericArray output9 = agrsOut[8] as MWNumericArray;//第9个输出参数
  797. MWNumericArray output10 = agrsOut[9] as MWNumericArray;//第10个输出参数
  798. MWCellArray output11 = agrsOut[10] as MWCellArray;//第11个输出参数
  799. var table_header = output1.ToArray();
  800. var tableline = (object[,])output2.ToArray();
  801. var table_xb = (object[,])output3.ToArray();
  802. var table_milej = (double[,])output4.ToArray();
  803. var table_milex = (double[,])output5.ToArray();
  804. var table_date = (object[,])output6.ToArray();
  805. var table_car = (object[,])output7.ToArray();
  806. var table_data = (double[,])output8.ToArray();
  807. var wave_id = (double[,])output9.ToArray();
  808. var wave_sw = (double[,])output10.ToArray();
  809. var table_check = (object[,])output11.ToArray();
  810. List<T_jihefenxi_account> JHWXobjs = new List<T_jihefenxi_account>();
  811. DataAnalysisToPG.InsertGetIdMAX(new T_jihefenxi_boxing() { Yswjm = "?????" });
  812. T_jihefenxi_account jhwxojb = new T_jihefenxi_account();
  813. jhwxojb.Wx_xgjlc = Convert.ToDecimal(table_milex);
  814. int idindex = DataAnalysisToPG.QueryMaxID("jh") + 1;
  815. #region 录入T_jihefenxi_account
  816. for (int i = 0; i < table_data.GetLength(0); i++)
  817. {
  818. int bxidq = (int)wave_id[i, 0];
  819. int bxidz = (int)wave_id[i, 1];
  820. int bxindex = bxidz - bxidq;
  821. jhwxojb.Wx_bhl_gd = Convert.ToDecimal(table_data[i, 0]);
  822. jhwxojb.Wx_bhl_gx = Convert.ToDecimal(table_data[i, 1]);
  823. jhwxojb.Wx_bhl_sp = Convert.ToDecimal(table_data[i, 2]);
  824. jhwxojb.Wx_bhl_sjk = Convert.ToDecimal(table_data[i, 3]);
  825. jhwxojb.Wx_bhl_gj = Convert.ToDecimal(table_data[i, 4]);
  826. JHWXobjs.Add(jhwxojb);
  827. idindex += bxindex + 1;
  828. }
  829. DataAnalysisToPG.InsertJHDataToPG(JHWXobjs);
  830. #endregion
  831. #region 录入波形
  832. List<T_jihefenxi_boxing> Bolist = new List<T_jihefenxi_boxing>();
  833. for (int i = 0; i < wave_sw.GetLength(0); i++)
  834. {
  835. T_jihefenxi_boxing bolist = new T_jihefenxi_boxing();
  836. bolist.Licheng = Convert.ToDecimal(wave_sw[i, 0]);
  837. bolist.Sudu_jhbx = Convert.ToDecimal(wave_sw[i, 1]);
  838. bolist.Cthj = Convert.ToDecimal(wave_sw[i, 2]);
  839. bolist.Ctcj = Convert.ToDecimal(wave_sw[i, 3]);
  840. bolist.Gjzhy = Convert.ToDecimal(wave_sw[i, 4]);
  841. bolist.Gjyhy = Convert.ToDecimal(wave_sw[i, 5]);
  842. bolist.Zgd = Convert.ToDecimal(wave_sw[i, 6]);
  843. bolist.Ygd = Convert.ToDecimal(wave_sw[i, 7]);
  844. bolist.Zgx = Convert.ToDecimal(wave_sw[i, 8]);
  845. bolist.Ygx = Convert.ToDecimal(wave_sw[i, 9]);
  846. bolist.Gj = Convert.ToDecimal(wave_sw[i, 10]);
  847. bolist.Sp = Convert.ToDecimal(wave_sw[i, 11]);
  848. bolist.Sjk = Convert.ToDecimal(wave_sw[i, 12]);
  849. bolist.Cbzgd = Convert.ToDecimal(wave_sw[i, 13]);
  850. bolist.Cbygd = Convert.ToDecimal(wave_sw[i, 14]);
  851. bolist.Cbzgx = Convert.ToDecimal(wave_sw[i, 15]);
  852. bolist.Cbygx = Convert.ToDecimal(wave_sw[i, 16]);
  853. bolist.Dcdw = Convert.ToDecimal(wave_sw[i, 17]);
  854. bolist.Bxid = i + 1;
  855. Bolist.Add(bolist);
  856. }
  857. DataAnalysisToPG.InsertJHBXDataToPG(Bolist);
  858. #endregion
  859. }
  860. /// <summary>
  861. /// char[]转string
  862. /// </summary>
  863. private static string Char2String(char[,] chararr)
  864. {
  865. string arr = "";
  866. for (int j = 0; j < chararr.GetLength(1); j++)
  867. {
  868. arr += chararr[0, j].ToString();
  869. }
  870. return arr;
  871. }
  872. }
  873. }