/*
 * options.h
 * This file is part of galvani.
 * Copyright (C) 2020-2024 Burkard Lutz <b.lutz@online.de>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef OPTIONS_H
#define OPTIONS_H

#include "typedef.h"
#include "ui.h"

// extern Variables
extern Main_Window* main_win;
extern Project *project;
extern std::string workdir;
extern std::string dmmdir;
extern std::string confdir;
extern std::string error_str;
extern Multimeter dmm[2];
extern Multimeter idmm[10];
extern int mid;
extern bool mess_done;
extern bool eval_titvolumen;

//Functions
void error_msg (std::string msg); //error message
bool is_known_function (std::string funct);
double get_dbstr(std::string num_str);
int get_intstr(std::string num_str);
bool get_boolstr(std::string num_str);
typ get_dmmtyp(std::string t);
void set_messfunkt (int kanal, std::string funkt); //set function for channel X/Y
std::string set_std_unit (std::string funkt);	//set standard unit
std::string set_std_range (std::string funkt);	//set standard range



//Variables
Gdk::RGBA std_axcol, std_gridcol, std_bkcol, std_xycol;
double messintervall;
int min_timeout;
std::string dmm_file_id = "galvani_dmm_options";
std::string conf_file_id = "galvani_conf_options";
std::ifstream dmm_open_file;
std::ifstream conf_open_file;
std::vector<std::string> ports;
int id;	//index of found dmm in array
int kanal; // data channel
           //
#endif
