def __init__(self, netlist_file, **kwargs): ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self._Netlist_info = {} # information array self._netlist_info_done = False # flag for getting netlist info self._netlist_file = None # netlist file self._netlist_lines = [] # save verbatim input self._netlist_title_line = None # 1st line in the file self._netlist_line_list = [] # uncontinued, uncommented list self._netlist_format = "spice" # spice or spectre or verilog #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "verbose": [False, None], "simulator": ["sspice", self._config_simulator_callback], }) #---------------------------------------------------------------------- # all keyword arguments are configuration options: #---------------------------------------------------------------------- for key, value in list(kwargs.items()): self[key] = value self._read_netlist(netlist_file)
def __init__(self, par, **kwargs) : ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__par = par #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "initial_value" : [0.0, None], "current_value" : [0.0, None], "include" : [True, None], "lower_limited" : [True, None], "lower_limit" : [0.0, None], "upper_limited" : [False, None], "upper_limit" : [0.0, None], "step" : [0.0, None], "relative_step" : [0.0, None], "side" : [1, None], "minstep" : [0.0, None], "maxstep" : [0.0, None], "tied" : ["", self._config_tied_callback], "print" : [True, None], }) #---------------------------------------------------------------------- # keyword arguments are all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()) : self[key] = value self.reset()
def __init__(self, model_eqns, par_specs, **kwargs): ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__parobj = None #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "data": [None, None], "meast_col": ["", None], "model_col": ["", None], "error_col": ["", None], "residual": ["relative", None], "quiet": [False, None], }) #---------------------------------------------------------------------- # keyword arguments are all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()): self[key] = value #---------------------------------------------------------------------- # parameters #---------------------------------------------------------------------- parobj_specs = [] for line in decida.interpolate(par_specs, 2).split("\n"): line = line.strip() if line: items = line.split() name = items.pop(0) value = float(items.pop(0)) include = False lower_limited = False lower_limit = 0.0 upper_limited = False upper_limit = 0.0 for item in items: if item == "include": include = True elif re.search("^lower_limit", item): var, val = item.split("=") lower_limited = True lower_limit = float(val) elif re.search("^upper_limit", item): var, val = item.split("=") upper_limited = True upper_limit = float(val) parobj_specs.append([ name, value, include, lower_limited, upper_limited, lower_limit, upper_limit ]) self.__parobj = Parameters(specs=parobj_specs) self.__model_eqns = decida.interpolate(model_eqns, 2) self.__optobj = None
def __init__(self, parent=None, use_matplotlib=True, **kwargs): ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__parent = parent self.__use_matplotlib = use_matplotlib self.__Component = {} self.__data_obj = None self.__dataview = None self.__equations = None self.__plotter_root = "plot" #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- if sys.platform == "darwin": plot_width = "8i" plot_height = "8i" else: plot_width = "5i" plot_height = "5i" self._add_options({ "verbose": [False, None], "plot_width": [plot_width, None], "plot_height": [plot_height, None], "plot_type": ["cartesian", self._config_plot_type_callback], "sample_type": ["linear", self._config_sample_type_callback], "xcol": ["x", self._config_xcol_callback], "ycol": ["y", self._config_ycol_callback], "acol": ["theta", self._config_acol_callback], "rcol": ["r", self._config_rcol_callback], "tcol": ["t", self._config_tcol_callback], "npts": [1000, self._config_npts_callback], "min": [0.0, self._config_min_callback], "max": [5.0, self._config_max_callback], }) #---------------------------------------------------------------------- # keyword arguments are *not* all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()): if key == "equations": self.__equations = value else: self[key] = value #---------------------------------------------------------------------- # class variables #---------------------------------------------------------------------- self.__show_cols = None self.__swept_col = None #---------------------------------------------------------------------- # build gui: #---------------------------------------------------------------------- self.__gui()
def __init__(self, **kwargs) : ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: # from www.xilinx.com/support/documentation/application_notes/xapp052.pdf" #---------------------------------------------------------------------- self.__poly = ( [], [], [0], [1], [2], [2], [4], [5], [5,4,3], [4], [6], [8], [5,3,0], [3,2,0], [4,2,0], [13], [14,12,3], [13], [10], [5,1,0], [16], [18], [20], [17], [22,21,16], [21], [5,1,0], [4,1,0], [24], [26], [5,3,0], [27], [21,1,0], [19], [26,1,0], [32], [24], [4,3,2,1,0], [5,4,0], [34], [37,20,18], [37], [40,19,18], [41,37,36], [42,17,16], [43,41,40], [44,25,24], [41], [46,20,19], [39], [48,23,22], [49,35,34], [48], [51,37,36], [52,17,16], [30], [54,34,33], [49], [38], [57,37,36], [58], [59,45,44], [60,5,4], [61], [62,60,59], [46], [64,56,55], [65,57,56], [58], [66,41,39], [68,54,53], [64], [65,24,18], [47], [72,58,57], [73,64,63], [74,40,39], [75,46,45], [76,58,57], [69], [78,42,41], [76], [78,46,43], [81,37,36], [70], [83,57,56], [84,73,72], [73], [86,16,15], [50], [88,71,70], [89,7,6], [90,79,78], [90], [72], [83], [93,48,46], [90], [86], [96,53,51], [62], [99,94,93], [100,35,34], [93], [102,93,92], [88], [90], [104,43,41], [76], [107,102,101], [108,97,96], [100], [109,68,66], [103], [112,32,31], [113,100,99], [114,45,44], [114,98,96], [84], [110], [112,8,1], [102], [120,62,61], [120], [86], [123,17,16], [124,89,88], [125], [125,100,98], [123], [126], [129,83,82], [102], [131,81,80], [76], [123], [134,10,9], [115], [136,130,129], [135,133,130], [110], [139,109,108], [120], [141,122,121], [142,74,73], [92], [144,86,85], [145,109,108], [120], [147,39,38], [96], [147], [150,86,85], [151], [151,26,24], [153,123,122], [154,40,39], [155,130,129], [156,131,130], [127], [158,141,140], [142], [160,74,73], [161,103,102], [162,150,149], [163,134,133], [164,127,126], [160], [165,152,150], ) #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "v0" : [0.0, None], "v1" : [1.0, None], "delay" : [0.0, None], "edge" : [50e-12, None], "period" : [1e-9, None], "pre" : ["", None], "post" : ["", None], "start_at_first_bit" : [False, None], "format" : ["pwl", None], }) #---------------------------------------------------------------------- # keyword arguments are all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()) : self[key] = value
def __getitem__(self, item): if item in self.config_options(): return ItclObjectx.__getitem__(self, item) elif item in self.__parameters: return self.__ParHandle[item]["current_value"] self.warning("config option or parameter \"%s\" not present" % (item)) return None
def __init__(self, parent=None, specs=None, **kwargs): ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__parent = parent self.__Component = {} self.__parameters = [] self.__ParHandle = {} self.__mapped = False #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "verbose": [False, None], "gui": [True, None], }) #---------------------------------------------------------------------- # keyword arguments are all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()): self[key] = value #---------------------------------------------------------------------- # add any parameters from specs # specs should be in less restrictive form #---------------------------------------------------------------------- for spec in specs: par, init, incl, fllim, fulim, llim, ulim = spec self.add( par, initial_value=init, include=incl, lower_limited=fllim, lower_limit=llim, upper_limited=fulim, upper_limit=ulim, ) #---------------------------------------------------------------------- # build gui: #---------------------------------------------------------------------- if self["gui"]: self._gui()
def __init__(self, parent=None, title="", bitmap="info", command=None, **kwargs): ItclObjectx.__init__(self) DialogBase.__init__(self, parent=parent, title=title, bitmap=bitmap) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__status_file = "status.txt" self.__command = command self.__iter = 0 self.__after_id = None #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "verbose": [False, None], "update_time_ms": [1000, self._config_update_time_ms_callback], }) #---------------------------------------------------------------------- # keyword arguments are all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()): self[key] = value #---------------------------------------------------------------------- # run command to update status message #---------------------------------------------------------------------- if self.__command: self.__message = self.__command() while self.__message is None: self.__message = self.__command() #---------------------------------------------------------------------- # start logging status #---------------------------------------------------------------------- self._gui() msg = self._Component["message"] msg.update() self.__status_update() self.go()
def __init__(self, parent=None, **kwargs) : ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__parent = parent self.__Component = {} self.__log = False self.__saved_constants = [] self.__wait = True #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "verbose" : [False, None], }) #---------------------------------------------------------------------- # keyword arguments are *not* all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()) : if key == "wait" : self.__wait = value else : self[key] = value #---------------------------------------------------------------------- # class variables #---------------------------------------------------------------------- self.logfile = "" self.__logfid = None self.__constant_results = "" self.mem = 0 self.m = "" self.hyp = 0 self.arc = 0 self.mode = ">" self.x = [] self.STK = [] self.drg = 0 #---------------------------------------------------------------------- # build gui: #---------------------------------------------------------------------- self.__gui()
def __init__(self, **kwargs): ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__Component = {} self.__pending = None self.__Help_Message = {} #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "verbose": [False, None], "active": [True, None], "delay": [150, None], "background": ["yellow", self._config_background_callback], "foreground": ["black", self._config_foreground_callback], "font": ["Lucida 10", self._config_font_callback], "place": ["under", self._config_place_callback], "offset": [3, None], }) #---------------------------------------------------------------------- # keyword arguments are all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()): self[key] = value #---------------------------------------------------------------------- # build window: #---------------------------------------------------------------------- tk.Toplevel.__init__(self, class_="Balloonhelp") info = tk.Label(self, justify="left", wraplength="3i") info.pack(side="left", fill="y") info["background"] = self["background"] info["foreground"] = self["foreground"] info["font"] = self["font"] self.__Component["info"] = info self.wm_overrideredirect(True) self.wm_withdraw() self._config_place_callback()
def __init__(self, parent=None, **kwargs) : ItclObjectx.__init__(self) #---------------------------------------------------------------------- # private variables: #---------------------------------------------------------------------- self.__parent = parent self.__Component = {} self.__tabids = [] self.__TabText = {} self.__TabID_frame = {} self.__PageFrame = {} self.__current_tab = None self.__pending = None self.__header = True #---------------------------------------------------------------------- # configuration options: #---------------------------------------------------------------------- self._add_options({ "verbose" : [False, None], "tab_location" : ["top", self.__refresh], "wait" : [False, None], "wait_to_display": [False, None], "destroy" : [True, None], }) #---------------------------------------------------------------------- # keyword arguments are *NOT* all configuration options #---------------------------------------------------------------------- for key, value in list(kwargs.items()) : if key == "header" : self.__header = value else : self[key] = value #---------------------------------------------------------------------- # build gui: #---------------------------------------------------------------------- self.__gui()