Commit a73a0e38 authored by Stuart Sides's avatar Stuart Sides
Browse files

Updated lronac2pds to include changes from ASU dealing with label padding and end of line sequence

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5640 41f8697f-d340-4b68-9986-7bafba869bb8
parent 524f1431
Loading
Loading
Loading
Loading
+19 −1
Changes for isis/src/lro/apps/lronac2pds/lronac2pds.cpp: 19 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -240,9 +240,27 @@ void OutputLabel ( std::ofstream &fout, Cube* cube ) {

    stream << labelPvl;
    pdsLabel += stream.str().c_str();
    /* Ensure that we have enough room for the actual label content, plus at
     * least two bytes for a carriage return and a linefeed, so the end of the
     * label looks pretty */
    while ((int)pdsLabel.length() + 2 > (int)(labelRecords * recordBytes)) {
        labelRecords++;
        // Refresh the label content
        labelPvl["FILE_RECORDS"] = toString((int) (cube->lineCount() * 4 + labelRecords));
        labelPvl["LABEL_RECORDS"] = toString(labelRecords);
        labelPvl["^IMAGE"] = toString((int) (labelRecords + 1));
        stream.str(std::string());
        stream << labelPvl;
        pdsLabel = stream.str().c_str();
    }

    /* Now, add a carriage return and linefeed, and then pad the label with
     * spaces if necessary */
    pdsLabel += "\r\n";


    while ((int)pdsLabel.length() < (int) (labelRecords * recordBytes)) {
        pdsLabel += '\n';
        pdsLabel += " ";
    }

    fout << pdsLabel;