// FuncImportFichierText.inc function TToporobotStructure2012.LoadFichierText(const FichierText: TStringDirectoryFilename): integer; deprecated; const // colonnes des champs //COL_COMMENT = 00; // parenthèse de commentaire éventuel COL_NUM_SECTION = 01; // numéro de section ou numéro de série COL_NUM_ITEM = 02; // numéro d'item (expé, code, point topo) //COL_SESSION = 03; // numéro de session (inutilisé) COL_CODE = 04; // code attaché à la station COL_EXPE = 05; // numéro de séance COL_VAR_DATA = 06; // colonne suivant les colonnes de préfixes et index COL_NOMENTREE = COL_VAR_DATA; // nom de l'entrée COL_XENTREE = COL_VAR_DATA; COL_YENTREE = COL_XENTREE + 1; COL_ZENTREE = COL_YENTREE + 1; COL_ENT_SER = COL_ZENTREE + 1; COL_ENT_ST = COL_ENT_SER + 1; COL_DATE_EXPE = COL_VAR_DATA; COL_SPELEOMETRE = COL_DATE_EXPE + 1; COL_SPELEOGRAPH = COL_SPELEOMETRE + 1; COL_MODEDECL = COL_SPELEOGRAPH + 1; COL_DECL_VALUE = COL_MODEDECL + 1; COL_INCL_VALUE = COL_DECL_VALUE + 1; COL_COULEUR = COL_INCL_VALUE + 1; COL_U_AZIMUT = COL_VAR_DATA; COL_U_PENTE = COL_U_AZIMUT + 1; COL_PSI_L = COL_U_PENTE + 1; COL_PSI_AZ = COL_PSI_L +1; COL_PSI_P = COL_PSI_AZ + 1; //COL_OLD_DECL = COL_PSI_P + 1; COL_FACT_LONG = COL_PSI_P + 1; COL_ANG_LIMITE = COL_FACT_LONG + 1; COL_SER_DEP = COL_VAR_DATA; COL_PT_DEP = COL_SER_DEP + 1; COL_SER_ARR = COL_PT_DEP + 1; COL_PT_ARR = COL_SER_ARR + 1; COL_NB_PTS = COL_PT_ARR + 1; COL_CHANCE = COL_NB_PTS + 1; COL_OBSTACLE = COL_CHANCE + 1; COL_LONG = COL_VAR_DATA; COL_AZ = COL_LONG + 1; COL_P = COL_AZ + 1; COL_LG = COL_P + 1; COL_LD = COL_LG + 1; COL_HZ = COL_LD + 1; COL_HN = COL_HZ + 1; TEMPORARYTABFILE = '~GhtopoTemp.txt'; var EPSGDefault : TLabelSystemesCoordsEPSG; // fichier d'erreur pTEXT : TextFile; // liste provisoire pour entrées ProvListeEntrees: TStringList; // séries, réseaux, etc UneEntree : TEntrance; UneExpe : TExpe; UnCode : TCode; UneSerie: TObjSerie; qVisee : TUneVisee; // ligne de données NoLigneTEXT, NbErrorsInLoading: integer; LigneTEXT: string; PrmsLn : TGHStringArrayExt; // la ligne contient une parenthèse de tête ? HasParenthesis: boolean; // messages d'erreur ErrMsg : string; // Préfixes de section Prefix1, Prefix2 : integer; // divers str : string; llanfair_pg : string; // dates yyy, mmm, ddd: word; // Index courant //IdxCourant: integer; IdxCourantStation: integer; NomDeLaSerie: String; WU: String; mioumiou: Boolean; IdxCourant, QN: Integer; myViseeAntenne: TViseeAntenne; // Conversion de lignes Mac > PC procedure ConvertTextMacToPC(var Lin: string); begin // convertir accentués Lin := StringReplace(Lin, #136, 'a', [rfReplaceAll]); Lin := StringReplace(Lin, #142, 'e', [rfReplaceAll]); Lin := StringReplace(Lin, #143, 'e', [rfReplaceAll]); Lin := StringReplace(Lin, #148, 'i', [rfReplaceAll]); Lin := StringReplace(Lin, #137, 'a', [rfReplaceAll]); Lin := StringReplace(Lin, #144, 'e', [rfReplaceAll]); Lin := StringReplace(Lin, #144, 'e', [rfReplaceAll]); Lin := StringReplace(Lin, #141, 'c', [rfReplaceAll]); end; // extraire une visée en antenne function ExtraireViseeEnAntenne(const qStr: string; const qIdxReseau: integer; const qIdxSerie: integer; const qIdxPoint: integer; const qMyVisee: TUneVisee; var qVA : TViseeAntenne): boolean; var myStr: String; CrO, CrF: integer; EWE: TGHStringArrayExt; begin Result := False; myStr := Trim(qStr); try // Visées en antenne sont de la forme [%.2f %.2f %.2f] // crochets indispensables // recherche de crochets et suppression CrO := Pos('[', myStr); if (CrO = 0) then Exit; if (CrO > 0) then System.Delete(myStr, CrO, 1); CrF := Pos(']', myStr); if (CrF > 0) then System.Delete(myStr, CrF, 1); EWE.SplitFrom(myStr, ' '); qVA.SerieDepart := qIdxSerie; qVA.PtDepart := qIdxPoint; qVA.Reseau := qIdxReseau; qVA.Secteur := qMyVisee.IDSecteur; qVA.setLongAzInc(EWE.getFloat(0), EWE.getFloat(1), EWE.getFloat(2)); qVA.MarkedForDelete := false; Result := (qVA.Longueur > 0.00); except end; end; // afficher avertissement procedure WriteWarning(const wm: string); begin AfficherMessage(wm); end; begin //self.ClearListeSeries(); EPSGDefault.CodeEPSG := DEFAULT_SYSTEME_COORDONNEES_CODE_EPSG; EPSGDefault.NomEPSG := DEFAULT_SYSTEME_COORDONNEES_NOM; AfficherMsgClass(self, 'LoadFichierText(): %s', [FichierText]); Result := -1; // Fichier introuvable ? OK, On sort if not FileExistsUTF8(FichierText) then begin Result:=-32; Exit; end; // nom étude par défaut SetNomEtude('Etude001'); SetCommentairesEtude('Issued from Toporobot Text format (fixed columns)'); SetCodeEPSGSystemeCoordonnees(EPSGDefault); try // try..finally niveau 0 //************************************************************************* // Pour pallier à tout problème de formats de fichiers textes, // et notamments ceux liés aux fins de ligne, // on fait une conversion. // Pour économiser une variable, on utilise une variable utilisée + tard LigneTEXT := AnsiToUtf8(ExtractFilePath(FichierText)+ TEMPORARYTABFILE); AfficherMessageErreur('*** 0002'); ConvertTextFile(FichierText, LigneTEXT, tfMAC, tfWINDOWS); AfficherMessage(GetResourceString(rsSEPARATOR_LINE)); // nom de la base SetDatabaseName(ExtractFileNameWithoutExt(FichierText)); // Laz 1.8: ExtractFileNameWithoutExt() remplace ExtractFileNameOnly() // Initialisation des listes ReInitialiser(True); AfficherMessage('%s: %s', [{$I %FILE%}, {$I %LINE%}]); // code EPSG par défaut SetCodeEPSGSystemeCoordonnees(EPSGDefault); // début du véritable traitement // liste provisoire pour lecture des sections -6 ProvListeEntrees:=TStringList.Create; // ouverture fichier Text AssignFile(pTEXT, LigneTEXT); AfficherMessage('--> Lecture du fichier'); AfficherMessage('--> %d expés, %d codes', [GetNbExpes(), GetNbCodes()]); try // niveau 1: pour le fichier Text Reset(pTEXT); // lire tout le fichier NoLigneTEXT:=0; NbErrorsInLoading:=0; ErrMsg:= rsRD_TAB_MSG_ERR; IdxCourant := -1; while Not Eof(pTEXT) do begin try // traitement local d'exceptions dans la lecture des lignes Prefix1:=0; Inc(NoLigneTEXT); ReadLn(pTEXT, LigneTEXT); if Trim(LigneTEXT)='' then Prefix1 := -100 // lignes vides else if LigneTEXT[1]='#' then Prefix1 := -1000 // commentaires sur une ligne else begin // Commentaire = parenthèse de tête présente HasParenthesis := (LigneTEXT[1] = '('); // attraper le préfixe de section (en évitant une décomposition) str := Trim(Copy(LigneTEXT, 2, 5)); Prefix1 := StrToIntDef(str, -110); if (HasParenthesis) then // On zappe les commentaires (difficultés d'implémentation) begin //Continue; // classique décomposition ... PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 80,100]); // := SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 80,100]); llanfair_pg := PrmsLn.getString(COL_VAR_DATA); // Trim(PrmsLn[COL_VAR_DATA]); case Prefix1 of -5: begin // entrées UneEntree := GetEntrance(IdxCourant); // on concatène les lignes UneEntree.eObserv := UneEntree.eObserv + llanfair_pg; PutEntrance(IdxCourant, UneEntree); end; -4: pass; // sessions (obsolète) -3: pass; // section non affectée -2: begin // expés IdxCourant := GetNbExpes() - 1; UneExpe := GetExpe(IdxCourant); // on concatène les lignes UneExpe.Commentaire := UneExpe.Commentaire + llanfair_pg; PutExpe(IdxCourant, UneExpe); end; -1: begin // code IdxCourant := GetNbCodes() - 1; UnCode := GetCode(IdxCourant); // on concatène les lignes UnCode.Commentaire := UnCode.Commentaire + llanfair_pg; PutCode(IdxCourant, UnCode); end; else // séries // Zapper cette section begin //Continue; if (Prefix1 > 0) then begin Prefix2 := PrmsLn.getInteger(COL_NUM_ITEM); ///StrToInt( // PrmsLn[COL_NUM_ITEM]); if (Prefix2 = -1) then begin // tête de série IdxCourant := GetNbSeries - 1; UneSerie := GetSerie(IdxCourant); UneSerie.SetObsSerie(UneSerie.ObsSerie + llanfair_pg); end else begin // sinon, station //Continue; IdxCourant := GetNbSeries - 1; IdxCourantStation := UneSerie.NbVisees - 1; qVisee := UneSerie.GetVisee(IdxCourantStation); if (ExtraireViseeEnAntenne(llanfair_pg, UneSerie.NumeroReseau, UneSerie.NumeroDeSerie, IdxCourantStation, qVisee, myViseeAntenne)) then begin AddViseeAntenne(myViseeAntenne); llanfair_pg := ''; end; qVisee.Commentaires := qVisee.Commentaires + llanfair_pg; UneSerie.PutVisee(IdxCourantStation, qVisee); end; end; end; end; // on zappe tout le reste ... Continue; end; // if HasParenthesis case Prefix1 of -9999: begin // Arrêt forcé du traitement // utiliser cette balise avec de grandes précautions // et de préférence à la fin d'une série WriteWarning(''); WriteWarning(Format(rsRD_TAB_STOP_9999, [NoLigneTEXT])); WriteWarning(''); Break; end; -1000: AfficherMessage(GetResourceString(rsRD_TAB_LN_OBS),[NoLigneTEXT]); // commentaire -900: Continue; // balise de pause -110: Continue; // Ligne invalide; ignorée -100: Continue; // ignorer les lignes vides -7: Continue; //AfficherMessage(GetResourceString(rsRD_TAB_CLASSEURS)); // Section -7 : Classeurs -- Ignoré par GHTopo -6: begin // Section -6: Entrée PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 80, 100]); //:= SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 80, 100]); ProvListeEntrees.Add(PrmsLn.getString(COL_NOMENTREE)); Continue; end; -5: begin // Entrées PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 37, 49, 61, 67, 73, 80]); //nombre d'entrées nul = on définit l'entrée par défaut // TODO: Revoir cette zone if (0 = self.GetNbEntrances()) then begin SetDefaultCoords(PrmsLn.getFloat(COL_XENTREE), PrmsLn.getFloat(COL_YENTREE), PrmsLn.getFloat(COL_ZENTREE)); SetRefSeriePoint(PrmsLn.getInteger(COL_ENT_SER, 1), PrmsLn.getInteger(COL_ENT_ST, 0)); end; // Ajouter les entrées // le nombre d'entrées retenu est celui décompté dans // la section -5 with UneEntree do begin QN := GetNbEntrances(); eIDTerrain := ''; // non supporté par TOPOROBOT // On ajoute l'entrée récupérée en -6 try eNomEntree:=ProvListeEntrees.Strings[QN]; except AfficherMessage(rsWARNINGENTRYADDED,[QN]); eNomEntree:= Format(rsRD_TAB_ENTRANCE,[QN]); end; ePosition.setFrom(PrmsLn.getFloat(COL_XENTREE, 0.00), PrmsLn.getFloat(COL_YENTREE, 0.00), PrmsLn.getFloat(COL_ZENTREE, 0.00)); // couleurs non supportées = couleur par défault eCouleur := clGray; //------------ // entrées non géoréférencées ? if (ePosition.X < 100.00) or (ePosition.Y < 100.00) or (ePosition.Z < 100.00) then WriteWarning(Format(GetResourceString(rsRD_TAB_ENTR_NOGEOREF), [NoLigneTEXT,QN, eNomEntree])); eRefSer := PrmsLn.getInteger(COL_ENT_SER, 1); eRefSt := PrmsLn.getInteger(COL_ENT_ST , 0); if ((eRefSer < 1) or (eRefSt < 0)) then WriteWarning(Format(rsRD_TAB_ENTR_BADLINK, [NoLigneTEXT, QN, eNomEntree, eRefSer, eRefSt])); eObserv := ''; end; // with UneEntree // n'ajouter l'entrée que si elle comporte une RefSerie non nulle mioumiou := (UneEntree.eRefSer > 0); if (mioumiou) then self.AddEntrance(UneEntree); // index courant IdxCourant := GetNbEntrances() - 1; Continue; end; -4: Continue; // sessions; ignoré -3: Continue; // réservé; ignoré -2: begin // Expés //Ajoute l'expé dans la liste PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 36, 50, 64, 65, 73, 77, 81,100]); UneExpe.IDExpe := PrmsLn.getInteger(COL_NUM_ITEM, 0); if (UneExpe.IDExpe <= 0) then begin ErrMsg := rsRD_TAB_BAD_TRIP; raise Exception.Create(ErrMsg); end; UneExpe.fromToporobotJJMMAA(PrmsLn.getString(COL_DATE_EXPE)); UneExpe.Operateur := PrmsLn.getString(COL_SPELEOMETRE); // spéléomètre UneExpe.ClubSpeleo := PrmsLn.getString(COL_SPELEOGRAPH); // spéléographe UneExpe.ModeDecl := TModeCalculDeclimag(PrmsLn.getInteger(COL_MODEDECL, 1)); // déclinaison auto ? UneExpe.DeclinaisonInDegrees := PrmsLn.getFloat(COL_DECL_VALUE, 0.00); // déclinaison //Inclinaison := ConvertirEnNombreReel(PrmsLn[COL_INCL_VALUE], 0.00); // correction clino x10 UneExpe.IdxCouleur := PrmsLn.getInteger(COL_COULEUR, 0); // couleur UneExpe.Commentaire := ''; //PrmsLn[11]; // commentaire AfficherMessage('%s: %s', [{$I %FILE%}, {$I %LINE%}]); AddExpe(UneExpe); Continue; end; -1: begin // Codes // U_AZ // | U_P // | | PSI_L // | | | PSI_A // | | | | PSI_P // | | | | | FACT // | | | | | | ANG_LIM // | | | | | | | PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 33, 41, 49, 57, 65, 73, 81, 100]); with UnCode do begin IDCode := PrmsLn.getInteger(COL_NUM_ITEM, 0); // ID Code if (IDCode<=0) then begin ErrMsg:=rsRD_TAB_BAD_CODE; raise Exception.Create(ErrMsg); end; GradAz := PrmsLn.getFloat(COL_U_AZIMUT, DEGRES_PAR_TOUR); // unité boussole GradInc := PrmsLn.getFloat(COL_U_PENTE , DEGRES_PAR_TOUR); // unite CLINO PsiL := PrmsLn.getFloat(COL_PSI_L, 0.01); // precision longueur PsiAz := PrmsLn.getFloat(COL_PSI_AZ, 0.5); // precision azimut PsiP := PrmsLn.getFloat(COL_PSI_P, 0.5); // precision pente // TODO: Support de FactLong a valider FactLong := 1.00; // ConvertirEnNombreReel(PrmsLn[COL_FACT_LONG], 1.00)/100.00; // Facteur des longueurs AngLimite := PrmsLn.getFloat(COL_ANG_LIMITE, 0.00); // angle limite ErreurTourillonInM := 0.00; DiametreBoule1InM := 0.00; DiametreBoule2InM := 0.00; ParamsFuncCorrAz.Empty();// non supporté par LimeLight ParamsFuncCorrInc.Empty(); //CoefsPolynomeAdjustAz.ReDim(0,0,0); // := ''; Commentaire:= ''; //PrmsLn[9]; // commentaire end; // with UnCode AfficherMessage('%s: %s', [{$I %FILE%}, {$I %LINE%}]); AddCode(UnCode); Continue; end; 0: begin Continue; // pas de section 0 end else // on est dans les séries begin PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 80, 100]); // Si le préfixe 2 (2e colonne) =-1 =>nouvelle série Prefix1 := PrmsLn.getInteger(COL_NUM_SECTION, 0); if (Prefix1 > 0) then begin Prefix2 := PrmsLn.getInteger(COL_NUM_ITEM); // C'est le header de série ? // les headers de série comportent deux lignes ! if (Prefix2 = -2) then begin // première ligne NomDeLaSerie := PrmsLn.getString(COL_VAR_DATA); //AfficherMessage('Une serie a ajouter: Prefix1: %d - Prefix2 = %d - %s',[Prefix1, Prefix2, NomDeLaSerie])); // Lecture de la 2e ligne Inc(NoLigneTEXT); ReadLn(pTEXT, LigneTEXT); // décomposition //******************************************************************************* // SD // | PD // | | SA // | | | PA // | | | | NB // Serie | | | | | CH // | | | | | | OBS // | | | | | | | PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 33, 41, 49, 57, 65, 73, 81, 100]); //AfficherMessage('%d %d - %s', [Prefix1, Prefix2, UneSerie.GetNomSerie])); // si c'est la première série, on crée //AfficherMessage(LigneTEXT); //AfficherMessage(PrmsLn[1]); Prefix1 := PrmsLn.getInteger(1); if (Prefix1 = 1) then begin UneSerie := TObjSerie.Create; UneSerie.SetNumeroSerie(1); //AfficherMessage('Prefix = %d - Serie 1 creee',[Prefix1])); end else // sinon on ferme la série courante et on crée la suivante begin self.AddSerie(UneSerie); UneSerie := TObjSerie.Create; end; with UneSerie do begin SetNumeroSerie(TNumeroSerie(Prefix1)); SetNomSerie(NomDeLaSerie); SetSeriePtExtremites(PrmsLn.getInteger(COL_SER_DEP), PrmsLn.getInteger(COL_PT_DEP), PrmsLn.getInteger(COL_SER_ARR), PrmsLn.getInteger(COL_PT_ARR) ); SetChanceObstacle(PrmsLn.getInteger(COL_CHANCE), PrmsLn.getInteger(COL_OBSTACLE)); SetNumeroReseau(0); // non supporté par TOPOROBOT SetObsSerie(''); SetRaideur(1.00); // Raideur: Non supporté par TOPOROBOT end; //with UneSerie do end else begin // on lit les visées // ('-->'+LigneTab); //******************************************************************************* // Long // | Azimut // | | Pente // Parenthèse | | | LG // | Serie | | | | LD // | | Station | | | | | HZ // | | | Code | | | | | | HN // | | | | |Session| | | | | | | // | | | | | Expé | | | | | | | PrmsLn.SplitFixedColLine(LigneTEXT, [1, 2, 7, 13, 17, 21, 25, 33, 41, 49, 57, 65, 73, 81, 100]); with qVisee do begin TypeVisee := tgDEFAULT; Code := PrmsLn.getInteger(COL_CODE, 0); Expe := PrmsLn.getInteger(COL_EXPE, 0); Longueur := PrmsLn.getFloat(COL_LONG, 0.00); if (Longueur < 0.00) then begin WriteWarning(Format(rsRD_TAB_NEG_LONG, [NoLigneTEXT, Longueur])); Longueur:=Abs(Longueur); end; Azimut := PrmsLn.getFloat(COL_AZ , 0.00); Pente := PrmsLn.getFloat(COL_P , 0.00); LG := PrmsLn.getFloat(COL_LG , 0.00); //LG LD := PrmsLn.getFloat(COL_LD , 0.00); //LD HZ := PrmsLn.getFloat(COL_HZ , 0.00); HN := PrmsLn.getFloat(COL_HN , 0.00); Commentaires:= ''; IDSecteur := 0; IDTerrainStation := ''; // Non supporté par TOPOROBOT TypeVisee := tgDEFAULT; // Non supporté par TOPOROBOT end; // with qVisee do UneSerie.AddVisee(qVisee); end; // if Prefix2 end; // case end; end; // case Prefix1 of end; IdxCourantStation := UneSerie.NbVisees - 1; // imprimer la ligne traitée //AfficherMessage('Ligne traitée'); except AfficherMessageErreur('[%d] %s', [NoLigneTEXT, LigneTEXT]); end; end; //while Not Eof(pTEXT) do // On ferme la dernière série AddSerie(UneSerie); //******************************** Preconditionner(FichierText); //******************************** Result := GetNbSeries(); AfficherMessage('Fichier TEXT OK'); finally CloseFile(pTEXT); end; // niveau 1: pour le fichier Text finally FreeAndNil(ProvListeEntrees);//ProvListeEntrees.Free; end; //try..finally niveau 0 end; //****************************************************************************** // pour le moment, on exporte au format Text de Toporobot // Statut: OK, mais des détails à revoir. // Entrées multiples OK // Nota: Support du TLM330 non implémenté volontairement //*) procedure TToporobotStructure2012.ExporterVersToporobotTEXT(const QFileName: TStringDirectoryFilename; const LongueurMaxAntenne: double; const DoExportAntennaShots: boolean); var fp: TextFile; EWE: String; myEntree, MyEntrance0: TEntrance; i, Nb, j, NbV: Integer; myExpe: TExpe; myCode: TCode; mySerie: TObjSerie; myVisee: TUneVisee; // NbA: Integer; // myAntenne: TViseeAntenne; // k, q: Integer; // zdar: String; PPP: TPoint3Df; QYYYY, QMM, QDD: word; function makeColonnesEnTete(const IsCommentaire: boolean; const Section, ID1, ID2, ID3, ID4: integer): string; begin Result := IIF(IsCommentaire, '(', ' ') + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [Section]), 5, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [ID1]) , 6, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [ID2]) , 4, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [ID3]) , 4, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [ID4]) , 4, taRightJustify); end; procedure WriteTextLine(const L: string); var MyLine: String; begin MyLine := Copy(L, 1, 80); // Indispensable pour Toporobot: Troncature des lignes à 80 caractères WriteLn(fp, MyLine); end; begin EWE := format('ExporterVersToporobotTEXT(): %s', [QFileName]); AfficherMsgClass(self, EWE); AfficherMsgErrClass(self, EWE); if (HasGHTopoCodesInstrumentsExtended()) then AfficherMessageErreur(' Le document contient des instruments inconnus de Limelight'); AssignFile(fp, QFileName); try ReWrite(fp); // section -6 = entrée Nb := GetNbEntrances(); for i := 0 to Nb - 1 do begin myEntree := self.GetEntrance(i); if (myEntree.eFixed) then begin EWE := makeColonnesEnTete(false, -6, i + 1, 1, 1, 1) + ' ' + myEntree.eNomEntree; WriteTextLine(EWE); end; end; // N'accepte que les coordonnées en Suisse ... Imbitable Coordonnées (0, 0, 0) rejetées MyEntrance0 := self.GetEntrance(0); for i := 0 to Nb - 1 do begin myEntree := self.GetEntrance(i); // section -5 = Coordonnées //-5 1 1 1 1 629000.72 178000.68 1777.71 1 0 // Plus imbitable que le format TEXT de Limelight, tu meurs ... // N'accepte que les coordonnées en Suisse ... Imbitable Coordonnées (0, 0, 0) rejetées if (myEntree.eFixed) then begin PPP.setFrom((myEntree.ePosition.X - MyEntrance0.ePosition.X) + 600000.00, (myEntree.ePosition.Y - MyEntrance0.ePosition.Y) + 200000.00, (myEntree.ePosition.Z - MyEntrance0.ePosition.Z) + 0.00); EWE := makeColonnesEnTete(false, -5, i+1, 1, 1, 1) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [PPP.X]), 12, taRightJustify) + // Swisstopo MN03. Pour MN06, utiliser 2600000 FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [PPP.Y]), 12, taRightJustify) + // Swisstopo MN03. Pour MN06, utiliser 1200000 FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [PPP.Z]), 12, taRightJustify) + //FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myEntree.ePosition.X]), 12, taRightJustify) + //FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myEntree.ePosition.Y]), 12, taRightJustify) + //FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myEntree.ePosition.Z]), 12, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [myEntree.eRefSer]), 6, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [myEntree.eRefSt]), 6, taRightJustify); WriteTextLine(EWE); end; end; // section -4: Horodatage //-4 1 1 1 1 14/12/08 11:47:22 Guest for i := 1 to 2 do begin EWE := makeColonnesEnTete(false, -4, i, 1, 1, 1) + FormatterFixedColumn(FormatterDateHeureToporobot(Now), 18, taRightJustify) + ' ' + 'Guest'; WriteTextLine(EWE); end; // Section -3: Inutilisée EWE := makeColonnesEnTete(false, -3, 1, 1, 1, 1); WriteTextLine(EWE); // Section -2: Expés // -2 1 1 1 1 25/08/07 MCH AH 1 0.00 0 1 Nb := self.GetNbExpes; for i := 1 to Nb - 1 do begin myExpe := GetExpe(i); DecodeDate(myExpe.DateExpe, QYYYY, QMM, QDD); // Encore un truc imbitable de Limelight: Année entre 1950 et 2010 uniquement QYYYY := 2000; EWE := makeColonnesEnTete(false, -2, myExpe.IDExpe, 1, 1, 1) + FormatterFixedColumn(Format('%.2d/%.2d/%.2d', [QDD, QMM, 0]), 9, taRightJustify) + ' ' + //FormatterFixedColumn(myExpe.Operateur, 13, taLeftJustify) + ' ' + //FormatterFixedColumn(myExpe.ClubSpeleo, 13, taLeftJustify) + ' ' + // Limelight est intolérant +++ = On met un couple spéléomètre/spéléographe par défaut FormatterFixedColumn('Speleometre', 13, taLeftJustify) + ' ' + // //FormatterFixedColumn(myExpe.Operateur , 13, taLeftJustify) + ' ' + FormatterFixedColumn('ClubSpeleo' , 13, taLeftJustify) + ' ' + // //FormatterFixedColumn(myExpe.ClubSpeleo, 13, taLeftJustify) + ' ' + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [1]), 2, taLeftJustify) + // 1 = Manuelle FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 7, taRightJustify) + // déclinaison FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [0]), 4, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [1]), 4, taRightJustify); WriteTextLine(EWE); end; // Section -1: Codes //-1 1 1 1 1 360.00 360.00 0.05 1.00 1.00 100.00 100.00 Nb := self.GetNbCodes; for i := 1 to Nb - 1 do begin myCode := GetCode(i); EWE := makeColonnesEnTete(false, -1, myCode.IDCode, 1, 1, 1) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myCode.GradAz]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myCode.GradInc]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.05]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [1.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [1.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [100.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [100.00]), 8, taRightJustify); WriteTextLine(EWE); end; // Sections > 0 = séries Nb := self.GetNbSeries; for i := 1 to Nb - 1 do begin mySerie := GetSerie(i); //1 -2 1 1 1 GALERIE D'ENTREE D10H10 EWE := makeColonnesEnTete(false, mySerie.NumeroDeSerie, -2, 1, 1, 1) + ' ' + mySerie.NomSerie; WriteTextLine(EWE); //1 -1 1 1 1 1 0 1 6 6 3 0 EWE := makeColonnesEnTete(false, mySerie.NumeroDeSerie, -1, 1, 1, 1) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [mySerie.NoSerieDep]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [mySerie.NoPointDep]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [mySerie.NoSerieArr]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [mySerie.NoPointArr]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [mySerie.NbVisees - 1]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [mySerie.Chance]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_INTEGER, [mySerie.GetObstacle(True) MOD 10]), 8, taRightJustify); WriteTextLine(EWE); nbV := mySerie.NbVisees; EWE := makeColonnesEnTete(false, mySerie.NumeroDeSerie, 0, 1, 1, 1) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [0.00]), 8, taRightJustify); WriteTextLine(EWE); for j := 1 to nbV -1 do // et non 'for j = 0 to nbV - 1' begin myVisee := mySerie.GetVisee(j); // Plus imbitable que le format TEXT de Limelight, tu meurs ... // Un changement de code ou expé dans une série = échec //EWE := makeColonnesEnTete(false, mySerie.NumeroDeSerie, j, 1, myVisee.Code, myVisee.Expe) + EWE := makeColonnesEnTete(false, mySerie.NumeroDeSerie, j, 1, 1, 1) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myVisee.Longueur]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myVisee.Azimut]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myVisee.Pente]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myVisee.LG]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myVisee.LD]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myVisee.HZ]), 8, taRightJustify) + FormatterFixedColumn(Format(FORMAT_NB_REAL_2_DEC, [myVisee.HN]), 8, taRightJustify); WriteTextLine(EWE); // export des commentaires (sacrifié: Limelight est intolérant +++) (* q := 0; zdar := Trim(myVisee.Commentaires); if (zdar <> '') then begin zdar += Trim(Copy(StringOfChar(' ', 80), 1, 40)); EWE := makeColonnesEnTete(true, mySerie.NumeroDeSerie, j, 0, myVisee.Code, myVisee.Expe) + ' ' + zdar; // Tronquer le commentaire de manière à ne pas dépasser la longeur de 80 caractères du format TEXT WriteTextLine(EWE); q+=1; end; //*) // exporter ici les visées en antenne // 2024-07-20: Accepté par PocketTopo mais pas par Toporobot. // Les méthodes de travail de JPC ne réutilisent pas les splays // Par conséquent, cette partie est inertée { if (DoExportAntennaShots) then begin NbA := GetNbAntennes; if (NbA > 0) then begin for k := 0 to NbA - 1 do begin myAntenne := GetViseeAntenne(k); if ((myAntenne.SerieDepart = mySerie.NumeroDeSerie) and (myAntenne.PtDepart = j) and (myAntenne.Longueur < LongueurMaxAntenne)) then begin // PocketTopo stocke les antennes dans les commentaires du point d'accrochage EWE := makeColonnesEnTete(true, myAntenne.SerieDepart, myAntenne.PtDepart, q, 0, 0) + //myAntenne.Code, myAntenne.Expe) + Format(' [%s %s %s]', [ FormatterNombreWithDotDecimal(myAntenne.Longueur, 2), FormatterNombreWithDotDecimal(myAntenne.Azimut , 1), FormatterNombreWithDotDecimal(myAntenne.Pente , 1)]); WriteTextLine(EWE); q += 1; end; end; end; // if (NbA > 0) then end; // if (DoExportAntennaShots) then // } // % Inerté parce que inutilisé end; // for j := 1 to nbV -1 do //: Les visées end; // for i := 1 to Nb - 1 do // Les séries finally CloseFile(fp); end; end; // Pas de 'end.' ici