ramancontrol.py 1.71 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# -*- coding: utf-8 -*-
"""
GEPARD - Gepard-Enabled PARticle Detection
Copyright (C) 2018  Lars Bittrich and Josef Brandt, Leibniz-Institut für 
Polymerforschung Dresden e. V. <bittrich-lars@ipfdd.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 3 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, see COPYING.  
If not, see <https://www.gnu.org/licenses/>.
"""
import os
22
import configparser
23

24
__all__ = ["RamanControl", "defaultPath", "simulatedRaman"]
25

26
config = configparser.ConfigParser()
Raman's avatar
Raman committed
27
config.read('D://Projekte//Gepard//gepard//gepard.cfg')             #absolute path to config file
28 29

interface = "SIMULATED_RAMAN_CONTROL"
30 31
defaultPath = os.path.split(__file__)[0]

32 33 34 35 36 37 38 39 40 41 42 43 44
try: 
    defaultPath = config["Defaults"]["file_path"]
except KeyError:
    pass

try:
    interface = config["Interface"]["raman_interface"]
except KeyError:
    pass

if interface == "SIMULATED_RAMAN_CONTROL":
    from simulatedraman import SimulatedRaman
    RamanControl = SimulatedRaman
45 46
    print("WARNING: using only simulated raman control!")
    simulatedRaman = True
Raman's avatar
Raman committed
47
elif interface == "WITEC_CONTROL":
48 49 50 51 52 53 54
    from WITecCOM import WITecCOM
    RamanControl = WITecCOM
    simulatedRaman = False
elif interface == "RENISHAW_CONTROL":
    raise NotImplementedError
    simulatedRaman = False