Esempio n. 1
0
        //public static void ReadCameraConfig_FullPath(string File)
        //{
        //    Program.CameraConfig_File = File;
        //    Program.CameraConfig.Resolution = (DEFS.enum_Resolution)Convert.ToByte(FuncionesINI.IniGet(Program.CameraConfig_File, INI_CAMERA_SECTION, "Resolution", "0"));
        //}

        public static Firmw_Config_Camera ReadCameraConfig_FullPath_ret(string File)
        {
            Program.AuxConfig_File = File;
            Firmw_Config_Camera AuxConfig = new Firmw_Config_Camera();

            AuxConfig.Resolution    = (DEFS.enum_Resolution)Convert.ToByte(FuncionesINI.IniGet(Program.AuxConfig_File, INI_CAMERA_SECTION, "Resolution", "1"));
            AuxConfig.Gain          = (DEFS.enum_Gain)Convert.ToByte(FuncionesINI.IniGet(Program.AuxConfig_File, INI_CAMERA_SECTION, "Gain", "0"));
            AuxConfig.Exposure_Time = (DEFS.enum_Exposure_Time)Convert.ToByte(FuncionesINI.IniGet(Program.AuxConfig_File, INI_CAMERA_SECTION, "Exposure_Time", "0"));


            Program.AuxConfigAcq.TimeInterval_seg = Convert.ToUInt16(FuncionesINI.IniGet(Program.AuxConfig_File, INI_ACQUISITION_SECTION, "Time_Interval", "0"));
            Program.AuxConfigAcq.TimeScan_min     = Convert.ToUInt16(FuncionesINI.IniGet(Program.AuxConfig_File, INI_ACQUISITION_SECTION, "Time_Scan", "0"));
            return(AuxConfig);
        }
Esempio n. 2
0
        private void btn_LoadCameraConfig_Click(object sender, EventArgs e)
        {
            OpenFileDialog FilePath = new OpenFileDialog();

            FilePath.Filter           = "ini files (*.ini)|*.ini";
            FilePath.InitialDirectory = Program.INI_PATH_CAMERA;
            //FilePath.RestoreDirectory = true;
            if (FilePath.ShowDialog() == DialogResult.OK)
            {
                this.ConfigFile      = FilePath.FileName;
                this.lbl_Config.Text = this.ConfigFile;
                this.Config          = Program.ReadCameraConfig_FullPath_ret(this.ConfigFile);
                this.RefreshConfig();
            }
        }
Esempio n. 3
0
        public bool ShowCameraConfig(ref Firmw_Config_Camera CameraConfig, ref string ConfigurationFile, ref Firmw_Config_Acquisition AcqConfig)
        {
            this.Config     = CameraConfig;
            this.ConfigFile = ConfigurationFile;
            this.InitControls();
            this.lbl_Config.Text = this.ConfigFile;

            this.RefreshConfig();
            this.ShowDialog();

            if (this.Return == true && this.Cancel == false)
            {
                Config.Resolution    = this.ParseResolution(this.cbox_Resolution.SelectedItem.ToString());
                Config.Gain          = this.ParseGain(this.cbox_Gain.SelectedItem.ToString());
                Config.Exposure_Time = this.ParseExposure_Time(this.cbox_Exposure_Time.SelectedItem.ToString());
                CameraConfig         = Config;
                int Pos      = this.ConfigFile.LastIndexOf('\\') + 1;
                int finalpos = this.ConfigFile.LastIndexOf('.');   //Añadido para intertar quitar el .ini. y asi cuando se guarda dos veces no se come parte de la configuración al poner el -4
                if (finalpos > 0)
                {
                    this.ConfigFile = this.ConfigFile.Remove(finalpos);
                }

                //Tiene que estar antes para no sobreescribir en Program.Config_File
                AcqConfig = Program.AuxConfigAcq;


                ConfigurationFile = this.ConfigFile.Substring(Pos, this.ConfigFile.Length - Pos);
                //ConfigurationFile = this.ConfigFile.Substring(Pos, this.ConfigFile.Length - Pos - 4);
                //ConfigurationFile = this.ConfigFile;



                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool ShowAcquisitionConfig(ref Firmw_Config_Acquisition AcquisitionConfig, ref string ConfigurationFile, ref Firmw_Config_Camera CameraConfig)
        {
            this.AcqConfig       = AcquisitionConfig;
            this.ConfigFile      = ConfigurationFile;
            this.lbl_Config.Text = this.ConfigFile;

            this.lbl_Resolution.Text    = CameraConfig.Resolution.ToString();
            this.lbl_Gain.Text          = CameraConfig.Gain.ToString();
            this.lbl_Exposure_Time.Text = CameraConfig.Exposure_Time.ToString();


            this.RefreshConfig();
            this.ShowDialog();
            if (this.Return == true && this.Cancel == false)
            {
                int Pos      = this.ConfigFile.LastIndexOf('\\') + 1;
                int finalpos = this.ConfigFile.LastIndexOf('.');   //Añadido para intertar quitar el .ini. y asi cuando se guarda dos veces no se come parte de la configuración al poner el -4
                if (finalpos > 0)
                {
                    this.ConfigFile = this.ConfigFile.Remove(finalpos);
                }
                ConfigurationFile = this.ConfigFile.Substring(Pos, this.ConfigFile.Length - Pos);
                //ConfigurationFile = this.ConfigFile.Substring(Pos, this.ConfigFile.Length - Pos - 4);
                //ConfigurationFile = this.ConfigFile;

                this.AcqConfig.TimeInterval_seg = Convert.ToUInt16(this.numbox_Time_Interval.Value);
                this.AcqConfig.TimeScan_min     = Convert.ToUInt16(this.numbox_Time_Scan.Value);
                AcquisitionConfig = this.AcqConfig;
                return(true);
            }
            else
            {
                return(false);
            }
        }