Exemplo n.º 1
0
    def set_sweep_shape(self, sweepShape='rectangle', simType='verifier'):
        sys.path.append(self.pluginPath)
        print self.pluginPath
        print os.getcwd()
        from Utilities import ini_worker
        reload(ini_worker)

        if simType == 'verifier':

            section_params = ini_worker.get_section_from_ini(
                self.INI_CONFIG, 'SIMULATION')

            for key, value in section_params.iteritems():
                if key == 'sweepShape':
                    print 'SIMULATION SWEEP SHAPE SWITCHED TO ' + sweepShape
                    ini_worker.write_to_section(self.INI_CONFIG, 'SIMULATION',
                                                'sweepShape', sweepShape)

        elif simType == 'MachSim':

            section_params = ini_worker.get_section_from_ini(
                self.INI_MachSim, 'startup')

            print section_params

            for key, value in section_params.iteritems():
                if key == 'tpSweepShape':
                    print 'SIMULATION SWEEP SHAPE SWITCHED TO ' + sweepShape
                    ini_worker.write_to_section(self.INI_MachSim, 'startup',
                                                'tpSweepShape', sweepShape)
Exemplo n.º 2
0
    def expandCollapse(self, event, refresh=False):
        if not refresh:
            section_clicked = event.EventObject.GetName()
            if self.section_EC_stat[section_clicked]:
                self.section_EC_stat[section_clicked] = 0
                ini_worker.write_to_section(self.configFile, section_clicked, 'collapse', 0)
            else:
                self.section_EC_stat[section_clicked] = 1
                ini_worker.write_to_section(self.configFile, section_clicked, 'collapse', 1)

        self.GOC.inject_param_changed('collapse')

        self.current_y_pxpos_elem = 0
        param_indentation = 10
        headline_placed = False

        # for section, params in self.param_dict.iteritems():
        for section in self.section_list:
            if section in self.param_dict:
                for param, value in self.param_dict[section].iteritems():

                    if self.section_EC_stat[section]:
                        # value[0].ShowWithEffect(10, timeout=30)
                        if not headline_placed:
                            value[1]['headline'].SetPosition([UI.THEADERSTART['pos'][0],
                                                              UI.THEADERSTART['pos'][1] + self.current_y_pxpos_elem])
                            value[3]['button'].SetPosition([UI.BEXPAND['pos'][0],
                                                            UI.THEADERSTART['pos'][1] + self.current_y_pxpos_elem])
                            headline_placed = True
                            self.current_y_pxpos_elem += 20

                        value[0]['ebox'][0].Show()
                        value[1]['headline'].Show()
                        value[2]['text'].Show()
                        value[0]['ebox'][0].SetPosition([UI.EBOX['pos'][0],
                                                         UI.THEADERSTART['pos'][1] + self.current_y_pxpos_elem])
                        value[2]['text'].SetPosition([UI.THEADERSTART['pos'][0] + param_indentation,
                                                      UI.THEADERSTART['pos'][1] + self.current_y_pxpos_elem])

                        self.current_y_pxpos_elem += 20

                    else:
                        # value[0].HideWithEffect(10, timeout=30)
                        if not headline_placed:

                            value[1]['headline'].SetPosition([UI.THEADERSTART['pos'][0],
                                                              UI.THEADERSTART['pos'][1] + self.current_y_pxpos_elem])

                            value[3]['button'].SetPosition([UI.BEXPAND['pos'][0],
                                                            UI.THEADERSTART['pos'][1] + self.current_y_pxpos_elem])

                            headline_placed = True
                            self.current_y_pxpos_elem += 20

                        value[0]['ebox'][0].Hide()
                        value[2]['text'].Hide()

                headline_placed = False
Exemplo n.º 3
0
 def OnExit(self, event):
     self.Destroy()
     self.GOC.inject_runstat(False)
     self.KST.kill_sheduler()
     PG_XY = self.GetScreenPosition()
     ini_worker.write_to_section(self.PGconfigFileCore, 'UISETTINGS', 'lastWindowPosition', str(PG_XY))
     PG_SIZE = self.GetSize()
     PG_SIZE[0] = self.MIN_SIZE_W
     ini_worker.write_to_section(self.PGconfigFileCore, 'UISETTINGS', 'lastWindowSize', str(PG_SIZE))
Exemplo n.º 4
0
 def OnExit(self, event):
     self.Destroy()
     self.GOC.inject_runstat(False)
     self.KST.kill_sheduler()
     PG_XY = self.GetScreenPosition()
     ini_worker.write_to_section(self.PGconfigFileCore, 'UISETTINGS',
                                 'lastWindowPosition', str(PG_XY))
     PG_SIZE = self.GetSize()
     PG_SIZE[0] = self.MIN_SIZE_W
     ini_worker.write_to_section(self.PGconfigFileCore, 'UISETTINGS',
                                 'lastWindowSize', str(PG_SIZE))
Exemplo n.º 5
0
    def set_sweep_shape(self, sweepShape='rectangle'):
        sys.path.append(self.pluginPath)
        print self.pluginPath
        print os.getcwd()
        from Utilities import ini_worker
        reload(ini_worker)

        section_params = ini_worker.get_section_from_ini(self.INI_CONFIG, 'SIMULATION')

        for key, value in section_params.iteritems():
            if key == 'sweepShape':
                print 'SIMULATION SWEEP SHAPE SWITCHED TO ' + sweepShape
                ini_worker.write_to_section(self.INI_CONFIG, 'SIMULATION', 'sweepShape', sweepShape)
Exemplo n.º 6
0
    def switch(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        section_params = ini_worker.get_section_from_ini(self.INI_CONFIG, self.feature)

        for key, value in section_params.iteritems():
            if key == "create":
                if int(value) == 0:
                    print self.feature + " SWITCHED TO ON"
                    ini_worker.write_to_section(self.INI_CONFIG, self.feature, "create", 1)
                else:
                    print self.feature + " SWITCHED TO OFF"
                    ini_worker.write_to_section(self.INI_CONFIG, self.feature, "create", 0)
Exemplo n.º 7
0
    def set_floor_layers(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define number of solid floor layer: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'solidFloorLayers', num)
        except:
            raise
Exemplo n.º 8
0
    def set_rotation_angle(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define rotation angle of pattern [deg]: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, 'angle',
                                        num)
        except:
            raise
Exemplo n.º 9
0
    def set_first_layer_slicer_height(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define first layer height [mm]: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'firstLayerHeight', num)
        except:
            raise
Exemplo n.º 10
0
    def set_support_overhang_angle(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define overhang angle [deg]: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'overhangAngleThreshold', num)
        except:
            raise
Exemplo n.º 11
0
    def set_distance(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define the distance to object: ')
        try:
            num = int(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'distance', num)
        except:
            raise
Exemplo n.º 12
0
    def set_num(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        num = raw_input("Define the number of perimeter: ")
        try:
            num = int(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "perimeterCount", num)
        except:
            raise
Exemplo n.º 13
0
    def set_path_width(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        num = raw_input("Define path width: ")
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "pathWidth", num)
        except:
            raise
Exemplo n.º 14
0
    def set_first_layer_slicer_height(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        num = raw_input("Define first layer height [mm]: ")
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "firstLayerHeight", num)
        except:
            raise
Exemplo n.º 15
0
    def set_support_overhang_angle(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        num = raw_input("Define overhang angle [deg]: ")
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "overhangAngleThreshold", num)
        except:
            raise
Exemplo n.º 16
0
    def set_distance(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        num = raw_input("Define the distance to object: ")
        try:
            num = int(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "distance", num)
        except:
            raise
Exemplo n.º 17
0
    def adjust_abs_folder(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        abs_path_file = self.corePath + '\\' + self.configFile

        print abs_path_file

        ini_worker.write_to_section(abs_path_file,
                                    'MESH',
                                    'filename',
                                    self.corePath + '\\' + 'Mesh.stl')

        ini_worker.write_to_section(abs_path_file,
                                    'GCODE',
                                    'filename',
                                    self.corePath + '\\' + 'Mesh.gcode')
Exemplo n.º 18
0
    def set_path_width(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define path width: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'pathWidth', num)
        except:
            raise
Exemplo n.º 19
0
    def set_num(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define the number of perimeter: ')
        try:
            num = int(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'perimeterCount', num)
        except:
            raise
Exemplo n.º 20
0
    def set_connection_angle(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        num = raw_input("Define connection angle of pattern [deg]. Set to zero to disable connections: ")
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "maxConnectionAngle", num)
        except:
            raise
Exemplo n.º 21
0
    def set_floor_layers(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        num = raw_input("Define number of solid floor layer: ")
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "solidFloorLayers", num)
        except:
            raise
Exemplo n.º 22
0
    def set_min_segment_length(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define min segment length: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'minLength', num)
            print 'DONE'
        except:
            raise
Exemplo n.º 23
0
    def set_connection_sparse_onoff(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Switch connections to on or off: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'connectSparse', num)
            print 'DONE'
        except:
            raise
Exemplo n.º 24
0
    def switch(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        section_params = ini_worker.get_section_from_ini(
            self.INI_CONFIG, self.feature)

        for key, value in section_params.iteritems():
            if key == 'create':
                if int(value) == 0:
                    print self.feature + ' SWITCHED TO ON'
                    ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                                'create', 1)
                else:
                    print self.feature + ' SWITCHED TO OFF'
                    ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                                'create', 0)
Exemplo n.º 25
0
    def set_filter_tolerance(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define filter tolerance: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'filterTolerance', num)
            print 'DONE'
        except:
            raise
Exemplo n.º 26
0
    def set_infill_pattern(self, pattern="cross"):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        if pattern == "parallel":
            print "Infill pattern set to parallel"
            try:
                ini_worker.write_to_section(self.INI_CONFIG, self.feature, "cross", 0)
            except:
                raise
        elif pattern == "cross":
            print "Infill pattern set to cross"
            try:
                ini_worker.write_to_section(self.INI_CONFIG, self.feature, "cross", 1)
            except:
                raise
Exemplo n.º 27
0
    def set_minimum_sparse_ratio(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define ratio of sparse to solid: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'minimumSparseRatio', num)
            print 'DONE'
        except:
            raise
Exemplo n.º 28
0
    def set_infill_pattern(self, pattern='cross'):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        if pattern == 'parallel':
            print 'Infill pattern set to parallel'
            try:
                ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                            'cross', 0)
            except:
                raise
        elif pattern == 'cross':
            print 'Infill pattern set to cross'
            try:
                ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                            'cross', 1)
            except:
                raise
Exemplo n.º 29
0
    def set_feed_rate(self, num=None):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        if num is None:
            num = raw_input("Define feed rate [mm\min] > " + self.feature)
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "feedrate", num)
        except:
            raise

        return num
Exemplo n.º 30
0
    def set_feed_rate(self, num=None):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        if num is None:
            num = raw_input('Define feed rate [mm\min] > ' + self.feature)
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'feedrate', num)
        except:
            raise

        return num
Exemplo n.º 31
0
    def set_support_grid(self, num=None):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        if num is None:
            num = raw_input("Define grid square area of support tower (define one side here) [mm]: ")
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "baseWidth", num)
        except:
            raise

        return num
Exemplo n.º 32
0
    def set_support_foot_height(self, num=None):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        if num is None:
            num = raw_input('Define foot height of support tower [mm]: ')
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'footHeight', num)
        except:
            raise

        return num
Exemplo n.º 33
0
    def set_support_foot_height(self, num=None):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker

        reload(ini_worker)

        if num is None:
            num = raw_input("Define foot height of support tower [mm]: ")
        try:
            num = float(num)
        except:
            print "This is not a valid number"
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, "footHeight", num)
        except:
            raise

        return num
Exemplo n.º 34
0
    def set_support_grid(self, num=None):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        if num is None:
            num = raw_input(
                'Define grid square area of support tower (define one side here) [mm]: '
            )
        try:
            num = float(num)
        except:
            print 'This is not a valid number'
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'fieldWidth', num)
        except:
            raise

        return num
Exemplo n.º 35
0
    def run(self):
        while self.running:
            while self.last_key_stroke == None:
                if not self.running:
                    break
            if not self.running:
                break

            # time.sleep(self.time_interval)
            time_delta = 0
            while time_delta <= self.time_interval:
                time_delta = time.time() - self.last_key_stroke

            if str(ini_worker.get_param_from_ini(self.configFile, self.section, self.param)) != str(self.value):
                ini_worker.write_to_section(self.configFile,
                                            self.section,
                                            self.param,
                                            self.value)

            self.last_key_stroke = None

        print '--|X|-- key guard unplugged'
Exemplo n.º 36
0
    def run(self):
        while self.running:
            while self.last_key_stroke == None:
                if not self.running:
                    break
            if not self.running:
                break

            # time.sleep(self.time_interval)
            time_delta = 0
            while time_delta <= self.time_interval:
                time_delta = time.time() - self.last_key_stroke

            if str(
                    ini_worker.get_param_from_ini(
                        self.configFile, self.section, self.param)) != str(
                            self.value):
                ini_worker.write_to_section(self.configFile, self.section,
                                            self.param, self.value)

            self.last_key_stroke = None

        print '--|X|-- key guard unplugged'
Exemplo n.º 37
0
    def set_simulation_precision(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input('Define simulation precision [mm]. Press ESC for automated calculation: ')
        try:
            num = float(num)
        except:
            print 'Simulation set to automatic solution'
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, 'precision', 'auto')
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, 'precision', num)
        except:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature, 'precision', 'auto')
Exemplo n.º 38
0
    def set_simulation_precision(self):
        sys.path.append(self.pluginPath)
        from Utilities import ini_worker
        reload(ini_worker)

        num = raw_input(
            'Define simulation precision [mm]. Press ESC for automated calculation: '
        )
        try:
            num = float(num)
        except:
            print 'Simulation set to automatic solution'
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'precision', 'auto')
            return

        try:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'precision', num)
        except:
            ini_worker.write_to_section(self.INI_CONFIG, self.feature,
                                        'precision', 'auto')
Exemplo n.º 39
0
    def expandCollapse(self, event, refresh=False):
        if not refresh:
            section_clicked = event.EventObject.GetName()
            if self.section_EC_stat[section_clicked]:
                self.section_EC_stat[section_clicked] = 0
                ini_worker.write_to_section(self.configFile, section_clicked,
                                            'collapse', 0)
            else:
                self.section_EC_stat[section_clicked] = 1
                ini_worker.write_to_section(self.configFile, section_clicked,
                                            'collapse', 1)

        self.GOC.inject_param_changed('collapse')

        self.current_y_pxpos_elem = 0
        param_indentation = 10
        headline_placed = False

        # for section, params in self.param_dict.iteritems():
        for section in self.section_list:
            if section in self.param_dict:
                for param, value in self.param_dict[section].iteritems():

                    if self.section_EC_stat[section]:
                        # value[0].ShowWithEffect(10, timeout=30)
                        if not headline_placed:
                            value[1]['headline'].SetPosition([
                                UI.THEADERSTART['pos'][0],
                                UI.THEADERSTART['pos'][1] +
                                self.current_y_pxpos_elem
                            ])
                            value[3]['button'].SetPosition([
                                UI.BEXPAND['pos'][0],
                                UI.THEADERSTART['pos'][1] +
                                self.current_y_pxpos_elem
                            ])
                            headline_placed = True
                            self.current_y_pxpos_elem += 20

                        value[0]['ebox'][0].Show()
                        value[1]['headline'].Show()
                        value[2]['text'].Show()
                        value[0]['ebox'][0].SetPosition([
                            UI.EBOX['pos'][0], UI.THEADERSTART['pos'][1] +
                            self.current_y_pxpos_elem
                        ])
                        value[2]['text'].SetPosition([
                            UI.THEADERSTART['pos'][0] + param_indentation,
                            UI.THEADERSTART['pos'][1] +
                            self.current_y_pxpos_elem
                        ])

                        self.current_y_pxpos_elem += 20

                    else:
                        # value[0].HideWithEffect(10, timeout=30)
                        if not headline_placed:

                            value[1]['headline'].SetPosition([
                                UI.THEADERSTART['pos'][0],
                                UI.THEADERSTART['pos'][1] +
                                self.current_y_pxpos_elem
                            ])

                            value[3]['button'].SetPosition([
                                UI.BEXPAND['pos'][0],
                                UI.THEADERSTART['pos'][1] +
                                self.current_y_pxpos_elem
                            ])

                            headline_placed = True
                            self.current_y_pxpos_elem += 20

                        value[0]['ebox'][0].Hide()
                        value[2]['text'].Hide()

                headline_placed = False
Exemplo n.º 40
0
import sys

sys.path.append(
    r'C:\Users\ModuleWoks\Documents\Development\GitRep\gcode2cutsim')

import rhinoscriptsyntax as rs
from Utilities import ini_worker

reload(ini_worker)

INI_CONFIG = r'C:\StoreDaily\Mesh.ini'

section_params = ini_worker.get_section_from_ini(INI_CONFIG, 'BRIM')

for key, value in section_params.iteritems():
    if key == 'create':
        if int(value) == 0:
            print 'BRIM SWITCHED TO ON'
            ini_worker.write_to_section(INI_CONFIG, 'BRIM', 'create', 1)
        else:
            print 'BRIM SWITCHED TO OFF'
            ini_worker.write_to_section(INI_CONFIG, 'BRIM', 'create', 0)
Exemplo n.º 41
0
import sys

sys.path.append(r'C:\Users\ModuleWoks\Documents\Development\GitRep\gcode2cutsim')

import rhinoscriptsyntax as rs
from Utilities import ini_worker

reload(ini_worker)

INI_CONFIG = r'D:\StoreDaily\Mesh.ini'

section_params = ini_worker.get_section_from_ini(INI_CONFIG, 'INFILL')

for key, value in section_params.iteritems():
    if key == 'cross':
        if int(value) == 0:
            print 'INFILL PATTERN SWITCHHED TO CROSS'
            ini_worker.write_to_section(INI_CONFIG, 'INFILL', 'cross', 1)
        else:
            print 'INFILL PATTERN SWITCHHED TO PARALLEL'
            ini_worker.write_to_section(INI_CONFIG, 'INFILL', 'cross', 0)
Exemplo n.º 42
0
import sys

sys.path.append(r'C:\Users\ModuleWoks\Documents\Development\GitRep\gcode2cutsim')

import rhinoscriptsyntax as rs
from Utilities import ini_worker

reload(ini_worker)

INI_CONFIG = r'C:\StoreDaily\Mesh.ini'

section_params = ini_worker.get_section_from_ini(INI_CONFIG, 'BRIM')

for key, value in section_params.iteritems():
    if key == 'create':
        if int(value) == 0:
            print 'BRIM SWITCHED TO ON'
            ini_worker.write_to_section(INI_CONFIG, 'BRIM', 'create', 1)
        else:
            print 'BRIM SWITCHED TO OFF'
            ini_worker.write_to_section(INI_CONFIG, 'BRIM', 'create', 0)