Patch level : 10.0 272

Files correlati     :  ca2.exe 
Ricompilazione Demo : [ ]
Commento            :

Aggiunto esecuzione ripetuta dell' invio a Board. 
La linea di comando è ca2 -4 -M -uADMIN


git-svn-id: svn://10.65.10.50/branches/R_10_00@23208 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2016-07-07 08:37:52 +00:00
parent 8494445c99
commit a379b353fe

View File

@ -10,6 +10,7 @@
class TBoard_msk : public TAutomask
{
protected:
virtual long handler(WINDOW task, EVENT* ep);
virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly);
void update_sheet();
public:
@ -46,6 +47,16 @@ void TBoard_msk::update_sheet()
s.force_update();
}
long TBoard_msk::handler(WINDOW task, EVENT* ep)
{
if (ep->type == E_TIMER)
{
if (is_running())
stop_run(K_ENTER);
}
return TAutomask::handler(task, ep);
}
bool TBoard_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
{
switch (o.dlg())
@ -230,6 +241,39 @@ bool TBoard_app::esporta(const TString& DSN, TIsam_handle lf, const TDate& datef
void TBoard_app::main_loop()
{
TBoard_msk m;
bool batch = false;
if (argc() > 2)
{
const TFixed_string a(argv(2));
batch = toupper(a[1]) == 'M';
}
if (batch)
{
const WINDOW task =TASK_WIN;
WINDOW tray = xvt_trayicon_create(task, 10212, name()); // Washing machine
if (tray != NULL_WIN)
xvt_vobj_set_visible(task, FALSE);
xvt_timer_create(m.win(), 60 * 1000L);
while (m.run() == K_ENTER)
{
TSheet_field& s = m.sfield(F_FILES);
const TString& DSN = m.get(F_DSN);
const TDate datef = m.get(F_DATA_INI);
const TDate datet = m.get(F_DATA_FIN);
xvt_vobj_set_visible(task, TRUE);
FOR_EACH_SHEET_ROW(s, r, row) if (row->get_char(0) > ' ')
esporta(DSN, row->get_int(1), datef, datet);
xvt_vobj_set_visible(task, FALSE);
}
xvt_trayicon_destroy(tray);
}
else
{
while (m.run() == K_ENTER)
{
TSheet_field& s = m.sfield(F_FILES);
@ -240,6 +284,7 @@ void TBoard_app::main_loop()
esporta(DSN, row->get_int(1), datef, datet);
}
}
}
int ca2500(int argc, char* argv[])