diff --git a/ord_interface/editor/db/680b0d9fe649417cb092d790907bd5a5/full.pbtxt b/ord_interface/editor/db/680b0d9fe649417cb092d790907bd5a5/full.pbtxt index 0ede50e0..d781b477 100644 --- a/ord_interface/editor/db/680b0d9fe649417cb092d790907bd5a5/full.pbtxt +++ b/ord_interface/editor/db/680b0d9fe649417cb092d790907bd5a5/full.pbtxt @@ -48,6 +48,10 @@ reactions { format: "txt" } } + texture { + type: POWDER + details: "121" + } } crude_components { reaction_id: "15.25" @@ -90,6 +94,10 @@ reactions { precision: 24.0 units: FAHRENHEIT } + texture { + type: POWDER + details: "123" + } } } inputs { diff --git a/ord_interface/editor/html/reaction.html b/ord_interface/editor/html/reaction.html index 5877d766..977ee246 100644 --- a/ord_interface/editor/html/reaction.html +++ b/ord_interface/editor/html/reaction.html @@ -206,6 +206,18 @@
+ @@ -278,6 +290,18 @@ + diff --git a/ord_interface/editor/js/compounds.js b/ord_interface/editor/js/compounds.js index f400c63e..27a5b2d3 100644 --- a/ord_interface/editor/js/compounds.js +++ b/ord_interface/editor/js/compounds.js @@ -58,6 +58,8 @@ const Data = goog.require('proto.ord.Data'); const ProductCompound = goog.require('proto.ord.ProductCompound'); const ReactionRoleType = goog.require('proto.ord.ReactionRole.ReactionRoleType'); +const Texture = goog.require('proto.ord.Texture'); +const TextureType = goog.require('proto.ord.Texture.TextureType'); /** * Adds and populates the form's fields describing multiple compounds for a @@ -119,6 +121,12 @@ function loadIntoCompound(node, compound) { const featureNode = addFeature(node); loadFeature(featureNode, name, feature); }); + + const texture = compound.getTexture(); + if (texture) { + utils.setSelector($('.component_texture_type', node), texture.getType()); + $('.component_texture_details', node).text(texture.getDetails()); + } } /** @@ -245,6 +253,16 @@ function unloadCompound(node) { } }); + const texture = new Texture(); + const textureType = + utils.getSelectorText($('.component_texture_type', node)[0]); + texture.setType(TextureType[textureType]); + texture.setDetails( + asserts.assertString($('.component_texture_details', node).text())); + if (!utils.isEmptyMessage(texture)) { + compound.setTexture(texture); + } + return compound; } diff --git a/ord_interface/editor/js/inputs.js b/ord_interface/editor/js/inputs.js index 457c4c3f..daa3407f 100644 --- a/ord_interface/editor/js/inputs.js +++ b/ord_interface/editor/js/inputs.js @@ -34,6 +34,8 @@ const AdditionSpeed = goog.require('proto.ord.ReactionInput.AdditionSpeed'); const AdditionSpeedType = goog.require('proto.ord.ReactionInput.AdditionSpeed.AdditionSpeedType'); const Temperature = goog.require('proto.ord.Temperature'); +const Texture = goog.require('proto.ord.Texture'); +const TextureType = goog.require('proto.ord.Texture.TextureType'); const Time = goog.require('proto.ord.Time'); exports = { @@ -156,6 +158,13 @@ function loadInputUnnamed(node, input) { if (flowRate) { utils.writeMetric('.input_flow_rate', flowRate, node); } + + const texture = input.getTexture(); + if (texture) { + utils.setSelector($('.input_texture_type', node), texture.getType()); + $('.input_texture_details', node).text(texture.getDetails()); + } + return node; } @@ -250,6 +259,15 @@ function unloadInputUnnamed(node) { input.setFlowRate(flowRate); } + const texture = new Texture(); + const textureType = utils.getSelectorText($('.input_texture_type', node)[0]); + texture.setType(TextureType[textureType]); + texture.setDetails( + asserts.assertString($('.input_texture_details', node).text())); + if (!utils.isEmptyMessage(texture)) { + input.setTexture(texture); + } + return input; }