summaryrefslogtreecommitdiffstats
path: root/Project/LimiterForm.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-03-30 11:10:06 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-03-30 11:10:06 -0300
commit045037ce8f2b106acbe5425245746a2dbed65c26 (patch)
treef81b4003f1ec6f835681c768c945065b1976da42 /Project/LimiterForm.cpp
parent3985018cdb8508b9970646ae4b9886ba4df6dd78 (diff)
downloadPSP.git-045037ce8f2b106acbe5425245746a2dbed65c26.tar.gz
PSP.git-045037ce8f2b106acbe5425245746a2dbed65c26.tar.xz
PSP.git-045037ce8f2b106acbe5425245746a2dbed65c26.zip
Exponencial under implementation
Diffstat (limited to 'Project/LimiterForm.cpp')
-rw-r--r--Project/LimiterForm.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/Project/LimiterForm.cpp b/Project/LimiterForm.cpp
new file mode 100644
index 0000000..dfbffb8
--- /dev/null
+++ b/Project/LimiterForm.cpp
@@ -0,0 +1,34 @@
+#include "LimiterForm.h"
+#include "Limiter.h"
+
+LimiterForm::LimiterForm(wxWindow* parent, Limiter* limiter) : LimiterFormBase(parent)
+{
+ m_limiter = limiter;
+ m_parent = parent;
+
+ m_textCtrlUpLimit->SetValue(m_limiter->StringFromDouble(m_limiter->GetUpLimit()));
+ m_textCtrlLowLimit->SetValue(m_limiter->StringFromDouble(m_limiter->GetLowLimit()));
+}
+
+LimiterForm::~LimiterForm() {}
+void LimiterForm::OnOKButtonClick(wxCommandEvent& event)
+{
+ if(ValidateData()) EndModal(wxID_OK);
+}
+
+bool LimiterForm::ValidateData()
+{
+ double upLimit;
+ double lowLimit;
+
+ if(!m_limiter->DoubleFromString(this, m_textCtrlUpLimit->GetValue(), upLimit,
+ _("Value entered incorrectly in the field \"Upper limit\".")))
+ return false;
+ if(!m_limiter->DoubleFromString(this, m_textCtrlLowLimit->GetValue(), lowLimit,
+ _("Value entered incorrectly in the field \"Lower limit\".")))
+ return false;
+
+ m_limiter->SetUpLimit(upLimit);
+ m_limiter->SetLowLimit(lowLimit);
+ return true;
+} \ No newline at end of file