# HG changeset patch # User pyon@macmini # Date 1317900474 -32400 # Node ID 3b734fd6ee2b6203d5d2a95073a364e35df1f659 # Parent a505f7417742eadf68e96c693a67315a31f4015b v0.2 diff -r a505f7417742 -r 3b734fd6ee2b include/marksheet.h --- a/include/marksheet.h Thu Oct 06 07:56:12 2011 +0900 +++ b/include/marksheet.h Thu Oct 06 20:27:54 2011 +0900 @@ -1,5 +1,5 @@ // Filename : marksheet.h -// Last Change: 05-Oct-2011. +// Last Change: 06-Oct-2011. // #ifndef __MARKSHEET__ #define __MARKSHEET__ @@ -77,13 +77,13 @@ if( IsBlack( (int)r, (int)g, (int)b ) ) black++; } float z = (float)black / h; - float zmin = 0.103428 * 0.95; - float zmax = 0.103428 * 1.05; + float zmin = 0.095713; + float zmax = 0.108600; wxFile f( file ); long l = f.Length(); - float lmin = 2181468 * 0.95; - float lmax = 2181468 * 1.05; + float lmin = 2072393; + float lmax = 2346082; //wxPuts(wxString::Format(wxT("z = %f, len = %d"),z,len)); if ( zmin < z && z < zmax diff -r a505f7417742 -r 3b734fd6ee2b include/myframe.h --- a/include/myframe.h Thu Oct 06 07:56:12 2011 +0900 +++ b/include/myframe.h Thu Oct 06 20:27:54 2011 +0900 @@ -1,5 +1,5 @@ // Filename : myframe.h -// Last Change: 05-Oct-2011. +// Last Change: 06-Oct-2011. // #ifndef MYFRAME #define MYFRAME @@ -67,6 +67,7 @@ void OnDetectWhite( wxCommandEvent& event ); void SetDir( wxCommandEvent& event ); void MakeDir( wxCommandEvent& event ); + void OnOpenHhsDir(wxListEvent& event); void MoveImages( wxCommandEvent& event ); void SaveConfig( wxCloseEvent& event ); void TellLocation( void ); diff -r a505f7417742 -r 3b734fd6ee2b include/symbol.h --- a/include/symbol.h Thu Oct 06 07:56:12 2011 +0900 +++ b/include/symbol.h Thu Oct 06 20:27:54 2011 +0900 @@ -1,10 +1,10 @@ // Filename : symbol.h -// Last Change: 01-Oct-2011. +// Last Change: 06-Oct-2011. // #define MYAPPNAME wxT("AMover") #define VER 0 -#define REV 01 +#define REV 02 #define BLD 20111011 diff -r a505f7417742 -r 3b734fd6ee2b src/myframe.cpp --- a/src/myframe.cpp Thu Oct 06 07:56:12 2011 +0900 +++ b/src/myframe.cpp Thu Oct 06 20:27:54 2011 +0900 @@ -1,5 +1,5 @@ // Filename : mainframe.cpp -// Last Change: 05-Oct-2011. +// Last Change: 06-Oct-2011. // #include "symbol.h" #include "common.h" @@ -170,6 +170,7 @@ EVT_BUTTON( ID_STDIR, MyFrame::SetDir ) EVT_BUTTON( ID_MKDIR, MyFrame::MakeDir ) EVT_BUTTON( ID_DOMOVE, MyFrame::MoveImages ) + EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnOpenHhsDir ) EVT_CLOSE( MyFrame::SaveConfig ) END_EVENT_TABLE() @@ -312,18 +313,32 @@ } m_listCtrl->SetItem( r-1, 2, wxString::Format(wxT("%d"),cnt), -1 ); // ファイル数 if ( cnt < 5 ) m_listCtrl->SetItemTextColour( r, *wxRED ); + if ( cnt > 5 ) m_listCtrl->SetItemTextColour( r, *wxBLUE ); wxString cmd = wxT("explorer ") + dirname; wxExecute( cmd ); } +/* 被保険者のフォルダを開く */ +void MyFrame::OnOpenHhsDir(wxListEvent& WXUNUSED(event)) +{ + wxString hhsdir = m_textCtrlMoveDir->GetValue(); + hhsdir.Append( wxFILE_SEP_PATH ); + long n = m_listCtrl->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); + wxListItem item; + item.SetId(n); + m_listCtrl->GetColumn( 1, item ); + hhsdir.Append( item.GetText() ); + wxMessageBox(hhsdir); + //wxString execmd = wxT("explorer ") + hhsdir; +} + /* 作業フォルダを開く */ void MyFrame::OnOpenWorkDir(wxCommandEvent& WXUNUSED(event)) { wxString workdir = m_dirPickerWork->GetPath(); wxString execmd = wxT("explorer ") + workdir; wxExecute( execmd ); - return; } diff -r a505f7417742 -r 3b734fd6ee2b src/testtune.cpp --- a/src/testtune.cpp Thu Oct 06 07:56:12 2011 +0900 +++ b/src/testtune.cpp Thu Oct 06 20:27:54 2011 +0900 @@ -1,10 +1,11 @@ // Filename : testtune.cpp -// Last Change: 29-Sep-2011. +// Last Change: 06-Oct-2011. // #include "wx/utils.h" #include "wx/file.h" #include "wx/string.h" +#include "wx/app.h" #include "wx/image.h" bool IsBlack( int r, int g, int b ) @@ -74,15 +75,15 @@ if( IsBlack( (int)r, (int)g, (int)b ) ) black++; } float z = (float)black / h; - float zmin = 0.103428 * 0.95; - float zmax = 0.103428 * 1.05; + float zmin = 0.095713; + float zmax = 0.108600; wxFile f( file ); long l = f.Length(); - float lmin = 2181468 * 0.95; - float lmax = 2181468 * 1.05; + float lmin = 2072393; + float lmax = 2346082; - //wxPuts(wxString::Format(wxT("z = %f, len = %d"),z,len)); + wxPuts(wxString::Format(wxT("z = %f, len = %d"),z,l)); if ( zmin < z && z < zmax && lmin < l && l < lmax ) { return true; @@ -93,9 +94,15 @@ int main( int argc, char **argv ) { wxInitAllImageHandlers(); - wxString file = wxT("img\\img081.jpg"); + //wxString file = wxT("nodetect/img045.jpg"); + //wxString file = wxT("nodetect/img073.jpg"); + //wxString file = wxT("nodetect/img174.jpg"); + //wxString file = wxT("nodetect/img182.jpg"); + //wxString file = wxT("nodetect/img246.jpg"); + //wxString file = wxT("nodetect/img268.jpg"); + wxString file = wxT("nodetect/img294.jpg"); - if ( IsMarksheet( file ) ) wxPuts(wxT("perhaps marksheet !")); + if ( IsMarksheet( file ) ) wxPuts(file+wxT(" is perhaps marksheet !")); wxString hhs = GuessHhs( file ); wxPuts(hhs);