totalFecedLength = GetTotalFecedLength(messageAndParityWithUncertainLength, encoder, decoder, probableTotalMessageLength, possibleNumberOfAdditionalMessageBytes);
Exemple #2
0
        void camera_Load(object sender, EventArgs e)
        {
            result["result"] = "FAIL";
            var jsonconfig = GetFullPath("config.json");

            if (!File.Exists(jsonconfig))
            {
                MessageBox.Show("config.json not founded");
                Exit();
            }

            dynamic jobject = JObject.Parse(File.ReadAllText(jsonconfig));

            ShowWindow                 = (bool)jobject.ShowWindow;
            CameraAmount               = (int)jobject.CameraAmount;
            IsAutoModeCamera           = (bool)jobject.IsAutoModeCamera;
            TimerIntervalCamaraCapture = (int)jobject.TimerIntervalCamaraCapture;
            ConfirmTagContextBarcode   = jobject.ConfirmTagContextBarcode.ToString();
            TestProduct                = jobject.TestProduct.ToString();
            IsFM08 = (bool)jobject.IsFM08;

            if (ShowWindow)
            {
                this.Opacity       = 100;
                this.ShowInTaskbar = true;
            }
            if (IsDebugMode)
            {
                Trace.WriteLine("Camera_Load, Is8MCameraUsed : " + Is8MCameraUsed);
            }

            TestCamera = 0; // 確認測試過的相機數是初始值的0, Winmate Kenkun modify on 2017/07/07

            if (IsDeveloperMode)
            {
                UpdateDeviceList();
            }
            else if (HotTabCamera.GetCameraCount() <= 0)
            {
                if (IsDebugMode)
                {
                    Trace.WriteLine("Camera Not Found");
                }
                comboBoxCameraDevices.Items.Add("Device Not Found");
                comboBoxCameraDevices.SelectedIndex = 0;
                checkTestStatus("Camera Not Found.");
                return;
            }
            else
            {
                FangtecCameraDLL.ALC_Initialization(0, "");  // About 1.3 Sec

                // 將Camera轉90度, 需搭配廠商提供的Rotation Driver
                if (TestProduct.Equals("FMB8") && !IsFM08)
                {
                    HotTabDLL.FangtecRotate090();                                        // 由於DLL改版, 只有FM10用, Winmate Kenkun modify on 2015/12/14
                }
                UpdateDeviceList();
            }

            if (IsAutoModeCamera)
            {
                if (IsDebugMode)
                {
                    Trace.WriteLine("Camera - AutoMode");
                }
                groupBoxCapturePreview.Visible    = false;
                groupBoxPositionOfCapture.Visible = false;
                CaptureDecoder = new decoder();
            }
        }