diff --git a/relog-web/src/casebuilder/PlantBlock.js b/relog-web/src/casebuilder/PlantBlock.js index 75d7c03..531791a 100644 --- a/relog-web/src/casebuilder/PlantBlock.js +++ b/relog-web/src/casebuilder/PlantBlock.js @@ -27,24 +27,28 @@ const PlantBlock = (props) => { name: "Washakie County", "latitude (deg)": "43.8356", "longitude (deg)": "-107.6602", + "initial capacity (tonne)": "0", "area cost factor": "0.88", }, { name: "Platte County", "latitude (deg)": "42.1314", "longitude (deg)": "-104.9676", + "initial capacity (tonne)": "0", "area cost factor": "1.29", }, { name: "Park County", "latitude (deg)": "44.4063", "longitude (deg)": "-109.4153", + "initial capacity (tonne)": "0", "area cost factor": "0.99", }, { name: "Goshen County", "latitude (deg)": "42.0853", "longitude (deg)": "-104.3534", + "initial capacity (tonne)": "0", "area cost factor": "1", }, ]) @@ -59,6 +63,7 @@ const PlantBlock = (props) => { "latitude (deg)", "longitude (deg)", "area cost factor", + "initial capacity (tonne)", ], }); const result = {}; diff --git a/relog-web/src/casebuilder/defaults.js b/relog-web/src/casebuilder/defaults.js index 96d9cf3..99a2274 100644 --- a/relog-web/src/casebuilder/defaults.js +++ b/relog-web/src/casebuilder/defaults.js @@ -13,6 +13,7 @@ export const defaultProduct = { export const defaultPlantLocation = { "area cost factor": 1.0, + "initial capacity (tonne)": 0, "latitude (deg)": 0, "longitude (deg)": 0, }; @@ -24,17 +25,17 @@ export const defaultPlant = { "disposal limit (tonne)": {}, "emissions (tonne/tonne)": {}, storage: { - "cost ($/tonne)": 0, - "limit (tonne)": 0, + "cost ($/tonne)": "0", + "limit (tonne)": "0", }, - "maximum capacity (tonne)": 0, - "minimum capacity (tonne)": 0, - "opening cost (max capacity) ($)": 0, - "opening cost (min capacity) ($)": 0, - "fixed operating cost (max capacity) ($)": 0, - "fixed operating cost (min capacity) ($)": 0, - "variable operating cost ($/tonne)": 0, - "energy (GJ/tonne)": 0, + "maximum capacity (tonne)": "0", + "minimum capacity (tonne)": "0", + "opening cost (max capacity) ($)": "0", + "opening cost (min capacity) ($)": "0", + "fixed operating cost (max capacity) ($)": "0", + "fixed operating cost (min capacity) ($)": "0", + "variable operating cost ($/tonne)": "0", + "energy (GJ/tonne)": "0", x: 0, y: 0, }; diff --git a/relog-web/src/casebuilder/export.js b/relog-web/src/casebuilder/export.js index dc1426c..3528929 100644 --- a/relog-web/src/casebuilder/export.js +++ b/relog-web/src/casebuilder/export.js @@ -233,9 +233,11 @@ export const exportPlant = (original, parameters) => { }; // Copy scalar values - ["latitude (deg)", "longitude (deg)"].forEach((key) => { - resDict[key] = origDict[key]; - }); + ["latitude (deg)", "longitude (deg)", "initial capacity (tonne)"].forEach( + (key) => { + resDict[key] = origDict[key]; + } + ); // Copy minimum capacity dict capDict[minCap] = {}; @@ -462,10 +464,12 @@ export const importPlant = (original) => { for (const [locName, origLocDict] of Object.entries(original["locations"])) { resLocDict[locName] = {}; - // Import latitude and longitude - ["latitude (deg)", "longitude (deg)"].forEach((key) => { - resLocDict[locName][key] = origLocDict[key]; - }); + // Import scalars + ["latitude (deg)", "longitude (deg)", "initial capacity (tonne)"].forEach( + (key) => { + resLocDict[locName][key] = origLocDict[key]; + } + ); const capacities = keysToList(origLocDict["capacities (tonne)"]); const last = capacities.length - 1; diff --git a/relog-web/src/casebuilder/export.test.js b/relog-web/src/casebuilder/export.test.js index f780712..d358ea0 100644 --- a/relog-web/src/casebuilder/export.test.js +++ b/relog-web/src/casebuilder/export.test.js @@ -197,11 +197,13 @@ const samplePlantsOriginal = [ "latitude (deg)": 43.8356, "longitude (deg)": -107.6602, "area cost factor": 1.0, + "initial capacity (tonne)": 0, }, "Platte County": { "latitude (deg)": 42.1314, "longitude (deg)": -104.9676, "area cost factor": 0.5, + "initial capacity (tonne)": 0, }, }, "disposal cost ($/tonne)": { @@ -245,11 +247,13 @@ const samplePlantsOriginal = [ "latitude (deg)": 43.8356, "longitude (deg)": -107.6602, "area cost factor": 1.0, + "initial capacity (tonne)": 0, }, "Platte County": { "latitude (deg)": 42.1314, "longitude (deg)": -104.9676, "area cost factor": 0.5, + "initial capacity (tonne)": 0, }, }, "disposal cost ($/tonne)": { @@ -293,11 +297,13 @@ const samplePlantsOriginal = [ "latitude (deg)": 43.8356, "longitude (deg)": -107.6602, "area cost factor": 1.0, + "initial capacity (tonne)": 0, }, "Platte County": { "latitude (deg)": 42.1314, "longitude (deg)": -104.9676, "area cost factor": 0.5, + "initial capacity (tonne)": 0, }, }, "disposal cost ($/tonne)": { @@ -340,12 +346,14 @@ const samplePlantsOriginal = [ "latitude (deg)": 43.8356, "longitude (deg)": -107.6602, "area cost factor": 1.0, + "initial capacity (tonne)": 0, x: 2, }, "Platte County": { "latitude (deg)": 42.1314, "longitude (deg)": -104.9676, "area cost factor": 0.5, + "initial capacity (tonne)": 0, x: 4, }, }, @@ -407,6 +415,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [5, 10, 20], "limit (tonne)": 10000, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182500: { "opening cost ($)": [200000, 400000, 800000], @@ -439,6 +448,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [2.5, 5, 10], "limit (tonne)": 10000, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182500: { "opening cost ($)": [100000, 200000, 400000], @@ -486,6 +496,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [5, 5, 5], "limit (tonne)": 10000, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182500: { "opening cost ($)": [200000, 200000, 200000], @@ -513,6 +524,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [2.5, 2.5, 2.5], "limit (tonne)": 10000, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182500: { "opening cost ($)": [100000, 100000, 100000], @@ -544,6 +556,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [5, 5, 5], "limit (tonne)": 10000, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182500: { "opening cost ($)": [200000, 200000, 200000], @@ -565,6 +578,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [2.5, 2.5, 2.5], "limit (tonne)": 10000, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182500: { "opening cost ($)": [100000, 100000, 100000], @@ -611,6 +625,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [7, 14, 28], "limit (tonne)": 10002, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182502: { "opening cost ($)": [200002, 400004, 800008], @@ -643,6 +658,7 @@ const samplePlantsExported = [ "cost ($/tonne)": [4.5, 9, 18], "limit (tonne)": 10004, }, + "initial capacity (tonne)": 0, "capacities (tonne)": { 182504: { "opening cost ($)": [100002, 200004, 400008],