public FlowCalculator(PLCHelpers plc, int pht, int phtt)
 {
     PLC = plc;
     HTT = PLC.GetHeatTankVolume();
     HT = PLC.GetHoldTankVolume();
     HTFR = PLC.GetHoldTankFlowrate();
     LHTT = 0;
     LHT = 0;
     PHT = pht;
     PHTT = phtt;
 }
 //initialize the model
 public void init()
 {
     PLC = new PLCHelpers(HETankIP, BeltPressIP);
     TickDuration = Globals.MilliSecondPerTick;
     HETank = new TrueTank(HTankCap, PLC.GetHeatTankVolume, PLC.GetHeatTankTemp);
     StorTank = new TrueTank(StorTankCap, PLC.GetHoldTankVolume, PLC.GetHoldTankTemp);
     HExchanger = new TrueHeatExchanger(HExchangerCap, PLC.GetHETempIn, PLC.GetHETempOut);
     StartTime = DateTime.Now;
     PrevTime = StartTime;
     CurTime = StartTime;
     PHT = PLC.GetHoldTankVolume(); //magic initial value
     PHTT = PLC.GetHeatTankVolume(); //magic initial value
     Tracker = new IngressTracker(PLC, PHT, PHTT);
     SetInitValues();
     Thread.Sleep(5000);
 }
 public IngressTracker(PLCHelpers plc, int pht, int phtt)
 {
     FlowInstances = new Queue<FlowRate>();
     AvgIncFlowRate = 0;
     AvgOutFlowRate = 0;
     PLC = plc;
     FCalc = new FlowCalculator(PLC, pht, phtt);
 }