-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathscMacroForm.py
68 lines (51 loc) · 2.18 KB
/
scMacroForm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- coding: utf-8 -*-
"""
Created on Wed May 4 21:03:49 2016
@author: peng69
"""
# -*- coding: utf-8 -*-
from abaqusGui import *
#from abaqusConstants import *
#import osutils, os
import scMacroDB
###########################################################################
# Class definition
###########################################################################
class MacroForm(AFXForm):
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def __init__(self, owner):
# Construct the base class.
#
AFXForm.__init__(self, owner)
self.radioButtonGroups = {}
self.cmd = AFXGuiCommand(mode=self, method='importSCmat',
objectName='scMacroMat', registerQuery=False)
pickedDefault = ''
self.sgmodel_sourceKw = AFXIntKeyword(self.cmd, 'sgmodel_source', True, 1)
self.sg_nameKw = AFXStringKeyword(self.cmd, 'sg_name', True)
self.sc_input_kKw = AFXStringKeyword(self.cmd, 'sc_input_k', True, '')
self.macro_modelKw = AFXIntKeyword(self.cmd, 'macro_model', True, 3, evalExpression=False)
self.analysisKw = AFXIntKeyword(self.cmd, 'analysis', True, 0, evalExpression=False)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getFirstDialog(self):
# import scMacroDB
reload(scMacroDB)
return scMacroDB.MacroDB(self)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def doCustomChecks(self):
# Try to set the appropriate radio button on. If the user did
# not specify any buttons to be on, do nothing.
#
for kw1,kw2,d in self.radioButtonGroups.values():
try:
value = d[ kw1.getValue() ]
kw2.setValue(value)
except:
pass
return True
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def okToCancel(self):
# No need to close the dialog when a file operation (such
# as New or Open) or model change is executed.
#
return False