private void btnPlay_Click(object sender, EventArgs e) { if (PlayThree[0] != null) { PlayThree[0].Stop(); PlayThree[0] = null; } if (PlayThree[1] != null) { PlayThree[1].Stop(); PlayThree[1] = null; } if (PlayThree[2] != null) { PlayThree[2].Stop(); PlayThree[2] = null; } PlayThree[0] = new All.Window.PlayWindow.AutoPlayOneByOne(); PlayThree[1] = new All.Window.PlayWindow.AutoPlayOneByOne(); PlayThree[2] = new All.Window.PlayWindow.AutoPlayOneByOne(); for (int i = 0; i < frmMain.mMain.AllDataXml.AllPlaySet.AllPlay.Length; i++) { if (frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].Play) { frmPlayWindow fpw = new frmPlayWindow(); switch (frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].Player) { case cDataXml.PlaySet.PlayList.部装线: //引处其实已改为设备显示 fpw = new frmPlaySheBei(); fpw.DelayTime = 99999; break; case cDataXml.PlaySet.PlayList.订单: fpw = new frmPlayOrder(); fpw.DelayTime = frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].DelayTime; break; case cDataXml.PlaySet.PlayList.管理信息: fpw = new frmPlayManagement(); fpw.DelayTime = frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].DelayTime; break; case cDataXml.PlaySet.PlayList.媒体信息: fpw = new frmPlayVideo(); int delayTime = 0; //图片文件 DirectoryInfo di; //获取图片数量 if (System.IO.Directory.Exists(frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].Info[0])) { di = new DirectoryInfo(frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].Info[0]); foreach (FileInfo fi in di.GetFiles()) { if (All.Control.PicturePlayer.FileFilter.ToUpper().IndexOf(fi.Extension.ToUpper()) >= 0) { delayTime += frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].DelayTime; } } } //获取所有视频时长 if (System.IO.Directory.Exists(frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].Info[1])) { delayTime = 9999; //有视频播放时,将播放时间设为最大 } fpw.DelayTime = 99999; break; case cDataXml.PlaySet.PlayList.生产瓶颈: fpw = new frmPlayTick(); fpw.DelayTime = frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].DelayTime; break; case cDataXml.PlaySet.PlayList.停线信息: fpw = new frmPlayAll(); fpw.DelayTime = frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].DelayTime; break; case cDataXml.PlaySet.PlayList.小时产量: fpw = new frmPlayCounts(); fpw.DelayTime = frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].DelayTime; break; case cDataXml.PlaySet.PlayList.总装线: fpw = new frmPlayLine(); fpw.DelayTime = frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].DelayTime; break; } PlayThree[frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].TVIndex].Add(fpw); if ((frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].TVIndex) < Screen.AllScreens.Length) { fpw.ShowScreen = Screen.AllScreens[frmMain.mMain.AllDataXml.AllPlaySet.AllPlay[i].TVIndex]; } } } PlayThree[0].Start(); PlayThree[1].Start(); PlayThree[2].Start(); }
private void btnHourTest_Click(object sender, EventArgs e) { frmPlayCounts fpc = new frmPlayCounts(); fpc.ShowDialog(); }