<commit_before>/**
 * \file XTPlot.cpp
 * \brief Implements class for drawing the XT plots
 */

#include "XTPlot.h"
#include "ChaosSettings.h"

XTPlot::XTPlot(wxWindow* parent, wxWindowID id, const wxPoint& pos,
                       const wxSize& size, long style, const wxString& name) 
                       : ChaosPlot(parent, id, pos, size, style, name) {
    /**
    *   Constructor for the XT plot. Defaults to only showing X.
    */
    side_gutter_size = 15;
    bottom_gutter_size = 1;
    x1Visible = true;
    x2Visible = false;
    x3Visible = false;
    graph_title = wxT("Waveform as a function of time");
    graph_subtitle = wxT("X (V) vs. T");
}

XTPlot::~XTPlot() {
    /**
    *   Deconstructor for the Rotating3dPlot class
    */
}

void XTPlot::drawPlot() {
    /**
    *   Main drawing function for the XTPlot class.
    *
    *   Calculates the units for the axis and then draws them
    *   Draws an XT graph using X, X', and X'' depending on which ones
    *   the user has selected.
    *
    */
    const int xt_points = 300;
    
    static int times_called = 0;
    
    int x1,x2,x1_old,x2_old, x3, x3_old;
    int start;
    
    startDraw();
    if(ChaosSettings::YAxisLabels == ChaosSettings::Y_AXIS_VGND) {
        graph_subtitle = wxT("X (V) vs. T");
        drawYAxis(0.0,3.3,1);
    } else if(ChaosSettings::YAxisLabels == ChaosSettings::Y_AXIS_VBIAS) {
        graph_subtitle = wxT("X (V) vs. T");
        drawYAxis(-1.2,2.1,.5);
    } else {
        graph_subtitle = wxT("X (ADC) vs. T");
        drawYAxis(0,1024,341);
    }

    if(device_connected == false) {
        endDraw();
        return;
    }
    
    int plot_width = width-side_gutter_size-2;
    int plot_points;
    float x_scale;
    float y_scale = float(graph_height)/1024.0;
    
    if(plot_width > xt_points) {
        plot_points = xt_points;
        x_scale = float(plot_width)/xt_points;
    } else {
        plot_points = plot_width;
        x_scale = 1.0;
    }<commit_msg>- modified XT plot to never truncate the graph<commit_after>/**
 * \file XTPlot.cpp
 * \brief Implements class for drawing the XT plots
 */

#include "XTPlot.h"
#include "ChaosSettings.h"

XTPlot::XTPlot(wxWindow* parent, wxWindowID id, const wxPoint& pos,
                       const wxSize& size, long style, const wxString& name) 
                       : ChaosPlot(parent, id, pos, size, style, name) {
    /**
    *   Constructor for the XT plot. Defaults to only showing X.
    */
    side_gutter_size = 20;
    bottom_gutter_size = 20;
    x1Visible = true;
    x2Visible = false;
    x3Visible = false;
    graph_title = wxT("Waveform as a function of time");
    graph_subtitle = wxT("X (V) vs. T");
}

XTPlot::~XTPlot() {
    /**
    *   Deconstructor for the Rotating3dPlot class
    */
}

void XTPlot::drawPlot() {
    /**
    *   Main drawing function for the XTPlot class.
    *
    *   Calculates the units for the axis and then draws them
    *   Draws an XT graph using X, X', and X'' depending on which ones
    *   the user has selected.
    *
    */
    const int xt_points = 300;
    
    static int times_called = 0;
    
    int x1,x2,x1_old,x2_old, x3, x3_old;
    int start;
    
    startDraw();
    if(ChaosSettings::YAxisLabels == ChaosSettings::Y_AXIS_VGND) {
        graph_subtitle = wxT("X (V) vs. T");
        drawYAxis(0.0,3.3,1);
    } else if(ChaosSettings::YAxisLabels == ChaosSettings::Y_AXIS_VBIAS) {
        graph_subtitle = wxT("X (V) vs. T");
        drawYAxis(-1.2,2.1,.5);
    } else {
        graph_subtitle = wxT("X (ADC) vs. T");
        drawYAxis(0,1024,341);
    }
    drawXAxis(0,5,1);

    if(device_connected == false) {
        endDraw();
        return;
    }
    
    int plot_width = width-side_gutter_size-2;
    int plot_points;
    float x_scale;
    float y_scale = float(graph_height)/1024.0;
    
    plot_points = xt_points;
    x_scale = float(plot_width)/xt_points;
{'fraction_non_alphanumeric': 0.11986738077021168, 'fraction_numerical': 0.022443254271869422, 'mean_word_length': 2.3293718166383703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2171207', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1384, 'n_words': 350}