//---------------------------------------------------------------------------

#ifndef UCppModelFrameH
#define UCppModelFrameH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "UCppModelWrapper.h"
#include <Vcl.ComCtrls.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TCppModelFrame : public TFrame
{
__published:	// IDE-managed Components
	TPanel *Panel1;
	TButton *btReload;
	TButton *btSave;
	TButton *btOptimizeWeights;
	TButton *btOptimizeParams;
	TButton *btCrossVal;
	TButton *btPrintClfINfo;
	TPanel *Panel2;
	TProgressBar *ProgressBar1;
	TPanel *Panel3;
	TButton *btCancel;
	TMemo *MemoMsg;
	void __fastcall btOptimizeWeightsClick(TObject *Sender);
	void __fastcall btOptimizeParamsClick(TObject *Sender);
	void __fastcall btCrossValClick(TObject *Sender);
	void __fastcall btSaveClick(TObject *Sender);
	void __fastcall btCancelClick(TObject *Sender);
	void __fastcall btPrintClfInfoClick(TObject *Sender);
	void __fastcall btReloadClick(TObject *Sender);
private:	// User declarations
 	TCppModelWrapper* CppModel;
static char* _getFullFileName(const char* clfFileName);
public:		// User declarations
	bool CancelPending;
	bool IsWorking;

	int Predict(const double *data, unsigned n_samples, int* y_pred);

	void DisableButtons();
	void EnableButtons();
	__fastcall TCppModelFrame(TComponent* Owner);
	__fastcall ~TCppModelFrame();
};

void ProgressChanged(void * hnd, float progress);
void Finished(void * hnd);
void PrintMessageMultiLine(void * hnd, const char* msg);


//---------------------------------------------------------------------------
extern PACKAGE TCppModelFrame *CppModelFrame;
//---------------------------------------------------------------------------
#endif
