|
35 | 35 | error('Error: Flex I/O configuration requires State Machine r2+ or newer.'); |
36 | 36 | end |
37 | 37 | dropMenuHeight = 35; |
| 38 | +dropMenuYpos = 140; |
38 | 39 | if verLessThan('matlab', '25.1') |
39 | 40 | dropMenuHeight = 15; |
| 41 | + dropMenuYpos = 160; |
40 | 42 | end |
41 | 43 | % Set background color to match UI theme |
42 | 44 | bgColor = [.8 .8 .8]; |
43 | 45 | if IsMATLAB_DarkMode |
44 | 46 | bgColor = [0.15 0.15 0.15]; |
45 | 47 | end |
46 | | -BpodSystem.GUIHandles.FlexConfigFig = figure('Position',[600 400 500 200],'name','Flex I/O Config.',... |
| 48 | +BpodSystem.GUIHandles.FlexConfigFig = figure('Position',[600 400 500 260],'name','Flex I/O Config.',... |
47 | 49 | 'numbertitle','off', 'MenuBar', 'none', 'Resize', 'off'); |
48 | 50 | fontName = 'Courier New'; |
49 | 51 | ha = axes('units','normalized', 'position',[0 0 1 1]); |
50 | 52 | uistack(ha,'bottom'); |
51 | 53 | bg = imread('InputChannelConfig2.bmp'); |
52 | 54 | image(bg); axis off; |
53 | 55 | channelTypeStrings = {'Digital In', 'Digital Out', 'Analog In', 'Analog Out', 'Disabled'}; |
54 | | -BpodSystem.GUIHandles.FlexConfig1 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [35 120 100 dropMenuHeight],... |
| 56 | +% BpodSystem.GUIHandles.FlexConfig1Label = uicontrol('Style', 'text', 'String', 'Ch1', 'Position', [35 150 100 25],... |
| 57 | +% 'BackgroundColor', bgColor, 'FontSize', 12); |
| 58 | +BpodSystem.GUIHandles.FlexConfig1 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [35 dropMenuYpos 100 dropMenuHeight],... |
55 | 59 | 'Callback', @UpdateFlexConfig,'TooltipString', 'Select Channel Type', 'BackgroundColor', bgColor, 'FontSize', 12,... |
56 | 60 | 'Value', BpodSystem.HW.FlexIO_ChannelTypes(1)+1); |
57 | | -BpodSystem.GUIHandles.FlexConfig2 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [145 120 100 dropMenuHeight],... |
| 61 | +BpodSystem.GUIHandles.FlexConfig2 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [145 dropMenuYpos 100 dropMenuHeight],... |
58 | 62 | 'Callback', @UpdateFlexConfig,'TooltipString', 'Select Channel Type', 'BackgroundColor', bgColor, 'FontSize', 12,... |
59 | 63 | 'Value', BpodSystem.HW.FlexIO_ChannelTypes(2)+1); |
60 | | -BpodSystem.GUIHandles.FlexConfig3 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [255 120 100 dropMenuHeight],... |
| 64 | +BpodSystem.GUIHandles.FlexConfig3 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [255 dropMenuYpos 100 dropMenuHeight],... |
61 | 65 | 'Callback', @UpdateFlexConfig,'TooltipString', 'Select Channel Type', 'BackgroundColor', bgColor, 'FontSize', 12,... |
62 | 66 | 'Value', BpodSystem.HW.FlexIO_ChannelTypes(3)+1); |
63 | | -BpodSystem.GUIHandles.FlexConfig4 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [365 120 100 dropMenuHeight],... |
| 67 | +BpodSystem.GUIHandles.FlexConfig4 = uicontrol('Style', 'popupmenu', 'String', channelTypeStrings, 'Position', [365 dropMenuYpos 100 dropMenuHeight],... |
64 | 68 | 'Callback', @UpdateFlexConfig,'TooltipString', 'Select Channel Type', 'BackgroundColor', bgColor, 'FontSize', 12,... |
65 | 69 | 'Value', BpodSystem.HW.FlexIO_ChannelTypes(4)+1); |
66 | | -text(130, 25, 'Flex I/O Config', 'FontName', fontName, 'FontSize', 16, 'Color', [0.8 0.8 0.8]); |
| 70 | +text(130, 20, 'Flex I/O Config', 'FontName', fontName, 'FontSize', 16, 'Color', [0.8 0.8 0.8]); |
| 71 | +text(55, 40, 'Ch1', 'FontName', fontName, 'FontSize', 12, 'Color', [0.8 0.8 0.8]); |
| 72 | +text(145, 40, 'Ch2', 'FontName', fontName, 'FontSize', 12, 'Color', [0.8 0.8 0.8]); |
| 73 | +text(232, 40, 'Ch3', 'FontName', fontName, 'FontSize', 12, 'Color', [0.8 0.8 0.8]); |
| 74 | +text(320, 40, 'Ch4', 'FontName', fontName, 'FontSize', 12, 'Color', [0.8 0.8 0.8]); |
67 | 75 |
|
68 | 76 | function UpdateFlexConfig(~,~) |
69 | 77 | global BpodSystem % Import the global BpodSystem object |
|
0 commit comments