Use tips on more cards

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2023-09-06 17:10:51 +08:00
parent 8db77cf8c7
commit a3075a5691
2 changed files with 31 additions and 18 deletions

View File

@ -15,7 +15,7 @@ class Radio extends Component {
super(props); super(props);
// Initialize the state object with the initial values from the props // Initialize the state object with the initial values from the props
this.state = { this.state = {
variant: props.outvar in props.data ? props.data[props.outvar] : props.variants[0], variant: props.outvar in props.data ? props.data[props.outvar] : props.variants[ props.fallback ? props.fallback : 0 ],
}; };
// Bind the event handler to this // Bind the event handler to this
@ -40,7 +40,7 @@ class Radio extends Component {
let key = this.props.id + this.props.outvar; let key = this.props.id + this.props.outvar;
return ( return (
<div className="shop-radio" key={this.props.id}> <div className="shop-radio" key={this.props.id}>
<div> <div style={{"display": "inline"}}>
{this.props.icon ? <img src={`/images${this.props.icon}`} className="options-icon"/> : null} {this.props.icon ? <img src={`/images${this.props.icon}`} className="options-icon"/> : null}
{this.props.title} {this.props.title}
</div> </div>
@ -78,8 +78,8 @@ class Radio extends Component {
} }
} }
function RadioWrapper(target, id, data, {title, variants, outvar, icon, tip}) { function RadioWrapper(target, id, data, {title, variants, outvar, fallback, icon, tip}) {
return <Radio target={target} title={title} variants={variants} outvar={outvar} icon={icon} tip={tip} key={id} return <Radio target={target} title={title} variants={variants} outvar={outvar} icon={icon} tip={tip} key={id} fallback={fallback}
id={id} data={data}/>; id={id} data={data}/>;
} }

View File

@ -160,11 +160,14 @@ const shop_data = {
] ]
}, },
[ [
{type: "Line", args: {title: "IPv4", outvar: "ipv4", fallback: "192.168.1.75/24"}}, {type: "Line", args: {title: "IPv4", outvar: "ipv4", fallback: "192.168.1.75/24", tip: "Set up IPv4 address used by core device"}},
{type: "SwitchLine", args: {title: "IPv6", outvar: "ipv6"}}, {type: "SwitchLine", args: {title: "IPv6", outvar: "ipv6"}},
{type: "SwitchLine", args: {title: "Ext CLK", outvar: "ext_clk", fallback: {text: "125 MHz", checked: false}}}, {type: "SwitchLine", args: {title: "Ext CLK", outvar: "ext_clk", fallback: {text: "125 MHz", checked: false}, tip: "Use external clock reference: 10, 80 (beta), 100 or 125 MHz. Other variants may be provided if needed."}},
{type: "Switch", args: {title: "Email device_db", outvar: "out", icon: "/shop/icon-leaf.svg", tip: "Send the device_db.py file by email instead of USB-drive"}},
], ],
null [
{type: "Switch", args: {title: "Optic fiber", outvar: "optics", tip: "Use optic fiber instead of direct attach copper cable"}}
]
] ]
} }
], ],
@ -284,8 +287,8 @@ const shop_data = {
slotOccupied: 1, slotOccupied: 1,
clockOccupied: 0, clockOccupied: 0,
options: [ options: [
{type: "Switch", args: {title: "Output first group", outvar: "out_first_group"}}, {type: "Switch", args: {title: "Output first group", outvar: "out_first_group", tip: "Switch connectors 0-3 to output"}},
{type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true}} {type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true, tip: "Switch connectors 4-7 to output"}}
], ],
rules: { rules: {
resources: { resources: {
@ -309,8 +312,8 @@ const shop_data = {
datasheet_file: '/docs/sinara-datasheets/2118-2128.pdf', datasheet_file: '/docs/sinara-datasheets/2118-2128.pdf',
datasheet_name: '2118/2128 BNC/SMA-TTL datasheet', datasheet_name: '2118/2128 BNC/SMA-TTL datasheet',
options: [ options: [
{type: "Switch", args: {title: "Output first group", outvar: "out_first_group"}}, {type: "Switch", args: {title: "Output first group", outvar: "out_first_group", tip: "Switch connectors 0-3 to output"}},
{type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true}} {type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true, tip: "Switch connectors 4-7 to output"}}
], ],
size: 'small', size: 'small',
type: null, type: null,
@ -346,10 +349,10 @@ const shop_data = {
datasheet_file: '/docs/sinara-datasheets/2238.pdf', datasheet_file: '/docs/sinara-datasheets/2238.pdf',
datasheet_name: '2238 MCX-TTL datasheet', datasheet_name: '2238 MCX-TTL datasheet',
options: [ options: [
{type: "Switch", args: {title: "Output first group", outvar: "out_first_group"}}, {type: "Switch", args: {title: "Output first group", outvar: "out_first_group", tip: "Switch connectors 0-3 to output"}},
{type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true}}, {type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true, tip: "Switch connectors 4-7 to output"}},
{type: "Switch", args: {title: "Output third group", outvar: "out_third_group", fallback: true}}, {type: "Switch", args: {title: "Output third group", outvar: "out_third_group", fallback: true, tip: "Switch connectors 8-11 to output"}},
{type: "Switch", args: {title: "Output fourth group", outvar: "out_fourth_group", fallback: true}} {type: "Switch", args: {title: "Output fourth group", outvar: "out_fourth_group", fallback: true, tip: "Switch connectors 12-15 to output"}}
], ],
size: 'small', size: 'small',
type: null, type: null,
@ -422,7 +425,7 @@ const shop_data = {
datasheet_file: '/docs/sinara-datasheets/4410-4412.pdf', datasheet_file: '/docs/sinara-datasheets/4410-4412.pdf',
datasheet_name: '4410/4412 Urukul datasheet', datasheet_name: '4410/4412 Urukul datasheet',
options: [ options: [
{type: "Switch", args: {title: "AD9912 instead of AD9910", outvar: "ad9912"}}, {type: "Switch", args: {title: "AD9912", outvar: "ad9912", tip: "AD9912 chip instead of AD9910"}},
{ {
"if": [ "if": [
{"var": "ad9912"}, {"var": "ad9912"},
@ -437,7 +440,7 @@ const shop_data = {
null, null,
[ [
{type: "SwitchLine", args: {title: "Ext CLK", outvar: "ext_clk", fallback: {text: "125 MHz", checked: false}}}, {type: "SwitchLine", args: {title: "Ext CLK", outvar: "ext_clk", fallback: {text: "125 MHz", checked: false}}},
{type: "Switch", args: {title: "SUServo mode", outvar: "suservo"}} {type: "Switch", args: {title: "SUServo mode", outvar: "suservo", }}
] ]
] ]
} }
@ -786,6 +789,9 @@ const shop_data = {
'Existing stack supports summing over rectangular ROIs and reporting the result to ARTIQ kernels.', 'Existing stack supports summing over rectangular ROIs and reporting the result to ARTIQ kernels.',
'Camera signal is entirely processed in the Kasli FPGA.', 'Camera signal is entirely processed in the Kasli FPGA.',
], ],
options: [
{type: "Radio", args: {title: "Connectors", outvar: "n_eem", variants: ["1 EEM", "2 EEM", "3 EEM"], tip: "Number of EEM ports to use.", fallback: 1}},
],
size: 'small', size: 'small',
type: 'koster', type: 'koster',
hp: 4, hp: 4,
@ -824,7 +830,8 @@ const shop_data = {
'Low jitter <100fs RMS.' 'Low jitter <100fs RMS.'
], ],
options: [ options: [
{type: "Switch", args: {title: "Ext CLK", outvar: "ext_clk"}} {type: "Switch", args: {title: "Ext CLK", outvar: "ext_clk"}},
{type: "Switch", args: {title: "Ext power", outvar: "ext_pwr", "tip": "Use external power supply in order to reduce number of used EEM connectors"}}
], ],
size: 'small', size: 'small',
type: 'clocker', type: 'clocker',
@ -864,6 +871,9 @@ const shop_data = {
'100Base-T Ethernet.', '100Base-T Ethernet.',
'Can be controlled by Kasli or work stand-alone with PoE supply.' 'Can be controlled by Kasli or work stand-alone with PoE supply.'
], ],
options: [
{type: "Switch", args: {title: "Ext power", outvar: "ext_pwr", "tip": "Use external power supply in order to reduce number of used EEM connectors"}}
],
size: 'small', size: 'small',
type: null, type: null,
hp: 4, hp: 4,
@ -1008,6 +1018,9 @@ const shop_data = {
'2-channel Pound Drever Hall (PDH) lock generator.', '2-channel Pound Drever Hall (PDH) lock generator.',
'AD9959 DDS (500MSPS, 10-bit).' 'AD9959 DDS (500MSPS, 10-bit).'
], ],
options: [
{type: "Switch", args: {title: "Ext power", outvar: "ext_pwr", "tip": "Use external power supply in order to reduce number of used EEM connectors"}}
],
size: 'big', size: 'big',
type: null, type: null,
hp: 8, hp: 8,