Add 2 channel thermostat to shop #139

Merged
sb10q merged 1 commits from esavkin/web2019:31-thermostat-2ch into master 2024-07-05 14:50:10 +08:00
6 changed files with 59 additions and 5 deletions
Showing only changes of commit d3cc86dfa5 - Show all commits

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 35 KiB

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,8 @@ function ClockRenderer({occupied, max}) {
const resource_progress_renderers = {
"eem": EEMRenderer,
"clk": ClockRenderer,
"idc": EEMRenderer
"idc": EEMRenderer,
"tec": EEMRenderer
Outdated
Review

Just call it TEC connector. IDC 10-pin is a silly name.

Just call it TEC connector. IDC 10-pin is a silly name.
}
@ -45,6 +46,10 @@ function IDCTipRender({occupied, max}) {
return (<p key={uuidv4()}>{`${occupied}/${max} IDC connectors used`}</p>);
}
function TECTipRender({occupied, max}) {
return (<p key={uuidv4()}>{`${occupied}/${max} TEC connectors used`}</p>);
}
function ClockTipRender({occupied, max}) {
return (<p key={uuidv4()}>{`${occupied}/${max} clock connectors used`}</p>);
}
@ -52,7 +57,8 @@ function ClockTipRender({occupied, max}) {
const resource_tip = {
"eem": EEMTipRender,
"clk": ClockTipRender,
"idc": IDCTipRender
"idc": IDCTipRender,
"tec": TECTipRender
}
function RenderResources({resources, library}) {

View File

@ -26,10 +26,15 @@ const count_item_occupied_hp = (item) => {
return (item.consumes && item.consumes.hp) || 0;
}
const count_item_occupied_tec = (item) => {
return (item.options_data && item.options_data.tec === false) ? 0 : (item.consumes && item.consumes.tec);
}
export const item_occupied_counters = {
"eem": count_item_occupied_eem,
"clk": count_item_occupied_clock,
"idc": count_item_occupied_idc,
"tec": count_item_occupied_tec,
"hp": count_item_occupied_hp,
}
@ -49,6 +54,7 @@ export const resource_counters = {
"clk": CounterFactory("clk"),
"idc": CounterFactory("idc"),
"hp": CounterFactory("hp"),
"tec": CounterFactory("tec"),
}
export function CountResources(data, index) {

View File

@ -6,9 +6,11 @@ export const true_type_of = (obj) => Object.prototype.toString.call(obj).slice(8
export function FillExtCardData(data, index) {
return {
// we cannot use value id, because they are substituted with uuid
has_other_dio: data.filter((value, item_index) => index !== item_index && value.name &&value.name.endsWith("-TTL")).length > 0,
has_dds: data.filter(((value, _) => value.name === "DDS" && value.name_number === "4410" && (!value.options_data || !value.options_data.mono_eem))).length > 0,
has_sampler: data.filter(((value, _) => value.name === "Sampler" && (!value.options_data || !value.options_data.mono_eem))).length > 0,
has_thermostat: data.filter((value, item_index) => index !== item_index && value.name_number && value.name_number === '8451').length > 0
}
}

View File

@ -801,7 +801,17 @@ const shop_data = {
'DAC temperature can be stabilized using the Sinara 8451 Thermostat (sold separately).'
],
options: [
{type: "Switch", args: {title: "TEC", outvar: "tec", tip: "Used for stabilizing temperature with Sinara 8451 Thermostat"}},
{
"if": [
{"var": "ext_data.has_thermostat"},
[
{type: "Switch", args: {title: "TEC", outvar: "tec", fallback: true, tip: "Used for stabilizing temperature with Sinara 8451 Thermostat"}}
],
[
{type: "Switch", args: {title: "TEC", outvar: "tec", tip: "Used for stabilizing temperature with Sinara 8451 Thermostat"}}
]
]
}
],
datasheet_file: '/docs/sinara-datasheets/5432.pdf',
datasheet_name: '5432 Zotino datasheet',
@ -813,7 +823,8 @@ const shop_data = {
],
consumes: {
hp: 4,
eem: 1
eem: 1,
tec: 1
},
resources: [
{name: "idc", max: 4}
@ -1190,6 +1201,29 @@ const shop_data = {
eem: 1,
}
},
'thermostat2ch': {
id: 'thermostat2ch',
name: 'Thermostat',
name_number: '8451',
name_codename: '',
price: 900,
image: '/images/shop/graphic-03_Thermostat2ch.svg',
specs: [
'2 TEC channels.',
'Parallel output 10 pin IDC 2.54mm and 5 pin 3.81mm connectors per channel.',
'Up to 8W (+/-2A with 4V compliance) heater/TEC drive from MAX1968 drivers.',
'100Base-T Ethernet with PoE.',
'Can stabilize temperature of Sinara 5432 DAC or external devices containing TEC and thermistor.'
Outdated
Review

Or external devices containing TEC and thermistor

Or external devices containing TEC and thermistor
Outdated
Review

I didn't say remove zotino. Please pay attention.

I didn't say remove zotino. Please pay attention.
],
size: 'small',
type: null,
consumes: {
hp: 4
},
resources: [
{name: "tec", max: 2}
]
},
'shuttler': {
id: 'shuttler',
name: 'DAC',
@ -1325,6 +1359,7 @@ const shop_data = {
'stabilizer',
'fast_servo',
'pounder',
'thermostat2ch',
'thermostat-eem']},
{ name: 'Misc',
itemIds: [