Fixed some typos, ported to win32
[vtf.git] / vtf.py
blob6e5267fa5e7460f2ac259109e9c35746a3fab61b
1 #!/usr/bin/env python
3 # system include
4 import sys, os, re, string, ConfigParser
5 sys.path.append('GuiModules')
6 sys.path.append('SrcModules')
8 # PyQt4 include
9 from PyQt4 import QtGui, QtCore
10 from vtf_gui import Ui_Vtf
12 class VtfWindow(Ui_Vtf):
13 def __init__(self):
14 self.giri = 0
15 self.denti = 0
16 self.ava_dente = 0
17 self.vel_ava = 0
18 self.diametro = 0
19 self.vel_taglio = 0
21 def FinalizeGui(self):
22 QtCore.QObject.connect(ui.SP_Denti, QtCore.SIGNAL("valueChanged (int)"), self.DentiMod)
23 QtCore.QObject.connect(ui.LE_Diametro, QtCore.SIGNAL("textChanged (QString)"), self.DiamMod)
24 QtCore.QObject.connect(ui.LE_VelTaglio, QtCore.SIGNAL("textChanged (QString)"), self.VelTaglioMod)
25 QtCore.QObject.connect(ui.LE_AvaDente, QtCore.SIGNAL("textChanged (QString)"), self.AvaDentMod)
27 def UpdateCalc(self):
28 # Calcolo il numero di giri
29 # Controllo che tutti i valori necessari siano diversi da zero
30 pass
32 def DentiMod(self, i):
33 if i == 0:
34 return
35 self.denti = i
36 self.UpdateCalc()
38 def DiamMod(self, text):
39 try:
40 self.diametro = float(text)
41 self.UpdateCalc()
42 except:
43 ui.LE_Diametro.setText(text[:-1])
45 def VelTaglioMod(self, text):
46 try:
47 self.vel_taglio = float(text)
48 self.UpdateCalc()
49 except:
50 ui.LE_VelTaglio.setText(text[:-1])
52 def AvaDentMod(self, text):
53 try:
54 self.vel_taglio = float(text)
55 self.UpdateCalc()
56 except:
57 ui.LE_AvaDente.setText(text[:-1])
59 def CheckValuesAvanz(self):
61 av = ui.LE_AvaDente()
62 if av == 0 or de == 0:
63 return 1
64 return 0
68 app = QtGui.QApplication(sys.argv)
69 window = QtGui.QDialog()
70 ui = VtfWindow()
71 ui.setupUi(window)
72 ui.FinalizeGui()
73 window.show()
74 sys.exit(app.exec_())