mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
removed module_files.h module_files.cpp module_output.cpp FInterface.for
renamed IPhreeqc2 to IPhreeqc git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/branches/class@4226 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
9489dbf7e6
commit
33c23851e6
@ -1982,10 +1982,6 @@
|
|||||||
RelativePath=".\include\IPhreeqc.hpp"
|
RelativePath=".\include\IPhreeqc.hpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="src\module_files.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="src\SelectedOutput.hxx"
|
RelativePath="src\SelectedOutput.hxx"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef __IPHREEQC_LIB_H
|
#ifndef INC_IPHREEQC_H
|
||||||
#define __IPHREEQC_LIB_H
|
#define INC_IPHREEQC_H
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ typedef enum {
|
|||||||
} IPQ_RESULT;
|
} IPQ_RESULT;
|
||||||
|
|
||||||
|
|
||||||
class IPhreeqc2;
|
class IPhreeqc;
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -576,4 +576,4 @@ const char* GetErrorLine(int id, int n);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __IPHREEQC_LIB_H
|
#endif // INC_IPHREEQC_H
|
||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef _INC_IPHREEQC2_HPP
|
#ifndef INC_IPHREEQC_HPP
|
||||||
#define _INC_IPHREEQC2_HPP
|
#define INC_IPHREEQC_HPP
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <list>
|
#include <list>
|
||||||
@ -16,11 +16,11 @@ class IPhreeqcStop : std::exception
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
class IPhreeqc2
|
class IPhreeqc
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IPhreeqc2(void);
|
IPhreeqc(void);
|
||||||
~IPhreeqc2(void);
|
~IPhreeqc(void);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -132,4 +132,4 @@ private:
|
|||||||
Phreeqc* PhreeqcPtr;
|
Phreeqc* PhreeqcPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _INC_IPHREEQC2_HPP
|
#endif // INC_IPHREEQC_HPP
|
||||||
@ -1,8 +1,6 @@
|
|||||||
#ifndef __CVAR_HXX_INC
|
#ifndef INC_CVAR_HXX
|
||||||
#define __CVAR_HXX_INC
|
#define INC_CVAR_HXX
|
||||||
|
|
||||||
|
|
||||||
#include "Debug.h" // ASSERT
|
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include <ostream> // std::ostream
|
#include <ostream> // std::ostream
|
||||||
|
|
||||||
@ -93,7 +91,6 @@ public:
|
|||||||
VRESULT InternalClear()
|
VRESULT InternalClear()
|
||||||
{
|
{
|
||||||
VRESULT vr = Clear();
|
VRESULT vr = Clear();
|
||||||
ASSERT(vr == VR_OK);
|
|
||||||
if (vr != VR_OK)
|
if (vr != VR_OK)
|
||||||
{
|
{
|
||||||
type = TT_ERROR;
|
type = TT_ERROR;
|
||||||
@ -162,4 +159,4 @@ inline std::ostream& operator<< (std::ostream &os, const CVar &a)
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __CVAR_HXX_INC
|
#endif // INC_CVAR_HXX
|
||||||
|
|||||||
@ -1,116 +0,0 @@
|
|||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
FUNCTION LoadDatabase(FILENAME)
|
|
||||||
CHARACTER(LEN=*) :: FILENAME
|
|
||||||
INTEGER(KIND=4) :: LoadDatabase
|
|
||||||
INTERFACE
|
|
||||||
FUNCTION FLoadDatabase(FILENAME)
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::FLoadDatabase
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_LoadDatabaseF'::FLoadDatabase
|
|
||||||
CHARACTER(LEN=*) :: FILENAME
|
|
||||||
INTEGER(KIND=4) :: FLoadDatabase
|
|
||||||
END FUNCTION FLoadDatabase
|
|
||||||
END INTERFACE
|
|
||||||
LoadDatabase = FLoadDatabase(FILENAME)
|
|
||||||
END FUNCTION LoadDatabase
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
SUBROUTINE OutputLastError
|
|
||||||
INTERFACE
|
|
||||||
SUBROUTINE FOutputLastError
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::FOutputLines
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_OutputLastError'::FOutputLastError
|
|
||||||
END SUBROUTINE FOutputLastError
|
|
||||||
END INTERFACE
|
|
||||||
CALL FOutputLastError
|
|
||||||
END SUBROUTINE OutputLastError
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
FUNCTION AccumulateLine(LINE)
|
|
||||||
CHARACTER(LEN=*) :: LINE
|
|
||||||
INTEGER(KIND=4) :: AccumulateLine
|
|
||||||
INTERFACE
|
|
||||||
FUNCTION FAccumulate(LINE)
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::FAccumulate
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_AccumulateLineF'::FAccumulate
|
|
||||||
CHARACTER(LEN=*) :: LINE
|
|
||||||
INTEGER(KIND=4) :: FAccumulate
|
|
||||||
END FUNCTION FAccumulate
|
|
||||||
END INTERFACE
|
|
||||||
AccumulateLine = FAccumulate(LINE)
|
|
||||||
END FUNCTION AccumulateLine
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
FUNCTION Run(OUTPUT_ON, ERROR_ON, LOG_ON, SELECTED_ON)
|
|
||||||
LOGICAL(KIND=4) :: OUTPUT_ON
|
|
||||||
LOGICAL(KIND=4) :: ERROR_ON
|
|
||||||
LOGICAL(KIND=4) :: LOG_ON
|
|
||||||
LOGICAL(KIND=4) :: SELECTED_ON
|
|
||||||
INTEGER(KIND=4) :: Run
|
|
||||||
INTERFACE
|
|
||||||
FUNCTION FRun(OUTPUT_ON, ERROR_ON, LOG_ON, SELECTED_ON)
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::FRun
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_RunF'::FRun
|
|
||||||
LOGICAL(KIND=4) :: OUTPUT_ON
|
|
||||||
LOGICAL(KIND=4) :: ERROR_ON
|
|
||||||
LOGICAL(KIND=4) :: LOG_ON
|
|
||||||
LOGICAL(KIND=4) :: SELECTED_ON
|
|
||||||
INTEGER(KIND=4) :: FRun
|
|
||||||
END FUNCTION FRun
|
|
||||||
END INTERFACE
|
|
||||||
Run = FRun(OUTPUT_ON, ERROR_ON, LOG_ON, SELECTED_ON)
|
|
||||||
END FUNCTION Run
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
SUBROUTINE OutputLines
|
|
||||||
INTERFACE
|
|
||||||
SUBROUTINE FOutputLines
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::FOutputLines
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_OutputLines'::FOutputLines
|
|
||||||
END SUBROUTINE FOutputLines
|
|
||||||
END INTERFACE
|
|
||||||
CALL FOutputLines
|
|
||||||
END SUBROUTINE OutputLines
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
FUNCTION GetSelectedOutputRowCount
|
|
||||||
INTEGER(KIND=4) :: GetSelectedOutputRowCount
|
|
||||||
INTERFACE
|
|
||||||
FUNCTION FRows
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::FRows
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_GetSelectedOutputRowCount'::FRows
|
|
||||||
INTEGER(KIND=4) :: FRows
|
|
||||||
END FUNCTION FRows
|
|
||||||
END INTERFACE
|
|
||||||
GetSelectedOutputRowCount = FRows() - 1
|
|
||||||
END FUNCTION GetSelectedOutputRowCount
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
FUNCTION GetSelectedOutputColumnCount
|
|
||||||
INTEGER(KIND=4) :: GetSelectedOutputColumnCount
|
|
||||||
INTERFACE
|
|
||||||
FUNCTION FCols
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::FCols
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_GetSelectedOutputColumnCount'::FCols
|
|
||||||
INTEGER(KIND=4) :: FCols
|
|
||||||
END FUNCTION FCols
|
|
||||||
END INTERFACE
|
|
||||||
GetSelectedOutputColumnCount = FCols()
|
|
||||||
END FUNCTION GetSelectedOutputColumnCount
|
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
FUNCTION GetSelectedOutputValue(ROW,COL,VTYPE,DVALUE,SVALUE)
|
|
||||||
INTEGER(KIND=4) :: ROW
|
|
||||||
INTEGER(KIND=4) :: COL
|
|
||||||
INTEGER(KIND=4) :: VTYPE
|
|
||||||
REAL(KIND=8) :: DVALUE
|
|
||||||
CHARACTER(LEN=*) :: SVALUE
|
|
||||||
INTEGER(KIND=4) :: GetSelectedOutputValue
|
|
||||||
INTEGER(KIND=4) :: adjcol
|
|
||||||
INTERFACE
|
|
||||||
FUNCTION Get(ROW,COL,VTYPE,DVALUE,SVALUE)
|
|
||||||
!DEC$ ATTRIBUTES C,REFERENCE::Get
|
|
||||||
!DEC$ ATTRIBUTES ALIAS:'_GetSelectedOutputValueF'::Get
|
|
||||||
INTEGER(KIND=4) :: ROW
|
|
||||||
INTEGER(KIND=4) :: COL
|
|
||||||
INTEGER(KIND=4) :: VTYPE
|
|
||||||
REAL(KIND=8) :: DVALUE
|
|
||||||
CHARACTER(LEN=*) :: SVALUE
|
|
||||||
INTEGER(KIND=4) :: Get
|
|
||||||
END FUNCTION Get
|
|
||||||
END INTERFACE
|
|
||||||
adjcol = col - 1
|
|
||||||
GetSelectedOutputValue = Get(ROW,adjcol,VTYPE,DVALUE,SVALUE)
|
|
||||||
END FUNCTION GetSelectedOutputValue
|
|
||||||
127
src/IPhreeqc.cpp
127
src/IPhreeqc.cpp
@ -1,8 +1,9 @@
|
|||||||
#include "IPhreeqc.hpp"
|
#include <memory> // auto_ptr
|
||||||
|
|
||||||
|
#include "IPhreeqc.hpp" // IPhreeqc
|
||||||
#include "Phreeqc.h" // Phreeqc
|
#include "Phreeqc.h" // Phreeqc
|
||||||
|
|
||||||
#include <cassert> // assert
|
#include "Debug.h" // ASSERT
|
||||||
#include <memory> // auto_ptr
|
|
||||||
#include "ErrorReporter.hxx" // CErrorReporter
|
#include "ErrorReporter.hxx" // CErrorReporter
|
||||||
#include "SelectedOutput.hxx" // CSelectedOutput
|
#include "SelectedOutput.hxx" // CSelectedOutput
|
||||||
#include "dumper.h" // dumper
|
#include "dumper.h" // dumper
|
||||||
@ -34,7 +35,7 @@ int istream_getc(void *cookie)
|
|||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPhreeqc2::IPhreeqc2(void)
|
IPhreeqc::IPhreeqc(void)
|
||||||
: DatabaseLoaded(false)
|
: DatabaseLoaded(false)
|
||||||
, SelectedOutputOn(false)
|
, SelectedOutputOn(false)
|
||||||
, OutputOn(false)
|
, OutputOn(false)
|
||||||
@ -55,15 +56,15 @@ IPhreeqc2::IPhreeqc2(void)
|
|||||||
this->UnLoadDatabase();
|
this->UnLoadDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
IPhreeqc2::~IPhreeqc2(void)
|
IPhreeqc::~IPhreeqc(void)
|
||||||
{
|
{
|
||||||
delete this->PhreeqcPtr;
|
delete this->PhreeqcPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
int IPhreeqc::handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
int n = OK;
|
int n = OK;
|
||||||
IPhreeqc2 *pThis = (IPhreeqc2*)cookie;
|
IPhreeqc *pThis = (IPhreeqc*)cookie;
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case Phreeqc::ACTION_OPEN:
|
case Phreeqc::ACTION_OPEN:
|
||||||
@ -86,9 +87,9 @@ int IPhreeqc2::handler(const int action, const int type, const char *err_str, co
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::output_handler(const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
int IPhreeqc::output_handler(const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
assert(cookie == this);
|
ASSERT(cookie == this);
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@ -126,7 +127,7 @@ int IPhreeqc2::output_handler(const int type, const char *err_str, const int sto
|
|||||||
return module_handler(Phreeqc::ACTION_OUTPUT, type, err_str, stop, cookie, format, args);
|
return module_handler(Phreeqc::ACTION_OUTPUT, type, err_str, stop, cookie, format, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::open_handler(const int type, const char *file_name)
|
int IPhreeqc::open_handler(const int type, const char *file_name)
|
||||||
{
|
{
|
||||||
int n = OK;
|
int n = OK;
|
||||||
switch (type)
|
switch (type)
|
||||||
@ -151,9 +152,9 @@ int IPhreeqc2::open_handler(const int type, const char *file_name)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
int IPhreeqc::module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
IPhreeqc2* pThis = (IPhreeqc2*) cookie;
|
IPhreeqc* pThis = (IPhreeqc*) cookie;
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
@ -170,7 +171,7 @@ int IPhreeqc2::module_handler(const int action, const int type, const char *err_
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::module_isopen_handler(const int type)
|
int IPhreeqc::module_isopen_handler(const int type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@ -178,14 +179,14 @@ int IPhreeqc2::module_isopen_handler(const int type)
|
|||||||
if (this->PhreeqcPtr->punch_file) return 1;
|
if (this->PhreeqcPtr->punch_file) return 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::module_open_handler(const int type, const char *file_name)
|
int IPhreeqc::module_open_handler(const int type, const char *file_name)
|
||||||
{
|
{
|
||||||
assert(file_name && ::strlen(file_name));
|
ASSERT(file_name && ::strlen(file_name));
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case Phreeqc::OUTPUT_MESSAGE:
|
case Phreeqc::OUTPUT_MESSAGE:
|
||||||
@ -201,7 +202,7 @@ int IPhreeqc2::module_open_handler(const int type, const char *file_name)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Phreeqc::OUTPUT_ERROR:
|
case Phreeqc::OUTPUT_ERROR:
|
||||||
assert(this->PhreeqcPtr->error_file != stderr);
|
ASSERT(this->PhreeqcPtr->error_file != stderr);
|
||||||
if (this->PhreeqcPtr->error_file != NULL)
|
if (this->PhreeqcPtr->error_file != NULL)
|
||||||
{
|
{
|
||||||
::fclose(this->PhreeqcPtr->error_file);
|
::fclose(this->PhreeqcPtr->error_file);
|
||||||
@ -233,7 +234,7 @@ int IPhreeqc2::module_open_handler(const int type, const char *file_name)
|
|||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::output_isopen(const int type)
|
int IPhreeqc::output_isopen(const int type)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
int isopen;
|
int isopen;
|
||||||
@ -245,12 +246,12 @@ int IPhreeqc2::output_isopen(const int type)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::EndRow(void)
|
int IPhreeqc::EndRow(void)
|
||||||
{
|
{
|
||||||
if (this->SelectedOutput->GetRowCount() <= 1)
|
if (this->SelectedOutput->GetRowCount() <= 1)
|
||||||
{
|
{
|
||||||
// ensure all user_punch headings are included
|
// ensure all user_punch headings are included
|
||||||
assert(this->PhreeqcPtr->n_user_punch_index >= 0);
|
ASSERT(this->PhreeqcPtr->n_user_punch_index >= 0);
|
||||||
for (int i = this->PhreeqcPtr->n_user_punch_index; i < this->PhreeqcPtr->user_punch_count_headings; ++i)
|
for (int i = this->PhreeqcPtr->n_user_punch_index; i < this->PhreeqcPtr->user_punch_count_headings; ++i)
|
||||||
{
|
{
|
||||||
this->SelectedOutput->PushBackEmpty(this->PhreeqcPtr->user_punch_headings[i]);
|
this->SelectedOutput->PushBackEmpty(this->PhreeqcPtr->user_punch_headings[i]);
|
||||||
@ -259,38 +260,38 @@ int IPhreeqc2::EndRow(void)
|
|||||||
return this->SelectedOutput->EndRow();
|
return this->SelectedOutput->EndRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::ClearAccumulatedLines(void)
|
void IPhreeqc::ClearAccumulatedLines(void)
|
||||||
{
|
{
|
||||||
this->StringInput.erase();
|
this->StringInput.erase();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t IPhreeqc2::AddError(const char* error_msg)
|
size_t IPhreeqc::AddError(const char* error_msg)
|
||||||
{
|
{
|
||||||
return this->ErrorReporter->AddError(error_msg);
|
return this->ErrorReporter->AddError(error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t IPhreeqc2::AddWarning(const char* error_msg)
|
size_t IPhreeqc::AddWarning(const char* error_msg)
|
||||||
{
|
{
|
||||||
return this->WarningReporter->AddError(error_msg);
|
return this->WarningReporter->AddError(error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& IPhreeqc2::GetAccumulatedLines(void)
|
const std::string& IPhreeqc::GetAccumulatedLines(void)
|
||||||
{
|
{
|
||||||
return this->StringInput;
|
return this->StringInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::OutputLastError(void)
|
void IPhreeqc::OutputLastError(void)
|
||||||
{
|
{
|
||||||
std::cout << this->GetLastErrorString() << std::endl;
|
std::cout << this->GetLastErrorString() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::OutputLines(void)
|
void IPhreeqc::OutputLines(void)
|
||||||
{
|
{
|
||||||
std::cout << this->StringInput.c_str() << std::endl;
|
std::cout << this->StringInput.c_str() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int IPhreeqc2::LoadDatabase(const char* filename)
|
int IPhreeqc::LoadDatabase(const char* filename)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -336,7 +337,7 @@ int IPhreeqc2::LoadDatabase(const char* filename)
|
|||||||
return this->PhreeqcPtr->input_error;
|
return this->PhreeqcPtr->input_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::LoadDatabaseString(const char* input)
|
int IPhreeqc::LoadDatabaseString(const char* input)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -374,7 +375,7 @@ int IPhreeqc2::LoadDatabaseString(const char* input)
|
|||||||
return this->PhreeqcPtr->input_error;
|
return this->PhreeqcPtr->input_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::UnLoadDatabase(void)
|
void IPhreeqc::UnLoadDatabase(void)
|
||||||
{
|
{
|
||||||
// init IPhreeqc
|
// init IPhreeqc
|
||||||
//
|
//
|
||||||
@ -405,72 +406,72 @@ void IPhreeqc2::UnLoadDatabase(void)
|
|||||||
// initialize phreeqc
|
// initialize phreeqc
|
||||||
//
|
//
|
||||||
this->PhreeqcPtr->clean_up();
|
this->PhreeqcPtr->clean_up();
|
||||||
this->PhreeqcPtr->add_output_callback(IPhreeqc2::handler, this);
|
this->PhreeqcPtr->add_output_callback(IPhreeqc::handler, this);
|
||||||
this->PhreeqcPtr->do_initialize();
|
this->PhreeqcPtr->do_initialize();
|
||||||
this->PhreeqcPtr->input_error = 0;
|
this->PhreeqcPtr->input_error = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPhreeqc2::GetOutputOn(void)const
|
bool IPhreeqc::GetOutputOn(void)const
|
||||||
{
|
{
|
||||||
return this->OutputOn;
|
return this->OutputOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::SetOutputOn(bool bValue)
|
void IPhreeqc::SetOutputOn(bool bValue)
|
||||||
{
|
{
|
||||||
this->OutputOn = bValue;
|
this->OutputOn = bValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPhreeqc2::GetSelectedOutputOn(void)const
|
bool IPhreeqc::GetSelectedOutputOn(void)const
|
||||||
{
|
{
|
||||||
return this->SelectedOutputOn;
|
return this->SelectedOutputOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::SetSelectedOutputOn(bool bValue)
|
void IPhreeqc::SetSelectedOutputOn(bool bValue)
|
||||||
{
|
{
|
||||||
this->SelectedOutputOn = bValue;
|
this->SelectedOutputOn = bValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPhreeqc2::GetLogOn(void)const
|
bool IPhreeqc::GetLogOn(void)const
|
||||||
{
|
{
|
||||||
return this->LogOn;
|
return this->LogOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::SetLogOn(bool bValue)
|
void IPhreeqc::SetLogOn(bool bValue)
|
||||||
{
|
{
|
||||||
this->LogOn = bValue;
|
this->LogOn = bValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPhreeqc2::GetDumpOn(void)const
|
bool IPhreeqc::GetDumpOn(void)const
|
||||||
{
|
{
|
||||||
return this->DumpOn;
|
return this->DumpOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::SetDumpOn(bool bValue)
|
void IPhreeqc::SetDumpOn(bool bValue)
|
||||||
{
|
{
|
||||||
this->DumpOn = bValue;
|
this->DumpOn = bValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPhreeqc2::GetDumpStringOn(void)const
|
bool IPhreeqc::GetDumpStringOn(void)const
|
||||||
{
|
{
|
||||||
return this->DumpStringOn;
|
return this->DumpStringOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::SetDumpStringOn(bool bValue)
|
void IPhreeqc::SetDumpStringOn(bool bValue)
|
||||||
{
|
{
|
||||||
this->DumpStringOn = bValue;
|
this->DumpStringOn = bValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPhreeqc2::GetErrorOn(void)const
|
bool IPhreeqc::GetErrorOn(void)const
|
||||||
{
|
{
|
||||||
return this->ErrorOn;
|
return this->ErrorOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::SetErrorOn(bool bValue)
|
void IPhreeqc::SetErrorOn(bool bValue)
|
||||||
{
|
{
|
||||||
this->ErrorOn = bValue;
|
this->ErrorOn = bValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::AddSelectedOutput(const char* name, const char* format, va_list argptr)
|
void IPhreeqc::AddSelectedOutput(const char* name, const char* format, va_list argptr)
|
||||||
{
|
{
|
||||||
int bInt;
|
int bInt;
|
||||||
int bDouble;
|
int bDouble;
|
||||||
@ -644,25 +645,25 @@ void IPhreeqc2::AddSelectedOutput(const char* name, const char* format, va_list
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* IPhreeqc2::GetLastErrorString(void)
|
const char* IPhreeqc::GetLastErrorString(void)
|
||||||
{
|
{
|
||||||
this->LastErrorString = ((CErrorReporter<std::ostringstream>*)this->ErrorReporter)->GetOS()->str();
|
this->LastErrorString = ((CErrorReporter<std::ostringstream>*)this->ErrorReporter)->GetOS()->str();
|
||||||
return this->LastErrorString.c_str();
|
return this->LastErrorString.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* IPhreeqc2::GetLastWarningString(void)
|
const char* IPhreeqc::GetLastWarningString(void)
|
||||||
{
|
{
|
||||||
this->LastWarningString = ((CErrorReporter<std::ostringstream>*)this->WarningReporter)->GetOS()->str();
|
this->LastWarningString = ((CErrorReporter<std::ostringstream>*)this->WarningReporter)->GetOS()->str();
|
||||||
return this->LastWarningString.c_str();
|
return this->LastWarningString.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* IPhreeqc2::GetDumpString(void)
|
const char* IPhreeqc::GetDumpString(void)
|
||||||
{
|
{
|
||||||
return this->DumpString.c_str();
|
return this->DumpString.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPhreeqc2::check_database(const char* sz_routine)
|
void IPhreeqc::check_database(const char* sz_routine)
|
||||||
{
|
{
|
||||||
this->ErrorReporter->Clear();
|
this->ErrorReporter->Clear();
|
||||||
this->SelectedOutput->Clear();
|
this->SelectedOutput->Clear();
|
||||||
@ -676,7 +677,7 @@ void IPhreeqc2::check_database(const char* sz_routine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::do_run(const char* sz_routine, std::istream* pis, FILE* fp, PFN_PRERUN_CALLBACK pfn_pre, PFN_POSTRUN_CALLBACK pfn_post, void *cookie)
|
void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, FILE* fp, PFN_PRERUN_CALLBACK pfn_pre, PFN_POSTRUN_CALLBACK pfn_post, void *cookie)
|
||||||
{
|
{
|
||||||
std::auto_ptr<std::istringstream> auto_iss(NULL);
|
std::auto_ptr<std::istringstream> auto_iss(NULL);
|
||||||
char token[MAX_LENGTH];
|
char token[MAX_LENGTH];
|
||||||
@ -1008,7 +1009,7 @@ void IPhreeqc2::do_run(const char* sz_routine, std::istream* pis, FILE* fp, PFN_
|
|||||||
this->update_errors();
|
this->update_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
VRESULT IPhreeqc2::AccumulateLine(const char *line)
|
VRESULT IPhreeqc::AccumulateLine(const char *line)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -1025,7 +1026,7 @@ VRESULT IPhreeqc2::AccumulateLine(const char *line)
|
|||||||
return VR_OUTOFMEMORY;
|
return VR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::RunAccumulated(void)
|
int IPhreeqc::RunAccumulated(void)
|
||||||
{
|
{
|
||||||
static const char *sz_routine = "RunAccumulated";
|
static const char *sz_routine = "RunAccumulated";
|
||||||
try
|
try
|
||||||
@ -1065,7 +1066,7 @@ int IPhreeqc2::RunAccumulated(void)
|
|||||||
return this->PhreeqcPtr->input_error;
|
return this->PhreeqcPtr->input_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::RunFile(const char* filename)
|
int IPhreeqc::RunFile(const char* filename)
|
||||||
{
|
{
|
||||||
static const char *sz_routine = "RunFile";
|
static const char *sz_routine = "RunFile";
|
||||||
try
|
try
|
||||||
@ -1112,7 +1113,7 @@ int IPhreeqc2::RunFile(const char* filename)
|
|||||||
return this->PhreeqcPtr->input_error;
|
return this->PhreeqcPtr->input_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::RunString(const char* input)
|
int IPhreeqc::RunString(const char* input)
|
||||||
{
|
{
|
||||||
static const char *sz_routine = "RunString";
|
static const char *sz_routine = "RunString";
|
||||||
try
|
try
|
||||||
@ -1152,17 +1153,17 @@ int IPhreeqc2::RunString(const char* input)
|
|||||||
return this->PhreeqcPtr->input_error;
|
return this->PhreeqcPtr->input_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::GetSelectedOutputRowCount(void)const
|
int IPhreeqc::GetSelectedOutputRowCount(void)const
|
||||||
{
|
{
|
||||||
return (int)this->SelectedOutput->GetRowCount();
|
return (int)this->SelectedOutput->GetRowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::GetSelectedOutputColumnCount(void)const
|
int IPhreeqc::GetSelectedOutputColumnCount(void)const
|
||||||
{
|
{
|
||||||
return (int)this->SelectedOutput->GetColCount();
|
return (int)this->SelectedOutput->GetColCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
VRESULT IPhreeqc2::GetSelectedOutputValue(int row, int col, VAR* pVAR)
|
VRESULT IPhreeqc::GetSelectedOutputValue(int row, int col, VAR* pVAR)
|
||||||
{
|
{
|
||||||
this->ErrorReporter->Clear();
|
this->ErrorReporter->Clear();
|
||||||
if (!pVAR)
|
if (!pVAR)
|
||||||
@ -1197,12 +1198,12 @@ VRESULT IPhreeqc2::GetSelectedOutputValue(int row, int col, VAR* pVAR)
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::GetDumpLineCount(void)const
|
int IPhreeqc::GetDumpLineCount(void)const
|
||||||
{
|
{
|
||||||
return (int)this->DumpLines.size();
|
return (int)this->DumpLines.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* IPhreeqc2::GetDumpLine(int n)
|
const char* IPhreeqc::GetDumpLine(int n)
|
||||||
{
|
{
|
||||||
static const char empty[] = "";
|
static const char empty[] = "";
|
||||||
if (n < 0 || n >= this->GetDumpLineCount())
|
if (n < 0 || n >= this->GetDumpLineCount())
|
||||||
@ -1212,12 +1213,12 @@ const char* IPhreeqc2::GetDumpLine(int n)
|
|||||||
return this->DumpLines[n].c_str();
|
return this->DumpLines[n].c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
int IPhreeqc2::GetErrorLineCount(void)const
|
int IPhreeqc::GetErrorLineCount(void)const
|
||||||
{
|
{
|
||||||
return (int)this->ErrorLines.size();
|
return (int)this->ErrorLines.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* IPhreeqc2::GetErrorLine(int n)
|
const char* IPhreeqc::GetErrorLine(int n)
|
||||||
{
|
{
|
||||||
static const char empty[] = "";
|
static const char empty[] = "";
|
||||||
if (n < 0 || n >= this->GetErrorLineCount())
|
if (n < 0 || n >= this->GetErrorLineCount())
|
||||||
@ -1227,7 +1228,7 @@ const char* IPhreeqc2::GetErrorLine(int n)
|
|||||||
return this->ErrorLines[n].c_str();
|
return this->ErrorLines[n].c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPhreeqc2::update_errors(void)
|
void IPhreeqc::update_errors(void)
|
||||||
{
|
{
|
||||||
this->LastErrorString = ((CErrorReporter<std::ostringstream>*)this->ErrorReporter)->GetOS()->str();
|
this->LastErrorString = ((CErrorReporter<std::ostringstream>*)this->ErrorReporter)->GetOS()->str();
|
||||||
|
|
||||||
@ -1240,21 +1241,21 @@ void IPhreeqc2::update_errors(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list< std::string > IPhreeqc2::ListComponents(void)
|
std::list< std::string > IPhreeqc::ListComponents(void)
|
||||||
{
|
{
|
||||||
std::list< std::string > comps;
|
std::list< std::string > comps;
|
||||||
this->PhreeqcPtr->list_components(comps);
|
this->PhreeqcPtr->list_components(comps);
|
||||||
return comps;
|
return comps;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t IPhreeqc2::GetComponentCount(void)
|
size_t IPhreeqc::GetComponentCount(void)
|
||||||
{
|
{
|
||||||
std::list< std::string > comps;
|
std::list< std::string > comps;
|
||||||
this->PhreeqcPtr->list_components(comps);
|
this->PhreeqcPtr->list_components(comps);
|
||||||
return comps.size();
|
return comps.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* IPhreeqc2::GetComponent(int n)
|
const char* IPhreeqc::GetComponent(int n)
|
||||||
{
|
{
|
||||||
static const char empty[] = "";
|
static const char empty[] = "";
|
||||||
this->Components = this->ListComponents();
|
this->Components = this->ListComponents();
|
||||||
|
|||||||
@ -8,10 +8,10 @@ class IPhreeqcLib
|
|||||||
public:
|
public:
|
||||||
static int CreateIPhreeqc(void);
|
static int CreateIPhreeqc(void);
|
||||||
static IPQ_RESULT DestroyIPhreeqc(int n);
|
static IPQ_RESULT DestroyIPhreeqc(int n);
|
||||||
static IPhreeqc2* GetInstance(int n);
|
static IPhreeqc* GetInstance(int n);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::map<size_t, IPhreeqc2*> Instances;
|
static std::map<size_t, IPhreeqc*> Instances;
|
||||||
static size_t InstancesIndex;
|
static size_t InstancesIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ DestroyIPhreeqc(int id)
|
|||||||
int
|
int
|
||||||
LoadDatabase(int id, const char* filename)
|
LoadDatabase(int id, const char* filename)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->LoadDatabase(filename);
|
return IPhreeqcPtr->LoadDatabase(filename);
|
||||||
@ -41,7 +41,7 @@ LoadDatabase(int id, const char* filename)
|
|||||||
int
|
int
|
||||||
LoadDatabaseString(int id, const char* input)
|
LoadDatabaseString(int id, const char* input)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->LoadDatabaseString(input);
|
return IPhreeqcPtr->LoadDatabaseString(input);
|
||||||
@ -52,7 +52,7 @@ LoadDatabaseString(int id, const char* input)
|
|||||||
int
|
int
|
||||||
UnLoadDatabase(int id)
|
UnLoadDatabase(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->UnLoadDatabase();
|
IPhreeqcPtr->UnLoadDatabase();
|
||||||
@ -65,7 +65,7 @@ void
|
|||||||
OutputLastError(int id)
|
OutputLastError(int id)
|
||||||
{
|
{
|
||||||
static const char err_msg[] = "OutputLastError: Bad instance.\n";
|
static const char err_msg[] = "OutputLastError: Bad instance.\n";
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->OutputLastError();
|
IPhreeqcPtr->OutputLastError();
|
||||||
@ -78,7 +78,7 @@ const char*
|
|||||||
GetLastErrorString(int id)
|
GetLastErrorString(int id)
|
||||||
{
|
{
|
||||||
static const char err_msg[] = "GetLastErrorString: Bad instance.\n";
|
static const char err_msg[] = "GetLastErrorString: Bad instance.\n";
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->GetLastErrorString();
|
return IPhreeqcPtr->GetLastErrorString();
|
||||||
@ -90,7 +90,7 @@ const char*
|
|||||||
GetDumpString(int id)
|
GetDumpString(int id)
|
||||||
{
|
{
|
||||||
static const char empty[] = "";
|
static const char empty[] = "";
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->GetDumpString();
|
return IPhreeqcPtr->GetDumpString();
|
||||||
@ -101,7 +101,7 @@ GetDumpString(int id)
|
|||||||
int
|
int
|
||||||
GetDumpLineCount(int id)
|
GetDumpLineCount(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->GetDumpLineCount();
|
return IPhreeqcPtr->GetDumpLineCount();
|
||||||
@ -113,7 +113,7 @@ const char*
|
|||||||
GetDumpLine(int id, int n)
|
GetDumpLine(int id, int n)
|
||||||
{
|
{
|
||||||
static const char err_msg[] = "GetDumpLine: Bad instance.\n";
|
static const char err_msg[] = "GetDumpLine: Bad instance.\n";
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->GetDumpLine(n);
|
return IPhreeqcPtr->GetDumpLine(n);
|
||||||
@ -124,7 +124,7 @@ GetDumpLine(int id, int n)
|
|||||||
int
|
int
|
||||||
GetComponentCount(int id)
|
GetComponentCount(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->ListComponents().size();
|
return IPhreeqcPtr->ListComponents().size();
|
||||||
@ -139,7 +139,7 @@ GetComponent(int id, int n)
|
|||||||
static const char empty[] = "";
|
static const char empty[] = "";
|
||||||
static std::string comp;
|
static std::string comp;
|
||||||
|
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
std::list< std::string > comps = IPhreeqcPtr->ListComponents();
|
std::list< std::string > comps = IPhreeqcPtr->ListComponents();
|
||||||
@ -161,7 +161,7 @@ GetComponent(int id, int n)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
AccumulateLine(int id, const char *line)
|
AccumulateLine(int id, const char *line)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
switch (IPhreeqcPtr->AccumulateLine(line))
|
switch (IPhreeqcPtr->AccumulateLine(line))
|
||||||
@ -180,7 +180,7 @@ AccumulateLine(int id, const char *line)
|
|||||||
int
|
int
|
||||||
GetSelectedOutputOn(int id)
|
GetSelectedOutputOn(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
if (IPhreeqcPtr->GetSelectedOutputOn())
|
if (IPhreeqcPtr->GetSelectedOutputOn())
|
||||||
@ -198,7 +198,7 @@ GetSelectedOutputOn(int id)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
SetSelectedOutputOn(int id, int value)
|
SetSelectedOutputOn(int id, int value)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->SetSelectedOutputOn(value != 0);
|
IPhreeqcPtr->SetSelectedOutputOn(value != 0);
|
||||||
@ -210,7 +210,7 @@ SetSelectedOutputOn(int id, int value)
|
|||||||
int
|
int
|
||||||
GetOutputOn(int id)
|
GetOutputOn(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
if (IPhreeqcPtr->GetOutputOn())
|
if (IPhreeqcPtr->GetOutputOn())
|
||||||
@ -228,7 +228,7 @@ GetOutputOn(int id)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
SetOutputOn(int id, int value)
|
SetOutputOn(int id, int value)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->SetOutputOn(value != 0);
|
IPhreeqcPtr->SetOutputOn(value != 0);
|
||||||
@ -240,7 +240,7 @@ SetOutputOn(int id, int value)
|
|||||||
int
|
int
|
||||||
GetErrorOn(int id)
|
GetErrorOn(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
if (IPhreeqcPtr->GetErrorOn())
|
if (IPhreeqcPtr->GetErrorOn())
|
||||||
@ -258,7 +258,7 @@ GetErrorOn(int id)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
SetErrorOn(int id, int value)
|
SetErrorOn(int id, int value)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->SetErrorOn(value != 0);
|
IPhreeqcPtr->SetErrorOn(value != 0);
|
||||||
@ -270,7 +270,7 @@ SetErrorOn(int id, int value)
|
|||||||
int
|
int
|
||||||
GetLogOn(int id)
|
GetLogOn(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
if (IPhreeqcPtr->GetLogOn())
|
if (IPhreeqcPtr->GetLogOn())
|
||||||
@ -288,7 +288,7 @@ GetLogOn(int id)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
SetLogOn(int id, int value)
|
SetLogOn(int id, int value)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->SetLogOn(value != 0);
|
IPhreeqcPtr->SetLogOn(value != 0);
|
||||||
@ -301,7 +301,7 @@ SetLogOn(int id, int value)
|
|||||||
int
|
int
|
||||||
GetDumpOn(int id)
|
GetDumpOn(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
if (IPhreeqcPtr->GetDumpOn())
|
if (IPhreeqcPtr->GetDumpOn())
|
||||||
@ -319,7 +319,7 @@ GetDumpOn(int id)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
SetDumpOn(int id, int value)
|
SetDumpOn(int id, int value)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->SetDumpOn(value != 0);
|
IPhreeqcPtr->SetDumpOn(value != 0);
|
||||||
@ -331,7 +331,7 @@ SetDumpOn(int id, int value)
|
|||||||
int
|
int
|
||||||
GetDumpStringOn(int id)
|
GetDumpStringOn(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
if (IPhreeqcPtr->GetDumpStringOn())
|
if (IPhreeqcPtr->GetDumpStringOn())
|
||||||
@ -349,7 +349,7 @@ GetDumpStringOn(int id)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
SetDumpStringOn(int id, int value)
|
SetDumpStringOn(int id, int value)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->SetDumpStringOn(value != 0);
|
IPhreeqcPtr->SetDumpStringOn(value != 0);
|
||||||
@ -361,7 +361,7 @@ SetDumpStringOn(int id, int value)
|
|||||||
int
|
int
|
||||||
RunAccumulated(int id)
|
RunAccumulated(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->RunAccumulated();
|
return IPhreeqcPtr->RunAccumulated();
|
||||||
@ -372,7 +372,7 @@ RunAccumulated(int id)
|
|||||||
int
|
int
|
||||||
RunFile(int id, const char* filename)
|
RunFile(int id, const char* filename)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->RunFile(filename);
|
return IPhreeqcPtr->RunFile(filename);
|
||||||
@ -383,7 +383,7 @@ RunFile(int id, const char* filename)
|
|||||||
int
|
int
|
||||||
RunString(int id, const char* input)
|
RunString(int id, const char* input)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->RunString(input);
|
return IPhreeqcPtr->RunString(input);
|
||||||
@ -394,7 +394,7 @@ RunString(int id, const char* input)
|
|||||||
int
|
int
|
||||||
GetSelectedOutputRowCount(int id)
|
GetSelectedOutputRowCount(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->GetSelectedOutputRowCount();
|
return IPhreeqcPtr->GetSelectedOutputRowCount();
|
||||||
@ -405,7 +405,7 @@ GetSelectedOutputRowCount(int id)
|
|||||||
int
|
int
|
||||||
GetSelectedOutputColumnCount(int id)
|
GetSelectedOutputColumnCount(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->GetSelectedOutputColumnCount();
|
return IPhreeqcPtr->GetSelectedOutputColumnCount();
|
||||||
@ -417,7 +417,7 @@ GetSelectedOutputColumnCount(int id)
|
|||||||
IPQ_RESULT
|
IPQ_RESULT
|
||||||
GetSelectedOutputValue(int id, int row, int col, VAR* pVAR)
|
GetSelectedOutputValue(int id, int row, int col, VAR* pVAR)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
switch(IPhreeqcPtr->GetSelectedOutputValue(row, col, pVAR))
|
switch(IPhreeqcPtr->GetSelectedOutputValue(row, col, pVAR))
|
||||||
@ -438,7 +438,7 @@ GetSelectedOutputValue(int id, int row, int col, VAR* pVAR)
|
|||||||
int
|
int
|
||||||
AddError(int id, const char* error_msg)
|
AddError(int id, const char* error_msg)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return (int)IPhreeqcPtr->AddError(error_msg);
|
return (int)IPhreeqcPtr->AddError(error_msg);
|
||||||
@ -450,7 +450,7 @@ void
|
|||||||
OutputLines(int id)
|
OutputLines(int id)
|
||||||
{
|
{
|
||||||
static const char err_msg[] = "OutputLines: Bad instance.\n";
|
static const char err_msg[] = "OutputLines: Bad instance.\n";
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
IPhreeqcPtr->OutputLines();
|
IPhreeqcPtr->OutputLines();
|
||||||
@ -462,7 +462,7 @@ OutputLines(int id)
|
|||||||
int
|
int
|
||||||
GetErrorLineCount(int id)
|
GetErrorLineCount(int id)
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return (int)IPhreeqcPtr->GetErrorLineCount();
|
return (int)IPhreeqcPtr->GetErrorLineCount();
|
||||||
@ -474,7 +474,7 @@ const char*
|
|||||||
GetErrorLine(int id, int n)
|
GetErrorLine(int id, int n)
|
||||||
{
|
{
|
||||||
static const char err_msg[] = "GetErrorLine: Bad instance.\n";
|
static const char err_msg[] = "GetErrorLine: Bad instance.\n";
|
||||||
IPhreeqc2* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
IPhreeqc* IPhreeqcPtr = IPhreeqcLib::GetInstance(id);
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
return IPhreeqcPtr->GetErrorLine(n);
|
return IPhreeqcPtr->GetErrorLine(n);
|
||||||
@ -483,7 +483,7 @@ GetErrorLine(int id, int n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::map<size_t, IPhreeqc2*> IPhreeqcLib::Instances;
|
std::map<size_t, IPhreeqc*> IPhreeqcLib::Instances;
|
||||||
size_t IPhreeqcLib::InstancesIndex = 0;
|
size_t IPhreeqcLib::InstancesIndex = 0;
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -492,11 +492,11 @@ IPhreeqcLib::CreateIPhreeqc(void)
|
|||||||
int n = IPQ_OUTOFMEMORY;
|
int n = IPQ_OUTOFMEMORY;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IPhreeqc2* IPhreeqcPtr = new IPhreeqc2;
|
IPhreeqc* IPhreeqcPtr = new IPhreeqc;
|
||||||
if (IPhreeqcPtr)
|
if (IPhreeqcPtr)
|
||||||
{
|
{
|
||||||
std::map<size_t, IPhreeqc2*>::value_type instance(IPhreeqcLib::InstancesIndex, IPhreeqcPtr);
|
std::map<size_t, IPhreeqc*>::value_type instance(IPhreeqcLib::InstancesIndex, IPhreeqcPtr);
|
||||||
std::pair<std::map<size_t, IPhreeqc2*>::iterator, bool> pr = IPhreeqcLib::Instances.insert(instance);
|
std::pair<std::map<size_t, IPhreeqc*>::iterator, bool> pr = IPhreeqcLib::Instances.insert(instance);
|
||||||
if (pr.second)
|
if (pr.second)
|
||||||
{
|
{
|
||||||
n = (int) (*pr.first).first;
|
n = (int) (*pr.first).first;
|
||||||
@ -517,7 +517,7 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
|
|||||||
IPQ_RESULT retval = IPQ_BADINSTANCE;
|
IPQ_RESULT retval = IPQ_BADINSTANCE;
|
||||||
if (id >= 0)
|
if (id >= 0)
|
||||||
{
|
{
|
||||||
std::map<size_t, IPhreeqc2*>::iterator it = IPhreeqcLib::Instances.find(size_t(id));
|
std::map<size_t, IPhreeqc*>::iterator it = IPhreeqcLib::Instances.find(size_t(id));
|
||||||
if (it != IPhreeqcLib::Instances.end())
|
if (it != IPhreeqcLib::Instances.end())
|
||||||
{
|
{
|
||||||
delete (*it).second;
|
delete (*it).second;
|
||||||
@ -528,10 +528,10 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPhreeqc2*
|
IPhreeqc*
|
||||||
IPhreeqcLib::GetInstance(int id)
|
IPhreeqcLib::GetInstance(int id)
|
||||||
{
|
{
|
||||||
std::map<size_t, IPhreeqc2*>::iterator it = IPhreeqcLib::Instances.find(size_t(id));
|
std::map<size_t, IPhreeqc*>::iterator it = IPhreeqcLib::Instances.find(size_t(id));
|
||||||
if (it != IPhreeqcLib::Instances.end())
|
if (it != IPhreeqcLib::Instances.end())
|
||||||
{
|
{
|
||||||
return (*it).second;
|
return (*it).second;
|
||||||
|
|||||||
@ -2,22 +2,22 @@
|
|||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <windows.h> // reqd to avoid namespace problems
|
#include <windows.h> // OutputDebugString
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
#include <sstream> // std::ostringstream
|
#include <sstream> // std::ostringstream
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "SelectedOutput.hxx"
|
#include "Debug.h" // ASSERT
|
||||||
|
#include "SelectedOutput.hxx" // CSelectedOutput
|
||||||
|
|
||||||
const size_t RESERVE_ROWS = 80;
|
const size_t RESERVE_ROWS = 80;
|
||||||
const size_t RESERVE_COLS = 80;
|
const size_t RESERVE_COLS = 80;
|
||||||
|
|
||||||
|
|
||||||
CSelectedOutput::CSelectedOutput()
|
CSelectedOutput::CSelectedOutput()
|
||||||
: m_nRowCount(0)
|
: m_nRowCount(0)
|
||||||
{
|
{
|
||||||
@ -195,7 +195,8 @@ void CSelectedOutput::Dump(const char* heading)
|
|||||||
oss << *this;
|
oss << *this;
|
||||||
std::istringstream iss(oss.str());
|
std::istringstream iss(oss.str());
|
||||||
std::string line;
|
std::string line;
|
||||||
while (std::getline(iss, line)) {
|
while (std::getline(iss, line))
|
||||||
|
{
|
||||||
::OutputDebugStringA(line.c_str());
|
::OutputDebugStringA(line.c_str());
|
||||||
::OutputDebugStringA("\n");
|
::OutputDebugStringA("\n");
|
||||||
}
|
}
|
||||||
@ -216,13 +217,13 @@ void CSelectedOutput::AssertValid(void)const
|
|||||||
|
|
||||||
std::ostream& operator<< (std::ostream &os, const CSelectedOutput &a)
|
std::ostream& operator<< (std::ostream &os, const CSelectedOutput &a)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
|
||||||
os << "CSelectedOutput(rows=" << a.GetRowCount() << ", cols=" << a.GetColCount() << ")\n";
|
os << "CSelectedOutput(rows=" << a.GetRowCount() << ", cols=" << a.GetColCount() << ")\n";
|
||||||
#endif
|
|
||||||
|
|
||||||
CVar v;
|
CVar v;
|
||||||
for (size_t r = 0; r < a.GetRowCount(); ++r) {
|
for (size_t r = 0; r < a.GetRowCount(); ++r)
|
||||||
for (size_t c = 0; c < a.GetColCount(); ++c) {
|
{
|
||||||
|
for (size_t c = 0; c < a.GetColCount(); ++c)
|
||||||
|
{
|
||||||
a.Get((int)r, (int)c, &v);
|
a.Get((int)r, (int)c, &v);
|
||||||
os << v << ", ";
|
os << v << ", ";
|
||||||
::VarClear(&v);
|
::VarClear(&v);
|
||||||
|
|||||||
@ -1,95 +0,0 @@
|
|||||||
#include "module_files.h"
|
|
||||||
#if defined(R_SO)
|
|
||||||
#include "phreeqc_files.inl"
|
|
||||||
#else
|
|
||||||
// COMMENT: {3/25/2010 12:36:14 PM}#include "phreeqcpp/phreeqc/phreeqc_files.c"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// COMMENT: {3/2/2010 4:06:35 PM}static int module_isopen_handler(const int type);
|
|
||||||
// COMMENT: {3/2/2010 4:06:35 PM}static int module_open_handler(const int type, const char *file_name);
|
|
||||||
|
|
||||||
//{{{3/25/2010 12:37:19 PM}
|
|
||||||
#include <cassert>
|
|
||||||
//}}{3/25/2010 12:37:19 PM}
|
|
||||||
#include "IPhreeqc.hpp"
|
|
||||||
|
|
||||||
int IPhreeqc::module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args)
|
|
||||||
{
|
|
||||||
IPhreeqc* pThis = (IPhreeqc*) cookie;
|
|
||||||
|
|
||||||
switch (action) {
|
|
||||||
case ACTION_OPEN:
|
|
||||||
return pThis->module_open_handler(type, err_str);
|
|
||||||
break;
|
|
||||||
case ACTION_ISOPEN:
|
|
||||||
return pThis->module_isopen_handler(type);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return pThis->phreeqc_handler(action, type, err_str, stop, cookie, format, args);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
int IPhreeqc::module_isopen_handler(const int type)
|
|
||||||
{
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case OUTPUT_PUNCH:
|
|
||||||
if (this->punch_file) return 1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
assert(0);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int IPhreeqc::module_open_handler(const int type, const char *file_name)
|
|
||||||
{
|
|
||||||
assert(file_name && ::strlen(file_name));
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case OUTPUT_MESSAGE:
|
|
||||||
if (this->output != NULL)
|
|
||||||
{
|
|
||||||
::fclose(this->output);
|
|
||||||
this->output = NULL;
|
|
||||||
}
|
|
||||||
if ( (this->output = ::fopen(file_name, "w")) == NULL)
|
|
||||||
{
|
|
||||||
return ERROR;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OUTPUT_ERROR:
|
|
||||||
assert(this->error_file != stderr);
|
|
||||||
if (this->error_file != NULL)
|
|
||||||
{
|
|
||||||
::fclose(this->error_file);
|
|
||||||
this->error_file = NULL;
|
|
||||||
}
|
|
||||||
if ( (this->error_file = ::fopen(file_name, "w")) == NULL)
|
|
||||||
{
|
|
||||||
return ERROR;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case OUTPUT_LOG:
|
|
||||||
if (this->log_file != NULL)
|
|
||||||
{
|
|
||||||
::fclose(this->log_file);
|
|
||||||
this->log_file = NULL;
|
|
||||||
}
|
|
||||||
if ( (this->log_file = ::fopen(file_name, "w")) == NULL)
|
|
||||||
{
|
|
||||||
return ERROR;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return this->Phreeqc::open_handler(type, file_name);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return(OK);
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
#ifndef __MODULE_FILES__H
|
|
||||||
#define __MODULE_FILES__H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// COMMENT: {3/2/2010 4:07:45 PM}int module_handler(const int action, const int type, const char *err_str, const int stop, void *cookie, const char *format, va_list args);
|
|
||||||
// COMMENT: {3/2/2010 4:07:45 PM}int output_isopen(const int type);
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
ACTION_ISOPEN = -100,
|
|
||||||
} module_action_type;
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __MODULE_FILES__H */
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
#include "module_files.h"
|
|
||||||
|
|
||||||
#include "IPhreeqc.hpp"
|
|
||||||
|
|
||||||
#if defined(R_SO)
|
|
||||||
#include "output.inl"
|
|
||||||
#else
|
|
||||||
// COMMENT: {3/25/2010 12:36:24 PM}#include "phreeqcpp/phreeqc/output.c"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int IPhreeqc::output_isopen(const int type)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
int isopen;
|
|
||||||
for (i = 0; i < this->count_output_callback; ++i)
|
|
||||||
{
|
|
||||||
isopen = (this->output_callbacks[i].callback)(ACTION_ISOPEN, type, NULL, CONTINUE, this->output_callbacks[i].cookie, NULL, NULL);
|
|
||||||
if (isopen) return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@ -1,8 +1,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <IPhreeqc.hpp>
|
#include <IPhreeqc.hpp>
|
||||||
|
|
||||||
#define IPhreeqc IPhreeqc2
|
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
IPhreeqc obj;
|
IPhreeqc obj;
|
||||||
|
|||||||
@ -17,11 +17,11 @@ int DeleteFile(const char* szPathName);
|
|||||||
|
|
||||||
bool FileExists(const char *szPathName);
|
bool FileExists(const char *szPathName);
|
||||||
|
|
||||||
VRESULT SOLUTION(IPhreeqc2& obj, double C, double Ca, double Na);
|
VRESULT SOLUTION(IPhreeqc& obj, double C, double Ca, double Na);
|
||||||
VRESULT EQUILIBRIUM_PHASES(IPhreeqc2& obj, const char* phase, double si, double amount);
|
VRESULT EQUILIBRIUM_PHASES(IPhreeqc& obj, const char* phase, double si, double amount);
|
||||||
VRESULT USER_PUNCH(IPhreeqc2& obj, const char* element, int max);
|
VRESULT USER_PUNCH(IPhreeqc& obj, const char* element, int max);
|
||||||
VRESULT SELECTED_OUTPUT(IPhreeqc2& obj);
|
VRESULT SELECTED_OUTPUT(IPhreeqc& obj);
|
||||||
VRESULT DUMP(IPhreeqc2& obj);
|
VRESULT DUMP(IPhreeqc& obj);
|
||||||
|
|
||||||
void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, bool selected_output_on, bool dump_on);
|
void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, bool selected_output_on, bool dump_on);
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ TestIPhreeqc::~TestIPhreeqc(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestLoadDatabase(void)
|
void TestIPhreeqc::TestLoadDatabase(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
for (int i = 0; i < 10; ++i)
|
for (int i = 0; i < 10; ++i)
|
||||||
{
|
{
|
||||||
CPPUNIT_ASSERT_EQUAL(true, ::FileExists("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(true, ::FileExists("phreeqc.dat"));
|
||||||
@ -111,7 +111,7 @@ void TestIPhreeqc::TestLoadDatabaseString(void)
|
|||||||
" log_k -14.0; -gamma 1e7 0.0\n"
|
" log_k -14.0; -gamma 1e7 0.0\n"
|
||||||
"END\n";
|
"END\n";
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabaseString(ex15_dat));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabaseString(ex15_dat));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ void TestIPhreeqc::TestLoadDatabaseMissingFile(void)
|
|||||||
{
|
{
|
||||||
CPPUNIT_ASSERT_EQUAL(false, ::FileExists("missing.file"));
|
CPPUNIT_ASSERT_EQUAL(false, ::FileExists("missing.file"));
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(1, obj.LoadDatabase("missing.file"));
|
CPPUNIT_ASSERT_EQUAL(1, obj.LoadDatabase("missing.file"));
|
||||||
CPPUNIT_ASSERT_EQUAL(1, obj.LoadDatabase("missing.file"));
|
CPPUNIT_ASSERT_EQUAL(1, obj.LoadDatabase("missing.file"));
|
||||||
@ -140,7 +140,7 @@ void TestIPhreeqc::TestLoadDatabaseWithErrors(void)
|
|||||||
assert(n0 == 0);
|
assert(n0 == 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
for (int i = 0; i < 10; ++i)
|
for (int i = 0; i < 10; ++i)
|
||||||
{
|
{
|
||||||
@ -189,7 +189,7 @@ void TestIPhreeqc::TestRun(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool files_on = false;
|
bool files_on = false;
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("solution 12"));
|
CPPUNIT_ASSERT_EQUAL(VR_OK, obj.AccumulateLine("solution 12"));
|
||||||
obj.SetOutputOn(files_on);
|
obj.SetOutputOn(files_on);
|
||||||
@ -203,7 +203,7 @@ void TestIPhreeqc::TestRun(void)
|
|||||||
void TestIPhreeqc::TestRunWithErrors(void)
|
void TestIPhreeqc::TestRunWithErrors(void)
|
||||||
{
|
{
|
||||||
const char dump_file[] = "error.inp";
|
const char dump_file[] = "error.inp";
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
// remove dump file if it exists
|
// remove dump file if it exists
|
||||||
//
|
//
|
||||||
@ -254,7 +254,7 @@ void TestIPhreeqc::TestRunFile(void)
|
|||||||
CPPUNIT_ASSERT(::DeleteFile(dump_file));
|
CPPUNIT_ASSERT(::DeleteFile(dump_file));
|
||||||
}
|
}
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
obj.SetOutputOn(false);
|
obj.SetOutputOn(false);
|
||||||
@ -350,7 +350,7 @@ void TestIPhreeqc::TestRunString(void)
|
|||||||
"END\n"
|
"END\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
if (::FileExists("phreeqc.out"))
|
if (::FileExists("phreeqc.out"))
|
||||||
{
|
{
|
||||||
@ -374,7 +374,7 @@ void TestIPhreeqc::TestRunString(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestGetSelectedOutputRowCount(void)
|
void TestIPhreeqc::TestGetSelectedOutputRowCount(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("llnl.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("llnl.dat"));
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ void TestIPhreeqc::TestGetSelectedOutputValue(void)
|
|||||||
{
|
{
|
||||||
int col;
|
int col;
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("llnl.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("llnl.dat"));
|
||||||
|
|
||||||
@ -997,7 +997,7 @@ EXPECTED selected.out:
|
|||||||
|
|
||||||
void TestIPhreeqc::TestGetSelectedOutputColumnCount(void)
|
void TestIPhreeqc::TestGetSelectedOutputColumnCount(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("llnl.dat"));
|
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("llnl.dat"));
|
||||||
CPPUNIT_ASSERT_EQUAL( 0, obj.GetSelectedOutputColumnCount() );
|
CPPUNIT_ASSERT_EQUAL( 0, obj.GetSelectedOutputColumnCount() );
|
||||||
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(obj, 1.0, 1.0, 1.0) );
|
CPPUNIT_ASSERT_EQUAL( VR_OK, SOLUTION(obj, 1.0, 1.0, 1.0) );
|
||||||
@ -1009,7 +1009,7 @@ void TestIPhreeqc::TestGetSelectedOutputColumnCount(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestAddError(void)
|
void TestIPhreeqc::TestAddError(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
|
|
||||||
@ -1066,7 +1066,7 @@ void TestIPhreeqc::TestRunWithCallback(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestRunNoDatabaseLoaded(void)
|
void TestIPhreeqc::TestRunNoDatabaseLoaded(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
obj.UnLoadDatabase();
|
obj.UnLoadDatabase();
|
||||||
obj.SetOutputOn(false);
|
obj.SetOutputOn(false);
|
||||||
@ -1092,7 +1092,7 @@ void TestIPhreeqc::TestCase1(void)
|
|||||||
// output_isopen(OUTPUT_PUNCH) == FALSE
|
// output_isopen(OUTPUT_PUNCH) == FALSE
|
||||||
// selected_output_on == TRUE
|
// selected_output_on == TRUE
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
// remove punch file if it exists
|
// remove punch file if it exists
|
||||||
if (::FileExists("selected.out"))
|
if (::FileExists("selected.out"))
|
||||||
@ -1138,7 +1138,7 @@ void TestIPhreeqc::TestCase2(void)
|
|||||||
// output_isopen(OUTPUT_PUNCH) == FALSE
|
// output_isopen(OUTPUT_PUNCH) == FALSE
|
||||||
// selected_output_on == TRUE
|
// selected_output_on == TRUE
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
// remove punch files if they exists
|
// remove punch files if they exists
|
||||||
//
|
//
|
||||||
@ -1206,7 +1206,7 @@ void TestIPhreeqc::TestCase2(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestPrintSelectedOutputFalse(void)
|
void TestIPhreeqc::TestPrintSelectedOutputFalse(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
// remove punch files if they exists
|
// remove punch files if they exists
|
||||||
//
|
//
|
||||||
@ -1322,7 +1322,7 @@ void TestIPhreeqc::TestSelOutOnOff()
|
|||||||
|
|
||||||
void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, bool selected_output_on, bool dump_on)
|
void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on, bool selected_output_on, bool dump_on)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
// remove FILENAME if it exists
|
// remove FILENAME if it exists
|
||||||
//
|
//
|
||||||
@ -1419,7 +1419,7 @@ void TestOnOff(const char* FILENAME, bool output_on, bool error_on, bool log_on,
|
|||||||
}
|
}
|
||||||
|
|
||||||
VRESULT
|
VRESULT
|
||||||
SOLUTION(IPhreeqc2& obj, double C, double Ca, double Na)
|
SOLUTION(IPhreeqc& obj, double C, double Ca, double Na)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
|
||||||
@ -1432,7 +1432,7 @@ SOLUTION(IPhreeqc2& obj, double C, double Ca, double Na)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VRESULT
|
VRESULT
|
||||||
EQUILIBRIUM_PHASES(IPhreeqc2& obj, const char* phase, double si, double amount)
|
EQUILIBRIUM_PHASES(IPhreeqc& obj, const char* phase, double si, double amount)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
|
||||||
@ -1442,7 +1442,7 @@ EQUILIBRIUM_PHASES(IPhreeqc2& obj, const char* phase, double si, double amount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VRESULT
|
VRESULT
|
||||||
USER_PUNCH(IPhreeqc2& obj, const char* element, int max)
|
USER_PUNCH(IPhreeqc& obj, const char* element, int max)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
|
||||||
@ -1477,7 +1477,7 @@ USER_PUNCH(IPhreeqc2& obj, const char* element, int max)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VRESULT
|
VRESULT
|
||||||
SELECTED_OUTPUT(IPhreeqc2& obj)
|
SELECTED_OUTPUT(IPhreeqc& obj)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
|
||||||
@ -1489,7 +1489,7 @@ SELECTED_OUTPUT(IPhreeqc2& obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VRESULT
|
VRESULT
|
||||||
DUMP(IPhreeqc2& obj)
|
DUMP(IPhreeqc& obj)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "DUMP" << "\n";
|
oss << "DUMP" << "\n";
|
||||||
@ -1502,7 +1502,7 @@ void TestIPhreeqc::TestLongHeadings()
|
|||||||
char long_header[] = "this_is_a_long_header_0123456789012345678901234567890123456789";
|
char long_header[] = "this_is_a_long_header_0123456789012345678901234567890123456789";
|
||||||
char long_value[] = "this_is_a_long_value_01234567890123456789012345678901234567890";
|
char long_value[] = "this_is_a_long_value_01234567890123456789012345678901234567890";
|
||||||
|
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
|
|
||||||
@ -1545,7 +1545,7 @@ void TestIPhreeqc::TestLongHeadings()
|
|||||||
|
|
||||||
void TestIPhreeqc::TestDatabaseKeyword()
|
void TestIPhreeqc::TestDatabaseKeyword()
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
obj.SetOutputOn(false);
|
obj.SetOutputOn(false);
|
||||||
@ -1566,7 +1566,7 @@ void TestIPhreeqc::TestDatabaseKeyword()
|
|||||||
|
|
||||||
void TestIPhreeqc::TestDumpString()
|
void TestIPhreeqc::TestDumpString()
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
|
|
||||||
@ -1649,7 +1649,7 @@ void TestIPhreeqc::TestDumpString()
|
|||||||
|
|
||||||
void TestIPhreeqc::TestGetDumpLineCount(void)
|
void TestIPhreeqc::TestGetDumpLineCount(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
|
|
||||||
@ -1674,7 +1674,7 @@ void TestIPhreeqc::TestGetDumpLineCount(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestGetDumpLine(void)
|
void TestIPhreeqc::TestGetDumpLine(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
CPPUNIT_ASSERT_EQUAL(0, obj.LoadDatabase("phreeqc.dat"));
|
||||||
|
|
||||||
@ -1771,7 +1771,7 @@ void TestIPhreeqc::TestGetDumpLine(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestGetComponentCount(void)
|
void TestIPhreeqc::TestGetComponentCount(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("phreeqc.dat") );
|
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("phreeqc.dat") );
|
||||||
|
|
||||||
@ -1791,7 +1791,7 @@ void TestIPhreeqc::TestGetComponentCount(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestGetComponent(void)
|
void TestIPhreeqc::TestGetComponent(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("phreeqc.dat") );
|
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("phreeqc.dat") );
|
||||||
|
|
||||||
@ -1822,7 +1822,7 @@ void TestIPhreeqc::TestGetComponent(void)
|
|||||||
|
|
||||||
void TestIPhreeqc::TestListComponents(void)
|
void TestIPhreeqc::TestListComponents(void)
|
||||||
{
|
{
|
||||||
IPhreeqc2 obj;
|
IPhreeqc obj;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("phreeqc.dat") );
|
CPPUNIT_ASSERT_EQUAL( 0, obj.LoadDatabase("phreeqc.dat") );
|
||||||
|
|
||||||
|
|||||||
@ -408,7 +408,7 @@ TestSelectedOutput::TestEndRow2()
|
|||||||
void
|
void
|
||||||
TestSelectedOutput::TestTooManyHeadings()
|
TestSelectedOutput::TestTooManyHeadings()
|
||||||
{
|
{
|
||||||
IPhreeqc2 p;
|
IPhreeqc p;
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(0u, p.SelectedOutput->GetColCount());
|
CPPUNIT_ASSERT_EQUAL(0u, p.SelectedOutput->GetColCount());
|
||||||
CPPUNIT_ASSERT_EQUAL(0u, p.SelectedOutput->GetRowCount());
|
CPPUNIT_ASSERT_EQUAL(0u, p.SelectedOutput->GetRowCount());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user