diff --git a/pom.xml b/pom.xml index ad2c835e10c13223e3163a78a46ea9880fd07ad5..55d187842a3b61e07753583e0534781cf36d2672 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ <packaging>war</packaging> <version>Legacy</version> <!-- <name>NRAO EVLA Exposure Calculator v${project.version} for semester ${currentSemester}</name> --> - <name>NRAO EVLA Exposure Calculator (Legacy version)</name> + <name>NRAO EVLA Exposure Calculator (2023 June)</name> <url>https://builder.aoc.nrao.edu/maven/m2-sites/WDG/opt</url> <parent> diff --git a/src/main/java/edu/nrao/wdg/tools/ect/beans/EctBean.java b/src/main/java/edu/nrao/wdg/tools/ect/beans/EctBean.java index e96300561900c94d4642d9757ced508bca34be7a..2284c8f2f1514806ab4049bf63628d7c6e927462 100644 --- a/src/main/java/edu/nrao/wdg/tools/ect/beans/EctBean.java +++ b/src/main/java/edu/nrao/wdg/tools/ect/beans/EctBean.java @@ -75,6 +75,7 @@ public class EctBean implements Serializable { private final ApproximateBeamSizeComponent approximateBeamSizeComponent = new ApproximateBeamSizeComponent(); private final ConfusionLevelComponent confusionLevelComponent = new ConfusionLevelComponent(); private final ThermalNoiseComponent thermalNoiseComponent = new ThermalNoiseComponent(); + private final OverheadExplanationComponent overheadExplanationComponent = new OverheadExplanationComponent(); private final EvlaExposureCalculator calculator; // stored values used to compare before/after state @@ -107,6 +108,7 @@ public class EctBean implements Serializable { componentList.add(rmsHydrogenComponent); componentList.add(approximateBeamSizeComponent); componentList.add(confusionLevelComponent); + componentList.add(overheadExplanationComponent); //componentList.add(thermalNoiseComponent); } @@ -254,8 +256,6 @@ public class EctBean implements Serializable { component.fromCalculator(calculator); trySendingComponentMessages(component); } - - sendRecalculationMessages(); } public ApproximateBeamSizeComponent getApproximateBeamSizeComponent() { @@ -314,6 +314,8 @@ public class EctBean implements Serializable { return numberOfPolarizationsComponent; } + public OverheadExplanationComponent getOverheadExplanationComponent() { return overheadExplanationComponent; } + public ReceiverBandComponent getReceiverBandComponent() { return receiverBandComponent; } @@ -433,7 +435,7 @@ public class EctBean implements Serializable { } private void saveInputsBeforeCalculating() { - prevOverhead = calculator.getOverheadFactor(); + prevOverhead = calculator.getStandardOverheadFactor(); } private static void sendExposureCalculatorMessage(ExposureCalculatorMessage message) { @@ -464,16 +466,6 @@ public class EctBean implements Serializable { FacesContext.getCurrentInstance().addMessage(null, msg); } - private void sendRecalculationMessages() { - - // check the overhead - if (prevOverhead != calculator.getOverheadFactor()) { - sendFacesInfoMessage("Overhead factor changed", - "The overhead factor used to derive Total Time from " + "Time on Source is now " - + calculator.getOverheadFactor() + "."); - } - } - private void sendToCalculator(ComponentInterface<?> component) { saveInputsBeforeCalculating(); component.toCalculator(calculator); diff --git a/src/main/java/edu/nrao/wdg/tools/ect/components/OverheadExplanationComponent.java b/src/main/java/edu/nrao/wdg/tools/ect/components/OverheadExplanationComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..5803b82c8b5f1db06d3d5c1ef7ea39ffb793bae9 --- /dev/null +++ b/src/main/java/edu/nrao/wdg/tools/ect/components/OverheadExplanationComponent.java @@ -0,0 +1,18 @@ +package edu.nrao.wdg.tools.ect.components; + +import edu.nrao.sss.model.resource.evla.EvlaExposureCalculator; + +/** + * @author <a href="mailto:dlyons@nrao.edu>Daniel Lyons</a> + * @since 1/24/17 + */ +public class OverheadExplanationComponent extends OutputComponent<String> { + public OverheadExplanationComponent() { + super("overheadExplanation", "Overhead Explanation", ""); + } + + @Override + public void fromCalculator(EvlaExposureCalculator calculator) { + setValue(calculator.getOverheadExplanation()); + } +} diff --git a/src/main/resources/edu/nrao/wdg/tools/ect/calc2fo.xsl b/src/main/resources/edu/nrao/wdg/tools/ect/calc2fo.xsl index 39deb111417188f71e13b0b891ae474dfadeca57..c74f01150ba94edb0bb1c7e648588442a0cd0297 100644 --- a/src/main/resources/edu/nrao/wdg/tools/ect/calc2fo.xsl +++ b/src/main/resources/edu/nrao/wdg/tools/ect/calc2fo.xsl @@ -9,7 +9,7 @@ <xsl:output indent="yes" method="xml"/> <xsl:template match="/"> - <fo:root> + <fo:root font-size="10pt"> <fo:layout-master-set> <fo:simple-page-master page-height="11in" page-width="8.5in" master-name="only"> <fo:region-body region-name="body" margin="0.7in"/> @@ -63,6 +63,8 @@ </fo:table> </fo:block> + <xsl:apply-templates select="//sss:overheadExplanation"/> + <xsl:apply-templates select="//sss:message"/> <fo:block space-before.minimum="0.5em" space-before.optimum="1em" @@ -77,6 +79,22 @@ </fo:root> </xsl:template> + <xsl:template match="sss:overheadExplanation"> + <fo:block space-before.minimum="0.5em" + space-before.optimum="1em" + space-before.maximum="1.5em" + space-after.minimum="0.5em" + space-after.optimum="1em" + space-after.maximum="1.5em"> + <fo:inline font-weight="bold"> + Overhead. + </fo:inline> + <xsl:text> </xsl:text> + <xsl:value-of select="text()"/> + <xsl:text>.</xsl:text> + </fo:block> + </xsl:template> + <xsl:template match="sss:message"> <fo:block space-before.minimum="0.5em" space-before.optimum="1em" @@ -91,7 +109,7 @@ <xsl:value-of select="@message"/> </fo:block> </xsl:template> - + <xsl:template match="*" mode="row"> <fo:table-row> <fo:table-cell padding="4pt" diff --git a/src/main/webapp/index.xhtml b/src/main/webapp/index.xhtml index c0dd720b6ab8aa75c3221045d07ae2f464e5aa09..7b974636d8f5e54353c38f18eaa79b1a9b9e358c 100644 --- a/src/main/webapp/index.xhtml +++ b/src/main/webapp/index.xhtml @@ -97,6 +97,9 @@ <!-- CONFUSION LEVEL --> <ect:componentOutput value="#{ectBean.confusionLevelComponent}"/> + <!-- OVERHEAD EXPLANATION --> + <ect:componentOutput value="#{ectBean.overheadExplanationComponent}"/> + <!--<!– THERMAL NOISE –> <ect:componentOutput value="#{ectBean.thermalNoiseComponent}"/>-->