Options to disable annotations
This commit is contained in:
6
gopow.go
6
gopow.go
@@ -56,7 +56,7 @@ func main() {
|
|||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "input,i",
|
Name: "input,i",
|
||||||
Value: "",
|
Value: "",
|
||||||
Usage: "CSV input file generated by rtl_power",
|
Usage: "CSV input file generated by rtl_power [required]",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "output,o",
|
Name: "output,o",
|
||||||
@@ -72,6 +72,10 @@ func main() {
|
|||||||
Name: "verbose",
|
Name: "verbose",
|
||||||
Usage: "Enable more verbose output",
|
Usage: "Enable more verbose output",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "no-annotations",
|
||||||
|
Usage: "Disabled annotations such as time and frequency scales",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
app.Run(os.Args)
|
app.Run(os.Args)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ type RunConfig struct {
|
|||||||
InputFile string
|
InputFile string
|
||||||
OutputFile string
|
OutputFile string
|
||||||
Format string
|
Format string
|
||||||
|
Annotations bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type GoPow struct {
|
type GoPow struct {
|
||||||
@@ -30,6 +31,7 @@ func NewGoPow(c *cli.Context) (*GoPow, error) {
|
|||||||
InputFile: c.String("input"),
|
InputFile: c.String("input"),
|
||||||
OutputFile: c.String("output"),
|
OutputFile: c.String("output"),
|
||||||
Format: c.String("format"),
|
Format: c.String("format"),
|
||||||
|
Annotations: !c.Bool("no-annotations"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.InputFile == "" {
|
if config.InputFile == "" {
|
||||||
@@ -79,15 +81,19 @@ func (g *GoPow) Render() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if g.config.Annotations {
|
||||||
|
|
||||||
annotator, err := NewAnnotator(g.image, table)
|
annotator, err := NewAnnotator(g.image, table)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// add some frequency and date annotation
|
// add some frequency and time annotation
|
||||||
annotator.DrawXScale()
|
annotator.DrawXScale()
|
||||||
annotator.DrawYScale()
|
annotator.DrawYScale()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user