e.crates[n]),((e,t)=>Ho(e.items,t.items)&&e.occupiedHP===t.occupiedHP&&e.crate_mode===t.crate_mode)),o=Zs((e=>e.crateParams)),a=_s(r.occupiedHP),i=_s(o(r.crate_mode).hp),l=r.items.map(((t,o)=>e.createElement(Ku,{card_index:o,crate_index:n,first:0===o,last:o===r.items.length-1&&a>=i,key:t.id})));return e.createElement(To,{droppableId:r.id,direction:"horizontal"},((t,n)=>e.createElement("div",Yu({ref:t.innerRef},t.droppableProps,{style:Uo(t.droppableProps.style,n),className:"items-cart-list"}),l,t.placeholder&&e.createElement("div",{style:{display:"none"}},t.placeholder),e.createElement(Qu,{nToDraw:i-a,isDraggingOver:n.isDraggingOver}))))}function Ju(t){let{crate_index:n}=t;const r=Zs((e=>e.modes_order)),o=Zs((e=>e.crate_modes)),a=Zs((e=>e.crates[n]),((e,t)=>e.id===t.id&&e.crate_mode===t.crate_mode)),i=Zs((e=>e.setCrateMode));return e.createElement("div",{className:"crate-mode"},r.map(((t,n)=>e.createElement("a",{key:t,className:a.crate_mode===t?"active":"",onClick:()=>i(a.id,t),href:"#",role:"button"},o[t].name))))}function Zu(t){let{crate_index:n}=t;const r=Zs((e=>e.crates[n].warnings),Ho);return e.createElement("div",{className:"crate-info"},r.map(((t,n)=>e.createElement("p",{key:n,className:"rule",style:{color:Rs(t.level).color}},e.createElement("img",{src:Rs(t.level).icon})," ",e.createElement("i",null,t.message)))))}function ed(t){let{crate_index:n}=t;const r=Zs((e=>e.crates[n].id)),o=Zs((e=>e.crate_options)),a=Zs((e=>e.updateCrateOptions)),i=Zs((e=>e.crates[n].options_data||{})),l=js({options:o,data:i,id:"crate_options"+r,target:{construct:(e,t)=>{i[e]=t},update:(e,t)=>{e in i&&(i[e]=t),a(r,{[e]:t})}}});return e.createElement("div",{className:"crate-bar"},l)}function td(t){let{crate_index:n}=t;const r=Zs((e=>e.crates[n]),((e,t)=>e.length===t.length&&e.id===t.id)),o=Zs((e=>e.modes_order)),a=Zs((e=>e.delCrate));return e.createElement("div",{className:"crate"},o.includes(r.crate_mode)?e.createElement("div",{className:"crate-bar d-inline-flex justify-content-between"},e.createElement(Ju,{crate_index:n}),e.createElement("div",{className:"delete-crate align-self-start align-content-start justify-content-end",onClick:()=>a(r.id)},"Delete crate ",e.createElement("img",{src:"/images/shop/icon-remove.svg",alt:"remove"}))):e.createElement(e.Fragment,null),e.createElement("div",{className:"crate-products"},e.createElement(Xu,{crate_index:n}),e.createElement(Zu,{crate_index:n}),e.createElement(ed,{crate_index:n})))}function nd(){const t=Zs((e=>e.crates),((e,t)=>e.length===t.length)),n=Zs((e=>e.active_crate)),r=Zs((e=>e.newCrate)),o=Zs((e=>e.setActiveCrate));return e.createElement(ju,{id:"accordion_crates",flush:!0,activeKey:n,onSelect:e=>{o(null!==e?e:"")}},t.map(((t,n)=>e.createElement(ju.Item,{eventKey:t.id,key:"accordion"+t.id,className:"accordion_crates_item"},e.createElement(ju.Header,null,t.name?t.name:e.createElement(e.Fragment,null,"Crate #","".concat(n))," "),e.createElement(ju.Body,null,e.createElement(td,{crate_index:n}))))),e.createElement(ju.Item,{eventKey:"last",id:"accordion_crates_add"},e.createElement(ju.Header,{onClick:r},"Add new crate")))}const rd=JSON.stringify({crates:[{items:[{pn:"1124",options:null},{pn:"2128",options:null},{pn:"2128",options:null},{pn:"2128",options:null}],type:"rack",options:{}},{items:[],type:"no_crate",options:{}}],options:{}});function od(){const t=Zs((e=>e.importShouldOpen)),n=Zs((e=>e.importValue)),r=Zs((e=>e.loadDescription)),o=Zs((e=>e.updateImportDescription)),a=Zs((e=>e.closeImport)),i=Zs((e=>e.openImport)),l=gc((e=>{"mousedown"===e.type&&a()}));return e.createElement(e.Fragment,null,e.createElement("button",{className:"btn btn-sm btn-outline-primary m-0 mb-2",style:{cursor:"pointer"},onClick:i},"Import JSON"),e.createElement(pu,{show:t,animation:!0,centered:!0,className:"rfqFeedback"},e.createElement(pu.Body,{ref:l},e.createElement("div",{className:"form-group"},e.createElement("p",{className:"small"},"Input the JSON description below. Should be something like:",e.createElement("br",null),rd)),e.createElement("div",{className:"form-group w-100"},e.createElement("textarea",{onChange:e=>{o(e.target.value)},value:n.value,className:"form-control w-100",rows:"5",placeholder:"Input JSON description here."})),n.error!==Bs.OK?e.createElement("div",{className:"form-group"},e.createElement("p",{className:"text-danger"},n.error===Bs.Empty?"Empty input":"Invalid JSON")):null,e.createElement("div",{className:"d-flex flex-column flex-sm-row justify-content-end"},e.createElement("a",{type:"button",onClick:a,className:"btn btn-sm btn-outline-primary m-0 mb-2 mt-2 mb-sm-0 me-sm-2"},"Close"),e.createElement("a",{type:"button",onClick:r,className:"btn btn-sm btn-primary m-0 ms-sm-2 mt-2 ".concat(n.error?"disabled":"")},"Load configuration")))))}function ad(){const t=Zs((e=>e.closeRFQFeedback)),n=Zs((e=>e.shouldShowRFQFeedback)),r=Zs((e=>e.processingResult)),o=gc((e=>{"mousedown"===e.type&&t()}));return e.createElement(pu,{show:n,animation:!0,centered:!0},e.createElement(pu.Body,{ref:o,className:"rfqFeedback"},e.createElement("div",{className:"d-flex"},e.createElement("div",null,r.status===Bs.OK?e.createElement("img",{width:"30px",src:"/images/shop/icon-done.svg",alt:"close"}):e.createElement("img",{width:"30px",src:"/images/shop/icon-warning.svg",alt:"close"})),e.createElement("div",{style:{padding:"0 .5em"}},r.message))))}function id(t){let{title:n,description:r}=t;const o=Zs((e=>e.isMobile)),a=Zs((e=>e.switchSideMenu));return e.createElement("section",{className:"panel"},e.createElement("h2",null,n),e.createElement("div",{className:"control justify-content-between"},r),e.createElement("div",null,e.createElement(od,null)),e.createElement(ad,null),o?e.createElement("div",{className:"mobileBtnDisplaySideMenu"},e.createElement("button",{onClick:a},e.createElement("img",{src:"/images/shop/icon-add.svg",alt:"add"}))):null,e.createElement(nd,null),e.createElement("section",{className:"summary"},e.createElement(Dc,null),e.createElement(hu,null)))}function ld(){const t=Zs((e=>e.addCardFromCatalog)),n=Zs((e=>e.initExtData)),r=Zs((e=>e.moveCard)),o=Zs((e=>e.deleteCard)),a=Zs((e=>e.cardIndexById));return(0,e.useEffect)((()=>{t(null,[a("eem_pwr_mod"),a("kasli")],-1,!0),n()}),[]),e.createElement(Kr,{onDragEnd:(e,n)=>{if(!e.destination)return console.warn("No drop destination"),void console.log(e);"catalog"===e.source.droppableId?t(e.destination.droppableId,e.source.index,e.destination.index):"catalog"===e.destination.droppableId?o(e.source.droppableId,e.source.index):r(e.source.droppableId,e.source.index,e.destination.droppableId,e.destination.index)}},e.createElement(nc,{aside:e.createElement(uc,null),main:e.createElement(id,{title:"Order hardware",description:e.createElement("p",{className:"description"},"Drag and drop the cards you want into the crate below to see how the combination would look like. Configure the card settings by tapping on the top of the card; many of the options can be adjusted even after the card has been shipped. If you have any issues with this ordering system, or if you need other configurations, email us directly anytime at ",e.createElement("a",{href:"mailto:sales@m-labs.hk"},"sales@m-labs.hk"),". The price excludes shipping, is estimated, and must be confirmed by a quote.")})}))}(0,t.H)(document.querySelector("#root-shop")).render(e.createElement(ld,null))})()})();
\ No newline at end of file
diff --git a/static/js/shop/Resources.jsx b/static/js/shop/Resources.jsx
index 6148687c..9b29704f 100644
--- a/static/js/shop/Resources.jsx
+++ b/static/js/shop/Resources.jsx
@@ -33,7 +33,8 @@ function ClockRenderer({occupied, max}) {
const resource_progress_renderers = {
"eem": EEMRenderer,
"clk": ClockRenderer,
- "idc": EEMRenderer
+ "idc": EEMRenderer,
+ "tec": EEMRenderer
}
@@ -45,6 +46,10 @@ function IDCTipRender({occupied, max}) {
return ({`${occupied}/${max} IDC connectors used`}
);
}
+function TECTipRender({occupied, max}) {
+ return ({`${occupied}/${max} TEC connectors used`}
);
+}
+
function ClockTipRender({occupied, max}) {
return ({`${occupied}/${max} clock connectors used`}
);
}
@@ -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}) {
diff --git a/static/js/shop/count_resources.js b/static/js/shop/count_resources.js
index c343f8ca..ea89c4e3 100644
--- a/static/js/shop/count_resources.js
+++ b/static/js/shop/count_resources.js
@@ -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) {
diff --git a/static/js/shop/options/utils.js b/static/js/shop/options/utils.js
index 1e77365d..3c795fbd 100644
--- a/static/js/shop/options/utils.js
+++ b/static/js/shop/options/utils.js
@@ -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
}
}
diff --git a/static/js/shop_data.js b/static/js/shop_data.js
index 9330f360..d118df43 100644
--- a/static/js/shop_data.js
+++ b/static/js/shop_data.js
@@ -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.'
+ ],
+ 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: [