function fnFixClimate($intThresholdEventID) { #Looks up Sensor info for ThresholdEvent (including Thresholds and RelayMapping) #Looks up appropriate Relay to activate via RelayMapping table for that particular sensor #More TBD (do we run shell script w/ parameters to activate relay off PLC board) # $booFlagSuccess = fnFlagEventInProccess($intThresholdEventID, 0); $intSensorID = fnGetEventData($intThresholdEventID, 1); $intRelayID = fnGetRelayNum($intSensorID); return @$strFixResult; }
<?php include 'base.php'; $intThresholdEventID = $_GET['evtid']; $intSensorID = fnGetEventData($intThresholdEventID, 1); $intMinValTH = fnChkSensorTH($intSensorID, 0); $intMaxValTH = fnChkSensorTH($intSensorID, 1); $intMedValTH = round(($intMaxValTH - $intMinValTH) / 2, 2) + $intMinValTH; $intRelayID = fnGetRelayNum($intSensorID); $intOrigValue = fnGetEventData($intThresholdEventID, 3); echo "<br>" . $intSensorID . " - " . $intMinValTH . " - " . $intMaxValTH . " - " . $intMedValTH . " - " . $intOrigValue; echo "<br><br>!!! - fnGetEventData({$intThresholdEventID}, 1): " . $intSensorID; echo "<br>Relay " . $intRelayID;