Web: Fix parsing of disposal limit

feature/CapEx
Alinson S. Xavier 3 years ago
parent b3a6632d7e
commit 3b3ecbde27
Signed by: isoron
GPG Key ID: 0DA8E4B9E1109DCA

@ -235,7 +235,7 @@ const InputPage = () => {
"disposal limit (tonne)",
].forEach((key) => {
newData.plants[plantName][key] = { ...newData.plants[plantName][key] };
newData.plants[plantName][key][productName] = 0;
newData.plants[plantName][key][productName] = "0";
});
save(newData);
return newData;

@ -277,7 +277,7 @@ export const exportPlant = (original, parameters) => {
const v = exportValueAcf(dispCost, origDict);
if (v) {
resDict.disposal[dispName] = { "cost ($/tonne)": v };
const limit = original["disposal limit (tonne)"][dispName];
const limit = String(original["disposal limit (tonne)"][dispName]);
if (limit.length > 0) {
resDict.disposal[dispName]["limit (tonne)"] = exportValue(
limit,

@ -213,7 +213,7 @@ const samplePlantsOriginal = [
},
"disposal limit (tonne)": {
"Hydrogen gas": "10",
"Carbon dioxide": "",
"Carbon dioxide": 0,
Tar: "",
},
"emissions (tonne/tonne)": {
@ -406,6 +406,7 @@ const samplePlantsExported = [
},
"Carbon dioxide": {
"cost ($/tonne)": [0, 0, 0],
"limit (tonne)": [0, 0, 0],
},
Tar: {
"cost ($/tonne)": [200, 400, 800],
@ -439,6 +440,7 @@ const samplePlantsExported = [
},
"Carbon dioxide": {
"cost ($/tonne)": [0, 0, 0],
"limit (tonne)": [0, 0, 0],
},
Tar: {
"cost ($/tonne)": [100, 200.0, 400],

Loading…
Cancel
Save