Commit 7140381a authored by thomas.forbriger's avatar thomas.forbriger

stuploxx [WP]: allow to adjust character height

this is just a quick hack unfortunately; the code and in particular
diagram settings require a major revision
parent d58dc4e4
......@@ -29,11 +29,12 @@
*
* REVISIONS and CHANGES
* - 13/02/2008 V1.0 Thomas Forbriger
* - 15/05/2019 V1.1 support adjustment of character height
*
* ============================================================================
*/
#define STUPLO_CONSTANTSOPTIONS_CC_VERSION \
"STUPLO_CONSTANTSOPTIONS_CC V1.0 "
"STUPLO_CONSTANTSOPTIONS_CC V1.1"
#include "constants.h"
......@@ -99,6 +100,8 @@ namespace stuplo {
{"datesep",arg_no,"."},
// 27: distance of ordinate unit label from graph box edge
{"lyd",arg_yes,"2.2"},
// 28: standard character height
{"ch",arg_yes,"1."},
{NULL}
};
......
......@@ -28,11 +28,12 @@
*
* REVISIONS and CHANGES
* - 08/08/2008 V1.0 Thomas Forbriger
* - 15/05/2019 V1.1 support adjustment of character height
*
* ============================================================================
*/
#define STUPLO_GLOBALSETTINGS_CC_VERSION \
"STUPLO_GLOBALSETTINGS_CC V1.0 "
"STUPLO_GLOBALSETTINGS_CC V1.1"
#include "globalsettings.h"
......@@ -64,7 +65,8 @@ namespace stuplo {
Mlabr(false),
Mlabh(0.05),
Mtitle(""),
Mdatesep(".")
Mdatesep("."),
Mch(1.)
{ } // GlobalSettings::Globalsettings()
/*----------------------------------------------------------------------*/
......@@ -88,6 +90,9 @@ namespace stuplo {
//! set command line option 6: line width for time scale
void GlobalSettings::set_lwts(const int& n)
{ Mlwts=n; }
//! set command line option 28: character height for time scale
void GlobalSettings::set_ch(const double &v)
{ Mch=v; }
//! set command line option 7: character height for time scale
void GlobalSettings::set_chts(const double &v)
{ Mchts=v; }
......
......@@ -29,6 +29,7 @@
* REVISIONS and CHANGES
* - 08/08/2008 V1.0 Thomas Forbriger
* - 17/03/2015 V1.1 adjust libpgplotxx interface
* - 15/05/2019 V1.2 support adjustment of character height
*
* ============================================================================
*/
......@@ -37,7 +38,7 @@
#ifndef STUPLO_GLOBALSETTINGS_H_VERSION
#define STUPLO_GLOBALSETTINGS_H_VERSION \
"STUPLO_GLOBALSETTINGS_H V1.1 (17-03-2015)"
"STUPLO_GLOBALSETTINGS_H V1.2 (2019-05-15)"
#include <string>
#include <pgplotxx/xpgplotxx.h>
......@@ -108,11 +109,14 @@ namespace stuplo {
void set_datesep(const std::string& s);
//! set command line option 27: distance between box and ordinate label
void set_lyd(const double& d);
//! set command line option 28: standard character height
void set_ch(const double& v);
/*----------------------------------------------------------------------*/
// read functions
// --------------
double lyd() const { return Mlyd; }
double chy() const { return Mchy; }
double ch() const { return Mch; }
private:
/*! mode flags
* ==========
......@@ -143,6 +147,8 @@ namespace stuplo {
/*! grid and frame style
* ====================
*/
//! standard character height
double Mch;
//! line width for time scale
int Mlwts;
//! character height for time scale
......
......@@ -60,6 +60,8 @@
## -lwyg l set line width for ordinate grid lines
## no ordinate grid lines are plotted if option is not set
## -lwys l set line width ordinate scale
-ch h set character height for elements for which no specific height
can be set
#
# title control options
-title n set title for plot to 'n'
......
......@@ -30,11 +30,12 @@
* - 30/01/2007 V1.0 Thomas Forbriger
* - 23/10/2009 V1.1 introduced prepend annotations
* - 05/03/2015 V1.2 take description texts from text files
* - 15/05/2019 V1.3 support adjustment of character height
*
* ============================================================================
*/
#define STUPLOXX_VERSION \
"STUPLOXX V1.2 Plot time series data"
"STUPLOXX V1.3 Plot time series data"
#include <unistd.h>
#include <stdlib.h>
......@@ -196,6 +197,7 @@ int main(int iargc, char* argv[])
globalsettings.set_labr(cmdline.optset(25));
globalsettings.set_datesep(cmdline.string_arg(26));
globalsettings.set_lyd(cmdline.double_arg(27));
globalsettings.set_ch(cmdline.double_arg(28));
/*----------------------------------------------------------------------*
* step 3: extract command line parameters
......
......@@ -50,6 +50,7 @@ usage: stuploxx [-v] [-D] [-device dev]
# [-lwys l]
# options to control plot title
[-title t] [-tstitle v]
[-ch h]
# options to control panel labels
[-labu] [-labc] [-labe] [-labh v] [-labr]
# further options
......
......@@ -32,11 +32,12 @@
* - 10/04/2008 V1.1 when chart stepping: replot old sample at new offset
* - 18/01/2011 V1.2 pgplot::Trange::total() was renamed
* - 17/03/2015 V1.3 adjust libpgplotxx interface
* - 15/05/2019 V1.4 support adjustment of character height
*
* ============================================================================
*/
#define STUPLO_WINDOWPANEL_CC_VERSION \
"STUPLO_WINDOWPANEL_CC V1.1 (17-03-2015)"
"STUPLO_WINDOWPANEL_CC V1.4 (2019-05-15)"
#include <tfxx/error.h>
#include <tfxx/misc.h>
......@@ -165,8 +166,10 @@ namespace stuplo {
boxstyle.setmode(Fxlabels, Fxselect);
boxstyle.setmode(Fxticks, Fselect|Fticksinvert|Fticksminor|Fticksmajor);
boxstyle.setmode(Fxtime, Fselect|Ftimesuper|Ftimemod24|Ftimeomitzeros);
dev.sch(globalsettings.ch());
boxstyle(dev);
}
dev.sch(globalsettings.ch());
dev.mtxt("B", 2.8, 0.5, 0.5, Mlabel.c_str());
dev.unsa();
} // void TimeAxisWindowPanel::plot() const
......@@ -215,6 +218,7 @@ namespace stuplo {
boxstyle.setmode(Fylabels, Fselect, false);
boxstyle.setmode(Fyticks, Fselect, false);
}
dev.sch(globalsettings.ch());
boxstyle(dev);
// print ordinate scale
dev.save();
......@@ -359,6 +363,7 @@ namespace stuplo {
dev.unsa();
if (ylabel != std::string(Cstringnotspecified))
{
dev.sch(globalsettings.ch());
dev.mtxt("L", globalsettings.lyd(), 0.5, 0.5, ylabel.c_str());
}
} // if (Mpanel.ntraces()>0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment