Exemple #1
0
        public FrameDataForm()
        {
            InitializeComponent();
            // We will create new AppSetting.txt if this file doesnot exist.
            AppSetting.CheckAndCreateIfHaveNoAppSetting();
            JObject settObj = AppSetting.GetAppSetting();

            LMSingleton.Instance.compareDownPercent = (float)settObj[AppSetting.settingKeyCompareDownPercent];
            LMSingleton.Instance.compareTopPercent  = (float)settObj[AppSetting.settingKeyCompareTopPercent];

            LMSingleton.Instance.currentForm = LMSingleton.FormName.Training;

            float cDownPercent = LMSingleton.Instance.compareDownPercent;
            float cTopPercent  = LMSingleton.Instance.compareTopPercent;

            dictHumanSign   = new Dictionary <string, Model.LMFrame>();
            this.controller = new Controller();
            this.listener   = new LeapEventListener(this);
            controller.AddListener(listener);
            mCaptureStatus = CaptureStatus.PreviewSign;
            updateUIByCaptureStatus();
            Debug.WriteLine("Load Done");

            mTrain = new TrainModule();


            string[] signFolders = FileHelper.CheckSignFolders();
            // We will create alphabet folders if there is no folder found.
            if (signFolders.Length == 0)
            {
                FileHelper.createABCFolderForFirstTime();

                signFolders = FileHelper.CheckSignFolders();
            }
            LMSingleton.Instance.signFolders = signFolders;

            for (int i = 0; i < signFolders.Length; i++)
            {
                TreeNode node = new TreeNode(signFolders[i]);
                trvHumanSign.Nodes.Add(node);
            }

            reloadListHumanSign();

            trvHumanSign.SelectedNode = trvHumanSign.Nodes[0];
            choosedSign         = clearNodeName(trvHumanSign.SelectedNode.Text);
            lbSelectedSign.Text = "Selected Gesture :" + choosedSign;

            initView();
        }