// 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. //============================================================================= // Dispay report data // ------------------------------------------------------------ // © 2006, Geodelft // // Date Id Modification // 2006-10-26 The Created this header // 2006-10-26 The Formatted code // 2006-10-27 The Resized and rearranged controls //============================================================================= class Tab_ReportData extends GUITabPanel DependsOn(SignalStringData); var float firstColumnLeft, secondColumnLeft, firstTop; var float VGap; var string EN_Status1, NL_Status1, EN_Status2, NL_Status2, EN_Yes, NL_Yes, EN_NotYet, NL_NotYet, EN_YesYesText, NL_YesYesText, EN_NotFilledIn, NL_NotFilledIn; var SignalStringData DataObject; //============================================================================= // Date Id Modification // 2006-10-26 The Created this header // 2006-11-20 zmr Changed positions //============================================================================= function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; local GeoPlayerController GeoPC; Super.Initcomponent(MyController, MyOwner); // controls 1 - 8 are on first column (the report property names) Controls[1].WinLeft = firstColumnLeft; Controls[1].WinTop = firstTop - VGap; for(i = 2; i < 9; i++) { Controls[i].WinLeft = firstColumnLeft; Controls[i].WinTop = Controls[i-1].WinTop + Controls[i-1].WinHeight + VGap; } // controls 9 - 16 are on second column (the report property values) Controls[9].WinLeft = secondColumnLeft; Controls[9].WinTop = firstTop - VGap; for(i = 10; i < 17; i++) { Controls[i].WinLeft = secondColumnLeft; Controls[i].WinTop = Controls[i-1].WinTop + Controls[i-1].WinHeight + VGap; } // Controls 17 - 21 are aligned from the bottom Controls[21].WinLeft = firstColumnLeft; Controls[21].WinTop = 1 - Controls[21].WinHeight - VGap; Controls[21].SetVisibility(false); Controls[19].WinLeft = firstColumnLeft; Controls[19].WinTop = Controls[21].WinTop - Controls[19].WinHeight - 2*VGap; Controls[20].WinLeft = 1 - Controls[20].WinWidth - firstColumnLeft; Controls[20].WinTop = Controls[19].WinTop; Controls[17].WinLeft = firstColumnLeft; Controls[17].WinTop = Controls[19].WinTop - Controls[17].WinHeight - VGap; Controls[18].WinLeft = 1 - Controls[18].WinWidth - firstColumnLeft; Controls[18].WinTop = Controls[17].WinTop; GeoPC = GeoPlayerController(PlayerOwner()); if (GeoPC.IsDroogte() == false) { Log("Report: niet droog"); DataObject = new class'SignalStringData'; }else { Log("Report: droog"); DataObject = new class'SignalStringDataDroogte'; } } //============================================================================= // Date Id Modification // 2006-10-26 The Created this header //============================================================================= function SetSize(float wLeft, float wTop, float wWidth, float wHeight) { WinLeft = wLeft; WinTop = wTop; WinWidth = wWidth; WinHeight = wHeight; } //============================================================================= // shows all properties of observation s (and all in right language) // Date Id Modification // 2006-10-26 The Created this header //============================================================================= function ShowReport(Signal s, int ReportIndex) { local bool dutch; local array qStrings; local array aStrings; local array givenAnswers; local int nrQ,questionIndex, labelIndex, u; dutch = GeoPlayerController(PlayerOwner()).Dutch; // get the needed data of questions and answers nrQ = DataObject.GetNrAllQuestions(s.SignalType); qStrings = DataObject.GetAllQuestionShortStrings(s.SignalType, dutch); aStrings = DataObject.GetAllAnswerStrings(s.SignalType, dutch); givenAnswers = DataObject.GetAllAnswers(s, ReportIndex); // for each signal type, get and set caption of signal properties (incl. signal location) // (Questions: Controls 1 - 8, with some possibly empty. Answers: Controls 9 - 16) labelIndex = 1; for(questionIndex = 0; questionIndex < nrQ; questionIndex++) { if(givenAnswers[questionIndex] == -2) { // this answer was not applicable and should not be shown continue; } GUILabel(Controls[labelIndex]).Caption = qStrings[questionIndex] $ ":"; if(givenAnswers[questionIndex] == -1) { // this answer was applicable but not filled in if(dutch) GUILabel(Controls[labelIndex + 8]).Caption = NL_NotFilledIn; else GUILabel(Controls[labelIndex + 8]).Caption = EN_NotFilledIn; } else { // this answer was applicable and filled in GUILabel(Controls[labelIndex + 8]).Caption = aStrings[questionIndex].Answers[givenAnswers[questionIndex]]; } labelIndex++; } // unused labels show empty string (e.g. invisible) for(u = labelIndex; u < 9; u++) { GUILabel(Controls[u]).Caption = ""; GUILabel(Controls[u + 8]).Caption = ""; } // set caption of status labels if(dutch){ GUILabel(Controls[17]).Caption = NL_Status1; GUILabel(Controls[19]).Caption = NL_Status2; }else{ GUILabel(Controls[17]).Caption = EN_Status1; GUILabel(Controls[19]).Caption = EN_Status2; } if(s.SignalReports[ReportIndex]== none && s.bCalled) { if(dutch) GUILabel(Controls[18]).Caption = NL_Yes; else GUILabel(Controls[18]).Caption = EN_Yes; if(s.bApproved){ if(dutch){ GUILabel(Controls[20]).Caption = NL_Yes; GUILabel(Controls[21]).Caption = NL_YesYesText; }else{ GUILabel(Controls[20]).Caption = EN_Yes; GUILabel(Controls[21]).Caption = EN_YesYesText; } Controls[21].SetVisibility(true); }else{ if(dutch) GUILabel(Controls[20]).Caption = NL_NotYet; else GUILabel(Controls[20]).Caption = EN_NotYet; } } else if(s.SignalReports[ReportIndex] != none && s.SignalReports[ReportIndex].bCalled){ if(dutch) GUILabel(Controls[18]).Caption = NL_Yes; else GUILabel(Controls[18]).Caption = EN_Yes; if(s.SignalReports[ReportIndex].bApproved){ if(dutch){ GUILabel(Controls[20]).Caption = NL_Yes; GUILabel(Controls[21]).Caption = NL_YesYesText; }else{ GUILabel(Controls[20]).Caption = EN_Yes; GUILabel(Controls[21]).Caption = EN_YesYesText; } Controls[21].SetVisibility(true); }else{ if(dutch) GUILabel(Controls[20]).Caption = NL_NotYet; else GUILabel(Controls[20]).Caption = EN_NotYet; } }else{ if(dutch){ GUILabel(Controls[18]).Caption = NL_NotYet; GUILabel(Controls[20]).Caption = NL_NotYet; }else{ GUILabel(Controls[18]).Caption = EN_NotYet; GUILabel(Controls[20]).Caption = EN_NotYet; } } ////// original > /* if(s.bCalled) { if(dutch) GUILabel(Controls[18]).Caption = NL_Yes; else GUILabel(Controls[18]).Caption = EN_Yes; if(s.bApproved) { if(dutch) GUILabel(Controls[20]).Caption = NL_Yes; else GUILabel(Controls[20]).Caption = EN_Yes; // has been called about AND has been approved; show text if(dutch) GUILabel(Controls[21]).Caption = NL_YesYesText; else GUILabel(Controls[21]).Caption = EN_YesYesText; Controls[21].SetVisibility(true); } else { if(dutch) GUILabel(Controls[20]).Caption = NL_NotYet; else GUILabel(Controls[20]).Caption = EN_NotYet; } } else { if(dutch) GUILabel(Controls[18]).Caption = NL_NotYet; else GUILabel(Controls[18]).Caption = EN_NotYet; if(dutch) GUILabel(Controls[20]).Caption = NL_NotYet; else GUILabel(Controls[20]).Caption = EN_NotYet; } */ //eof original } //============================================================================= // Date Id Modification // 2006-10-26 The Created this header //============================================================================= defaultproperties { Begin Object class=GUIImage Name=Background WinWidth=0.99 WinHeight=0.99 WinLeft=0.01 WinTop=0.01 Image=Material'GUIContent.BorderBoxD' ImageColor=(R=255,G=255,B=255,A=255); ImageRenderStyle=MSTY_Alpha ImageStyle=ISTY_Stretched End Object Controls(0)=GUIImage'Background' Begin Object class=GUILabel Name=UpperLabels Caption="***" TextAlign=TXTA_Left TextFont="MidGameButtonFont" WinHeight=0.045 WinWidth=0.50 End Object // controls 1 with 'Signal location:' Controls[1]=GUILabel'UpperLabels' // controls 2 - 8 for Signal(Report) names of properties (all on left column) Controls[2]=GUILabel'UpperLabels' Controls[3]=GUILabel'UpperLabels' Controls[4]=GUILabel'UpperLabels' Controls[5]=GUILabel'UpperLabels' Controls[6]=GUILabel'UpperLabels' Controls[7]=GUILabel'UpperLabels' Controls[8]=GUILabel'UpperLabels' Begin Object class=GUILabel Name=UpperLabelsRight Caption="***" TextAlign=TXTA_Left TextFont="MidGameButtonFont" WinHeight=0.045 WinWidth=0.50 End Object // controls 9 with value of signal location Controls[9]=GUILabel'UpperLabels' // controls 10 - 16 for Signal(Report) values of properties (all on right column) Controls[10]=GUILabel'UpperLabelsRight' Controls[11]=GUILabel'UpperLabelsRight' Controls[12]=GUILabel'UpperLabelsRight' Controls[13]=GUILabel'UpperLabelsRight' Controls[14]=GUILabel'UpperLabelsRight' Controls[15]=GUILabel'UpperLabelsRight' Controls[16]=GUILabel'UpperLabelsRight' Begin Object class=GUILabel Name=LeftStatusLabels Caption="***" TextAlign=TXTA_Left TextFont="MidGameButtonFont" WinHeight=0.045 WinWidth=0.75 End Object // status labels (not the value) Controls[17]=GUILabel'LeftStatusLabels' Controls[19]=GUILabel'LeftStatusLabels' Begin Object class=GUILabel Name=RightStatusLabels Caption="***" TextAlign=TXTA_Right TextFont="MidGameButtonFont" WinHeight=0.045 WinWidth=0.235 End Object // status labels (the values) Controls[18]=GUILabel'RightStatusLabels' Controls[20]=GUILabel'RightStatusLabels' Begin Object class=GUILabel Name=TextLabel Caption="***" TextAlign=TXTA_Left TextFont="MidGameButtonFont" WinHeight=0.2 WinWidth=0.9 bMultiLine=true End Object // status labels (the values) Controls[21]=GUILabel'TextLabel' firstColumnLeft=0.05 secondColumnLeft=0.45 firstTop=0.08 VGap=0.023 // will be overruled by SetSize!!!!! WinLeft=0.6 WinTop=0.3 WinWidth=0.4 WinHeight=0.5 EN_Status1="Discussed with Action Centre:" NL_Status1="Over gebeld met Actiecentrum:" EN_Status2="Approved by Action Centre:" NL_Status2="Goedgekeurd door Actiecentrum:" EN_Yes="Yes" NL_Yes="Ja" EN_NotYet="No" NL_NotYet="Nee" EN_YesYesText="The Action Centre is in possession of this report and it has been approved. So, you can no longer make changes to it." NL_YesYesText="Dit rapport ligt bij het Actiecentrum en is goedgekeurd. Je kunt er dus geen veranderingen meer in aanbrengen." EN_NotFilledIn="Not filled in" NL_NotFilledIn="Niet ingevuld" }