// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. class GeoFeedback extends Actor dependson(ConversationState) dependson(GeoPlayerController); var XMLlog xml; var bool open; var GeoPlayerController geoPC; function startLog() { open = true; xml.startDocument("1.0", "UTF-8"); xml.startElement("PlayerLog"); logGameDetails(); setTimer(2.5, true); } function openLog() { if(geoPC.getFBtype() == 0) {} else if(geoPC.getFBtype() == 1) { xml = Spawn(class'LocalLog'); xml.openLog(geoPC.getFBlocation()); } else if(geoPC.getFBtype() ==2) { xml = Spawn(class'NetworkLog'); xml.openLog2(geoPC.getFBlocation(), geoPC.getFBport()); } } function stopLog() { if(open) { setTimer(0.0, false); xml.closeLog(); open = false; } } function string getLogBuffer() { return xml.getBuffer(); } function logLocation() { if(open) { xml.startElement("Location"); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.writeAttribute("x", ""$geoPC.Pawn.Location.x); xml.writeAttribute("y",""$geoPC.Pawn.Location.y); xml.endElement(); } } function logEvent(string e) { if(open) { xml.startElement("User_Event"); xml.writeAttribute("Event_name", ""$e); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.endElement(); } } function logFailure(LeveeTile f) { if(open) { xml.startElement("Failure"); xml.writeAttribute("Name", ""$f.Name); xml.writeAttribute("Failure_Name",""$f.MapLocationSign.EN_LocationName); xml.writeAttribute("Name", ""$f.EN_FailureName); xml.writeAttribute("x", ""$f.Location.x); xml.writeAttribute("y", ""$f.Location.y); xml.writeAttribute("Mechanism", ""$f.Mechanism); xml.writeAttribute("Type_Of_Levee", ""$f.LeveeType); xml.endElement(); logSignals(f); } } function logFailureState(LeveeTile f) { if(open) { xml.startElement("Failure_state"); xml.writeAttribute("Name", ""$f.Name); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.writeAttribute("Current_state", ""$f.CurrentState); xml.writeAttribute("Detected", ""$f.bDetected); xml.writeAttribute("Reported", ""$f.bReported); xml.writeAttribute("Is_Set_Stable",""$f.bIsSetStable); xml.endElement(); } } function logGameDetails() { local GeoLevelDetails GeoLD; if(open) { GeoLD = new class'GeoLevelDetails'; xml.startElement("GameDetails"); xml.writeAttribute("PlayerName", ""$geoPC.PlayerReplicationInfo.GetHumanReadableName()); xml.writeAttribute("Level", ""$Level.Title); xml.writeAttribute("Date", ""$Level.Year$"-"$Level.Month$"-"$Level.Day$"-"$Level.Hour$"-"$Level.Minute$"-"$Level.Second); xml.writeAttribute("IsRaining", ""$GeoLD.IsRaining); xml.writeAttribute("IsCompleteExercise", ""$GeoLD.IsCompleteExercise); xml.writeAttribute("IsAllowedTakeMeasures", ""$GeoLD.TakeMeasures); xml.writeAttribute("IsAllowedMakeDiagnoses", ""$GeoLD.MakeDiagnoses); // 10-02-2012 - Also add player signed in id: xml.writeAttribute("PlayerID", "" $ geoPC.hash_ui); xml.endElement(); } } function logPutRedMarker(RedMarker r) { if (r == None) return; if(open) { xml.startElement("RedMarker"); xml.writeAttribute("x", ""$r.Location.x); xml.writeAttribute("y", ""$r.Location.y); xml.writeAttribute("failure", ""$r.LTile.Name); xml.writeAttribute("Name", ""$r.Name); xml.endElement(); } } function logPutYellowMarker(YellowMarker y) { if(open) { xml.startElement("YellowMarker"); xml.writeAttribute("x", ""$y.Location.x); xml.writeAttribute("y", ""$y.Location.y); xml.writeAttribute("other_marker", ""$y.OtherMarker.Name); xml.writeAttribute("name", ""$y.Name); xml.writeAttribute("distance", ""$y.CurrentDist); xml.writeAttribute("height", ""$y.CurrentHeight); xml.endElement(); } } function logSignal(Signal s, name owner) { if(open) { if(s.IsA('SignalCrack')) { xml.startElement("SignalCrack"); xml.writeAttribute("Revetment", ""$SignalCrack(s).RevetmentType); xml.writeAttribute("CrackType", ""$SignalCrack(s).CrackType); } else if(s.IsA('SignalBioActivity')) { xml.startElement("SignalBioActivity"); xml.writeAttribute("RiskFactor", ""$SignalBioActivity(s).RiskCause); } else if(s.IsA('SignalFloatingWaste')) { xml.startElement("SignalFloatingWaste"); xml.writeAttribute("RiskFactor", ""$SignalFloatingWaste(s).RiskCause); } else if(s.IsA('SignalGrass')) { xml.startElement("SignalGrass"); } else if(s.IsA('SignalHorizontalMovement')) { xml.startElement("SignalHorizontalMovement"); xml.writeAttribute("Revetment", ""$SignalHorizontalMovement(s).RevetmentType); } else if(s.IsA('SignalHumanActivity')) { xml.startElement("SignalHumanActivity"); xml.writeAttribute("RiskFactor", ""$SignalHumanActivity(s).RiskCause); } else if(s.IsA('SignalLiquefaction')) { xml.startElement("SignalLiquefaction"); } else if(s.IsA('SignalUprise')) { xml.startElement("SignalUprise"); } else if(s.IsA('SignalOverToppingWash')) { xml.startElement("SignalOverToppingWash"); xml.writeAttribute("OverType", ""$SignalOverToppingWash(s).TypeOcurring); } else if(s.IsA('SignalWaterOutflow')) { xml.startElement("SignalWaterOutflow"); } else if(s.IsA('SignalRipPitching')) { xml.startElement("SignalRipPitching"); xml.writeAttribute("Revetment", ""$SignalRipPitching(s).RevetmentType); } else if(s.IsA('SignalSettlement')) { xml.startElement("SignalSettlement"); xml.writeAttribute("Revetment", ""$SignalSettlement(s).RevetmentType); xml.writeAttribute("SettlementPositions", ""$SignalSettlement(s).SettlementPosition); } else { xml.startElement("Signal_unkown"); } xml.writeAttribute("CrossCutLocation", ""$s.CrossCutLocation); xml.writeAttribute("Name", ""$s.Name); xml.writeAttribute("Owner", ""$owner); xml.endElement(); logSignalReports(s); } } function logSignals(LeveeTile f) { local int i; if(open) { for(i = 0; i < f.Signals.length; i++) { logSignal(f.Signals[i], f.name); } } } function logSignalReports(Signal s) { local int i; if(open) { for(i = 0; i < s.SignalReports.length; i++) { logSignalReport(s.SignalReports[i], s.name); } } } function logSignalReport(SignalReport s, Name owner) { if(open) { if(s.IsA('SignalReportCrack')) { xml.startElement("SignalReportCrack"); xml.writeAttribute("LengthOfDamage", ""$SignalreportCrack(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalreportCrack(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalreportCrack(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalreportCrack(s).WidthOfDamageMax); xml.writeAttribute("MultipleCrack", ""$SignalreportCrack(s).MultipleCracks); xml.writeAttribute("FlushingSoil", ""$SignalreportCrack(s).FlushingSoil); xml.writeAttribute("FlushingSoilQuantity", ""$SignalreportCrack(s).FlushingSoilQuantity); } else if(s.IsA('SignalReportBioActivity')) { xml.startElement("SignalReportBioActivity"); } else if(s.IsA('SignalReportFloatingWaste')) { xml.startElement("SignalReportFloatingWaste"); } else if(s.IsA('SignalReportGrass')) { xml.startElement("SignalReportGrass"); xml.writeAttribute("LengthOfDamage", ""$SignalReportGrass(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalReportGrass(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalReportGrass(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalReportGrass(s).WidthOfDamageMax); } else if(s.IsA('SignalReportHorizontalMovement')) { xml.startElement("SignalReportHorizontalMovement"); xml.writeAttribute("LengthOfDamage", ""$SignalReportHorizontalMovement(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalReportHorizontalMovement(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalReportHorizontalMovement(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalReportHorizontalMovement(s).WidthOfDamageMax); } else if(s.IsA('SignalReportHumanActivity')) { xml.startElement("SignalReportHumanActivity"); } else if(s.IsA('SignalReportLiquefaction')) { xml.startElement("SignalReportLiquefaction"); xml.writeAttribute("LengthOfDamage", ""$SignalReportLiquefaction(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalReportLiquefaction(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalReportLiquefaction(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalReportLiquefaction(s).WidthOfDamageMax); xml.writeAttribute("SoilPartsMoving", ""$SignalReportLiquefaction(s).SoilPartsMoving); xml.writeAttribute("FlushingSoil", ""$SignalReportLiquefaction(s).FlushingSoil); xml.writeAttribute("FlushingSoilQuantity", ""$SignalReportLiquefaction(s).FlushingSoilQuantity); } else if(s.IsA('SignalReportUprise')) { xml.startElement("SignalReportUprise"); xml.writeAttribute("LengthOfDamage", ""$SignalReportUprise(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalReportUprise(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalReportUprise(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalReportUprise(s).WidthOfDamageMax); } else if(s.IsA('SignalReportOverToppingWash')) { xml.startElement("SignalReportOverToppingWash"); xml.writeAttribute("IsAccessible", ""$SignalReportOverToppingWash(s).IsAccessible); xml.writeAttribute("InfiltrateTopInner", ""$SignalReportOverToppingWash(s).InfiltrateTopInner); xml.writeAttribute("WaterFlowQuantity", ""$SignalReportOverToppingWash(s).WaterFlowQuantity); xml.writeAttribute("WavesDescription", ""$SignalReportOverToppingWash(s).WavesDescription); xml.writeAttribute("FlushingSoil", ""$SignalReportOverToppingWash(s).FlushingSoil); xml.writeAttribute("FlushingSoilQuantity", ""$SignalReportOverToppingWash(s).FlushingSoilQuantity); } else if(s.IsA('SignalReportWaterOutflow')) { xml.startElement("SignalReportWaterOutflow"); xml.writeAttribute("LengthOfDamage", ""$SignalReportWaterOutflow(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalReportWaterOutflow(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalReportWaterOutflow(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalReportWaterOutflow(s).WidthOfDamageMax); xml.writeAttribute("CurrentSpeed", ""$SignalReportWaterOutflow(s).CurrentSpeed); xml.writeAttribute("WaterFlowOut", ""$SignalReportWaterOutflow(s).WaterFlowOut); xml.writeAttribute("MultipleLocations", ""$SignalReportWaterOutflow(s).MultipleLocations); xml.writeAttribute("FlushingSoil", ""$SignalReportWaterOutflow(s).FlushingSoil); xml.writeAttribute("FlushingSoilQuantity", ""$SignalReportWaterOutflow(s).FlushingSoilQuantity); } else if(s.IsA('SignalReportSettlement')) { xml.startElement("SignalReportSettlement"); xml.writeAttribute("LengthOfDamage", ""$SignalReportSettlement(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalReportSettlement(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalReportSettlement(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalReportSettlement(s).WidthOfDamageMax); xml.writeAttribute("HeightDifference", ""$SignalReportSettlement(s).HeightDifference); xml.writeAttribute("HeightDifferenceMax", ""$SignalReportSettlement(s).HeightDifferenceMax); } else if(s.IsA('SignalReportRipPitching')) { xml.startElement("SignalReportRipPitching"); xml.writeAttribute("LengthOfDamage", ""$SignalReportRipPitching(s).LengthOfDamage); xml.writeAttribute("LengthOfDamageMax", ""$SignalReportRipPitching(s).LengthOfDamageMax); xml.writeAttribute("WidthOfDamage", ""$SignalReportRipPitching(s).WidthOfDamage); xml.writeAttribute("WidthOfDamageMax", ""$SignalReportRipPitching(s).WidthOfDamageMax); xml.writeAttribute("FlushingSoil", ""$SignalReportRipPitching(s).FlushingSoil); xml.writeAttribute("FlushingSoilQuantity", ""$SignalReportRipPitching(s).FlushingSoilQuantity); xml.writeAttribute("ElementsMissingOrMoved", ""$SignalReportRipPitching(s).ElementsMissingOrMoved); xml.writeAttribute("ElementsLoose", ""$SignalReportRipPitching(s).ElementsLoose); } else { xml.startElement("SignalReport_Unkown"); } xml.writeAttribute("State", ""$s.GeoState); xml.writeAttribute("Name", ""$s.Name); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.writeAttribute("Owner", ""$owner); xml.endElement(); } } function logNote(string s, string e) { if(open) { xml.startElement("Note"); xml.writeAttribute("Value", ""$s); xml.writeAttribute("Extra", ""$e); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.endElement(); } } function logDeleteMarker(name n) { if(open) { xml.startElement("Delete_marker"); xml.writeAttribute("Name", ""$n); xml.endElement(); } } function logMeasure(Measure m, name r) { if(open) { xml.startElement("Measure"); xml.writeAttribute("RedMarker", ""$r); xml.writeAttribute("MeasureType", ""$m.MeasureType); xml.writeAttribute("Effective", ""$m.bMeasureEffective); xml.writeAttribute("Taken", ""$m.bMeasureTaken); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.endElement(); } } function logHelp(HelpMenu n, string s) { if(open) { xml.startElement("Help"); xml.writeAttribute("Menu", ""$n.class); xml.writeAttribute("Previous_Menu", ""$s); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.endElement(); } } function logDiagnosis(name r, GeoEnums.FailingMechanisms f) { if(open) { xml.startElement("Diagnosis"); xml.writeAttribute("RedMarker", ""$r); xml.writeAttribute("Mechanism", ""$f); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.endElement(); } } function logConversation(ConversationState.ConvState c, name n, GeoEnums.GeoStates s, GeoEnums.GeoStates s2, int signalcount) { if(open) { xml.startElement("Conversation"); xml.writeAttribute("RedMarker", ""$n); xml.writeAttribute("State", ""$c); xml.writeAttribute("AssessmentAC", ""$s); xml.writeAttribute("AssessmentPlayer", ""$s2); xml.writeAttribute("SignalCount", ""$signalcount); xml.writeAttribute("Time", ""$geoPC.getTimer()); xml.endElement(); } } function logRedMarkerLocation(RedMarker r) { if(open) { xml.startElement("RedMarkerLocation"); xml.writeAttribute("RedMarker", ""$r.name); xml.writeAttribute("x", ""$r.GlobalLocation.LeftDistance); xml.writeAttribute("y", ""$r.GlobalLocation.TopDistance); xml.endElement(); } } function logScore(array ScoreArray) { if(open) { xml.startElement("Score"); xml.writeAttribute("FailureCorrect", ""$ScoreArray[0].CorrectCount); xml.writeAttribute("FailureMax", ""$ScoreArray[0].MaxCount); xml.writeAttribute("FailureUser", ""$ScoreArray[0].UserCount); xml.writeAttribute("LocationCorrect", ""$ScoreArray[1].CorrectCount); xml.writeAttribute("LocationMax", ""$ScoreArray[1].MaxCount); xml.writeAttribute("LocationUser", ""$ScoreArray[1].UserCount); xml.writeAttribute("SignalsCorrect", ""$ScoreArray[2].CorrectCount); xml.writeAttribute("SignalsMax", ""$ScoreArray[2].MaxCount); xml.writeAttribute("SignalsUser", ""$ScoreArray[2].UserCount); xml.writeAttribute("ReportsCorrect", ""$ScoreArray[3].CorrectCount); xml.writeAttribute("ReportsMax", ""$ScoreArray[3].MaxCount); xml.writeAttribute("ReportsUser", ""$ScoreArray[3].UserCount); xml.writeAttribute("AssessmentsCorrect", ""$ScoreArray[4].CorrectCount); xml.writeAttribute("AssessmentMax", ""$ScoreArray[4].MaxCount); xml.writeAttribute("AssessmentUser", ""$ScoreArray[4].UserCount); xml.writeAttribute("DiagnosesCorrect", ""$ScoreArray[5].CorrectCount); xml.writeAttribute("DiagnosesMax", ""$ScoreArray[5].MaxCount); xml.writeAttribute("DiagnosesUser", ""$ScoreArray[5].UserCount); xml.writeAttribute("MeasuresCorrect", ""$ScoreArray[6].CorrectCount); xml.writeAttribute("MeasuresMax", ""$ScoreArray[6].MaxCount); xml.writeAttribute("MeasuresUser", ""$ScoreArray[6].UserCount); xml.writeAttribute("Breach", ""$geoPC.IsBreachOccurred); xml.endElement(); } } function logDeleteSignal(Signal s) //menuobservationmain 288 { if(open) { xml.startElement("Delete_signal"); xml.writeAttribute("Name", ""$s.name); xml.endElement(); } } function Timer() { logLocation(); } defaultproperties { open = false; bHidden=true; }