private void OneStartModeActivate()
 {
     myMediaPlayer.Pause();
     autoModeActivateFlag = 0;
     autoModeImage.Source = JobEventHandler.GetImageFromResource(Properties.Resources.oneStartImage);
     myMediaPlayer.Play();
 }
Esempio n. 2
0
        private void checkTestStartButton_Click(object sender, RoutedEventArgs e)
        {
            if (checkFileTextBox.Text == "")
            {
                MessageBox.Show("경로를 입력해주세요.");
            }
            else if (!(IsServerName(checkFileTextBox.Text)))
            {
                MessageBox.Show("서버 파일 경로가 올바르지 않습니다.");
            }
            else
            {
                myFileRep = new MediaFileRepository(checkFileTextBox.Text, serverName);
                if (myFileRep.FindFlag) // txt또는 csv파일이 있을 경우에만 실행
                {
                    myFileRep.SortDataTable("systemResult");
                    App.DataMediaWin = DataMediaWindow.DataMediaWinObj;

                    App.DataMediaWin.ResultFilePath = JobEventHandler.MakeServerDir(checkFileTextBox.Text, serverName); // 파일 생성 및 저장 좌표 재정의
                    if (App.DataMediaWin.ResultFilePath != "0")                                                         //오류가 아닐시에
                    {
                        JobEventHandler.InputDataSave(myFileRep.MyDataTable, App.DataMediaWin.ResultFilePath);          // 파일 저장

                        App.DataMediaWin.MediaFilePath = App.DataMediaWin.ResultFilePath.Replace("\\" + serverName + ".csv", "");
                        Console.WriteLine("미디어 경로 : " + App.DataMediaWin.MediaFilePath);
                        App.DataMediaWin.ServerName = this.serverName;
                        App.DataMediaWin.MyFileRep  = this.myFileRep;

                        App.DataMediaWin.Show();
                        App.DataMediaWin.WindowStart();
                        this.Hide();
                    }
                }
            }
        }
 private void AutoModeActivate()
 {
     myMediaPlayer.Pause();
     autoModeActivateFlag = 2;
     autoModeImage.Source = JobEventHandler.GetImageFromResource(Properties.Resources.lotateAutoImage);
     if (totalTimeTxt.Text == progressTimeTxt.Text)
     {
         SubmitAct();
     }
     myMediaPlayer.Play();
 }
 private void SubmitAct()
 {
     if (HumanJobCheck())
     {
         return;
     }
     // 제출하기
     showWin.HumanResultAdjust(currentIndex, humanResultTxt.Text);
     MyFileRep.MyDataTable.Rows[currentIndex][1] = humanResultTxt.Text;
     CurrentIndexPlus();
     currentJobRowPlus();
     WindowStatusUpdate(currentIndex);
     JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
 }
        private void saveAndCheckBtn_Click(object sender, RoutedEventArgs e)
        {
            myMediaPlayer.Pause();
            // 검증 시 데이터 값이 초기화 되지 않는 현상
            currentIndex  = 0;
            fullJobCount  = 0;
            currentJobRow = 0;
            // END

            JobEventHandler.EndingJob(myFileRep.MyDataTable, mediaFilePath);
            MyFileRep.SortDataTable("fileName");
            JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
            MessageBox.Show("작업 완료");
            this.Hide();
            showWin.Hide();
            App.FileSelectWin.Show();
            App.FileSelectWin.checkFileTextBox.Text = "";
        }
        private void endZipBtn_Click(object sender, RoutedEventArgs e)
        {
            myMediaPlayer.Pause();
            if (jobRateTxt.Text != "100.0")
            {
                if ((MessageBox.Show("진행률이 100% 미만입니다. 그래도 압축하시겠습니까?", "압축", MessageBoxButton.YesNo)) == MessageBoxResult.No)
                {
                    myMediaPlayer.Play();
                    return;
                }
            }
            string savePath = FileDialogManager.ReturnFolderOpenDialog();

            if (savePath != "" && savePath != mediaFilePath)
            {
                JobEventHandler.EndingJob(myFileRep.MyDataTable, mediaFilePath);
                MyFileRep.SortDataTable("fileName");
                JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
                JobEventHandler.CompressZipByIonic(mediaFilePath, savePath + "\\" + serverName + ".zip");
                MessageBox.Show("압축 완료");

                this.Hide();
                showWin.Hide();
                App.FileSelectWin.Show();
                App.FileSelectWin.checkFileTextBox.Text = "";

                // 검증 시 데이터 값이 초기화 되지 않는 현상
                currentIndex  = 0;
                fullJobCount  = 0;
                currentJobRow = 0;
                // END
            }
            else if (savePath == mediaFilePath)
            {
                MessageBox.Show("미디어 파일 경로와 저장 경로를 다르게 해주세요.");
            }
            else if (savePath == "")
            {
            }
            else
            {
                MessageBox.Show("경로 오류");
            }
        }
        public void WindowStatusUpdate(int jobIndex)
        {
            myMediaPlayer.MediaOpened -= loadedMusic;                                  // 원래 있던 미디어 쓰레드를 지움
            myMediaPlayer.MediaEnded  -= endedMusic;                                   // 원래 있던 미디어 쓰레드를 지움

            fullFileTxt.Text = realFileCount.ToString();                               // 전체 파일 개수

            indexTxt.Text    = (jobIndex + 1).ToString();                              // 인덱스
            fileNameTxt.Text = MyFileRep.MyDataTable.Rows[jobIndex][0].ToString();     //파일 이름

            systemResultTxt.Text = MyFileRep.MyDataTable.Rows[jobIndex][2].ToString(); //시스템 인식
            if (MyFileRep.MyDataTable.Rows[jobIndex][1].ToString() == "")
            {
                humanResultTxt.Text = JobEventHandler.PredictResult(systemResultTxt.Text); // 전사 예측 입력
                overlapJobTxt.Text  = "";
            }
            else
            {
                humanResultTxt.Text = MyFileRep.MyDataTable.Rows[jobIndex][1].ToString(); // 이미 전사가 있을 경우
                overlapJobTxt.Text  = "작업을 완료한 행 입니다.";
            }
            UpdateJobRate();
            humanResultTxt.Focus();
            humanResultTxt.Select(0, humanResultTxt.Text.Length);

            //스크롤 뷰 이동
            if (ScrollViewFlag)
            {
                scrollViewFlag = false;
            }
            else
            {
                showWin.MoveScrollView(jobIndex);
            }
            //보고 있는 인덱스 색칠
            showWin.SignCurrentIndex();

            //파일 이름으로 미디어 재생
            myMediaPlayer.Open(new Uri(mediaFilePath + "\\" + fileNameTxt.Text));
            myMediaPlayer.MediaOpened += loadedMusic;
            myMediaPlayer.MediaEnded  += endedMusic;
            myMediaPlayer.Play();
        }
        private void DelRowAct()
        {
            //행 및 파일 삭제하기

            /*
             * FileInfo fileDel = new FileInfo(mediaFilePath + "\\" + MyFileRep.MyDataTable.Rows[currentIndex][0]);
             * fileDel.Delete();
             * DataRow dr = MyFileRep.MyDataTable.Rows[currentIndex];
             * dr.Delete();
             * currentJobRow++;
             * WindowStatusUpdate(currentIndex);
             * JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
             */
            // 퍼포먼스 문제로 닫아둠
            showWin.HumanResultAdjust(currentIndex, "0");
            MyFileRep.MyDataTable.Rows[currentIndex][1] = "0";
            realFileCount--;
            CurrentIndexPlus();
            currentJobRowPlus();
            WindowStatusUpdate(currentIndex);
            JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
        }