Ejemplo n.º 1
0
bool gpLayer::SelectYAxisScale(gpAXIS_SCALE type)
{
	//if(!IsYScaleSupported(type)) return false;
	if(!IsYPopupEnabled(gpChart_kind, type)) return false;
	gpYaxis_type = type;
	m_sameFormatAsPreviously = false;
	Refresh();
	RefreshLabels();
	return true;
}
Ejemplo n.º 2
0
bool gpLayer::SetChartKind(gpCHART_KIND kind)
{
	//if(!IsSupported(kind))  return false;
	if(!IsChartTypeEnabled(kind))  return false;
	gpChart_kind = kind;

	gpYaxis_type = gpAXIS_DEFAULT;
	gpXaxis_type = gpAXIS_DEFAULT;

	m_sameFormatAsPreviously = false;
	RefreshChart();
	RefreshLabels();

	//last refresh tooltip for current view
	/// @note maybe there is case, when tooltip
	///       don't want refresh to this kind of chart view...
	///       example with fft, wan't show tips before fft..
	RefreshToolTip();
	return true;
}
Ejemplo n.º 3
0
/*!
 *  \brief Constructor
 */
gpLineLayer::gpLineLayer(wxString label, wxString x_label, wxString y_label)
                        : gpLayer(label)
{
    //wxLogMessage(_("gpLineLayer::gpLineLayer()"));

    m_XLabel = x_label;
    m_YLabel = y_label;

    wxFont graphFont(11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
                     wxFONTWEIGHT_NORMAL);

    xaxis = new mpScaleX(x_label, mpALIGN_BOTTOM, true, mpX_NORMAL);
    xaxis->SetFont(graphFont);
    xaxis->SetVisible(true);
    xaxis->SetDrawOutsideMargins(false);

    yaxis = new mpScaleY(y_label, mpALIGN_LEFT, true);
    yaxis->SetFont(graphFont);
    yaxis->SetDrawOutsideMargins(false);
    yaxis->SetVisible(true);


    /*note = new mpNoteLegend(wxRect(200,20,40,40), &hatch2);
    note->SetVisible(true);
    note->SetName(_("Average: -\nDeviation: -\nMin/Max: -\n"));*/

    wxToolTip::Enable(false);
    this->SetDelay(5000);
    this->SetTip( label +_("\n                                                                                                                                            ") );


    //default labels for axis
    LabelList[gpCHART_DEFAULT] = label;
    xLabelList[gpCHART_DEFAULT] = x_label;
    yLabelList[gpCHART_DEFAULT] = y_label;

    LabelList[gpCHART_INL] = label;
    xLabelList[gpCHART_INL] = x_label;
    yLabelList[gpCHART_INL] = _("INL");

    LabelList[gpCHART_DNL] = label;
    xLabelList[gpCHART_DNL] = x_label;
    yLabelList[gpCHART_DNL] = _("DNL");

    LabelList[gpCHART_FFT] = label;
    xLabelList[gpCHART_FFT] = _("Frequency");
    yLabelList[gpCHART_FFT] = _("Y");

    LabelList[gpCHART_ACCUMULATION] = label;
    xLabelList[gpCHART_ACCUMULATION] = _("Y");
    yLabelList[gpCHART_ACCUMULATION] = _("Accumulation");

    LabelList[gpCHART_CUSTOM] = label;
    xLabelList[gpCHART_CUSTOM] = _("X");
    yLabelList[gpCHART_CUSTOM] = _("custom");


    popupGroupList[gpWINDOW].Enable(gpCHART_DEFAULT);
    popupGroupList[gpWINDOW].Enable(gpCHART_DNL);
    popupGroupList[gpWINDOW].Enable(gpCHART_INL);
    popupGroupList[gpWINDOW].Enable(gpCHART_FFT);
    popupGroupList[gpWINDOW].Enable(gpCHART_ACCUMULATION);
    popupGroupList[gpWINDOW].Enable(gpCHART_CUSTOM);

    //          chart type       axis type          X       Y
    EnablePopup(gpCHART_DEFAULT, gpAXIS_DEFAULT,    true,  true);
    EnablePopup(gpCHART_DEFAULT, gpAXIS_DISTANCE,   false, false);
    EnablePopup(gpCHART_DEFAULT, gpAXIS_N,          false, false);
    EnablePopup(gpCHART_DEFAULT, gpAXIS_PROCENT,    false, true);
    EnablePopup(gpCHART_DEFAULT, gpAXIS_TIME,       true,  false);
    EnablePopup(gpCHART_DEFAULT, gpAXIS_CUSTOM,     true,   true);

    //          chart type       axis type          X       Y
    EnablePopup(gpCHART_DNL, gpAXIS_DEFAULT,        true,  true);
    EnablePopup(gpCHART_DNL, gpAXIS_DISTANCE,       false, false);
    EnablePopup(gpCHART_DNL, gpAXIS_N,              true,  false);
    EnablePopup(gpCHART_DNL, gpAXIS_PROCENT,        false, true);
    EnablePopup(gpCHART_DNL, gpAXIS_TIME,           true,  false);
    EnablePopup(gpCHART_DNL, gpAXIS_CUSTOM,         false, false);

    //          chart type       axis type          X       Y
    EnablePopup(gpCHART_INL, gpAXIS_DEFAULT,        true,  true);
    EnablePopup(gpCHART_INL, gpAXIS_DISTANCE,       false, false);
    EnablePopup(gpCHART_INL, gpAXIS_N,              true,  false);
    EnablePopup(gpCHART_INL, gpAXIS_PROCENT,        false, true);
    EnablePopup(gpCHART_INL, gpAXIS_TIME,           true,  false);
    EnablePopup(gpCHART_INL, gpAXIS_CUSTOM,         false, false);

    //          chart type              axis type           X       Y
    EnablePopup(gpCHART_ACCUMULATION, gpAXIS_DEFAULT,       true,   true);
    EnablePopup(gpCHART_ACCUMULATION, gpAXIS_DISTANCE,      false,  false);
    EnablePopup(gpCHART_ACCUMULATION, gpAXIS_N,             false,  false);
    EnablePopup(gpCHART_ACCUMULATION, gpAXIS_PROCENT,       true,   true);
    EnablePopup(gpCHART_ACCUMULATION, gpAXIS_TIME,          false,  false);
    EnablePopup(gpCHART_ACCUMULATION, gpAXIS_CUSTOM,        false,  false);




    this->AddLayer( xaxis );
    this->AddLayer( yaxis );

    //this->AddLayer( note );


    samplerate = 1;
    fftlenght = 64;

    RefreshLabels();
}