Exemple #1
0
        //Retest
        //No Header
        public static List <String> buildMatrixA_file(List <Instance> list_inst, List <m_Motion> list_motion)
        {
            List <String> matrix = new List <String>();

            foreach (Instance inst in list_inst)
            {
                string matrix_data = inst.name + "," + inst.subject_id + "," + inst.motion_id;
                foreach (m_Motion motion in list_motion)
                {
                    Boolean detected = false;
                    detected     = TheRuleTester.testDetectMotion(inst.getDataRaw(true), motion.inputs);
                    matrix_data += "," + TheTool.convertBoolean_01(detected);
                }
                matrix.Add(matrix_data);
            }
            return(matrix);//TheTool.convert_List_toDataTable(matrix)
        }
Exemple #2
0
        //Motion Analysis on 1 File
        //All Data (Whole Sequence) - All Motion
        //Output: Matrix
        static public string motionAnalysis(String path_load, String path_save, List <m_Motion> list_motions)
        {
            string              currentFileName = TheTool.getFileName_byPath(path_load);
            string              matrix_data     = currentFileName;
            List <UKI_DataRaw>  list_raw        = TheUKI.csv_loadFileTo_DataRaw(path_load, 0);
            List <logDetection> log_list        = new List <logDetection>();//keep output summary
            //--- Preprocess to obtain BasePosture Data
            UKI_Offline mr = new UKI_Offline();

            mr.UKI_OfflineProcessing(list_raw, 0);
            List <UKI_Data_AnalysisForm> data = TheUKI.getData_AnalysisForm(mr.data.data_raw, mr.data.data_bp);

            //--- Analysis Motion by Motion
            foreach (m_Motion motion in list_motions)
            {
                Boolean      detected = TheRuleTester.testDetectMotion(data, motion.inputs);
                logDetection log      = TheRuleTester.temp_log;
                //
                log.info = motion.name + " ( " + log.info + " )";
                if (detected)
                {
                    log.info = "[" + log.detectAt + "] " + log.info;
                }
                else
                {
                    log.info = "[X] " + log.info;
                }
                log_list.Add(log);
                matrix_data += "," + TheTool.convertBoolean_01(detected);
            }
            //--------------------------------
            TheSys.showError("File: " + currentFileName);
            foreach (logDetection s in log_list.OrderBy(o => o.detectAt).ThenBy(o => o.num_pose))
            {
                TheSys.showError(s.info);
            }
            TheSys.showError("---------------------");
            return(matrix_data);
        }
Exemple #3
0
 public static void saveSetting()
 {
     try
     {
         List <string> stringList = new List <string>()
         {
         };
         stringList.Add("savepath:" + TheURL.url_saveFolder);
         stringList.Add("mute:" + TheTool.convertBoolean_01(userTracker.checkMute.IsChecked.Value));
         //--------
         stringList.Add("kAngle:" + Math.Round(userTracker.slideAngle.Value));
         stringList.Add("kSeat:" + TheTool.convertBoolean_01(userTracker.checkSeat.IsChecked.Value));
         stringList.Add("kClose:" + TheTool.convertBoolean_01(userTracker.checkClose.IsChecked.Value));
         stringList.Add("kFace:" + TheTool.convertBoolean_01(userTracker.checkFace.IsChecked.Value));
         stringList.Add("kFlip:" + TheTool.convertBoolean_01(userTracker.checkFlip.IsChecked.Value));
         //--------
         stringList.Add("kSmooth:" + TheTool.convertBoolean_01(userTracker.checkSmooth.IsChecked.Value));
         stringList.Add("kSmooth_S:" + Math.Round(userTracker.slide_Smooth.Value, 1));
         stringList.Add("kSmooth_P:" + Math.Round(userTracker.slide_Predict.Value, 1));
         stringList.Add("kSmooth_C:" + Math.Round(userTracker.slide_Correct.Value, 1));
         stringList.Add("kSmooth_J:" + Math.Round(userTracker.slide_Jitter.Value, 2));
         stringList.Add("kSmooth_M:" + Math.Round(userTracker.slide_Davia.Value, 2));
         //--------
         stringList.Add("hideData:" + TheTool.convertBoolean_01(userTracker.checkHide.IsChecked.Value));
         stringList.Add("hideDebug:" + TheTool.convertBoolean_01(userTracker.checkHideDebug.IsChecked.Value));
         //--------
         stringList.Add("view1:" + userTracker.comboV1.SelectedIndex);
         stringList.Add("view2:" + userTracker.comboV2.SelectedIndex);
         stringList.Add("view3:" + userTracker.comboV2.SelectedIndex);
         stringList.Add("view4:" + userTracker.comboV2.SelectedIndex);
         stringList.Add("view1_j:" + TheTool.convertBoolean_01(userTracker.checkVJoint1.IsChecked.Value));
         stringList.Add("view1_b:" + TheTool.convertBoolean_01(userTracker.checkVBone1.IsChecked.Value));
         stringList.Add("view1_e:" + TheTool.convertBoolean_01(userTracker.checkVEdge1.IsChecked.Value));
         stringList.Add("view2_j:" + TheTool.convertBoolean_01(userTracker.checkVJoint2.IsChecked.Value));
         stringList.Add("view2_b:" + TheTool.convertBoolean_01(userTracker.checkVBone2.IsChecked.Value));
         stringList.Add("view2_e:" + TheTool.convertBoolean_01(userTracker.checkVEdge2.IsChecked.Value));
         stringList.Add("view3_j:" + TheTool.convertBoolean_01(userTracker.checkVJoint3.IsChecked.Value));
         stringList.Add("view3_b:" + TheTool.convertBoolean_01(userTracker.checkVBone3.IsChecked.Value));
         stringList.Add("view3_e:" + TheTool.convertBoolean_01(userTracker.checkVEdge3.IsChecked.Value));
         stringList.Add("view4_j:" + TheTool.convertBoolean_01(userTracker.checkVJoint4.IsChecked.Value));
         stringList.Add("view4_b:" + TheTool.convertBoolean_01(userTracker.checkVBone4.IsChecked.Value));
         stringList.Add("view4_e:" + TheTool.convertBoolean_01(userTracker.checkVEdge4.IsChecked.Value));
         //--------
         stringList.Add("stream:" + userTracker.comboStream.SelectedIndex);
         stringList.Add("follow:" + userTracker.comboFollow.SelectedIndex);
         stringList.Add("backup:" + userTracker.txtBackup.Text);
         stringList.Add("digit:" + userTracker.comboDecimal.SelectedIndex);
         //
         if (userTracker.form_Detector != null)
         {
             stringList.Add("d_onTop:" + TheTool.convertBoolean_01(userTracker.form_Detector.checkOnTop.IsChecked.Value));
             stringList.Add("POS_monitor:" + TheTool.convertBoolean_01(userTracker.form_Detector.checkPOSmonitor.IsChecked.Value));
             stringList.Add("speech_off:" + TheTool.convertBoolean_01(userTracker.form_Detector.checkSpeech.IsChecked.Value));
             stringList.Add("alarm_off:" + TheTool.convertBoolean_01(userTracker.form_Detector.checkSound.IsChecked.Value));
             stringList.Add("consensus:" + userTracker.form_Detector.txtFrameAgree.Text);
             stringList.Add("BPcooldown:" + userTracker.form_Detector.txtWait.Text);
         }
         TheTool.writeFile(stringList, TheURL.url_config, true);
     }
     catch { TheSys.showError("Error Save Setting"); }
 }