コード例 #1
0
ファイル: rtc6.cs プロジェクト: li1794/rtclib
        public virtual bool Initialize(double kFactor, LaserMode laserMode, string ctbFileName)
        {
            Debug.Assert(this.kFactor > 0);
            RTC6Wrap.n_stop_execution(this.Index + 1);
            uint error      = RTC6Wrap.n_load_program_file(this.Index + 1, string.Empty);
            uint cardCnt    = RTC6Wrap.rtc6_count_cards();
            uint dllVersion = RTC6Wrap.get_dll_version();
            uint hexVersion = RTC6Wrap.get_hex_version();
            uint rtcVersion = RTC6Wrap.get_rtc_version();
            uint lastError  = RTC6Wrap.n_get_last_error(this.Index + 1);
            uint serialNo   = RTC6Wrap.n_get_serial_number(this.Index + 1);

            this.kFactor = kFactor;
            ///active high
            RTC6Wrap.n_set_laser_control(this.Index + 1, 0);

            if (!this.CtlLoadCorrectionFile(CorrectionTableIndex.Table1, ctbFileName))
            {
                return(false);
            }
            if (!this.CtlSelectCorrection(CorrectionTableIndex.Table1))
            {
                return(false);
            }
            RTC6Wrap.n_config_list(this.Index + 1, 4000 * 2, 4000 * 2);
            RTC6Wrap.n_set_laser_mode(this.Index + 1, (uint)laserMode);
            RTC6Wrap.n_set_firstpulse_killer(this.Index + 1, 0);
            RTC6Wrap.n_set_standby(this.Index + 1, 0, 0);
            return(true);
        }