diff --git a/code/drasil-example/Drasil/NoPCM/Body.hs b/code/drasil-example/Drasil/NoPCM/Body.hs index 5e08d124be..a443568dd3 100644 --- a/code/drasil-example/Drasil/NoPCM/Body.hs +++ b/code/drasil-example/Drasil/NoPCM/Body.hs @@ -71,8 +71,8 @@ import Drasil.DocLang (DocDesc, Fields, Field(..), Verbosity(Verbose), RefSec(RefProg), RefTab(TAandA, TUnits), TSIntro(SymbOrder, SymbConvention, TSPurpose), dataConstraintUncertainty, inDataConstTbl, intro, mkDoc, mkLklyChnk, mkRequirement, mkUnLklyChnk, - outDataConstTbl, physSystDesc, reqF, termDefnF, traceGIntro, traceMGF, - tsymb, valsOfAuxConstantsF) + outDataConstTbl, physSystDesc, reqF, funcReqDom, termDefnF, traceGIntro, traceMGF, + tsymb, valsOfAuxConstantsF, mkEnumCC) import Data.Drasil.SentenceStructures (showingCxnBw, foldlSent_, sAnd, foldlList, isThe, sOf, ofThe, foldlSPCol, foldlSent, foldlSP, acroIM, @@ -180,7 +180,7 @@ nopcm_si = SI { } nopcmRefDB :: ReferenceDB -nopcmRefDB = rdb [] [] assumps_Nopcm_list_new [] [] referencesRefList []-- FIXME: Convert the rest to new chunk types +nopcmRefDB = rdb [] [] assumps_Nopcm_list_new [] [] referencesRefList newReqs-- FIXME: Convert the rest to new chunk types nopcm_code :: CodeSpec nopcm_code = codeSpec nopcm_si [inputMod] @@ -625,21 +625,10 @@ reqS = reqF [funcReqs, nonFuncReqs] funcReqs = SRS.funcReq funcReqsList [] --TODO: Placeholder values until content can be added -funcReqsList :: [Contents] -funcReqsList = weave [funcReqsListWordsNum, funcReqsListItems] - -funcReqsListItems :: [Contents] -funcReqsListItems = [ - - Table [titleize symbol_, titleize M.unit_, titleize description] - (mkTable [ch, - unitToSentence, - phrase] inputVar) - (titleize input_ +:+ titleize variable +:+ titleize requirement) False "fr1list", +-- FIXME: Remove requirements generated from mkRequirements once SWHS does not depend on them - eqUnR ((sy w_mass) $= (sy w_vol) * (sy w_density) $= - (((sy diam) / 2) * (sy tank_length) * (sy w_density))) - ] +funcReqsList :: [Contents] +funcReqsList = funcReqsListWordsNum -- s5_1_list_words = map (\x -> Enumeration $ Simple [x]) -- $ mkEnumAbbrevList 1 (short requirement) $ map foldlSent_ [ @@ -670,9 +659,6 @@ funcReqsListItems = [ -- phrase simulation, phrase time +:+. sParen (S "from" +:+ acroIM 3)] -- ] -funcReqsListWordsNum :: [Contents] -funcReqsListWordsNum = [req1, req2, req3, req4, req5, req6] - req1, req2, req3, req4, req5, req6 :: Contents --Empty list is supposed to take a ModuleChunk. Not sure what to put there. @@ -704,6 +690,44 @@ req6 = mkRequirement "req6" ( +:+ sParen (ch w_E :+: sParen (ch time)) +:+ S "over the" +:+ phrase sim_time +:+. sParen (S "from" +:+ acroIM 3) ) "Calculate-Change-Heat_Energy-Water-Time" +nr1, nr2, nr3, nr4, nr5, nr6 :: ConceptInstance +nr1 = cic "nr1" (titleize input_ +:+ S "the" +:+ plural quantity +:+ S "described in" +:+ (makeRef nrTable) `sC` + S "which define the" +:+ plural tank_para `sC` S "material" +:+ + plural property +:+ S "and initial" +:+. plural condition) "Input-Inital-Values" funcReqDom +nr2 = cic "nr2" (S "Use the" +:+ plural input_ +:+ S "in" +:+ + (makeRef nr1) +:+ S "to find the" +:+ phrase mass +:+ + S "needed for" +:+ acroIM 1 +:+ S "to" +:+ acroIM 2 `sC` + S "as follows, where" +:+ ch w_vol `isThe` phrase w_vol +:+ + S "and" +:+ (ch tank_vol `isThe` phrase tank_vol) :+: S ":" +:+ + E ((sy w_mass) $= (sy w_vol) * (sy w_density) $= + (((sy diam) / 2) * (sy tank_length) * (sy w_density)))) "Use-Above-Find-Mass-IM1-IM2" funcReqDom -- FIXME: Equation shouldn't be inline. +nr3 = cic "nr3" (S "Verify that the" +:+ plural input_ +:+ S "satisfy the required" + +:+ phrase physicalConstraint +:+ S "shown in" +:+. makeRef dataConstTable1) "Check-Inputs-Satisfy-Physical-Constraints" funcReqDom +nr4 = cic "nr4" (titleize' output_ `sAnd` plural input_ +:+ plural quantity + +:+ S "and derived" +:+ plural quantity +:+ S "in the following list: the" +:+ + plural quantity +:+ S "from" +:+ (makeRef nr1) `sC` + S "the" +:+ phrase mass +:+ S "from" +:+ (makeRef nr2) + `sAnd` ch tau_W +:+. sParen(S "from" +:+ acroIM 1)) "Output-Input-Derivied-Quantities" funcReqDom +nr5 = cic "nr5" (S "Calculate and output the" +:+ phrase temp_W +:+ + sParen (ch temp_W :+: sParen (ch time)) +:+ S "over the" +:+ + phrase sim_time) "Calculate-Temperature-Water-Over-Time" funcReqDom +nr6 = cic "nr6" (S "Calculate and" +:+ phrase output_ +:+ S "the" +:+ phrase w_E + +:+ sParen (ch w_E :+: sParen (ch time)) +:+ S "over the" +:+ + phrase sim_time +:+. sParen (S "from" +:+ acroIM 3)) "Calculate-Change-Heat_Energy-Water-Time" funcReqDom + +nrTable :: Contents +nrTable = Table [titleize symbol_, titleize M.unit_, titleize description] + (mkTable [ch, + unitToSentence, + phrase] inputVar) + (titleize input_ +:+ titleize variable +:+ titleize' requirement) True "fr1list" + +newReqs :: [ConceptInstance] +newReqs = [nr1, nr2, nr3, nr4, nr5, nr6] + +funcReqsListWordsNum :: [Contents] +funcReqsListWordsNum = mkEnumCC (\x -> (getShortName x, Flat $ x ^. defn, Just $ refAdd x)) newReqs ++ [nrTable] + ------------------------------------------- --Section 5.2 : NON-FUNCTIONAL REQUIREMENTS ------------------------------------------- @@ -811,8 +835,7 @@ traceInstaModelRef = map (refFromType Theory) [eBalanceOnWtr, heatEInWtr] traceFuncReq = ["R1", "R2", "R3", "R4", "R5", "R6"] -traceFuncReqRef = map (\x -> (makeRef (find' x funcReqsListWordsNum))) - funcReqsListWordsNum--makeListRef s7_funcReq s5_1 +traceFuncReqRef = map makeRef newReqs traceData = ["Data Constraints"] traceDataRef = [makeRef dataConstTable1] --FIXME: Reference section?