Plugins-water-example code
From Bcontrol
% The following code runs stand-alone (assuming newstartup.m has been run). % % % Now let's make an object that is of the @water class. Normally, % this would be your protocol object, and you would inherit @water; % (e.g., "obj = class(struct, 'myprotocol', water)". % But here, we're just exemplifying @water, so we won't use a % protocol. The simplest object that is also a @water is @water % itself: gu = water % Now let's initialize it, with the lower left hand corner of its % GUI components (10, 10) pixels from the lower left hand corner of % the current figure: WaterValvesSection(gu, 'init', 10, 10) % We are assuming that the current rig's water calibration table % (which is managed separately; @water is just for *using* the water % calibration table, not for managing it) has entries for 24 uL on % both right and left valves. Then we can command-line ask for quantities % nearby. Note how the times display is automatically updated. WaterValvesSection(gu, 'set_water_amounts', 25, 23) % You can also edit the desired amounts by hand, ont he GUI, of course. % If you want to read the dispense times values into your program, not % through the GUI, use this call: [Lt, Rt] = WaterValvesSection(gu, 'get_water_times')