Fixed spacing and updated the moved the variableIsNotX check up into the parent if statement

This commit is contained in:
Stephanie Anderl 2020-08-20 14:36:48 -07:00
commit e3a637893f
3 changed files with 7 additions and 8 deletions

View file

@ -4071,7 +4071,7 @@
<value>Analysis is not supported for this function.</value> <value>Analysis is not supported for this function.</value>
<comment>Error displayed when graph analysis is not supported or had an error.</comment> <comment>Error displayed when graph analysis is not supported or had an error.</comment>
</data> </data>
<data name="KGFVariableIsNotX" xml:space="preserve"> <data name="KGFVariableIsNotX" xml:space="preserve">
<value>Analysis is only supported for functions in the f(x) format. Example: y=x</value> <value>Analysis is only supported for functions in the f(x) format. Example: y=x</value>
<comment>Error displayed when graph analysis detects the function format is not f(x).</comment> <comment>Error displayed when graph analysis detects the function format is not f(x).</comment>
</data> </data>

View file

@ -255,12 +255,11 @@ namespace GraphControl
equationVector.push_back(equation); equationVector.push_back(equation);
UpdateGraphOptions(graph->GetOptions(), equationVector); UpdateGraphOptions(graph->GetOptions(), equationVector);
bool variableIsNotX; bool variableIsNotX;
if (analyzer->CanFunctionAnalysisBePerformed(variableIsNotX)) if (analyzer->CanFunctionAnalysisBePerformed(variableIsNotX) && !variableIsNotX)
{ {
if (S_OK if (S_OK
== analyzer->PerformFunctionAnalysis( == analyzer->PerformFunctionAnalysis(
(Graphing::Analyzer::NativeAnalysisType)Graphing::Analyzer::PerformAnalysisType::PerformAnalysisType_All) (Graphing::Analyzer::NativeAnalysisType)Graphing::Analyzer::PerformAnalysisType::PerformAnalysisType_All))
&& !variableIsNotX)
{ {
Graphing::IGraphFunctionAnalysisData functionAnalysisData = m_solver->Analyze(analyzer.get()); Graphing::IGraphFunctionAnalysisData functionAnalysisData = m_solver->Analyze(analyzer.get());
return KeyGraphFeaturesInfo::Create(functionAnalysisData); return KeyGraphFeaturesInfo::Create(functionAnalysisData);

View file

@ -15,10 +15,10 @@ namespace Graphing::Analyzer
struct IGraphAnalyzer : public NonCopyable, public NonMoveable struct IGraphAnalyzer : public NonCopyable, public NonMoveable
{ {
virtual ~IGraphAnalyzer() = default; virtual ~IGraphAnalyzer() = default;
virtual bool CanFunctionAnalysisBePerformed(bool& variableIsNotX) = 0; virtual bool CanFunctionAnalysisBePerformed(bool& variableIsNotX) = 0;
virtual HRESULT PerformFunctionAnalysis(NativeAnalysisType analysisType) = 0; virtual HRESULT PerformFunctionAnalysis(NativeAnalysisType analysisType) = 0;
virtual HRESULT GetAnalysisTypeCaption(const AnalysisType type, std::wstring& captionOut) const = 0; virtual HRESULT GetAnalysisTypeCaption(const AnalysisType type, std::wstring& captionOut) const = 0;
virtual HRESULT GetMessage(const GraphAnalyzerMessage msg, std::wstring& msgOut) const = 0; virtual HRESULT GetMessage(const GraphAnalyzerMessage msg, std::wstring& msgOut) const = 0;
}; };
} }