Add options for the cards #93

Merged
sb10q merged 42 commits from esavkin/web2019:85-variants into master 2023-11-28 15:32:34 +08:00
2 changed files with 31 additions and 18 deletions
Showing only changes of commit a3075a5691 - Show all commits

View File

@ -15,7 +15,7 @@ class Radio extends Component {
super(props);
// Initialize the state object with the initial values from the props
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
@ -40,7 +40,7 @@ class Radio extends Component {
let key = this.props.id + this.props.outvar;
return (
<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.title}
</div>
@ -78,8 +78,8 @@ class Radio extends Component {
}
}
function RadioWrapper(target, id, data, {title, variants, outvar, icon, tip}) {
return <Radio target={target} title={title} variants={variants} outvar={outvar} icon={icon} tip={tip} key={id}
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} fallback={fallback}
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: "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,
clockOccupied: 0,
options: [
{type: "Switch", args: {title: "Output first group", outvar: "out_first_group"}},
{type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true}}
{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, tip: "Switch connectors 4-7 to output"}}
],
rules: {
resources: {
@ -309,8 +312,8 @@ const shop_data = {
datasheet_file: '/docs/sinara-datasheets/2118-2128.pdf',
datasheet_name: '2118/2128 BNC/SMA-TTL datasheet',
options: [
{type: "Switch", args: {title: "Output first group", outvar: "out_first_group"}},
{type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true}}
{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, tip: "Switch connectors 4-7 to output"}}
],
size: 'small',
type: null,
@ -346,10 +349,10 @@ const shop_data = {
datasheet_file: '/docs/sinara-datasheets/2238.pdf',
datasheet_name: '2238 MCX-TTL datasheet',
options: [
{type: "Switch", args: {title: "Output first group", outvar: "out_first_group"}},
{type: "Switch", args: {title: "Output second group", outvar: "out_second_group", fallback: true}},
{type: "Switch", args: {title: "Output third group", outvar: "out_third_group", fallback: true}},
{type: "Switch", args: {title: "Output fourth group", outvar: "out_fourth_group", fallback: true}}
{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, tip: "Switch connectors 4-7 to output"}},
{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, tip: "Switch connectors 12-15 to output"}}
],
size: 'small',
type: null,
@ -422,7 +425,7 @@ const shop_data = {
datasheet_file: '/docs/sinara-datasheets/4410-4412.pdf',
datasheet_name: '4410/4412 Urukul datasheet',
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": [
{"var": "ad9912"},
@ -437,7 +440,7 @@ const shop_data = {
null,
[
{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.',
'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',
type: 'koster',
hp: 4,
@ -824,7 +830,8 @@ const shop_data = {
'Low jitter <100fs RMS.'
],
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',
type: 'clocker',
@ -864,6 +871,9 @@ const shop_data = {
'100Base-T Ethernet.',
'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',
type: null,
hp: 4,
@ -1008,6 +1018,9 @@ const shop_data = {
'2-channel Pound Drever Hall (PDH) lock generator.',
'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',
type: null,
hp: 8,