Index: trunk/BNC/scripts/pppPlot.pl
===================================================================
--- trunk/BNC/scripts/pppPlot.pl	(revision 10388)
+++ trunk/BNC/scripts/pppPlot.pl	(revision 10585)
@@ -107,9 +107,5 @@
     my ( $station, $file ) = Bnc::parsePPPLogfile( $file, $sampling );
     my $EPOCH       = $file->{'EPOCH'};
-    my $EPOCH_OFF_GPS = $file->{'EPOCH_OFF_GPS'};
-    my $EPOCH_OFF_GLO = $file->{'EPOCH_OFF_GLO'};
-    my $EPOCH_OFF_GAL = $file->{'EPOCH_OFF_GAL'};
-    my $EPOCH_OFF_BDS = $file->{'EPOCH_OFF_BDS'};
-    my $EPOCH_CLK     = $file->{'EPOCH_CLK'};
+    my %RECCLK        = %{ $file->{'RECCLK'} };
     my %AMB            = %{ $file->{'AMB'} };
     my %RES            = %{ $file->{'RES'} };
@@ -154,5 +150,5 @@
     my $chartNEU = newChart($station);
     $chartNEU->set( output => $pngName );
-    $chartNEU->set( ylabel => "Displacements [m]", yrange => [ " -0.5 ", " 0.5 " ] );
+    $chartNEU->set( ylabel => "Displacements [m]", yrange => [ " -0.9 ", " 0.9 " ] );
 
     #y2label => "Number of Satellites [-]", y2range => [" 0 ", " 20 "], y2tics => 'on',
@@ -213,25 +209,39 @@
         $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
 
-        ######### CLK #####################
-        if ( scalar @{ $file->{'CLK'} } < 1 ) {
-            DEBUG "No CLK found";
-        }
-        else {
-            DEBUG "Plot CLK";
-            $pngName = sprintf ( "%s_CLK.png", $station );
-            my $chartCLK = newChart($station);
-            $chartCLK->set( output => $pngName );
-            $chartCLK->set( ylabel => "CLK [m]" );
-
-            $dataset = Chart::Gnuplot::DataSet->new(
-                                                     xdata   => $EPOCH,
-                                                     ydata   => $file->{'CLK'},
-                                                     title   => "Receiver clock",
-                                                     timefmt => '%s',
-                                                     style   => "linespoints",
-            );
-            $chartCLK->plot2d($dataset);
+        ######### RECCLK #####################
+        DEBUG "Plot Receiver Clocks";
+        $page = $pdf->page();
+        $page->mediabox('A4');
+        $y             = $y0 + $dy;
+        $headline      = sprintf ( "Receiver Clocks for station %s", $station );
+        $headline_text = $page->text;
+        $headline_text->font( $font1, 11 / pt );
+        $headline_text->translate( 15 / mm, 280 / mm );
+        $headline_text->text($headline);
+
+        my $chartRECCLK = newChart($station);
+        $chartRECCLK->set( legend => { position => "outside right" } );
+        my @datasets = ();                                                # init datasets
+        my $pngName  = sprintf ( "%s_RECCLK.png", $station);
+            $chartRECCLK->set( output => $pngName );
+            $chartRECCLK->set( ylabel => "Receiver Clocks [m]" );
+            # SYSTEM
+            foreach my $key_sys ( sort keys %RECCLK ) {
+
+                $dataset = Chart::Gnuplot::DataSet->new(
+                    xdata   => \@{ $RECCLK{$key_sys}{EPOCH} },         # array of epochs
+                    ydata   => \@{ $RECCLK{$key_sys}{DATA} },          # array of elevations of one satellite
+                    title   => "$key_sys",
+                    timefmt => '%s',
+
+                    #style   => "points",
+                    style => "points",
+                );
+                push ( @datasets, $dataset );
+            }
+            $chartRECCLK->plot2d(@datasets);
+
+            # system ("display $pngName&");
             $y = $y - $dy;
-
             if ( $y < 30 / mm ) {
                 $page = $pdf->page();
@@ -240,140 +250,6 @@
             }
             $png = $page->gfx();
-            LOGDIE("could not find image file: $!\n") unless -e $pngName;
+            die ("could not find image file: $!") unless -e $pngName;
             $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
-        }
-
-        ######### OFF_GPS #####################
-        if ( grep ( $_ eq "ALL", @plotTypes ) ) {
-            if ( scalar @{ $file->{'OFF_GPS'} } < 1 ) {
-                DEBUG "No OFF_GPS found";
-            }
-            else {
-                DEBUG "Plot OFF_GPS";
-                my $pngName  = sprintf ( "%s_OFF_G.png", $station );
-                my $chartOFF_GPS = newChart($station);
-                $chartOFF_GPS->set( output => $pngName );
-                $chartOFF_GPS->set( ylabel => "Offset GPS [m]" );
-
-                $dataset = Chart::Gnuplot::DataSet->new(
-                                                         xdata   => $EPOCH_OFF_GPS,
-                                                         ydata   => $file->{'OFF_GPS'},
-                                                         title   => "Receiver Offset GPS",
-                                                         timefmt => '%s',
-                                                         style   => "linespoints",
-                );
-                $chartOFF_GPS->plot2d($dataset);    #system ("display $pngName&");
-                $y = $y - $dy;
-
-                if ( $y < 30 / mm ) {
-                    $page = $pdf->page();
-                    $page->mediabox('A4');
-                    $y = $y0;
-                }
-                $png = $page->gfx();
-                LOGDIE("could not find image file: $!\n") unless -e $pngName;
-                $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
-            }
-        }
-
-
-        ######### OFF_GLO #####################
-        if ( grep ( $_ eq "ALL", @plotTypes ) ) {
-            if ( scalar @{ $file->{'OFF_GLO'} } < 1 ) {
-                DEBUG "No OFF_GLO found";
-            }
-            else {
-                DEBUG "Plot OFF_GLO";
-                my $pngName  = sprintf ( "%s_OFF_R.png", $station );
-                my $chartOFF_GLO = newChart($station);
-                $chartOFF_GLO->set( output => $pngName );
-                $chartOFF_GLO->set( ylabel => "Offset GLONASS [m]" );
-
-                $dataset = Chart::Gnuplot::DataSet->new(
-                                                         xdata   => $EPOCH_OFF_GLO,
-                                                         ydata   => $file->{'OFF_GLO'},
-                                                         title   => "Receiver Offset GLONASS",
-                                                         timefmt => '%s',
-                                                         style   => "linespoints",
-                );
-                $chartOFF_GLO->plot2d($dataset);    #system ("display $pngName&");
-                $y = $y - $dy;
-
-                if ( $y < 30 / mm ) {
-                    $page = $pdf->page();
-                    $page->mediabox('A4');
-                    $y = $y0;
-                }
-                $png = $page->gfx();
-                LOGDIE("could not find image file: $!\n") unless -e $pngName;
-                $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
-            }
-        }
-
-        ######### OFF_GAL #####################
-        if ( grep ( $_ eq "ALL", @plotTypes ) ) {
-            if ( scalar @{ $file->{'OFF_GAL'} } < 1 ) {
-                DEBUG "No OFF_GAL found";
-            }
-            else {
-                DEBUG "Plot OFF_GAL";
-                my $pngName  = sprintf ( "%s_OFF_E.png", $station );
-                my $chartOFF_GAL = newChart($station);
-                $chartOFF_GAL->set( output => $pngName );
-                $chartOFF_GAL->set( ylabel => "Offset Galileo [m]" );
-
-                $dataset = Chart::Gnuplot::DataSet->new(
-                                                         xdata   => $EPOCH_OFF_GAL,
-                                                         ydata   => $file->{'OFF_GAL'},
-                                                         title   => "Receiver Offset Galileo",
-                                                         timefmt => '%s',
-                                                         style   => "linespoints",
-                );
-                $chartOFF_GAL->plot2d($dataset);    #system ("display $pngName&");
-                $y = $y - $dy;
-
-                if ( $y < 30 / mm ) {
-                    $page = $pdf->page();
-                    $page->mediabox('A4');
-                    $y = $y0;
-                }
-                $png = $page->gfx();
-                LOGDIE("could not find image file: $!\n") unless -e $pngName;
-                $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
-            }
-        }
-
-        ######### OFF_BDS #####################
-        if ( grep ( $_ eq "ALL", @plotTypes ) ) {
-            if ( scalar @{ $file->{'OFF_BDS'} } < 1 ) {
-                DEBUG "No OFF_BDS found";
-            }
-            else {
-                DEBUG "Plot OFF_BDS";
-                my $pngName  = sprintf ( "%s_OFF_C.png", $station );
-                my $chartOFF_BDS = newChart($station);
-                $chartOFF_BDS->set( output => $pngName );
-                $chartOFF_BDS->set( ylabel => "Offset Beidou [m]" );
-
-                $dataset = Chart::Gnuplot::DataSet->new(
-                                                         xdata   => $EPOCH_OFF_BDS,
-                                                         ydata   => $file->{'OFF_BDS'},
-                                                         title   => "Receiver Offset Beidou",
-                                                         timefmt => '%s',
-                                                         style   => "linespoints",
-                );
-                $chartOFF_BDS->plot2d($dataset);    #system ("display $pngName&");
-                $y = $y - $dy;
-
-                if ( $y < 30 / mm ) {
-                    $page = $pdf->page();
-                    $page->mediabox('A4');
-                    $y = $y0;
-                }
-                $png = $page->gfx();
-                LOGDIE("could not find image file: $!\n") unless -e $pngName;
-                $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
-            }
-        }
 
         ######### ELE #####################
@@ -698,5 +574,5 @@
     $pdf->end();
 
-    system ("rm *.png");
+#    system ("rm *.png");
     if (Common::amInteractiv ) {
    system ("evince $inputDir/$pdf_name");
