Example #1
0
    def _job_with_settings(self, *args):
        settings = Settings(filename='tests/files/job_test_settings.ngc')

        for key, value in args:
            settings.set(key, value)

        job = Job(settings)
        job.execute()

        return job
Example #2
0
    def test_from_old_configfile(self):
        s = Settings(filename='tests/files/config.ngc')

        # test integers
        self.assertEquals(s.get('v_bit_angle'), 60)
        self.assertEquals(s.get('xscale'), 100)

        # test booleans
        self.assertEquals(s.get('var_dis'), False)
        self.assertEquals(s.get('upper'), True)
Example #3
0
    def _job_with_settings(self, *args):
        settings = Settings(filename='tests/files/job_test_settings.ngc')

        for key, value in args:
            settings.set(key, value)

        job = Job(settings)
        job.execute()

        return job
Example #4
0
    def test_casting(self):
        s = Settings()

        for var in ('yscale', 'default_text', 'v_bit_angle'):
            a = type(s.get(var))
            s.set(var, 1)
            self.assertEquals(a, type(s.get(var)))
            s.set(var, 1.0)
            self.assertEquals(a, type(s.get(var)))
Example #5
0
    def test_cast_string(self):
        s = Settings()

        s.set('default_text', '  "Test123 "   ')
        self.assertEquals(s.get('default_text'), 'Test123')

        s.set('default_text', '"bla bla "foo" bla bla"')
        self.assertEquals(s.get('default_text'), 'bla bla "foo" bla bla')
Example #6
0
    def test_casting(self):
        s = Settings()

        for var in ('yscale', 'text', 'v_bit_angle'):
            a = type(s.get(var))
            s.set(var, 1)
            self.assertEquals(a, type(s.get(var)))
            s.set(var, 1.0)
            self.assertEquals(a, type(s.get(var)))
Example #7
0
    def test_cast_string(self):
        s = Settings()

        s.set('text', '  "Test123 "   ')
        self.assertEquals(s.get('text'), 'Test123')

        s.set('text', '"bla bla "foo" bla bla"')
        self.assertEquals(s.get('text'), 'bla bla "foo" bla bla')
Example #8
0
    def test_new_configfile(self):
        s = Settings(filename='tests/files/config_newstyle.ngc')

        # test integers
        self.assertEquals(s.get('v_bit_angle'), 60)
        self.assertEquals(s.get('xscale'), 100)

        # test booleans
        self.assertEquals(s.get('var_dis'), True)
        self.assertEquals(s.get('upper'), True)

        # test strings
        self.assertEquals(s.get('fontfile'), 'courier.cxf')
        self.assertEquals(s.get('gcode_preamble'),
                          'G17 G64 P0.003 M3 S3000 M7')
        self.assertEquals(s.get('default_text'), 'OOF-Engrave')
Example #9
0
    def test_new_configfile(self):
        s = Settings(filename='tests/files/config_newstyle.ngc')

        # test integers
        self.assertEquals(s.get('v_bit_angle'), 60)
        self.assertEquals(s.get('xscale'), 100)

        # test booleans
        self.assertEquals(s.get('var_dis'), False)
        self.assertEquals(s.get('upper'), True)

        # test strings
        self.assertEquals(s.get('fontfile'), 'courier.cxf')
        self.assertEquals(s.get('gcode_preamble'), 'G17 G64 P0.003 M3 S3000 M7')
        self.assertEquals(s.get('text'), 'Jieter\nbla')
Example #10
0
    def test_from_old_configfile(self):
        s = Settings(filename='tests/files/config.ngc')

        # test integers
        self.assertEquals(s.get('v_bit_angle'), 60)
        self.assertEquals(s.get('xscale'), 100)

        # test booleans
        self.assertEquals(s.get('var_dis'), True)
        self.assertEquals(s.get('upper'), True)
Example #11
0
    def test_get(self):
        s = Settings()

        self.assertEquals(s.get('fontdir'), 'fonts')
 def f(settings: Settings):
     if event.new_window_state & Gdk.WindowState.MAXIMIZED:
         settings.window_state = WindowState.MAXIMIZED
     else:
         settings.window_state = WindowState.NORMAL
Example #13
0
    def test_has_setting(self):
        s = Settings()

        self.assertTrue(s.has_setting('origin'))
        self.assertFalse(s.has_setting('sinterklaas'))
Example #14
0
    def test_reset(self):
        s = Settings()

        self.assertEquals(s.get('fontdir'), 'fonts')

        s.set('fontdir', 'foobaar')
        s.reset('fontdir')

        self.assertEquals(s.get('fontdir'), 'fonts')

        s.set('fontdir', 'blaat')
        s.set('gcode_preamble', 'quack')
        s.reset()

        self.assertEquals(s.get('fontdir'), 'fonts')
        self.assertNotEquals(s.get('gcode_preamble'), 'quack')
Example #15
0
    def test_set(self):
        s = Settings()

        s.set('fontdir', 'foobar')

        self.assertEquals(s.get('fontdir'), 'foobar')
Example #16
0
    def test_has_setting(self):
        s = Settings()

        self.assertTrue(s.has_setting('origin'))
        self.assertFalse(s.has_setting('sinterklaas'))
 def f(settings: Settings):
     settings.main_split_position = position
Example #18
0
                  - [Fixed problem that can cause the program to freeze if the saved settings contain errors.]
                  - [Fixed problem that can cause the program to freeze if the saved settings contain errors.]
             1.67 - Improved DXF import for DXF files with some incomplete data
                  - Fixed curve fitting upon g-code export.
                    Limited curve fitting angle to avoid curve fitting sharp corners.
             1.68 - [Fixed typo in code introduced in v1.67 that broke curve fitting.]

    Version 1.69b - align with f-engrave v1.69:
                 - A couple of minor fixes to keep things working in Python 3.x
                 - [Added ability to disable plotting of v-carve toolpath and area]
                 - Fixed problem causing v-carve path to go outside of design bounds for very thin design sections.
"""

# TODO insert psyco / pypy

settings = Settings(autoload=True)

if settings.get('batch'):
    # batch processing
    pass

else:
    from util import icon
    from application.gui import Gui

    try:
        from tkinter import *
        from tkinter.filedialog import *
    except:
        from Tkinter import *
        from tkFileDialog import *
Example #19
0
    def test_set(self):
        s = Settings()

        s.set('fontdir', 'foobar')

        self.assertEquals(s.get('fontdir'), 'foobar')
Example #20
0
    def test_get(self):
        s = Settings()

        self.assertEquals(s.get('fontdir'), 'fonts')
Example #21
0
 def test_get_bonus_string(self):
     """test function get_bonus_string"""
     self.assertEqual(Settings.get_bonus_string() == 'Bonus: On'\
                      , CONFIGURATION.allow_bonuses)
     self.assertEqual(Settings.get_bonus_string() == 'Bonus: Off'\
                      , (CONFIGURATION.allow_bonuses == False))
Example #22
0
    def test_reset(self):
        s = Settings()

        self.assertEquals(s.get('fontdir'), 'fonts')

        s.set('fontdir', 'foobaar')
        s.reset('fontdir')

        self.assertEquals(s.get('fontdir'), 'fonts')

        s.set('fontdir', 'blaat')
        s.set('gcode_preamble', 'quack')
        s.reset()

        self.assertEquals(s.get('fontdir'), 'fonts')
        self.assertNotEquals(s.get('gcode_preamble'), 'quack')
Example #23
0
                 - Fixed v-bit cleanup step over. Generated step was twice the input cleanup step.
                 - Updated icon.
                 - Added console version of application to windows distribution. For batch mode in Windows.

    Version 1.64 - Fixed bug that created erroneous lines in some circumstances during v-carving.
                 - Mapped save function to Control-S for easier g-code saving.

    Version 1.65 - Fixed bug in sort_for_v_carve that resulted in an error for certain designs.

    Version 1.65b - OOF-Engrave: refactored F-Engrave source code.

"""

# TODO insert psyco / pypy

settings = Settings(autoload=True)

if settings.get('batch'):
    # batch processing
    pass

else:
    from util import icon
    from application.gui import Gui

    try:
        from tkinter import *
        from tkinter.filedialog import *
    except:
        from Tkinter import *
        from tkFileDialog import *
 def f(settings: Settings):
     settings.editor_viewer_split_position = position