Commit Graph

221 Commits

Author SHA1 Message Date
Ferdi Franceschini
9305d6da53 Don't fetch an implementation if an option is disabled. 2014-07-15 08:59:15 +10:00
Ferdi Franceschini
47fbb1979e You can now set the privilege and type for MakeSICSObj in an sct template. 2014-07-11 17:14:08 +10:00
Douglas Clowes
4f72bcaaf5 allow legacy sct controllers in generated drivers 2014-07-11 13:37:50 +10:00
Douglas Clowes
5ee7e6719f Defer makesctdrive to end of mkDriver to avoid possible forward references. 2014-07-11 13:37:35 +10:00
Douglas Clowes
0dbe7bd53e Allow empty braces on sct vars and remove semicolons from python code 2014-07-11 13:37:21 +10:00
Douglas Clowes
35067c3673 Clean up Nagelfar warnings in generated drivers 2014-07-11 13:37:17 +10:00
Douglas Clowes
a9e4c80a87 Reindent gen_sct.py to 4 spaces 2014-07-11 13:37:02 +10:00
Ferdi Franceschini
679651bd28 Add some help and feedback when saving a file. 2014-07-11 08:49:40 +10:00
Ferdi Franceschini
d79865edb4 Write sections to the configuration file in the same order as the screen layout. 2014-07-11 08:49:39 +10:00
Ferdi Franceschini
8953273dac Show IP address and PORT number for implmentations that have them. 2014-07-11 08:49:38 +10:00
Ferdi Franceschini
9be5cc4cec set_imp now works in initialisation code and makes sure that 'none' is not used as a key in imp2opt_dict.
Also provide consistency_check() method to check that there is a one to one
mapping between options and implementations.
2014-07-11 08:49:37 +10:00
Ferdi Franceschini
1b4cca9390 Options not in the cascade list should have their implementation set to 'none' 2014-07-11 08:49:37 +10:00
Ferdi Franceschini
b5d3b745c3 Don't allow the implementation of permanent options to be set to 'none'. 2014-07-11 08:49:36 +10:00
Ferdi Franceschini
a294d50a1d A bit of refactoring, a bit of housekeeping. Make Pylint happy. Mmmmm nice. 2014-07-11 08:49:35 +10:00
Ferdi Franceschini
dee4b0430e The order that __get_options() and __get_implementations() are called in shouldn't matter. 2014-07-11 08:49:35 +10:00
Ferdi Franceschini
cc6634abe9 The implementation field is set only if an option is enabled in the config file.
All other options should be shown as disabled with 'none' as the implementation.
Conflicts between enabled options are resolved in favour of the first option returned
by the ConfigParser which isn't necessarily the first enabled option in the file.
Only enabled options are mapped in the imp2opt_dict dictionary.
2014-07-11 08:49:34 +10:00
Douglas Clowes
737e56670b Use shutil.copy2 to preserve file dates 2014-07-07 13:59:03 +10:00
Ferdi Franceschini
3ce563696f Remove debug output and cleanup a bit. 2014-07-06 20:15:41 +10:00
Ferdi Franceschini
46b0e1a9a3 Provide navigation context for __imp_unavailable method. 2014-07-06 20:09:15 +10:00
Ferdi Franceschini
f1b13aa7c6 Remove dependency of viewer on data and manager objects.
It just requires listboxes for the layout.
Also use new style class definition for InstConfigData and InstConfigManager.
2014-07-06 18:27:45 +10:00
Ferdi Franceschini
80cc3350c5 Experiment with "pylint: disable" to eliminate false positives from pylint. 2014-07-06 15:08:03 +10:00
Ferdi Franceschini
9228dd2c0c Remove unused variable. 2014-07-06 12:15:13 +10:00
Ferdi Franceschini
82268ecc2e Make sure all instance attributes are defined in __init__ methods.
Also play with named arguments that don't define a default value (**kwargs)
2014-07-06 12:03:19 +10:00
Ferdi Franceschini
a5ea730343 Don't redefine the 'dict' builtin. (Caught by pylint)
Also improve variable name consistency.
2014-07-06 11:47:23 +10:00
Ferdi Franceschini
8a6004e12d Stop pylint complaining about unimplemented abstract methods.
But instantiating an apparently abstract class didn't bother Python???
2014-07-06 11:14:36 +10:00
Ferdi Franceschini
13c837d9b5 Reduce pylint noise and remove unused variable imp_lw 2014-07-06 10:13:40 +10:00
Ferdi Franceschini
7eaa8242bd Always show selected_imp in the implementation list for an option.
Fix imp_statechange bug (imp undefined for disabled options).
2014-07-06 09:40:37 +10:00
Ferdi Franceschini
37e75ab5b4 Make harmless changes to reduce pylint noise.
Work out what to do about warnings and apparent errors later.
2014-07-05 22:32:34 +10:00
Ferdi Franceschini
a0465541b3 set indent to four spaces. 2014-07-05 20:16:09 +10:00
Ferdi Franceschini
30791324ac Always enable permanent options when changing instrument configuration. 2014-07-05 20:09:47 +10:00
Ferdi Franceschini
fb93daeb46 Provide set_imp(opt,imp) method to keep opt and imp mappings in sync.
Added convenience method iter_implementations(opt) to enable looping over an option's implementation list.
Setting option labels now works properly when switching configurations.
2014-07-05 19:37:23 +10:00
Ferdi Franceschini
6625060fa0 Set opt:imp as the label on option checkboxes.
Do this when selecting an implementation and when enabling an option.
TODO:
When an option is disabled insert its implementation into the implementation list.
2014-07-04 17:19:36 +10:00
Ferdi Franceschini
a802f98a24 Remove unavailable implementations from the impelementation list when an option is selected. 2014-07-04 13:46:47 +10:00
Ferdi Franceschini
abcf19553b Copy original file in backup_files method instead of renaming it in case write_config_file fails.
Add a 'none' entry to the implementation list.
2014-07-03 23:36:43 +10:00
Ferdi Franceschini
294b6fa776 Make config_edit.py easier to browse by grouping order of class declarations. 2014-07-03 18:29:39 +10:00
Ferdi Franceschini
7a4ce1f234 Write option id into driver implementation section when saving the sics_config.ini 2014-07-03 16:04:00 +10:00
Ferdi Franceschini
87bf34c7b1 Renamed type to optype in sics_config.ini so devices
like multimeters can set a data type parameter eg datype
config_edit.py uses optype instead of type
Also the listwalker is now being generated dynamically so that in the
future unavailable drivers can be moved from the list of radiobuttons.
2014-07-02 08:50:17 +10:00
Douglas Clowes
202004766a Check for existence of config dict fields before using them in generated drivers 2014-06-30 12:49:22 +10:00
Douglas Clowes
62f1170a6d Restore sorted ini files on output 2014-06-30 12:47:21 +10:00
Ferdi Franceschini
bd93c34875 copy.copy() doesn't work with urwid on the SL6 VMs.
Explicitly make a new listwalker imp_lw to avoid overwriting the first entry in self.imp_lw_dict[opt]
Python 2.6 requires field numbers for format strings.
2014-06-30 10:09:34 +10:00
Ferdi Franceschini
e971cd8b64 New sicsconfig.ini file configuration editor.
Updated wombat sics_config.ini and gen_sct.py
Generated new tcl files from sct templates and
modified some old sct_*.tcl drivers.

TODO
sct_keithley_2700.tcl
magneticField/sct_oxford_labview.tcl
magneticField/sct_bruker_BEC1.tcl
temperature/sct_watlow_st4.tcl
temperature/sct_oxford_mercury.tcl
temperature/sct_mercury_pres.tcl
temperature/sct_julabo_lh45.tcl
temperature/sct_lakeshore_340.tcl
temperature/sct_julabo_lh45_gen.tcl
temperature/sct_watlow_rm.tcl
temperature/sct_eurotherm_2000.tcl
temperature/sct_lakeshore_336.tcl
temperature/sct_watlow_pm.tcl
temperature/sct_oxford_itc.tcl
temperature/sct_lakeshore_370.tcl
temperature/west400.tcl
2014-06-30 09:08:19 +10:00
Ferdi Franceschini
a363bc3c2c Fix bug introduced when AttrWrap was replaced by AttrMap.
AttrWrap transparently passes method calls through to the widget
but you need to use the original_widget attribute with AttrMap to
access methods on the underlying widget.
2014-06-27 15:05:07 +10:00
Ferdi Franceschini
bd97a75e9d Replace deprecated urwid AttrWrap() with AttrMap() 2014-06-27 15:05:05 +10:00
Douglas Clowes
fe3489b61f SICS-754 Use "clientput" instead of "puts stdout" in generated drivers 2014-06-26 13:48:44 +10:00
Ferdi Franceschini
35c5ccbb19 Added command to make virtual motor which hdbchains to a real motor. 2014-06-23 10:29:17 +10:00
Douglas Clowes
27ed29aea5 Allow SCT files to have numbers with a leading minus 2014-06-17 14:53:48 +10:00
Douglas Clowes
18d40f69d9 Make generated drivers log to "../log" instead of "/tmp" 2014-06-16 10:30:19 +10:00
Ferdi Franceschini
ea7f7b8b9d Generate posit_n parameters from posn attributes in the motor configuration CSV files. 2014-06-10 19:23:29 +10:00
Ferdi Franceschini
cb1652835a Added 'unpad' command to remove leading zeros from base 10 numbers. 2014-06-10 19:20:41 +10:00
Ferdi Franceschini
96526c7866 Trim whitespace from description when generating motor configuration. 2014-06-10 19:16:53 +10:00