FreeCAD-macros
1465 строк · 66.4 Кб
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3"""
4***************************************************************************
5* Copyright (c) 2014 2015 <mario52> *
6* *
7* This file is a supplement to the FreeCAD CAx development system. *
8* *
9* This program is free software; you can redistribute it and/or modify *
10* it under the terms of the GNU Lesser General Public License (LGPL) *
11* as published by the Free Software Foundation; either version 2 of *
12* the License, or (at your option) any later version. *
13* for detail see the LICENCE text file. *
14* *
15* This software is distributed in the hope that it will be useful, *
16* but WITHOUT ANY WARRANTY; without even the implied warranty of *
17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18* GNU Library General Public License for more details. *
19* *
20* You should have received a copy of the GNU Library General Public *
21* License along with this macro; if not, write to the Free Software *
22* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
23* USA *
24***************************************************************************
25* http://www.freecadweb.org/wiki/Macro_FCCircularText *
26* WARNING! All changes in this file will be lost and *
27* may cause malfunction of the program *
28***************************************************************************
29"""
30# FCCircularText.FCMacro
31# ver 0.10 #
32##################################################################################################
33# OS: Ubuntu 14.04.1 LTS # OS: Ubuntu 14.04.2 LTS
34# Platform: 32-bit # Word size of OS: 32-bit
35# Version: 0.14.2935 (Git) # Word size of FreeCAD: 32-bit
36# Branch: master # Version: 0.16.4928 (Git)
37# Hash: eab159b6ee675012bf79de838c206a311e911d85 # Branch: master
38# Python version: 2.7.6 # Hash: d8f63bcfd10301f3d1e141cced4370f0782238d0
39# Qt version: 4.8.6 # Python version: 2.7.6
40# Coin version: 4.0.0a # Qt version: 4.8.6
41# SoQt version: 1.6.0a # Coin version: 4.0.0a
42# OCC version: 6.7.0 # OCC version: 6.8.0.oce-0.17
43##################################################################################################
44# OS: Windows Vista # OS: Windows Vista
45# Word size of OS: 32-bit # Word size of OS: 32-bit
46# Word size of FreeCAD: 32-bit # Word size of FreeCAD: 32-bit
47# Version: 0.15.4527 (Git) # Version: 0.15.4671 (Git)
48# Branch: master # Branch: releases/FreeCAD-0-15
49# Hash: 0da2e4c45a9a259c26abd54c2a35393e1c15696f # Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
50# Python version: 2.7.8 # Python version: 2.7.8
51# Qt version: 4.8.6 # Qt version: 4.8.6
52# Coin version: 4.0.0a # Coin version: 4.0.0a
53# OCC version: 6.7.1 # OCC version: 6.8.0.oce-0.17
54##################################################################################################
55
56__Title__="FCCircularText"
57__Author__ = "Mario52"
58__Version__ = "00.11"
59__Date__ = "12/06/2015"
60__License__ = "LGPL-2.0-or-later"
61
62__Comment__ = "This macro creates a text around a cylinder"
63__Web__ = "http://forum.freecadweb.org/viewtopic.php?f=3&t=7384"
64__Wiki__ = "http://www.freecadweb.org/wiki/Macro_FCCircularText"
65__Icon__ = "/usr/lib/freecad/Mod/plugins/icons/FCCircularTextButtom.png"
66__IconW__ = "C:/Documents and Settings/YourUserName/Application Data/FreeCAD"
67__Help__ = "start the macro and follow the instructions"
68__Status__ = "stable"
69__Requires__ = "freecad 0.14.3706"
70__Communication__ = "http://www.freecadweb.org/wiki/User:Mario52"
71
72
73try:
74import PyQt4
75from PyQt4 import QtGui ,QtCore
76from PyQt4.QtGui import *
77from PyQt4.QtCore import *
78except Exception:
79import PySide
80from PySide import QtGui ,QtCore
81from PySide.QtGui import *
82from PySide.QtCore import *
83
84import Draft, Part, FreeCAD, math, PartGui, FreeCADGui
85from math import sqrt, pi, sin, cos, asin, degrees, radians, tan
86from FreeCAD import Base
87import os, time, sys
88
89App=FreeCAD
90Gui=FreeCADGui
91
92import sys,traceback
93def sayexc(mess=''):
94exc_type, exc_value, exc_traceback = sys.exc_info()
95ttt=repr(traceback.format_exception(exc_type, exc_value,exc_traceback))
96lls=eval(ttt)
97l=len(lls)
98l2=lls[(l-3):]
99FreeCAD.Console.PrintError(mess + "\n" +"--> ".join(l2))
100
101import platform
102
103class ConfigManager():
104
105def __init__(self,name):
106self.name="Plugins/"+name
107
108def get(self,param,default,defaultWindows=None,defaultMac=None):
109os=platform.system()
110#os='Linux'
111#os='Windows'
112#os='Darwin'
113v=False
114if not defaultWindows:
115defaultWindows=default
116if not defaultMac:
117defaultMac=default
118if os =='Windows' :
119default= defaultWindows
120if os =='Darwin' :
121default= defaultMac
122if default.__class__ == unicode:
123default=str(default)
124if default.__class__ == int:
125v=FreeCAD.ParamGet('User parameter:'+self.name).GetInt(param)
126if not v:
127FreeCAD.ParamGet('User parameter:'+self.name).SetInt(param,default)
128if default.__class__ == float:
129v=FreeCAD.ParamGet('User parameter:'+self.name).GetFloat(param)
130if not v:
131FreeCAD.ParamGet('User parameter:'+self.name).SetFloat(param,default)
132if default.__class__ == str:
133v=FreeCAD.ParamGet('User parameter:'+self.name).GetString(param)
134if not v:
135FreeCAD.ParamGet('User parameter:'+self.name).SetString(param,default)
136if default.__class__ == bool:
137v=FreeCAD.ParamGet('User parameter:'+self.name).GetBool(param)
138if not v:
139FreeCAD.ParamGet('User parameter:'+self.name).SetBool(param,default)
140if not v:
141v=default
142return v
143
144global points ;points = 0.0
145global coor_X ;coor_X = 0.0
146global coor_Y ;coor_Y = 0.0
147global coor_Z ;coor_Z = 0.0
148global vec ;vec = 0
149
150global PolicePath
151
152cm=ConfigManager("circular text")
153PolicePath=cm.get("PolicePath","/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-M.ttf","C:/Windows/Fonts/ARIAL.TTF",".../macfontdir/macfont.ttf")
154
155global rayon ;rayon = 10.0 # radius
156global texte ;texte = "FreeCAD the best" # FreeCad The Best your text
157global debut ;debut = 0 # begin text
158global rotation ;rotation = 360 # must exceed the number of characters of text
159global SizeCaractere ;SizeCaractere = 2.0 # size font
160
161global precision ;precision = 0.0
162global correctionAngle ;correctionAngle = 10.0
163global correctionRayon ;correctionRayon = 0.15
164global debout ;debout = 1 # 1=stand 0=flat
165global exterieur ;exterieur = 1 # 1=external 0=internal
166global baseHelix ;baseHelix = 0.0 # base of helix
167global endHelix ;endHelix = 0.0 # end of helix (height)
168global pasHelix ;pasHelix = 2.0 # Pas of helix
169global nombreCarParTour ;nombreCarParTour= 10 # number char by Pas
170
171global PlacementX ;PlacementX = 0.0 # Placement character axis X
172global PlacementY ;PlacementY = 0.0 # Placement character axis Y
173global PlacementZ ;PlacementZ = 0.0 # Placement character axis Z
174
175global inclinaisonX ;inclinaisonX = 0 # inclination character axis X
176global inclinaisonY ;inclinaisonY = 0 # inclination character axis Y
177global inclinaisonZ ;inclinaisonZ = 0 # inclination character axis Z + correctionAngle
178
179global cercleClock ;cercleClock = rayon # diameter support clock
180global nombreFaces ;nombreFaces = 0 # number Faces of support 0=none 1=circle 2=rectangle 3=triangle 4,5 ... polygon
181global romain ;romain = 0 # number roman or arabic
182global redressement ;redressement = 0 # character V or circular
183
184global comP ;comP = "" # container
185global nameL ;nameL = "" # container
186global epaisseur ;epaisseur = 0.0 # epaisseur extrusion character
187global epaisSupp ;epaisSupp = 0.0 # epaisseur extrusion support
188global extrusion ;extrusion = 0.0 # epaisseur extrusion
189
190global compount1 ;compount1 = 0 # cree un compose des carachteres
191
192# pointColor
193global red ;red = 1.0 # 1 = 255 [ color num x = (1/255)*x ]
194global green ;green = 0.0 #
195global blue ;blue = 0.0 #
196
197try:
198_fromUtf8 = QtCore.QString.fromUtf8
199except AttributeError:
200def _fromUtf8(s):
201return s
202
203try:
204_encoding = QtGui.QApplication.UnicodeUTF8
205def _translate(context, text, disambig):
206return QtGui.QApplication.translate(context, text, disambig, _encoding)
207except AttributeError:
208def _translate(context, text, disambig):
209return QtGui.QApplication.translate(context, text, disambig)
210
211class Ui_MainWindow(object):
212
213def setupUi(self, MainWindow):
214self.window = MainWindow
215
216path = FreeCAD.ConfigGet("AppHomePath")
217#path = FreeCAD.ConfigGet("UserAppData")
218
219global PolicePath
220global rayon
221global texte
222global rotation
223global SizeCaractere
224global debout
225global exterieur
226
227global precision
228global correctionAngle
229global correctionRayon
230global baseHelix
231global endHelix
232global nombreCarParTour
233
234global epaisseur
235global epaisSupp
236
237MainWindow.setObjectName(_fromUtf8("MainWindow"))
238MainWindow.resize(370, 638)
239MainWindow.setMaximumSize(QtCore.QSize(370, 638))
240MainWindow.setMinimumSize(QtCore.QSize(370, 638))
241self.centralWidget = QtGui.QWidget(MainWindow)
242self.centralWidget.setObjectName(_fromUtf8("centralWidget"))
243self.groupBox_02 = QtGui.QGroupBox(self.centralWidget)
244self.groupBox_02.setGeometry(QtCore.QRect(10, 100, 351, 301))
245self.groupBox_02.setAccessibleDescription(_fromUtf8(""))
246self.groupBox_02.setObjectName(_fromUtf8("groupBox_02"))
247
248self.DS_Size_Character = QtGui.QDoubleSpinBox(self.groupBox_02)
249self.DS_Size_Character.setGeometry(QtCore.QRect(140, 60, 81, 22))
250self.DS_Size_Character.setAccessibleDescription(_fromUtf8(""))
251self.DS_Size_Character.setMinimum(0.0)
252self.DS_Size_Character.setMaximum(99999999.0)
253self.DS_Size_Character.setSingleStep(1.0)
254self.DS_Size_Character.setValue(SizeCaractere)
255self.DS_Size_Character.setObjectName(_fromUtf8("DS_Size_Character"))
256self.DS_Size_Character.setToolTip(_fromUtf8("Size of the font"))
257self.DS_Size_Character.valueChanged.connect(self.on_DS_Size_Character) #connection doubleSpinBox
258
259self.label_4 = QtGui.QLabel(self.groupBox_02)
260self.label_4.setGeometry(QtCore.QRect(230, 60, 91, 16))
261self.label_4.setAccessibleDescription(_fromUtf8(""))
262self.label_4.setText(_fromUtf8("Size character"))
263self.label_4.setObjectName(_fromUtf8("label_4"))
264
265self.DS_Extrude = QtGui.QDoubleSpinBox(self.groupBox_02)
266self.DS_Extrude.setEnabled(False)
267self.DS_Extrude.setGeometry(QtCore.QRect(140, 210, 81, 22))
268self.DS_Extrude.setToolTip(_fromUtf8("Thickness of the extrude of character. If thickness = 0 then don't extrude"))
269self.DS_Extrude.setAccessibleDescription(_fromUtf8(""))
270self.DS_Extrude.setMinimum(-99999999.0)
271self.DS_Extrude.setMaximum(99999999.0)
272self.DS_Extrude.setValue(epaisseur)
273self.DS_Extrude.setObjectName(_fromUtf8("DS_Extrude"))
274self.DS_Extrude.valueChanged.connect(self.on_DS_Extrude) #connection doubleSpinBox
275
276self.label_7 = QtGui.QLabel(self.groupBox_02)
277self.label_7.setGeometry(QtCore.QRect(230, 150, 101, 20))
278self.label_7.setAccessibleDescription(_fromUtf8(""))
279self.label_7.setText(_fromUtf8("Correction Angle"))
280self.label_7.setObjectName(_fromUtf8("label_7"))
281
282self.DS_Correction_Angle = QtGui.QDoubleSpinBox(self.groupBox_02)
283self.DS_Correction_Angle.setGeometry(QtCore.QRect(140, 150, 81, 22))
284self.DS_Correction_Angle.setToolTip(_fromUtf8("Correct angle for tangent the text of the circle or give a tilt angle "))
285self.DS_Correction_Angle.setAccessibleDescription(_fromUtf8(""))
286self.DS_Correction_Angle.setMinimum(-359.00)
287self.DS_Correction_Angle.setMaximum(359.00)
288self.DS_Correction_Angle.setValue(correctionAngle)
289self.DS_Correction_Angle.setObjectName(_fromUtf8("DS_Correction_Angle"))
290self.DS_Correction_Angle.valueChanged.connect(self.on_DS_Correction_Angle) #connection doubleSpinBox
291
292self.label_8 = QtGui.QLabel(self.groupBox_02)
293self.label_8.setGeometry(QtCore.QRect(230, 180, 111, 16))
294self.label_8.setAccessibleDescription(_fromUtf8(""))
295self.label_8.setText(_fromUtf8("Correction Radius"))
296self.label_8.setObjectName(_fromUtf8("label_8"))
297
298self.DS_Correction_Radius = QtGui.QDoubleSpinBox(self.groupBox_02)
299self.DS_Correction_Radius.setGeometry(QtCore.QRect(140, 180, 81, 22))
300self.DS_Correction_Radius.setToolTip(_fromUtf8("Correct of the radius (depend of correction angle)"))
301self.DS_Correction_Radius.setAccessibleDescription(_fromUtf8(""))
302self.DS_Correction_Radius.setMinimum(-99999999.0)
303self.DS_Correction_Radius.setMaximum(99999999.0)
304self.DS_Correction_Radius.setValue(correctionRayon)
305self.DS_Correction_Radius.setObjectName(_fromUtf8("DS_Correction_Radius"))
306self.DS_Correction_Radius.valueChanged.connect(self.on_DS_Correction_Radius) #connection doubleSpinBox
307
308self.DS_Radius_Circle = QtGui.QDoubleSpinBox(self.groupBox_02)
309self.DS_Radius_Circle.setGeometry(QtCore.QRect(140, 30, 81, 22))
310self.DS_Radius_Circle.setToolTip(_fromUtf8("Give the radius of circle"))
311self.DS_Radius_Circle.setAccessibleDescription(_fromUtf8(""))
312self.DS_Radius_Circle.setMinimum(-99999999.0)
313self.DS_Radius_Circle.setMaximum(99999999.0)
314self.DS_Radius_Circle.setValue(rayon)
315self.DS_Radius_Circle.setObjectName(_fromUtf8("DS_Radius_Circle"))
316self.DS_Radius_Circle.valueChanged.connect(self.on_DS_Radius_Circle) #connection doubleSpinBox
317
318self.label_10 = QtGui.QLabel(self.groupBox_02)
319self.label_10.setGeometry(QtCore.QRect(230, 30, 101, 16))
320self.label_10.setAccessibleDescription(_fromUtf8(""))
321self.label_10.setObjectName(_fromUtf8("label_10"))
322
323self.groupBox_03 = QtGui.QGroupBox(self.groupBox_02)
324self.groupBox_03.setGeometry(QtCore.QRect(10, 20, 101, 211))
325self.groupBox_03.setAccessibleDescription(_fromUtf8(""))
326self.groupBox_03.setObjectName(_fromUtf8("groupBox_03"))
327
328self.RA_Choice_Outdoor = QtGui.QRadioButton(self.groupBox_03)
329self.RA_Choice_Outdoor.setGeometry(QtCore.QRect(10, 20, 71, 20))
330self.RA_Choice_Outdoor.setAccessibleDescription(_fromUtf8(""))
331self.RA_Choice_Outdoor.setChecked(True)
332self.RA_Choice_Outdoor.setObjectName(_fromUtf8("RA_Choice_Outdoor"))
333self.RA_Choice_Outdoor.clicked.connect(self.on_RA_Choice_Outdoor) #connection radioButton
334
335self.RA_Choice_Indoor = QtGui.QRadioButton(self.groupBox_03)
336self.RA_Choice_Indoor.setGeometry(QtCore.QRect(10, 40, 71, 20))
337self.RA_Choice_Indoor.setAccessibleDescription(_fromUtf8(""))
338self.RA_Choice_Indoor.setObjectName(_fromUtf8("RA_Choice_Indoor"))
339self.RA_Choice_Indoor.clicked.connect(self.on_RA_Choice_Indoor) #connection radioButton
340
341self.RA_Choice_Helix = QtGui.QRadioButton(self.groupBox_03)
342self.RA_Choice_Helix.setGeometry(QtCore.QRect(10, 60, 61, 20))
343self.RA_Choice_Helix.setAccessibleDescription(_fromUtf8(""))
344self.RA_Choice_Helix.setObjectName(_fromUtf8("RA_Choice_Helix"))
345self.RA_Choice_Helix.clicked.connect(self.on_RA_Choice_Helix) #connection radioButton
346
347self.RA_Choice_Clock = QtGui.QRadioButton(self.groupBox_03)
348self.RA_Choice_Clock.setGeometry(QtCore.QRect(10, 80, 61, 20))
349self.RA_Choice_Clock.setAccessibleDescription(_fromUtf8(""))
350self.RA_Choice_Clock.setObjectName(_fromUtf8("RA_Choice_Clock"))
351self.RA_Choice_Clock.clicked.connect(self.on_RA_Choice_Clock) #connection radioButton
352
353self.PU_Flat = QtGui.QPushButton(self.groupBox_03)
354self.PU_Flat.setEnabled(True)
355self.PU_Flat.setGeometry(QtCore.QRect(10, 105, 81, 28))
356self.PU_Flat.setAccessibleDescription(_fromUtf8(""))
357self.PU_Flat.setText(_fromUtf8("Mode Stand"))
358self.PU_Flat.setToolTip(_fromUtf8("Click to create the text Flat"))
359self.PU_Flat.setObjectName(_fromUtf8("PU_Flat"))
360self.PU_Flat.clicked.connect(self.on_PU_Flat)
361
362self.graphicsView = QtGui.QGraphicsView(self.groupBox_03)
363self.graphicsView.setGeometry(QtCore.QRect(10, 140, 81, 61))
364self.graphicsView.setObjectName(_fromUtf8("graphicsView"))
365
366self.label_13 = QtGui.QLabel(self.groupBox_02)
367self.label_13.setGeometry(QtCore.QRect(230, 90, 71, 16))
368self.label_13.setAccessibleDescription(_fromUtf8(""))
369self.label_13.setObjectName(_fromUtf8("label_13"))
370
371self.label_14 = QtGui.QLabel(self.groupBox_02)
372self.label_14.setGeometry(QtCore.QRect(230, 120, 71, 16))
373self.label_14.setAccessibleDescription(_fromUtf8(""))
374self.label_14.setObjectName(_fromUtf8("label_14"))
375
376self.CH_Extrude = QtGui.QCheckBox(self.groupBox_02)
377self.CH_Extrude.setGeometry(QtCore.QRect(230, 210, 105, 20))
378self.CH_Extrude.setToolTip(_fromUtf8("Choice extrude character or not"))
379self.CH_Extrude.setAccessibleDescription(_fromUtf8(""))
380self.CH_Extrude.setObjectName(_fromUtf8("CH_Extrude"))
381self.CH_Extrude.clicked.connect(self.on_CH_Extrude) #connection checkBox
382
383self.DS_InclinaisonX = QtGui.QSpinBox(self.groupBox_02)
384self.DS_InclinaisonX.setEnabled(False)
385self.DS_InclinaisonX.setGeometry(QtCore.QRect(10, 270, 61, 22))
386self.DS_InclinaisonX.setToolTip(_fromUtf8("Inclination character in axis X"))
387self.DS_InclinaisonX.setMinimum(-360)
388self.DS_InclinaisonX.setMaximum(360)
389self.DS_InclinaisonX.setValue(inclinaisonX)
390self.DS_InclinaisonX.setObjectName(_fromUtf8("DS_InclinaisonX"))
391self.DS_InclinaisonX.valueChanged.connect(self.on_DS_InclinaisonX) #connection doubleSpinBox
392
393self.DS_InclinaisonY = QtGui.QSpinBox(self.groupBox_02)
394self.DS_InclinaisonY.setEnabled(False)
395self.DS_InclinaisonY.setGeometry(QtCore.QRect(85, 270, 61, 22))
396self.DS_InclinaisonY.setToolTip(_fromUtf8("Inclination character axis Y"))
397self.DS_InclinaisonY.setMinimum(-360)
398self.DS_InclinaisonY.setMaximum(360)
399self.DS_InclinaisonY.setValue(inclinaisonY)
400self.DS_InclinaisonY.setObjectName(_fromUtf8("DS_InclinaisonY"))
401self.DS_InclinaisonY.valueChanged.connect(self.on_DS_InclinaisonY) #connection doubleSpinBox
402
403self.DS_InclinaisonZ = QtGui.QSpinBox(self.groupBox_02)
404self.DS_InclinaisonZ.setEnabled(False)
405self.DS_InclinaisonZ.setGeometry(QtCore.QRect(160, 270, 61, 22))
406self.DS_InclinaisonZ.setToolTip(_fromUtf8("Inclination character axis Z"))
407self.DS_InclinaisonZ.setMinimum(-360)
408self.DS_InclinaisonZ.setMaximum(360)
409self.DS_InclinaisonZ.setValue(inclinaisonZ)
410self.DS_InclinaisonZ.setObjectName(_fromUtf8("DS_InclinaisonZ"))
411self.DS_InclinaisonZ.valueChanged.connect(self.on_DS_InclinaisonZ) #connection doubleSpinBox
412
413self.CH_Sp_Inclination = QtGui.QCheckBox(self.groupBox_02)
414self.CH_Sp_Inclination.setGeometry(QtCore.QRect(230, 270, 111, 20))
415self.CH_Sp_Inclination.setToolTip(_fromUtf8("Inclination of character in the choice or all plane "))
416self.CH_Sp_Inclination.setText(_fromUtf8("Sp. inclination"))
417self.CH_Sp_Inclination.setObjectName(_fromUtf8("CH_Sp_Inclination"))
418self.CH_Sp_Inclination.clicked.connect(self.on_CH_Sp_Inclination) #connection checkBox
419
420self.S_Begin_Angle = QtGui.QSpinBox(self.groupBox_02)
421self.S_Begin_Angle.setGeometry(QtCore.QRect(140, 90, 81, 22))
422self.S_Begin_Angle.setMaximum(360)
423self.S_Begin_Angle.setObjectName(_fromUtf8("spinBox"))
424self.S_Begin_Angle.setToolTip(_fromUtf8("Starting text of the circle "))
425self.S_Begin_Angle.setValue(debut)
426self.S_Begin_Angle.valueChanged.connect(self.on_S_Begin_Angle) #connection SpinBox
427
428self.S_End_Angle = QtGui.QSpinBox(self.groupBox_02)
429self.S_End_Angle.setGeometry(QtCore.QRect(140, 120, 81, 22))
430self.S_End_Angle.setMaximum(360)
431self.S_End_Angle.setValue(rotation)
432self.S_End_Angle.setToolTip(_fromUtf8("End text of the circle "))
433self.S_End_Angle.setObjectName(_fromUtf8("S_End_Angle"))
434self.S_End_Angle.valueChanged.connect(self.on_S_End_Angle) #connection SpinBox
435
436self.DS_PlacementX = QtGui.QDoubleSpinBox(self.groupBox_02)
437self.DS_PlacementX.setEnabled(False)
438self.DS_PlacementX.setGeometry(QtCore.QRect(10, 240, 62, 22))
439self.DS_PlacementX.setToolTip(_fromUtf8("Placement direction X"))
440self.DS_PlacementX.setSpecialValueText(_fromUtf8(""))
441self.DS_PlacementX.setMinimum(-9999999.0)
442self.DS_PlacementX.setMaximum(9999999.99)
443self.DS_PlacementX.setObjectName(_fromUtf8("DS_PlacementX"))
444self.DS_PlacementX.valueChanged.connect(self.on_DS_PlacementX) #connection doubleSpinBox
445
446self.DS_PlacementY = QtGui.QDoubleSpinBox(self.groupBox_02)
447self.DS_PlacementY.setEnabled(False)
448self.DS_PlacementY.setGeometry(QtCore.QRect(85, 240, 62, 22))
449self.DS_PlacementY.setToolTip(_fromUtf8("Placement direction Y"))
450self.DS_PlacementY.setSpecialValueText(_fromUtf8(""))
451self.DS_PlacementY.setMinimum(-9999999.0)
452self.DS_PlacementY.setMaximum(9999999.99)
453self.DS_PlacementY.setObjectName(_fromUtf8("DS_PlacementY"))
454self.DS_PlacementY.valueChanged.connect(self.on_DS_PlacementY) #connection doubleSpinBox
455
456self.DS_PlacementZ = QtGui.QDoubleSpinBox(self.groupBox_02)
457self.DS_PlacementZ.setEnabled(False)
458self.DS_PlacementZ.setGeometry(QtCore.QRect(160, 240, 62, 22))
459self.DS_PlacementZ.setToolTip(_fromUtf8("Placement direction Z"))
460self.DS_PlacementZ.setSpecialValueText(_fromUtf8(""))
461self.DS_PlacementZ.setMinimum(-9999999.0)
462self.DS_PlacementZ.setMaximum(9999999.99)
463self.DS_PlacementZ.setObjectName(_fromUtf8("DS_PlacementZ"))
464self.DS_PlacementZ.valueChanged.connect(self.on_DS_PlacementZ) #connection doubleSpinBox
465
466self.CH_Sp_Placement = QtGui.QCheckBox(self.groupBox_02)
467self.CH_Sp_Placement.setGeometry(QtCore.QRect(230, 240, 111, 20))
468self.CH_Sp_Placement.setToolTip(_fromUtf8("Placement of character in the choice"))
469self.CH_Sp_Placement.setObjectName(_fromUtf8("CH_Sp_Placement"))
470self.CH_Sp_Placement.clicked.connect(self.on_CH_Sp_Placement) #connection checkBox
471
472self.groupBox_05 = QtGui.QGroupBox(self.centralWidget)
473self.groupBox_05.setEnabled(False)
474self.groupBox_05.setGeometry(QtCore.QRect(10, 480, 351, 111))
475self.groupBox_05.setAccessibleDescription(_fromUtf8(""))
476self.groupBox_05.setObjectName(_fromUtf8("groupBox_05"))
477
478self.PU_Roman = QtGui.QPushButton(self.groupBox_05)
479self.PU_Roman.setGeometry(QtCore.QRect(250, 20, 93, 28))
480self.PU_Roman.setAccessibleDescription(_fromUtf8(""))
481self.PU_Roman.setText(_fromUtf8("Mode Arabic"))
482self.PU_Roman.setObjectName(_fromUtf8("PU_Roman"))
483self.PU_Roman.clicked.connect(self.on_PU_Roman)
484
485self.PU_Redress = QtGui.QPushButton(self.groupBox_05)
486self.PU_Redress.setGeometry(QtCore.QRect(250, 50, 93, 28))
487self.PU_Redress.setAccessibleDescription(_fromUtf8(""))
488self.PU_Redress.setText(_fromUtf8("Redress"))
489self.PU_Redress.setObjectName(_fromUtf8("PU_Redress"))
490self.PU_Redress.clicked.connect(self.on_PU_Redress)
491
492self.S_Number_Faces_Support = QtGui.QSpinBox(self.groupBox_05)
493self.S_Number_Faces_Support.setGeometry(QtCore.QRect(10, 50, 81, 22))
494self.S_Number_Faces_Support.setToolTip(_fromUtf8("Number of side of the support 0=none, 1=circle, 2=rectangle, 3=triangle, 4=square, 5=pentagon . . . . (Thickness egal extrude)"))
495self.S_Number_Faces_Support.setAccessibleDescription(_fromUtf8(""))
496self.S_Number_Faces_Support.setMaximum(999)
497self.S_Number_Faces_Support.setValue(nombreFaces)
498self.S_Number_Faces_Support.setObjectName(_fromUtf8("S_Number_Faces_Support"))
499self.S_Number_Faces_Support.valueChanged.connect(self.on_S_Number_Faces_Support) #connection SpinBox
500
501self.label_5 = QtGui.QLabel(self.groupBox_05)
502self.label_5.setGeometry(QtCore.QRect(100, 50, 131, 16))
503self.label_5.setAccessibleDescription(_fromUtf8(""))
504self.label_5.setText(_fromUtf8("Support number face"))
505self.label_5.setObjectName(_fromUtf8("label_5"))
506
507self.DS_Radius_Support = QtGui.QDoubleSpinBox(self.groupBox_05)
508self.DS_Radius_Support.setGeometry(QtCore.QRect(10, 20, 81, 22))
509self.DS_Radius_Support.setToolTip(_fromUtf8("Radius of the support the clock (By default : Radius of circle)"))
510self.DS_Radius_Support.setAccessibleDescription(_fromUtf8(""))
511self.DS_Radius_Support.setMaximum(99999999.99)
512self.DS_Radius_Support.setValue(cercleClock)
513self.DS_Radius_Support.setObjectName(_fromUtf8("DS_Radius_Support"))
514self.DS_Radius_Support.valueChanged.connect(self.on_DS_Radius_Support) #connection doubleSpinBox
515
516self.label_11 = QtGui.QLabel(self.groupBox_05)
517self.label_11.setGeometry(QtCore.QRect(100, 20, 121, 16))
518self.label_11.setAccessibleDescription(_fromUtf8(""))
519self.label_11.setObjectName(_fromUtf8("label_11"))
520
521self.doubleSpinBox = QtGui.QDoubleSpinBox(self.groupBox_05)
522self.doubleSpinBox.setGeometry(QtCore.QRect(10, 80, 81, 22))
523self.doubleSpinBox.setObjectName(_fromUtf8("doubleSpinBox"))
524
525self.DS_Extrude_Support = QtGui.QDoubleSpinBox(self.groupBox_05)
526self.DS_Extrude_Support.setGeometry(QtCore.QRect(10, 80, 81, 22))
527self.DS_Extrude_Support.setToolTip(_fromUtf8("Thickness of the extrude the support. If thickness = 0 then don't extrude"))
528self.DS_Extrude_Support.setAccessibleDescription(_fromUtf8(""))
529self.DS_Extrude_Support.setMaximum(99999999.0)
530self.DS_Extrude_Support.setEnabled(False)
531self.DS_Extrude_Support.setValue(epaisSupp)
532self.DS_Extrude_Support.setObjectName(_fromUtf8("DS_Extrude_Support"))
533self.DS_Extrude_Support.valueChanged.connect(self.on_DS_Extrude_Support) #connection doubleSpinBox
534
535self.label_6 = QtGui.QLabel(self.groupBox_05)
536self.label_6.setGeometry(QtCore.QRect(100, 80, 121, 16))
537self.label_6.setObjectName(_fromUtf8("label_6"))
538
539self.groupBox_04 = QtGui.QGroupBox(self.centralWidget)
540self.groupBox_04.setEnabled(False)
541self.groupBox_04.setGeometry(QtCore.QRect(10, 400, 351, 81))
542self.groupBox_04.setAccessibleDescription(_fromUtf8(""))
543self.groupBox_04.setLayoutDirection(QtCore.Qt.LeftToRight)
544self.groupBox_04.setCheckable(False)
545self.groupBox_04.setObjectName(_fromUtf8("groupBox_04"))
546
547self.DS_Base_Helix = QtGui.QDoubleSpinBox(self.groupBox_04)
548self.DS_Base_Helix.setGeometry(QtCore.QRect(10, 50, 81, 22))
549self.DS_Base_Helix.setToolTip(_fromUtf8("Base (beginning) of helix (to activate Step of Helix must be zero)"))
550self.DS_Base_Helix.setEnabled(False)
551self.DS_Base_Helix.setAccessibleDescription(_fromUtf8(""))
552self.DS_Base_Helix.setMinimum(-99999999.0)
553self.DS_Base_Helix.setMaximum(99999999.0)
554self.DS_Base_Helix.setValue(baseHelix)
555self.DS_Base_Helix.setObjectName(_fromUtf8("DS_Base_Helix"))
556self.DS_Base_Helix.valueChanged.connect(self.on_DS_Base_Helix) #connection doubleSpinBox
557
558self.label = QtGui.QLabel(self.groupBox_04)
559self.label.setGeometry(QtCore.QRect(270, 20, 91, 16))
560self.label.setAccessibleDescription(_fromUtf8(""))
561self.label.setText(_fromUtf8("Char. per turn"))
562self.label.setObjectName(_fromUtf8("label"))
563
564self.DS_End_Helix = QtGui.QDoubleSpinBox(self.groupBox_04)
565self.DS_End_Helix.setGeometry(QtCore.QRect(180, 50, 81, 22))
566self.DS_End_Helix.setToolTip(_fromUtf8("Final height of the helix (to activate Step of Helix must be zero)"))
567self.DS_End_Helix.setEnabled(False)
568self.DS_End_Helix.setAccessibleDescription(_fromUtf8(""))
569self.DS_End_Helix.setMinimum(-99999999.0)
570self.DS_End_Helix.setMaximum(99999999.0)
571self.DS_End_Helix.setValue(endHelix)
572self.DS_End_Helix.setObjectName(_fromUtf8("DS_End_Helix"))
573self.DS_End_Helix.valueChanged.connect(self.on_DS_End_Helix) #connection doubleSpinBox
574
575self.label_2 = QtGui.QLabel(self.groupBox_04)
576self.label_2.setGeometry(QtCore.QRect(100, 50, 81, 16))
577self.label_2.setAccessibleDescription(_fromUtf8(""))
578self.label_2.setText(_fromUtf8("Base Helix"))
579self.label_2.setObjectName(_fromUtf8("label_2"))
580
581self.label_3 = QtGui.QLabel(self.groupBox_04)
582self.label_3.setGeometry(QtCore.QRect(270, 50, 61, 16))
583self.label_3.setAccessibleDescription(_fromUtf8(""))
584self.label_3.setText(_fromUtf8("End Helix"))
585self.label_3.setObjectName(_fromUtf8("label_3"))
586
587self.DS_Number_Char_Per_Turn = QtGui.QSpinBox(self.groupBox_04)
588self.DS_Number_Char_Per_Turn.setGeometry(QtCore.QRect(180, 20, 81, 22))
589self.DS_Number_Char_Per_Turn.setToolTip(_fromUtf8("Number of characters for one turn of helix"))
590self.DS_Number_Char_Per_Turn.setAccessibleDescription(_fromUtf8(""))
591self.DS_Number_Char_Per_Turn.setMaximum(99999999)
592self.DS_Number_Char_Per_Turn.setValue(nombreCarParTour)
593self.DS_Number_Char_Per_Turn.setObjectName(_fromUtf8("DS_Number_Char_Per_Turn"))
594self.DS_Number_Char_Per_Turn.valueChanged.connect(self.on_DS_Number_Char_Per_Turn) #connection doubleSpinBox
595
596self.DS_Step_Of_The_Helix = QtGui.QDoubleSpinBox(self.groupBox_04)
597self.DS_Step_Of_The_Helix.setGeometry(QtCore.QRect(10, 20, 81, 22))
598self.DS_Step_Of_The_Helix.setToolTip(_fromUtf8("Step of the text along the helix (min Size Character)"))
599self.DS_Step_Of_The_Helix.setAccessibleDescription(_fromUtf8(""))
600self.DS_Step_Of_The_Helix.setMaximum(99999999.99)
601self.DS_Step_Of_The_Helix.setValue(pasHelix)
602
603self.DS_Step_Of_The_Helix.setObjectName(_fromUtf8("DS_Step_Of_The_Helix"))
604self.DS_Step_Of_The_Helix.valueChanged.connect(self.on_DS_Step_Of_The_Helix) #connection doubleSpinBox
605
606self.label_12 = QtGui.QLabel(self.groupBox_04)
607self.label_12.setGeometry(QtCore.QRect(100, 20, 81, 16))
608self.label_12.setAccessibleDescription(_fromUtf8(""))
609self.label_12.setObjectName(_fromUtf8("label_12"))
610
611self.PU_Exit = QtGui.QPushButton(self.centralWidget)
612self.PU_Exit.setGeometry(QtCore.QRect(10, 600, 81, 28))
613self.PU_Exit.setAccessibleDescription(_fromUtf8(""))
614self.PU_Exit.setText(_fromUtf8("Exit"))
615self.PU_Exit.setObjectName(_fromUtf8("PU_Exit"))
616self.PU_Exit.clicked.connect(self.on_PU_Exit)
617
618self.PU_Execute = QtGui.QPushButton(self.centralWidget)
619self.PU_Execute.setGeometry(QtCore.QRect(280, 600, 81, 28))
620self.PU_Execute.setAccessibleDescription(_fromUtf8(""))
621self.PU_Execute.setText(_fromUtf8("Run"))
622self.PU_Execute.setToolTip("Execute the process") # without Compount
623self.PU_Execute.setObjectName(_fromUtf8("PU_Execute"))
624self.PU_Execute.clicked.connect(self.on_PU_Execute)
625
626self.PU_Reset = QtGui.QPushButton(self.centralWidget)
627self.PU_Reset.setGeometry(QtCore.QRect(100, 600, 81, 28))
628self.PU_Reset.setToolTip(_fromUtf8("Reset the macro and give the number of the characters of windows Textedit"))
629self.PU_Reset.setAccessibleDescription(_fromUtf8(""))
630self.PU_Reset.setEnabled(True)
631self.PU_Reset.setObjectName(_fromUtf8("PU_Reset"))
632self.PU_Reset.clicked.connect(self.on_PU_Reset)
633
634self.groupBox_01 = QtGui.QGroupBox(self.centralWidget)
635self.groupBox_01.setGeometry(QtCore.QRect(10, 0, 351, 101))
636self.groupBox_01.setAccessibleDescription(_fromUtf8(""))
637self.groupBox_01.setObjectName(_fromUtf8("groupBox_01"))
638
639self.lineEdit = QtGui.QLineEdit(self.groupBox_01)
640self.lineEdit.setGeometry(QtCore.QRect(10, 70, 211, 22))
641self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
642self.lineEdit.setText(PolicePath)
643
644self.textEdit = QtGui.QTextEdit(self.groupBox_01)
645self.textEdit.setGeometry(QtCore.QRect(10, 20, 331, 41))
646self.textEdit.setObjectName(_fromUtf8("textEdit"))
647self.textEdit.setText(texte)
648
649self.PU_New_Font = QtGui.QPushButton(self.groupBox_01)
650self.PU_New_Font.setGeometry(QtCore.QRect(230, 70, 111, 21))
651self.PU_New_Font.setToolTip(_fromUtf8("Search your new font"))
652self.PU_New_Font.setAccessibleDescription(_fromUtf8(""))
653self.PU_New_Font.setText(_fromUtf8("New Font"))
654self.PU_New_Font.setObjectName(_fromUtf8("PU_New_Font"))
655self.PU_New_Font.clicked.connect(self.on_PU_New_Font)
656
657self.PU_Benchmarks = QtGui.QPushButton(self.centralWidget)
658self.PU_Benchmarks.setGeometry(QtCore.QRect(190, 600, 81, 28))
659self.PU_Benchmarks.setToolTip(_fromUtf8("Execute the process and one Compount of the characters is create"))
660# self.PU_Benchmarks.setEnabled(True)
661self.PU_Benchmarks.setText("Run Comp")
662self.PU_Benchmarks.setObjectName(_fromUtf8("PU_Benchmarks"))
663self.PU_Benchmarks.clicked.connect(self.on_PU_Benchmarks)
664
665MainWindow.setCentralWidget(self.centralWidget)
666
667self.retranslateUi(MainWindow)
668QtCore.QMetaObject.connectSlotsByName(MainWindow)
669
670def retranslateUi(self, MainWindow):
671try:
672MainWindow.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint) # PyQt4 cette fonction met la fenetre en avant
673except Exception:
674MainWindow.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint) # PySide cette fonction met la fenetre en avant
675MainWindow.setWindowTitle("FCCircularText")
676self.groupBox_02.setTitle("Configuration FCCircularText Character")
677self.label_10.setText("Radius of circle")
678self.groupBox_03.setTitle("Choice")
679self.RA_Choice_Outdoor.setToolTip("Create the text on the outer face of the cylinder")
680self.RA_Choice_Outdoor.setText("Outdoor")
681self.RA_Choice_Indoor.setToolTip("Create the text on the inside of the cylinder")
682self.RA_Choice_Indoor.setText("Indoor")
683self.RA_Choice_Helix.setToolTip("Create the text in a helix")
684self.RA_Choice_Helix.setText("Helix")
685self.RA_Choice_Clock.setToolTip("Create the text to form a clock")
686self.RA_Choice_Clock.setText("Clock")
687self.label_13.setText("Begin angle")
688self.label_14.setText("End angle")
689self.CH_Extrude.setText("Extrude Char.")
690self.DS_InclinaisonX.setSuffix(unicode(" °"))
691self.DS_InclinaisonY.setSuffix(unicode(" °"))
692self.DS_InclinaisonZ.setSuffix(unicode(" °"))
693self.DS_PlacementX.setSuffix(" X")
694self.DS_PlacementY.setSuffix(" Y")
695self.DS_PlacementZ.setSuffix(" Z")
696self.CH_Sp_Placement.setText("Placement")
697self.groupBox_05.setTitle("Clock")
698self.PU_Roman.setToolTip("The characters is in Roman or Arabic (default)")
699self.PU_Redress.setToolTip("The numbers is straight or tangent of the circle")
700self.label_11.setText("Radius of support")
701self.label_6.setText("Extrude support")
702self.groupBox_04.setTitle("Helix")
703self.label_12.setText("Step of Helix")
704self.PU_Exit.setToolTip("Exit FCCircularText")
705self.PU_Reset.setText("Reset")
706self.groupBox_01.setTitle("Text to be displayed ( "+str(len(texte))+" characters )")
707self.lineEdit.setToolTip("Font to default")
708self.lineEdit.setText(PolicePath)
709self.textEdit.setToolTip("Your text to be displayed")
710self.textEdit.setHtml(texte)
711
712##############################################################################
713
714def on_PU_New_Font(self): # New Font
715global PolicePath
716OpenName = ""
717try:
718OpenName = QFileDialog.getOpenFileName(None,QString.fromLocal8Bit("New Font"),PolicePath,"*.ttf") # PyQt4
719except Exception:
720OpenName, Filter = PySide.QtGui.QFileDialog.getOpenFileName(None, "New Font", PolicePath, "*.ttf")#PySide
721try:
722if OpenName != "":
723PolicePath = OpenName
724self.lineEdit.setText(PolicePath)
725except Exception:
726None
727App.Console.PrintMessage("New Font " + (PolicePath)+"\n")
728
729def on_PU_Reset_Placement(self): # Reset_Placement
730global PlacementX
731global PlacementY
732global PlacementZ
733global coor_X
734global coor_Y
735global coor_Z
736coor_X = coor_Y = coor_Z = 0.0
737PlacementX = PlacementY = PlacementZ = 0.0
738self.CH_Sp_Placement.setChecked(False)
739self.DS_PlacementX.setValue(PlacementX)
740self.DS_PlacementX.setEnabled(False)
741self.DS_PlacementY.setValue(PlacementY)
742self.DS_PlacementY.setEnabled(False)
743self.DS_PlacementZ.setValue(PlacementZ)
744self.DS_PlacementZ.setEnabled(False)
745# App.Console.PrintMessage(str("on_PU_Reset_Placement ")+"\n")
746
747def on_PU_Reset_Inclination(self): # Reset_Inclination
748global inclinaisonX
749global inclinaisonY
750global inclinaisonZ
751inclinaisonX = inclinaisonY = inclinaisonZ = 0.0
752self.CH_Sp_Inclination.setChecked(False)
753self.DS_InclinaisonX.setValue(inclinaisonX)
754self.DS_InclinaisonX.setEnabled(False)
755self.DS_InclinaisonY.setValue(inclinaisonY)
756self.DS_InclinaisonY.setEnabled(False)
757self.DS_InclinaisonZ.setValue(inclinaisonZ)
758self.DS_InclinaisonZ.setEnabled(False)
759# App.Console.PrintMessage(str("on_PU_Reset_Inclination ")+"\n")
760
761def on_RA_Choice_Outdoor(self): #
762global exterieur
763global extrusion
764global epaisseur
765
766extrusion = 0
767epaisseur = 0.0
768self.DS_Extrude.setValue(epaisseur)
769self.CH_Extrude.setChecked(False)
770self.DS_Extrude.setEnabled(False)
771exterieur = 1
772self.S_Begin_Angle.setEnabled(True)
773self.S_End_Angle.setEnabled(True)
774self.DS_Correction_Radius.setEnabled(True)
775self.DS_Correction_Angle.setEnabled(True)
776self.PU_Flat.setEnabled(True)
777self.groupBox_04.setEnabled(False)
778self.groupBox_05.setEnabled(False)
779ff2 = ui
780ff2.on_PU_Reset_Placement()
781ff3 = ui
782ff3.on_PU_Reset_Inclination()
783# App.Console.PrintMessage(str("on_RA_Choice_Outdoor ")+" "+str(exterieur)+"\n")
784
785def on_RA_Choice_Indoor(self): #
786global exterieur
787global extrusion
788global epaisseur
789
790extrusion = 0
791epaisseur = 0.0
792self.DS_Extrude.setValue(epaisseur)
793self.CH_Extrude.setChecked(False)
794self.DS_Extrude.setEnabled(False)
795exterieur = 0
796self.S_Begin_Angle.setEnabled(True)
797self.S_End_Angle.setEnabled(True)
798self.DS_Correction_Radius.setEnabled(True)
799self.DS_Correction_Angle.setEnabled(True)
800self.PU_Flat.setEnabled(True)
801self.groupBox_04.setEnabled(False)
802self.groupBox_05.setEnabled(False)
803ff2 = ui
804ff2.on_PU_Reset_Placement()
805ff3 = ui
806ff3.on_PU_Reset_Inclination()
807# App.Console.PrintMessage(str("on_RA_Choice_Indoor ")+" "+str(exterieur)+"\n")
808
809def on_RA_Choice_Helix(self): #
810global exterieur
811global cercleClock
812global nombreFaces
813global debout
814global extrusion
815global epaisseur
816
817extrusion = 0
818epaisseur = 0.0
819self.DS_Extrude.setValue(epaisseur)
820self.CH_Extrude.setChecked(False)
821self.DS_Extrude.setEnabled(False)
822exterieur = 2
823cercleClock = 0
824nombreFaces = 0
825debout = 1
826
827self.RA_Choice_Outdoor.setText("Outdoor")
828self.RA_Choice_Indoor.setText("Indoor")
829self.PU_Flat.setText(_fromUtf8("Mode Stand"))
830
831self.S_Begin_Angle.setEnabled(True)
832self.S_End_Angle.setEnabled(True)
833self.DS_Correction_Radius.setEnabled(True)
834self.DS_Correction_Angle.setEnabled(True)
835self.PU_Flat.setEnabled(False)##
836self.groupBox_04.setEnabled(True)
837self.groupBox_05.setEnabled(False)
838
839ff2 = ui
840ff2.on_PU_Reset_Placement()
841ff3 = ui
842ff3.on_PU_Reset_Inclination()
843
844def on_RA_Choice_Clock(self): #
845global exterieur
846global debout
847global correctionRayon
848global correctionAngle
849global extrusion
850global epaisseur
851
852extrusion = 0
853epaisseur = 0.0
854self.DS_Extrude.setValue(epaisseur)
855self.CH_Extrude.setChecked(False)
856self.DS_Extrude.setEnabled(False)
857exterieur = 3
858debout = 0
859self.PU_Flat.setEnabled(False)
860self.S_Begin_Angle.setEnabled(False)
861self.S_End_Angle.setEnabled(False)
862# correctionRayon = 0
863self.DS_Correction_Radius.setEnabled(False)
864self.DS_Correction_Radius.setValue(0.0)
865# correctionAngle = 10.0
866self.DS_Correction_Angle.setEnabled(False)
867self.DS_Correction_Angle.setValue(0.0)
868self.groupBox_04.setEnabled(False)
869self.groupBox_05.setEnabled(True)
870ff2 = ui
871ff2.on_PU_Reset_Placement()
872ff3 = ui
873ff3.on_PU_Reset_Inclination()
874# App.Console.PrintMessage(str("on_RA_Choice_Clock ")+str(exterieur)+"\n")
875
876def on_PU_Flat(self): # Flat or Stand
877global debout
878if debout == 1:
879debout = 0
880self.RA_Choice_Outdoor.setText("Indoor")
881self.RA_Choice_Indoor.setText("Outdoor")
882self.PU_Flat.setText(_fromUtf8("Mode Flat"))
883self.PU_Flat.setToolTip(_fromUtf8("Click to create the text Stand"))
884else:
885debout = 1
886self.RA_Choice_Outdoor.setText("Outdoor")
887self.RA_Choice_Indoor.setText("Indoor")
888self.PU_Flat.setText(_fromUtf8("Mode Stand"))
889self.PU_Flat.setToolTip(_fromUtf8("Click to create the text Flat"))
890# App.Console.PrintMessage(str("on_PU_Flat ")+str(debout)+"\n")
891
892def on_DS_Radius_Circle(self,value):
893global rayon
894global cercleClock
895rayon = value
896cercleClock = rayon
897# App.Console.PrintMessage("on_DS_Radius_Circle Radius"+str(rayon)+"\n")
898
899def on_DS_Size_Character(self,value):
900global SizeCaractere
901SizeCaractere = value
902# App.Console.PrintMessage("on_DS_Size_Character Size"+str(SizeCaractere)+"\n")
903
904def on_S_Begin_Angle(self,value): #
905global debut
906debut = value
907# App.Console.PrintMessage(str("on_S_Begin_Angle ")+str(debut)+"\n")
908
909def on_S_End_Angle(self,value): #
910global rotation
911rotation = value
912# App.Console.PrintMessage(str("on_S_End_Angle ")+str(rotation)+"\n")
913
914def on_DS_PlacementX(self,value): #
915global PlacementX
916PlacementX = value
917# App.Console.PrintMessage(str("on_DS_PlacementX ")+str(PlacementX)+"\n")
918
919def on_DS_PlacementY(self,value): #
920global PlacementY
921PlacementY = value
922# App.Console.PrintMessage(str("on_DS_PlacementY ")+str(PlacementY)+"\n")
923
924def on_DS_PlacementZ(self,value): #
925global PlacementZ
926PlacementZ = value
927# App.Console.PrintMessage(str("on_DS_PlacementZ ")+str(PlacementZ)+"\n")
928
929def on_CH_Sp_Placement(self): # Placement or not Placement
930if self.CH_Sp_Placement.isChecked():
931self.DS_PlacementX.setEnabled(True)
932self.DS_PlacementY.setEnabled(True)
933self.DS_PlacementZ.setEnabled(True)
934# App.Console.PrintMessage(str("on_CH_Sp_Placement ")+str("True")+"\n")
935else:
936ff2 = ui
937ff2.on_PU_Reset_Placement()
938if self.RA_Choice_Clock.isChecked():
939self.DS_PlacementX.setEnabled(False)
940self.DS_PlacementY.setEnabled(False)
941# App.Console.PrintMessage(str("on_CH_Sp_Placement ")+str("False")+"\n")
942
943def on_DS_Correction_Angle(self,value): #
944global correctionAngle
945correctionAngle = value
946# App.Console.PrintMessage(str("on_DS_Correction_Angle ")+str(correctionAngle)+"\n")
947
948def on_DS_Correction_Radius(self,value): #
949global correctionRayon
950correctionRayon = value
951# App.Console.PrintMessage(str("on_DS_Correction_Radius ")+str(correctionRayon)+"\n")
952
953def on_DS_Extrude(self,value): #
954global epaisseur
955epaisseur = value
956# App.Console.PrintMessage("on_DS_Extrude "+str(epaisseur)+"\n")
957
958def on_CH_Extrude(self): #
959global extrusion
960global epaisseur
961if self.CH_Extrude.isChecked():
962self.DS_Extrude.setEnabled(True)
963extrusion = 1
964epaisseur = 1.0
965else:
966self.DS_Extrude.setEnabled(False)
967extrusion = 0
968epaisseur = 0.0
969self.DS_Extrude.setValue(epaisseur)
970# App.Console.PrintMessage(str("on_CH_Extrude ")+str(extrusion)+" "+str(epaisseur)+"\n")
971
972def on_DS_InclinaisonX(self,value): #
973global inclinaisonX
974inclinaisonX = value
975# App.Console.PrintMessage(str("on_DS_InclinaisonX ")+str(inclinaisonX)+"\n")
976
977def on_DS_InclinaisonY(self,value): #
978global inclinaisonY
979inclinaisonY = value
980# App.Console.PrintMessage(str("on_DS_InclinaisonY ")+str(inclinaisonY)+"\n")
981
982def on_DS_InclinaisonZ(self,value): #
983global inclinaisonZ
984inclinaisonZ = value
985# App.Console.PrintMessage(str("on_DS_InclinaisonZ ")+str(inclinaisonZ)+"\n")
986
987def on_CH_Sp_Inclination(self): #
988if self.CH_Sp_Inclination.isChecked():
989self.DS_InclinaisonX.setEnabled(True)
990self.DS_InclinaisonY.setEnabled(True)
991self.DS_InclinaisonZ.setEnabled(True)
992else:
993ff3 = ui
994ff3.on_PU_Reset_Inclination()
995# App.Console.PrintMessage(str("on_CH_Sp_Inclination ")+str(self.CH_Sp_Inclination.isChecked())+"\n")
996
997def on_DS_Step_Of_The_Helix(self,value): #
998global pasHelix
999global baseHelix
1000global endHelix
1001pasHelix = value
1002if pasHelix == 0:
1003baseHelix = endHelix = 0.0
1004self.DS_Base_Helix.setValue(baseHelix)
1005self.DS_Base_Helix.setEnabled(True)
1006self.DS_End_Helix.setValue(endHelix)
1007self.DS_End_Helix.setEnabled(True)
1008else:
1009baseHelix = endHelix = 0.0
1010self.DS_Base_Helix.setValue(baseHelix)
1011self.DS_Base_Helix.setEnabled(False)
1012self.DS_End_Helix.setValue(endHelix)
1013self.DS_End_Helix.setEnabled(False)
1014# App.Console.PrintMessage(str("on_DS_Step_Of_The_Helix ")+str(SizeCaractere)+"\n")
1015
1016def on_DS_Number_Char_Per_Turn(self,value):#
1017global nombreCarParTour
1018nombreCarParTour = value
1019# App.Console.PrintMessage(str("on_DS_Number_Char_Per_Turn ")+str(nombreCarParTour)+"\n")
1020
1021def on_DS_Base_Helix(self,value): #
1022global baseHelix
1023baseHelix = value
1024# App.Console.PrintMessage(str("on_DS_Base_Helix ")+str(baseHelix)+"\n")
1025
1026def on_DS_End_Helix(self,value): #
1027global endHelix
1028endHelix = value
1029# App.Console.PrintMessage(str("on_DS_End_Helix ")+str(endHelix)+"\n")
1030
1031def on_DS_Radius_Support(self,value): #
1032global cercleClock
1033cercleClock = value
1034# App.Console.PrintMessage(str("on_DS_Radius_Support ")+str(cercleClock)+"\n")
1035
1036def on_S_Number_Faces_Support(self,value): # number Faces of support 0=none 1=circle 2=rectangle 3=triangle 4,5 ... polygon
1037global nombreFaces
1038nombreFaces = value
1039self.DS_Extrude_Support.setEnabled(True)
1040if nombreFaces == 0:
1041self.label_5.setText(_fromUtf8("Support number face"))
1042self.DS_Extrude_Support.setEnabled(False)
1043elif nombreFaces == 1:
1044self.label_5.setText(_fromUtf8("Support Circle"))
1045elif nombreFaces == 2:
1046self.label_5.setText(_fromUtf8("Support Rectangle"))
1047elif nombreFaces == 3:
1048self.label_5.setText(_fromUtf8("Support Triangle"))
1049elif nombreFaces == 4:
1050self.label_5.setText(_fromUtf8("Support Square"))
1051else :
1052self.label_5.setText(_fromUtf8("Support Polygone"))
1053# App.Console.PrintMessage(str("on_S_Number_Faces_Support ")+str(nombreFaces)+"\n")
1054
1055def on_DS_Extrude_Support(self,value): #
1056global epaisSupp
1057epaisSupp = value
1058self.DS_PlacementZ.setEnabled(True)
1059# App.Console.PrintMessage(str("on_DS_Extrude_Support ")+str(epaisSupp)+"\n")
1060
1061def on_PU_Roman(self): # Roman or Arabic Clock
1062global romain
1063if romain == 1:
1064romain = 0
1065self.PU_Roman.setText(_fromUtf8("Mode Arabic"))
1066self.PU_Roman.setToolTip(_fromUtf8("Click to activate Roman mode"))
1067else:
1068romain = 1
1069self.PU_Roman.setText(_fromUtf8("Mode Roman"))
1070self.PU_Roman.setToolTip(_fromUtf8("Click to activate Arabic mode"))
1071# App.Console.PrintMessage(str("romain ")+str(romain)+"\n")
1072
1073def on_PU_Redress(self): # Redress or circumferential Clock
1074global redressement
1075if redressement == 1:
1076redressement = 0
1077self.PU_Redress.setText(_fromUtf8("Redress"))
1078self.PU_Redress.setToolTip(_fromUtf8("Click to activate Axial mode"))
1079else:
1080redressement = 1
1081self.PU_Redress.setText(_fromUtf8("Axial"))
1082self.PU_Redress.setToolTip(_fromUtf8("Click to activate Redress mode"))
1083# App.Console.PrintMessage(str("redressement ")+str(redressement)+"\n")
1084
1085def on_PU_Exit(self): # Exit
1086App.Console.PrintMessage("Fin FCCircularText"+"\n")
1087self.window.hide()
1088
1089def on_PU_Reset(self): #
1090global points
1091global coor_X
1092global coor_Y
1093global coor_Z
1094global vec
1095
1096global PolicePath
1097
1098global rayon
1099global texte
1100global debut
1101global rotation
1102global SizeCaractere
1103
1104global precision
1105global correctionAngle
1106global correctionRayon
1107global debout
1108global exterieur
1109global baseHelix
1110global endHelix
1111global pasHelix
1112global nombreCarParTour
1113
1114global PlacementX
1115global PlacementY
1116global PlacementZ
1117
1118global inclinaisonX
1119global inclinaisonY
1120global inclinaisonZ
1121
1122global cercleClock
1123global nombreFaces
1124global romain
1125global redressement
1126
1127global comP
1128global nameL
1129global epaisseur
1130global epaisSupp
1131global extrusion
1132global compount1
1133
1134texte = ""
1135
1136exterieur = 1
1137self.RA_Choice_Outdoor.setText("Outdoor")
1138self.RA_Choice_Indoor.setText("Indoor")
1139self.RA_Choice_Outdoor.setChecked(True)
1140
1141debout = 1
1142self.PU_Flat.setText(_fromUtf8("Mode Stand"))
1143self.PU_Flat.setToolTip(_fromUtf8("Click to create the Flat text"))
1144
1145SizeCaractere = 2.0
1146self.DS_Size_Character.setValue(SizeCaractere)
1147rayon = 10.0
1148self.DS_Radius_Circle.setValue(rayon)
1149
1150debut = 0
1151self.S_Begin_Angle.setValue(debut)
1152self.S_Begin_Angle.setEnabled(True)
1153rotation = 360
1154self.S_End_Angle.setValue(rotation)
1155self.S_End_Angle.setEnabled(True)
1156
1157correctionAngle = 10.0
1158self.DS_Correction_Angle.setValue(correctionAngle)
1159self.DS_Correction_Radius.setEnabled(True)
1160correctionRayon = 0.15
1161self.DS_Correction_Radius.setValue(correctionRayon)
1162self.DS_Correction_Angle.setEnabled(True)
1163
1164extrusion = 0
1165epaisseur = 0.0
1166self.DS_Extrude.setValue(epaisseur)
1167self.CH_Extrude.setChecked(False)
1168self.DS_Extrude.setEnabled(False)
1169
1170ff2 = ui
1171ff2.on_PU_Reset_Placement()
1172ff3 = ui
1173ff3.on_PU_Reset_Inclination()
1174
1175self.groupBox_04.setEnabled(False)
1176baseHelix = 0.0
1177self.DS_Base_Helix.setValue(baseHelix)
1178self.DS_Base_Helix.setEnabled(False)
1179endHelix = 0.0
1180self.DS_End_Helix.setValue(endHelix)
1181self.DS_Base_Helix.setEnabled(False)
1182pasHelix = 2.0
1183self.DS_Step_Of_The_Helix.setValue(pasHelix)
1184nombreCarParTour = 10
1185self.DS_Number_Char_Per_Turn.setValue(nombreCarParTour)
1186
1187self.groupBox_05.setEnabled(False)
1188cercleClock = rayon
1189self.DS_Radius_Support.setValue(cercleClock)
1190nombreFaces = 0
1191self.S_Number_Faces_Support.setValue(nombreFaces)
1192self.label_5.setText(_fromUtf8("Support number face"))
1193epaisSupp = 0.0
1194self.DS_Extrude_Support.setEnabled(False)
1195self.DS_Extrude_Support.setValue(epaisSupp)
1196
1197romain = 0
1198self.PU_Roman.setText(_fromUtf8("Mode Arabic"))
1199self.PU_Roman.setToolTip(_fromUtf8("Click to activate Roman mode"))
1200redressement = 0
1201self.PU_Redress.setText(_fromUtf8("Redress"))
1202self.PU_Redress.setToolTip(_fromUtf8("Click to activate Axial mode"))
1203
1204compount1 = 0
1205
1206##### update the setTitle ########################################
1207
1208texte = unicode(self.textEdit.toPlainText())
1209self.groupBox_01.setTitle("Text to be displayed ( "+str(len(texte))+" characters )")
1210# App.Console.PrintMessage(str("on_PU_Reset ")+str()+"\n")
1211
1212def on_PU_Benchmarks(self): # Benchmarks
1213try:
1214global compount1
1215compount1 = 1
1216ff = ui
1217ff.on_PU_Execute()
1218# App.Console.PrintMessage(str("Benchmarks")+"\n")
1219except:
1220sayexc("Error")
1221
1222##########################################################################
1223
1224def on_PU_Execute(self): # Execute
1225global PolicePath
1226
1227global points
1228global coor_X
1229global coor_Y
1230global coor_Z
1231
1232global PlacementX
1233global PlacementY
1234global PlacementZ
1235
1236global inclinaisonX
1237global inclinaisonY
1238global inclinaisonZ
1239
1240global vec
1241global PolicePath
1242global rayon
1243global texte
1244global debut
1245global rotation
1246global SizeCaractere
1247
1248global ii
1249global precision
1250global correctionAngle
1251global correctionRayon
1252global debout
1253global exterieur
1254global baseHelix
1255global endHelix
1256global pasHelix
1257global nombreCarParTour
1258
1259global cercleClock
1260global nombreFaces
1261global romain
1262global redressement
1263
1264global comP
1265global nameL
1266
1267global epaisseur
1268global epaisSupp
1269global extrusion
1270global compount1
1271
1272points = []
1273comP = []
1274nameL = []
1275
1276del points[:]
1277del comP[:]
1278del nameL[:]
1279
1280doc = FreeCAD.ActiveDocument
1281if doc == None:
1282doc = FreeCAD.newDocument()
1283
1284texte = unicode(self.textEdit.toPlainText())
1285self.groupBox_01.setTitle("Text to be displayed ( "+str(len(texte))+" characters )")
1286
1287if ((exterieur == 0) and (debout == 0)):
1288vecligne=[FreeCAD.Vector(PlacementX,PlacementY,PlacementZ),FreeCAD.Vector(rayon + correctionRayon,0.0,0.0)] #
1289else:
1290if exterieur == 3:
1291vecligne=[FreeCAD.Vector(PlacementX,PlacementY,PlacementZ),FreeCAD.Vector(rayon - (SizeCaractere/2),0.0,0.0)] #
1292elif debout == 0:
1293vecligne=[FreeCAD.Vector(PlacementX,PlacementY,PlacementZ),FreeCAD.Vector(rayon + correctionRayon - SizeCaractere,0.0,0.0)] #
1294else:
1295vecligne=[FreeCAD.Vector(PlacementX,PlacementY,PlacementZ),FreeCAD.Vector(rayon + correctionRayon,0.0,0.0)] #
1296
1297ligne = Draft.makeWire(vecligne,closed=False,face=False,support=None) # creation de la ligne de base
1298lineName = ligne.Name
1299
1300ii = -1
1301ii2 = -1
1302
1303nombre = len(texte)
1304coor_Z = PlacementZ
1305
1306if (exterieur == 0) or (debout == 0):
1307texte = texte[::-1]
1308if (exterieur == 0) and (debout == 0):
1309texte = texte[::-1]
1310
1311depart = time.clock() # chrono begin
1312
1313if exterieur == 2: # helix
1314if nombreCarParTour == 0:
1315nombreCarParTour = 1
1316App.Console.PrintError("Insufficient number"+"\n")
1317pas = 0.0
1318nombre = nombreCarParTour
1319if pasHelix != 0:
1320pas = pasHelix / (nombreCarParTour)
1321else:
1322pas = ((((endHelix - SizeCaractere)-baseHelix)/(len(texte) / nombreCarParTour))/(nombreCarParTour)) # pas of helix
1323coor_Z += baseHelix
1324else:
1325nombreCarParTour = 1
1326
1327if exterieur == 3: # Clock
1328FcString = doc.addObject("App::DocumentObjectGroup","FcClock")
1329nombre = 12
1330if romain == 0:
1331texte = ["1","2","3","4","5","6","7","8","9","10","11","12"]
1332else:
1333texte = ["I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"]
1334texte = texte[::-1]
1335else:
1336FcString = doc.addObject("App::DocumentObjectGroup","FcString")
1337
1338####Boucle principale############################################################################
1339boucler = len(texte) / nombreCarParTour
1340
1341if (len(texte) % nombreCarParTour) != 0: # calcul number spires Helix
1342boucler += 1
1343
1344for hel in range(boucler):
1345ii = -1
1346####Boucle de travail#################################################
1347for angleTr in range(debut,rotation,((rotation-debut)/nombre)):
1348ii += 1
1349ii2 += 1
1350ligne.Placement = App.Placement(App.Vector(PlacementX,PlacementY,PlacementZ), App.Rotation(App.Vector(0,0,1),angleTr), App.Vector(0,0,0))
1351a = ligne.Shape.Edges[0].Vertexes[1] # fin de ligne
1352
1353coor_X = (a.Point.x)
1354coor_Y = (a.Point.y)
1355
1356if (ii < nombre) and (ii2 < len(texte)):
1357if exterieur == 3: # clock
1358ligne.Placement = App.Placement(App.Vector(PlacementX,PlacementY,PlacementZ), App.Rotation(App.Vector(0,0,1),angleTr+90), App.Vector(0,0,0))
1359a = ligne.Shape.Edges[0].Vertexes[1] # fin
1360coor_X = (a.Point.x)
1361coor_Y = (a.Point.y)
1362ss=Draft.makeShapeString(String=unicode(texte[ii2]),FontFile=PolicePath,Size=SizeCaractere,Tracking=0)
1363
1364FcString.addObject(ss) # container character
1365
1366centreX = (ss.Shape.BoundBox.Center[0])
1367centreY = (ss.Shape.BoundBox.Center[1])
1368centreZ = (ss.Shape.BoundBox.Center[2])
1369lengthX = (ss.Shape.BoundBox.XLength)
1370lengthY = (ss.Shape.BoundBox.YLength)
1371lengthZ = (ss.Shape.BoundBox.ZLength)
1372
1373coor_X = coor_X + PlacementX
1374coor_Y = coor_Y + PlacementY
1375
1376plm=""
1377plm=FreeCAD.Placement()
1378plm.Base=FreeCAD.Vector(coor_X,coor_Y,coor_Z)
1379
1380if debout == 1: # debout
1381if exterieur == 0: # circumferential internal
1382plm = App.Placement(App.Vector(coor_X,coor_Y,coor_Z), App.Rotation(angleTr-90-correctionAngle+inclinaisonX,inclinaisonY,90+inclinaisonZ), App.Vector(0,0,0)) # pitch,roll...1
1383elif exterieur == 1: # circumferential external
1384plm = App.Placement(App.Vector(coor_X,coor_Y,coor_Z), App.Rotation(angleTr+90+correctionAngle+inclinaisonX,inclinaisonY,90+inclinaisonZ), App.Vector(0,0,0)) # pitch,roll...1
1385elif exterieur == 2: # circumferential helix
1386plm = App.Placement(App.Vector(coor_X,coor_Y,coor_Z), App.Rotation(angleTr+90+correctionAngle+inclinaisonX,inclinaisonY,90+inclinaisonZ), App.Vector(0,0,0)) # pitch,roll...1
1387coor_Z = coor_Z + pas
1388else: # a plat
1389if exterieur == 1: # exterieur (superieur)
1390plm = App.Placement(App.Vector(coor_X,coor_Y,coor_Z), App.Rotation(angleTr-90-correctionAngle+inclinaisonX,inclinaisonY,inclinaisonZ), App.Vector(0,0,0)) # pitch,roll...1
1391elif exterieur == 3: # circumferential plat (clock)
1392if redressement == 1:
1393plm = App.Placement(App.Vector(coor_X-centreX,coor_Y-centreY,coor_Z), App.Rotation(inclinaisonX,inclinaisonY,inclinaisonZ), App.Vector(0,0,0)) # pitch,roll...1
1394else:
1395plm = App.Placement(App.Vector(coor_X-centreX,coor_Y-centreY,coor_Z), App.Rotation(angleTr+inclinaisonX,inclinaisonY,inclinaisonZ), App.Vector(centreX,centreY,centreZ)) # pitch,roll...1
1396else: # interieur (inferieur)
1397plm = App.Placement(App.Vector(-coor_X,-coor_Y,-coor_Z), App.Rotation(angleTr+90+correctionAngle+inclinaisonX,180+inclinaisonY,180+inclinaisonZ), App.Vector(0,0,0)) # pitch,roll...1
1398
1399if epaisseur > 0: # extrusion characrters
1400CharExtrude = Draft.extrude(ss,Base.Vector(0,0,epaisseur))
1401CharExtrude.Placement=plm
1402comP.append(CharExtrude.Shape)
1403# nameL.append(CharExtrude.Name)
1404FcString.addObject(CharExtrude) # container extrude
1405else: #
1406ss.Placement=plm
1407ss.Support=None
1408comP.append(ss.Shape)
1409# nameL.append(ss.Name)
1410
1411# points += [FreeCAD.Vector(coor_X,coor_Y,coor_Z)] # coordinates makeBSpline
1412# BSpline = Draft.makeBSpline(points,closed=False) # makeBSpline repere
1413App.ActiveDocument.removeObject(lineName) # remove ligne de base directrice
1414if compount1 == 1: # create compount
1415comp = Part.makeCompound(comP)
1416Part.show(comp)
1417####Boucle de travail fin########################################################################
1418
1419####Extrude support clock#############################################
1420if nombreFaces > 0: # support clock
1421pl = FreeCAD.Placement()
1422if nombreFaces == 1: # circle
1423pl.Base = FreeCAD.Vector(0.0,0.0,0.0)
1424supp = Draft.makeCircle(cercleClock,placement=pl,face=True,support=None)
1425if nombreFaces == 2: # rectangle
1426cercleClock = cercleClock * 2
1427pl.Base = FreeCAD.Vector(-cercleClock, (-cercleClock / 2), 0.0)
1428supp = Draft.makeRectangle((cercleClock * 2), cercleClock, placement=pl, face = True)
1429if nombreFaces > 2: # polygon with number faces
1430if nombreFaces == 4:
1431rotateSupport = 45
1432else:
1433rotateSupport = 90
1434pl = App.Placement(App.Vector(0.0,0.0,0.0), App.Rotation(rotateSupport,0,0), App.Vector(0,0,0))
1435supp = Draft.makePolygon(nombreFaces,cercleClock,inscribed = False,placement = pl,face = True,support=None)
1436
1437supp.MakeFace = True
1438App.activeDocument().recompute()
1439FcString.addObject(supp) # container support
1440
1441if epaisSupp != 0: # extrude support clock
1442suppExtrude = Draft.extrude(supp,Base.Vector(0,0,epaisSupp))
1443FcString.addObject(suppExtrude) # container support extrude
1444
1445####Info################################################
1446App.Console.PrintMessage((PolicePath)+"\n")
1447App.Console.PrintMessage(u"texte " + unicode(texte)+"\n")
1448App.Console.PrintMessage("rayon " + str(rayon)+"\n")
1449App.Console.PrintMessage("rotation " + str(rotation)+"\n")
1450App.Console.PrintMessage("SizeCaractere " + str(SizeCaractere)+"\n")
1451App.Console.PrintMessage("debout " + str(debout)+"\n")
1452
1453####Reset################################################
1454ff = ui
1455ff.on_PU_Reset()
1456
1457#### Chrono end ####################################
1458arrive = time.clock() # chrono end
1459App.Console.PrintMessage("Time : "+str("%.2f" % ((arrive - depart)/60))+" min"+"\n\n") # chrono end
1460####################################################
1461
1462MainWindow = QtGui.QMainWindow()
1463ui = Ui_MainWindow()
1464ui.setupUi(MainWindow)
1465MainWindow.show()
1466