// 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. //============================================================================= // In game menu for filling in the questions associated with // Settlement (Verzakking) // Started from MenuObservationReport. // ------------------------------------------------------------ // Created by Maarten van Zomeren // Template by Maarten Wesselius // © 2006, GeoDelft // // Date Id Modification // 2006-08-11 The Replaced HeightDifference with HeightDifference (from // SignalReportSettlement) // 2006-10-27 ZMR Made menu dynamic // 2007-01-29 wsl Made sure that all answers to non-applicable questions are always set to NONE enum values. //============================================================================= class MenuSettlement extends MenuSignalQuestions dependsOn(GeoPlayerController); function InitComponent(GUIController MyController, GUIComponent MyOwner) { GeoPC=GeoPlayerController(MyController.ViewportOwner.Actor); if(GeoPC!=None) UpdateLanguage(); else log("ERROR WITH TYPE OF GAME"); InitializeHashTable(); InitializeStringData(); Super.InitComponent(MyController, MyOwner); SetQuestionPosition(); InitializeCheckedness(); if(GeoPC.ReportingMode == MODE_CreatingNewObservation || GeoPC.ReportingMode == MODE_EditingFirstReport) { // nothing special to be done } else { InitLaterReport(); } } function SetQuestionPosition() { local moCheckBox Q3A1, Q3A2, Q3A3, Q3A4, Q3A5, Q3A6, Q4A1, Q4A2, Q4A3, Q4A4, Q4A5, Q4A6, Q6A1, Q6A2, Q6A3, Q6A4, Q6A5, Q6A6, Q7A1, Q7A2, Q7A3, Q7A4, Q7A5, Q7A6; local GUILabel Q3,Q4,Q6,Q7; Q3 = GUILabel(Controls[HashTable.getValue("Q3")]); Q3A1 = moCheckBox(Controls[HashTable.getValue("Q3A1")]); Q3A2 = moCheckBox(Controls[HashTable.getValue("Q3A2")]); Q3A3 = moCheckBox(Controls[HashTable.getValue("Q3A3")]); Q3A4 = moCheckBox(Controls[HashTable.getValue("Q3A4")]); Q3A5 = moCheckBox(Controls[HashTable.getValue("Q3A5")]); Q3A6 = moCheckBox(Controls[HashTable.getValue("Q3A6")]); Q4 = GUILabel(Controls[HashTable.getValue("Q4")]); Q4A1 = moCheckBox(Controls[HashTable.getValue("Q4A1")]); Q4A2 = moCheckBox(Controls[HashTable.getValue("Q4A2")]); Q4A3 = moCheckBox(Controls[HashTable.getValue("Q4A3")]); Q4A4 = moCheckBox(Controls[HashTable.getValue("Q4A4")]); Q4A5 = moCheckBox(Controls[HashTable.getValue("Q4A5")]); Q4A6 = moCheckBox(Controls[HashTable.getValue("Q4A6")]); Q6 = GUILabel(Controls[HashTable.getValue("Q6")]); Q6A1 = moCheckBox(Controls[HashTable.getValue("Q6A1")]); Q6A2 = moCheckBox(Controls[HashTable.getValue("Q6A2")]); Q6A3 = moCheckBox(Controls[HashTable.getValue("Q6A3")]); Q6A4 = moCheckBox(Controls[HashTable.getValue("Q6A4")]); Q6A5 = moCheckBox(Controls[HashTable.getValue("Q6A5")]); Q6A6 = moCheckBox(Controls[HashTable.getValue("Q6A6")]); Q7 = GUILabel(Controls[HashTable.getValue("Q7")]); Q7A1 = moCheckBox(Controls[HashTable.getValue("Q7A1")]); Q7A2 = moCheckBox(Controls[HashTable.getValue("Q7A2")]); Q7A3 = moCheckBox(Controls[HashTable.getValue("Q7A3")]); Q7A4 = moCheckBox(Controls[HashTable.getValue("Q7A4")]); Q7A5 = moCheckBox(Controls[HashTable.getValue("Q7A5")]); Q7A6 = moCheckBox(Controls[HashTable.getValue("Q7A6")]); Q6.WinTop = Q3.WinTop; Q6A1.WinTop = Q3A1.WinTop; Q6A2.WinTop = Q3A2.WinTop; Q6A3.WinTop = Q3A3.WinTop; Q6A4.WinTop = Q3A4.WinTop; Q6A5.WinTop = Q3A5.WinTop; Q6A6.WinTop = Q3A6.WinTop; Q7.WinTop = Q4.WinTop; Q7A1.WinTop = Q4A1.WinTop; Q7A2.WinTop = Q4A2.WinTop; Q7A3.WinTop = Q4A3.WinTop; Q7A4.WinTop = Q4A4.WinTop; Q7A5.WinTop = Q4A5.WinTop; Q7A6.WinTop = Q4A6.WinTop; Q6.SetVisibility(false); Q6A1.SetVisibility(false); Q6A2.SetVisibility(false); Q6A3.SetVisibility(false); Q6A4.SetVisibility(false); Q6A5.SetVisibility(false); Q6A6.SetVisibility(false); Q7.SetVisibility(false); Q7A1.SetVisibility(false); Q7A2.SetVisibility(false); Q7A3.SetVisibility(false); Q7A4.SetVisibility(false); Q7A5.SetVisibility(false); Q7A6.SetVisibility(false); } function InitLaterReport() { local moCheckBox Q1A1, Q1A2, Q2A1, Q2A2, Q2A3; Q1A1 = moCheckBox(Controls[HashTable.getValue("Q1A1")]); Q1A2 = moCheckBox(Controls[HashTable.getValue("Q1A2")]); Q2A1 = moCheckBox(Controls[HashTable.getValue("Q2A1")]); Q2A2 = moCheckBox(Controls[HashTable.getValue("Q2A2")]); Q2A3 = moCheckBox(Controls[HashTable.getValue("Q2A3")]); if(GeoPC.Dutch) { Q1A1.MyLabel.Caption = NL_ChosenBefore $ Q1A1.MyLabel.Caption; Q1A2.MyLabel.Caption = NL_ChosenBefore $ Q1A2.MyLabel.Caption; Q2A1.MyLabel.Caption = NL_ChosenBefore $ Q2A1.MyLabel.Caption; Q2A2.MyLabel.Caption = NL_ChosenBefore $ Q2A2.MyLabel.Caption; Q2A3.MyLabel.Caption = NL_ChosenBefore $ Q2A3.MyLabel.Caption; } else { Q1A1.MyLabel.Caption = EN_ChosenBefore $ Q1A1.MyLabel.Caption; Q1A2.MyLabel.Caption = EN_ChosenBefore $ Q1A2.MyLabel.Caption; Q2A1.MyLabel.Caption = EN_ChosenBefore $ Q2A1.MyLabel.Caption; Q2A2.MyLabel.Caption = EN_ChosenBefore $ Q2A2.MyLabel.Caption; Q2A3.MyLabel.Caption = EN_ChosenBefore $ Q2A3.MyLabel.Caption; } Q1A1.WinWidth = getAnswerWidthValue(Q1A1.myLabel.Caption); Q1A2.WinWidth = getAnswerWidthValue(Q1A2.myLabel.Caption); Q2A1.WinWidth = getAnswerWidthValue(Q2A1.myLabel.Caption); Q2A2.WinWidth = getAnswerWidthValue(Q2A2.myLabel.Caption); Q2A3.WinWidth = getAnswerWidthValue(Q2A3.myLabel.Caption); if(Q1A1.IsChecked()) { //the first answer of question 1 is true; show only this answer, without checkbox Q1A1.MyCheckBox.SetVisibility(false); Q1A2.SetVisibility(false); } else { //the second answer of question 1 is true; show only this answer, without checkbox Q1A2.MyCheckBox.SetVisibility(false); Q1A1.SetVisibility(false); Q1A2.WinLeft = Q1A1.WinLeft; } if(Q2A1.IsChecked()) { //the first answer of question 2 is true; show only this answer, without checkbox Q2A1.MyCheckBox.SetVisibility(false); Q2A2.SetVisibility(false); Q2A3.SetVisibility(false); //Entire(false); } else if(Q2A2.IsChecked()) { //the second answer of question 2 is true; show only this answer, without checkbox Q2A2.MyCheckBox.SetVisibility(false); Q2A1.SetVisibility(false); Q2A3.SetVisibility(false); Q2A2.WinLeft = Q2A1.WinLeft; //Entire(false); } else { //the third answer of question 2 is true; show only this answer, without checkbox Q2A3.MyCheckBox.SetVisibility(false); Q2A1.SetVisibility(false); Q2A2.SetVisibility(false); Q2A3.WinLeft = Q2A1.WinLeft; //Entire(true); } } function Entire(bool entire) { if(!entire){ // SET_Inwards or SET_Outwards GUILabel(Controls[HashTable.getValue("Q3")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q3A1")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q3A2")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q3A3")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q3A4")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q3A5")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q3A6")]).SetVisibility(true); GUILabel(Controls[HashTable.getValue("Q4")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q4A1")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q4A2")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q4A3")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q4A4")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q4A5")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q4A6")]).SetVisibility(true); GUILabel(Controls[HashTable.getValue("Q5")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q5A1")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q5A2")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q5A3")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q5A4")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q5A5")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q5A6")]).SetVisibility(true); GUILabel(Controls[HashTable.getValue("Q6")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q6A1")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q6A2")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q6A3")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q6A4")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q6A5")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q6A6")]).SetVisibility(false); GUILabel(Controls[HashTable.getValue("Q7")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q7A1")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q7A2")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q7A3")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q7A4")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q7A5")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q7A6")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q6A1")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q6A2")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q6A3")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q6A4")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q6A5")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q6A6")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q7A1")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q7A2")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q7A3")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q7A4")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q7A5")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q7A6")]).Checked(false); }else { // SET_Entire GUILabel(Controls[HashTable.getValue("Q3")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q3A1")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q3A2")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q3A3")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q3A4")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q3A5")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q3A6")]).SetVisibility(false); GUILabel(Controls[HashTable.getValue("Q4")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q4A1")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q4A2")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q4A3")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q4A4")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q4A5")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q4A6")]).SetVisibility(false); GUILabel(Controls[HashTable.getValue("Q5")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q5A1")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q5A2")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q5A3")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q5A4")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q5A5")]).SetVisibility(false); moCheckBox(Controls[HashTable.getValue("Q5A6")]).SetVisibility(false); GUILabel(Controls[HashTable.getValue("Q6")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q6A1")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q6A2")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q6A3")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q6A4")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q6A5")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q6A6")]).SetVisibility(true); GUILabel(Controls[HashTable.getValue("Q7")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q7A1")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q7A2")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q7A3")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q7A4")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q7A5")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q7A6")]).SetVisibility(true); moCheckBox(Controls[HashTable.getValue("Q3A1")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q3A2")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q3A3")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q3A4")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q3A5")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q3A6")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q4A1")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q4A2")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q4A3")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q4A4")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q4A5")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q4A6")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q5A1")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q5A2")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q5A3")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q5A4")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q5A5")]).Checked(false); moCheckBox(Controls[HashTable.getValue("Q5A6")]).Checked(false); } } function SetRadioButtons(int controlsIndex) { if(controlsIndex == HashTable.getValue("Q2A1") ||controlsIndex == HashTable.getValue("Q2A2")) { // SET_Inwards or SET_Outwards Entire(false); } else if(controlsIndex == HashTable.getValue("Q2A3")) { // SET_Entire Entire(true); } super.SetRadioButtons(controlsIndex); } function InitializeHashTable() { // FUNCTIONALITY: initialize the hashtable with the keys (which should be "Q1", "Q1A1", // "Q2", "Q2A3", etc.) and its corresponding values (the index in the controls-array). HashTable = New class'QAHashTable'; HashTable.add("Q1", 7); HashTable.add("Q1A1", 8); HashTable.add("Q1A2", 9); HashTable.add("Q2", 10); HashTable.add("Q2A1", 11); HashTable.add("Q2A2", 12); HashTable.add("Q2A3", 13); HashTable.add("Q3", 14); HashTable.add("Q3A1", 15); HashTable.add("Q3A2", 16); HashTable.add("Q3A3", 17); HashTable.add("Q3A4", 18); HashTable.add("Q3A5", 19); HashTable.add("Q3A6", 20); HashTable.add("Q4", 21); HashTable.add("Q4A1", 22); HashTable.add("Q4A2", 23); HashTable.add("Q4A3", 24); HashTable.add("Q4A4", 25); HashTable.add("Q4A5", 26); HashTable.add("Q4A6", 27); HashTable.add("Q5", 28); HashTable.add("Q5A1", 29); HashTable.add("Q5A2", 30); HashTable.add("Q5A3", 31); HashTable.add("Q5A4", 32); HashTable.add("Q5A5", 33); HashTable.add("Q5A6", 34); HashTable.add("Q6", 35); HashTable.add("Q6A1", 36); HashTable.add("Q6A2", 37); HashTable.add("Q6A3", 38); HashTable.add("Q6A4", 39); HashTable.add("Q6A5", 40); HashTable.add("Q6A6", 41); HashTable.add("Q7", 42); HashTable.add("Q7A1", 43); HashTable.add("Q7A2", 44); HashTable.add("Q7A3", 45); HashTable.add("Q7A4", 46); HashTable.add("Q7A5", 47); HashTable.add("Q7A6", 48); } function InitializeStringData() { local Signal.GeoSignalTypes TypeThis; TypeThis = SIG_Settlement; if (!GeoPC.IsDroogte()) { DataObject = new class'SignalStringData'; }else { DataObject = new class'SignalStringDataDroogte'; } NrQuestions = DataObject.GetNrQuestions(TypeThis); EN_QuestionStrings = DataObject.GetQuestionStrings(TypeThis, false); NL_QuestionStrings = DataObject.GetQuestionStrings(TypeThis, true); EN_AnswerStrings = DataObject.GetAnswerStrings(TypeThis, false); NL_AnswerStrings = DataObject.GetAnswerStrings(TypeThis, true); } function InitializeCheckedness() { // FUNCTIONALITY: load values from GeoPC.NewSignal and set answerButtons checkedness accordingly local SignalSettlement theSignal; local SignalReportSettlement theSignalReport; local moCheckBox Q1A1, Q1A2, Q2A1, Q2A2, Q2A3, Q3A1, Q3A2, Q3A3, Q3A4, Q3A5, Q3A6, Q4A1, Q4A2, Q4A3, Q4A4, Q4A5, Q4A6, Q5A1, Q5A2, Q5A3, Q5A4, Q5A5, Q5A6, Q6A1, Q6A2, Q6A3, Q6A4, Q6A5, Q6A6, Q7A1, Q7A2, Q7A3, Q7A4, Q7A5, Q7A6; local bool heledijk; Q1A1 = moCheckBox(Controls[HashTable.getValue("Q1A1")]); Q1A2 = moCheckBox(Controls[HashTable.getValue("Q1A2")]); Q2A1 = moCheckBox(Controls[HashTable.getValue("Q2A1")]); Q2A2 = moCheckBox(Controls[HashTable.getValue("Q2A2")]); Q2A3 = moCheckBox(Controls[HashTable.getValue("Q2A3")]); Q3A1 = moCheckBox(Controls[HashTable.getValue("Q3A1")]); Q3A2 = moCheckBox(Controls[HashTable.getValue("Q3A2")]); Q3A3 = moCheckBox(Controls[HashTable.getValue("Q3A3")]); Q3A4 = moCheckBox(Controls[HashTable.getValue("Q3A4")]); Q3A5 = moCheckBox(Controls[HashTable.getValue("Q3A5")]); Q3A6 = moCheckBox(Controls[HashTable.getValue("Q3A6")]); Q4A1 = moCheckBox(Controls[HashTable.getValue("Q4A1")]); Q4A2 = moCheckBox(Controls[HashTable.getValue("Q4A2")]); Q4A3 = moCheckBox(Controls[HashTable.getValue("Q4A3")]); Q4A4 = moCheckBox(Controls[HashTable.getValue("Q4A4")]); Q4A5 = moCheckBox(Controls[HashTable.getValue("Q4A5")]); Q4A6 = moCheckBox(Controls[HashTable.getValue("Q4A6")]); Q5A1 = moCheckBox(Controls[HashTable.getValue("Q5A1")]); Q5A2 = moCheckBox(Controls[HashTable.getValue("Q5A2")]); Q5A3 = moCheckBox(Controls[HashTable.getValue("Q5A3")]); Q5A4 = moCheckBox(Controls[HashTable.getValue("Q5A4")]); Q5A5 = moCheckBox(Controls[HashTable.getValue("Q5A5")]); Q5A6 = moCheckBox(Controls[HashTable.getValue("Q5A6")]); Q6A1 = moCheckBox(Controls[HashTable.getValue("Q6A1")]); Q6A2 = moCheckBox(Controls[HashTable.getValue("Q6A2")]); Q6A3 = moCheckBox(Controls[HashTable.getValue("Q6A3")]); Q6A4 = moCheckBox(Controls[HashTable.getValue("Q6A4")]); Q6A5 = moCheckBox(Controls[HashTable.getValue("Q6A5")]); Q6A6 = moCheckBox(Controls[HashTable.getValue("Q6A6")]); Q7A1 = moCheckBox(Controls[HashTable.getValue("Q7A1")]); Q7A2 = moCheckBox(Controls[HashTable.getValue("Q7A2")]); Q7A3 = moCheckBox(Controls[HashTable.getValue("Q7A3")]); Q7A4 = moCheckBox(Controls[HashTable.getValue("Q7A4")]); Q7A5 = moCheckBox(Controls[HashTable.getValue("Q7A5")]); Q7A6 = moCheckBox(Controls[HashTable.getValue("Q7A6")]); theSignal = SignalSettlement(GeoPC.NewSignal); // get signal properties that are independent of the state of the failure // QUESTION 1 if(theSignal.RevetmentType == REV_Grass) Q1A1.Checked(true); else if(theSignal.RevetmentType == REV_Asphalt) Q1A2.Checked(true); // QUESTION 2 if(theSignal.SettlementPosition == SET_Inwards) { Q2A1.Checked(true); heledijk = false; } else if(theSignal.SettlementPosition == SET_Outwards) { Q2A2.Checked(true); heledijk = false; } else if(theSignal.SettlementPosition == SET_Entire) { Q2A3.Checked(true); heledijk = true; } Entire(heledijk); if(theSignal.SignalReports.length > 0) { // get signal properties that are dependent of the state of the failure theSignalReport = SignalReportSettlement(theSignal.SignalReports[theSignal.SignalReports.length-1]); if(!heledijk) { // QUESTION 3 if(theSignalReport.LengthOfDamage == SIZE_VerySmall) Q3A1.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_Small) Q3A2.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_Medium) Q3A3.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_MediumLarge) Q3A4.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_Large) Q3A5.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_VeryLarge) Q3A6.Checked(true); // QUESTION 4 if(theSignalReport.WidthOfDamage == SIZE_VerySmall) Q4A1.Checked(true); else if(theSignalReport.WidthOfDamage == SIZE_Small) Q4A2.Checked(true); else if(theSignalReport.WidthOfDamage == SIZE_Medium) Q4A3.Checked(true); else if(theSignalReport.WidthOfDamage == SIZE_MediumLarge) Q4A4.Checked(true); else if(theSignalReport.WidthOfDamage == SIZE_Large) Q4A5.Checked(true); else if(theSignalReport.WidthOfDamage == SIZE_VeryLarge) Q4A6.Checked(true); // QUESTION 5 if(theSignalReport.HeightDifference == SIZE_VerySmall) Q5A1.Checked(true); else if(theSignalReport.HeightDifference == SIZE_Small) Q5A2.Checked(true); else if(theSignalReport.HeightDifference == SIZE_Medium) Q5A3.Checked(true); else if(theSignalReport.HeightDifference == SIZE_MediumLarge) Q5A4.Checked(true); else if(theSignalReport.HeightDifference == SIZE_Large) Q5A5.Checked(true); else if(theSignalReport.HeightDifference == SIZE_VeryLarge) Q5A6.Checked(true); }else { // QUESTION 6 if(theSignalReport.LengthOfDamage == SIZE_VerySmall) Q6A1.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_Small) Q6A2.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_Medium) Q6A3.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_MediumLarge) Q6A4.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_Large) Q6A5.Checked(true); else if(theSignalReport.LengthOfDamage == SIZE_VeryLarge) Q6A6.Checked(true); // QUESTION 7 if(theSignalReport.HeightDifference == SIZE_VerySmall) Q7A1.Checked(true); else if(theSignalReport.HeightDifference == SIZE_Small) Q7A2.Checked(true); else if(theSignalReport.HeightDifference == SIZE_Medium) Q7A3.Checked(true); else if(theSignalReport.HeightDifference == SIZE_MediumLarge) Q7A4.Checked(true); else if(theSignalReport.HeightDifference == SIZE_Large) Q7A5.Checked(true); else if(theSignalReport.HeightDifference == SIZE_VeryLarge) Q7A6.Checked(true); } } } function storeAnswerValues() { // FUNCTIONALITY: look at current values in answers and save it in GeoPC.NewSignal local SignalSettlement theSignal; // set to GeoPC.NewSignal, working variable for the Signal answers local SignalSettlement OriginalSignal; // the original report made, to check for changes in observations local SignalReportSettlement tempSignalReport; // temporary working SignalReport for the SignalReport answers local moCheckBox Q1A1, Q1A2, Q2A1, Q2A2, Q2A3, Q3A1, Q3A2, Q3A3, Q3A4, Q3A5, Q3A6, Q4A1, Q4A2, Q4A3, Q4A4, Q4A5, Q4A6, Q5A1, Q5A2, Q5A3, Q5A4, Q5A5, Q5A6, Q6A1, Q6A2, Q6A3, Q6A4, Q6A5, Q6A6, Q7A1, Q7A2, Q7A3, Q7A4, Q7A5, Q7A6; local bool bObservationsChanged; local int tmp; bObservationsChanged = false; Q1A1 = moCheckBox(Controls[HashTable.getValue("Q1A1")]); Q1A2 = moCheckBox(Controls[HashTable.getValue("Q1A2")]); Q2A1 = moCheckBox(Controls[HashTable.getValue("Q2A1")]); Q2A2 = moCheckBox(Controls[HashTable.getValue("Q2A2")]); Q2A3 = moCheckBox(Controls[HashTable.getValue("Q2A3")]); Q3A1 = moCheckBox(Controls[HashTable.getValue("Q3A1")]); Q3A2 = moCheckBox(Controls[HashTable.getValue("Q3A2")]); Q3A3 = moCheckBox(Controls[HashTable.getValue("Q3A3")]); Q3A4 = moCheckBox(Controls[HashTable.getValue("Q3A4")]); Q3A5 = moCheckBox(Controls[HashTable.getValue("Q3A5")]); Q3A6 = moCheckBox(Controls[HashTable.getValue("Q3A6")]); Q4A1 = moCheckBox(Controls[HashTable.getValue("Q4A1")]); Q4A2 = moCheckBox(Controls[HashTable.getValue("Q4A2")]); Q4A3 = moCheckBox(Controls[HashTable.getValue("Q4A3")]); Q4A4 = moCheckBox(Controls[HashTable.getValue("Q4A4")]); Q4A5 = moCheckBox(Controls[HashTable.getValue("Q4A5")]); Q4A6 = moCheckBox(Controls[HashTable.getValue("Q4A6")]); Q5A1 = moCheckBox(Controls[HashTable.getValue("Q5A1")]); Q5A2 = moCheckBox(Controls[HashTable.getValue("Q5A2")]); Q5A3 = moCheckBox(Controls[HashTable.getValue("Q5A3")]); Q5A4 = moCheckBox(Controls[HashTable.getValue("Q5A4")]); Q5A5 = moCheckBox(Controls[HashTable.getValue("Q5A5")]); Q5A6 = moCheckBox(Controls[HashTable.getValue("Q5A6")]); Q6A1 = moCheckBox(Controls[HashTable.getValue("Q6A1")]); Q6A2 = moCheckBox(Controls[HashTable.getValue("Q6A2")]); Q6A3 = moCheckBox(Controls[HashTable.getValue("Q6A3")]); Q6A4 = moCheckBox(Controls[HashTable.getValue("Q6A4")]); Q6A5 = moCheckBox(Controls[HashTable.getValue("Q6A5")]); Q6A6 = moCheckBox(Controls[HashTable.getValue("Q6A6")]); Q7A1 = moCheckBox(Controls[HashTable.getValue("Q7A1")]); Q7A2 = moCheckBox(Controls[HashTable.getValue("Q7A2")]); Q7A3 = moCheckBox(Controls[HashTable.getValue("Q7A3")]); Q7A4 = moCheckBox(Controls[HashTable.getValue("Q7A4")]); Q7A5 = moCheckBox(Controls[HashTable.getValue("Q7A5")]); Q7A6 = moCheckBox(Controls[HashTable.getValue("Q7A6")]); theSignal = SignalSettlement(GeoPC.NewSignal.Duplicate()); // create a SignalReport for this Signal tempSignalReport = new class'SignalReportSettlement'; // set Signal properties (that are independent of the state of the failure) // QUESTION 1 if(Q1A1.isChecked()) theSignal.RevetmentType = REV_Grass; else if(Q1A2.isChecked()) theSignal.RevetmentType = REV_Asphalt; // QUESTION 2 if(Q2A1.isChecked()) theSignal.SettlementPosition = SET_Inwards; else if(Q2A2.isChecked()) theSignal.SettlementPosition = SET_Outwards; else if(Q2A3.isChecked()) theSignal.SettlementPosition = SET_Entire; // set SignalReport properties (that are dependent of the failure state) // QUESTION 3 if(Q3A1.isChecked()) tempSignalReport.LengthOfDamage = SIZE_VerySmall; else if(Q3A2.isChecked()) tempSignalReport.LengthOfDamage = SIZE_Small; else if(Q3A3.isChecked()) tempSignalReport.LengthOfDamage = SIZE_Medium; else if(Q3A4.isChecked()) tempSignalReport.LengthOfDamage = SIZE_MediumLarge; else if(Q3A5.isChecked()) tempSignalReport.LengthOfDamage = SIZE_Large; else if(Q3A6.isChecked()) tempSignalReport.LengthOfDamage = SIZE_VeryLarge; // QUESTION 4 if(theSignal.SettlementPosition == SET_Entire) tempSignalReport.WidthOfDamage = SIZE_NONE; else if(Q4A1.isChecked()) tempSignalReport.WidthOfDamage = SIZE_VerySmall; else if(Q4A2.isChecked()) tempSignalReport.WidthOfDamage = SIZE_Small; else if(Q4A3.isChecked()) tempSignalReport.WidthOfDamage = SIZE_Medium; else if(Q4A4.isChecked()) tempSignalReport.WidthOfDamage = SIZE_MediumLarge; else if(Q4A5.isChecked()) tempSignalReport.WidthOfDamage = SIZE_Large; else if(Q4A6.isChecked()) tempSignalReport.WidthOfDamage = SIZE_VeryLarge; // QUESTION 5 if(Q5A1.isChecked()) tempSignalReport.HeightDifference = SIZE_VerySmall; else if(Q5A2.isChecked()) tempSignalReport.HeightDifference = SIZE_Small; else if(Q5A3.isChecked()) tempSignalReport.HeightDifference = SIZE_Medium; else if(Q5A4.isChecked()) tempSignalReport.HeightDifference = SIZE_MediumLarge; else if(Q5A5.isChecked()) tempSignalReport.HeightDifference = SIZE_Large; else if(Q5A6.isChecked()) tempSignalReport.HeightDifference = SIZE_VeryLarge; // QUESTION 6 if(Q6A1.isChecked()) tempSignalReport.LengthOfDamage = SIZE_VerySmall; else if(Q6A2.isChecked()) tempSignalReport.LengthOfDamage = SIZE_Small; else if(Q6A3.isChecked()) tempSignalReport.LengthOfDamage = SIZE_Medium; else if(Q6A4.isChecked()) tempSignalReport.LengthOfDamage = SIZE_MediumLarge; else if(Q6A5.isChecked()) tempSignalReport.LengthOfDamage = SIZE_Large; else if(Q6A6.isChecked()) tempSignalReport.LengthOfDamage = SIZE_VeryLarge; // QUESTION 7 if(Q7A1.isChecked()) tempSignalReport.HeightDifference = SIZE_VerySmall; else if(Q7A2.isChecked()) tempSignalReport.HeightDifference = SIZE_Small; else if(Q7A3.isChecked()) tempSignalReport.HeightDifference = SIZE_Medium; else if(Q7A4.isChecked()) tempSignalReport.HeightDifference = SIZE_MediumLarge; else if(Q7A5.isChecked()) tempSignalReport.HeightDifference = SIZE_Large; else if(Q7A6.isChecked()) tempSignalReport.HeightDifference = SIZE_VeryLarge; // now check if observations have changed (only applicable in editing mode) if(GeoPC.ReportingMode == MODE_EditingFirstReport || GeoPC.ReportingMode == MODE_EditingLaterReport) { // if there is already an original, use it to get the answers // from last time, in order to see if any changes were made regarding the original. OriginalSignal = SignalSettlement(GeoPC.NearbyMarker.SignalOriginals[GeoPC.EditIndex]); if(OriginalSignal.RevetmentType != theSignal.RevetmentType) bObservationsChanged = true; if(OriginalSignal.SettlementPosition != theSignal.SettlementPosition) bObservationsChanged = true; // for the SignalReport-answers, IsEqual() is used to check for changes if(!tempSignalReport.IsEqual(OriginalSignal.SignalReports[OriginalSignal.SignalReports.length - 1], 0.95,tmp,tmp)) bObservationsChanged = true; // bChanged reflects if any changes were made regarding the original report tempSignalReport.bChanged = bObservationsChanged; } SaveAnswers(theSignal, tempSignalReport); } defaultproperties { // Controls 6 to 31 are the labels for the questions, and the buttons for the possible answers // common properties of all answer buttons // QUESTION 1 Controls(7)=GUILabel'QuestionLabel' Controls(8)=moCheckBox'AnswerButton' Controls(9)=moCheckBox'AnswerButton' // QUESTION 2 Controls(10)=GUILabel'QuestionLabel' Controls(11)=moCheckBox'AnswerButton' Controls(12)=moCheckBox'AnswerButton' Controls(13)=moCheckBox'AnswerButton' // QUESTION 3 Controls(14)=GUILabel'QuestionLabel' Controls(15)=moCheckBox'AnswerButton' Controls(16)=moCheckBox'AnswerButton' Controls(17)=moCheckBox'AnswerButton' Controls(18)=moCheckBox'AnswerButton' Controls(19)=moCheckBox'AnswerButton' Controls(20)=moCheckBox'AnswerButton' // QUESTION 4 Controls(21)=GUILabel'QuestionLabel' Controls(22)=moCheckBox'AnswerButton' Controls(23)=moCheckBox'AnswerButton' Controls(24)=moCheckBox'AnswerButton' Controls(25)=moCheckBox'AnswerButton' Controls(26)=moCheckBox'AnswerButton' Controls(27)=moCheckBox'AnswerButton' // QUESTION 5 Controls(28)=GUILabel'QuestionLabel' Controls(29)=moCheckBox'AnswerButton' Controls(30)=moCheckBox'AnswerButton' Controls(31)=moCheckBox'AnswerButton' Controls(32)=moCheckBox'AnswerButton' Controls(33)=moCheckBox'AnswerButton' Controls(34)=moCheckBox'AnswerButton' // QUESTION 6 Controls(35)=GUILabel'QuestionLabel' Controls(36)=moCheckBox'AnswerButton' Controls(37)=moCheckBox'AnswerButton' Controls(38)=moCheckBox'AnswerButton' Controls(39)=moCheckBox'AnswerButton' Controls(40)=moCheckBox'AnswerButton' Controls(41)=moCheckBox'AnswerButton' // QUESTION 7 Controls(42)=GUILabel'QuestionLabel' Controls(43)=moCheckBox'AnswerButton' Controls(44)=moCheckBox'AnswerButton' Controls(45)=moCheckBox'AnswerButton' Controls(46)=moCheckBox'AnswerButton' Controls(47)=moCheckBox'AnswerButton' Controls(48)=moCheckBox'AnswerButton' MenuWidth=0.9 MenuHeight=0.7 // override standard values of superclass here! EN_Title = "Observation report for settlement" NL_Title = "Observatie rapport voor verzakking" HelpMenuOption=0 }