From 8c474f47efc55d30a7e457eddcbc73a4b10c670b Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 7 Jan 2009 15:52:24 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2010.?= =?UTF-8?q?0=20Files=20correlati=20=20=20=20=20:=20ba1.exe=20Ricompilazion?= =?UTF-8?q?e=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20:=200001036:=20installazione=20cd=20patch=20180=20Install?= =?UTF-8?q?ando=20ex=20novo=20ed=20indicando=20una=20societ=C3=A0=20esiste?= =?UTF-8?q?nte=20di=20dati=20su=20una=20cartella=20diversa=20viene=20segna?= =?UTF-8?q?lato=20l'errore=20ba1.exe=20in=20fase=20di=20conversione=20arch?= =?UTF-8?q?ivi,=20richiamando=20da=20manutenzione=20archivi=20la=20convers?= =?UTF-8?q?ione=20vengono=20generati=20gli=20errori=20allegati.=20Nell'are?= =?UTF-8?q?a=20ftp=20di=20Aga,=20cartella=20Ilaria=20allego=20l'area=20dat?= =?UTF-8?q?i=20SIDA=20per=20il=20test.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@17993 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba1103.cpp | 29 +++++++++++++++++++-- ba/ba1200.cpp | 71 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 95 insertions(+), 5 deletions(-) diff --git a/ba/ba1103.cpp b/ba/ba1103.cpp index 6cc76134b..4dc01a50e 100755 --- a/ba/ba1103.cpp +++ b/ba/ba1103.cpp @@ -142,6 +142,17 @@ bool save_campo_xml() if (!root.Load(filename)) root.SetTag("Campo"); + TXmlItem& system = find_or_create_child(root, "system"); + char host[_MAX_PATH]; + xvt_sys_get_host_name(host, sizeof(host)); + system.SetAttr("Host", host); + xvt_sys_get_user_name(host, sizeof(host)); + system.SetAttr("User", host); + time_t t; time(&t); + system.SetAttr("Time", ctime(&t)); + xvt_sys_get_version(host, NULL, sizeof(host)); + system.SetAttr("O.S.", host); + if (prefix_valid()) { TXmlItem& study = find_or_create_child(root, "study", true); @@ -162,9 +173,7 @@ bool save_campo_xml() } TXmlItem& study = find_or_create_child(root, "study"); - char host[_MAX_PATH]; xvt_sys_get_host_name(host, sizeof(host)); - study.SetAttr("Host", host); study.SetAttr("DataPath", firm2dir(-1)); study.SetAttr("ExePath", main_app().argv(0)); @@ -174,6 +183,17 @@ bool save_campo_xml() chiavetta.SetAttr("Users", d.max_users()); chiavetta.SetAttr("Year", d.year_assist()); chiavetta.SetAttr("Update", d.last_update().string()); + switch (d.hardware()) + { + case _dongle_hardlock: chiavetta.SetAttr("Model", "Hardlock"); break; + case _dongle_eutron : chiavetta.SetAttr("Model", "Eutron"); break; + case _dongle_network : + chiavetta.SetAttr("Model", "Network server"); + xvt_sys_get_profile_string(NULL, "Server", "Dongle", "", host, sizeof(host)); + chiavetta.SetAttr("Server", host); + break; + default: chiavetta.SetAttr("Model", "Unknown"); break; + } TConfig ini("install.ini", "Main"); for (word m = 1; m < ENDAUT; m++) if (d.active(m)) @@ -198,6 +218,11 @@ bool send_campo_xml() { TWait_cursor waiter; bool ok = false; + +#ifdef NDEBUG + if (dongle().number() || !is_power_station()) // Non salvare attivazioni di prova interne +#endif + if (save_campo_xml()) { if (xvt_net_get_status() & 0x7) diff --git a/ba/ba1200.cpp b/ba/ba1200.cpp index 3529c7caa..9b6f581e7 100755 --- a/ba/ba1200.cpp +++ b/ba/ba1200.cpp @@ -27,6 +27,7 @@ TProfiler_mask::TProfiler_mask() : TMask(TR("Test"), 1, 60, 9) codes.add(3); items.add(TR("Lettura cursore con ordinamento fuori chiave")); codes.add(4); items.add(TR("Lettura causale con cache")); codes.add(5); items.add(TR("Creazione e cancellazione records")); + codes.add(6); items.add(TR("Creazione e cancellazione records in modo esclusivo")); add_radio(101, 0, TR("@bSelezione test"), 1, 1, 58, codes, items); add_number(102, 0, PR("Numero di iterazioni"), 1, 0, 3, "U"); @@ -51,7 +52,7 @@ protected: bool test3(TLog_report& log); bool test4(TLog_report& log); bool test5(TLog_report& log); - + bool test6(TLog_report& log); public: bool test(int n, TLog_report& log); @@ -243,7 +244,7 @@ bool TTest_application::test5(TLog_report& log) { bool ok = true; TString msg; - TRecnotype n = 200; + TRecnotype n = 100; if (n > 0) { @@ -293,6 +294,69 @@ bool TTest_application::test5(TLog_report& log) return ok; } +bool TTest_application::test6(TLog_report& log) +{ + bool ok = true; + TString msg; + TRecnotype n = 10000; + + if (n > 0) + { + TSystemisamfile tab(LF_TAB); + tab.open(_excllock); + msg.format("Creazione di %ld records", n); + const clock_t start = start_progind(n, msg); + int i; + for (i = 0; i < n; i++) + { + tab.curr().put("COD", "CZZ"); + tab.curr().put("CODTAB", i+1); + tab.write(); + if (!_pi->addstatus(1)) + { + log.log(1, TR("Interrotto dall'utente")); + ok = false; + break; + } + } + const clock_t t = stop_progind() - start; + msg.format("Scritti %ld records in %ld msec - %lg records per sec", i, t, 1000.0*i/t); + log.log(0, msg); + tab.close(); + } + + if (n > 0) + { + TSystemisamfile tab(LF_TAB); + tab.open(_excllock); + + TRelation rel("CZZ"); + TCursor cur(&rel); + n = cur.items(); + cur.freeze(); + + msg.format("Cancellazione %ld records", n); + const clock_t start = start_progind(n, msg); + for (cur = 0; cur.pos() < n; ++cur) + { + tab.put("COD", cur.curr().get("COD")); + tab.put("CODTAB", cur.curr().get("CODTAB")); + tab.remove(); + if (!_pi->addstatus(1)) + { + log.log(1, TR("Interrotto dall'utente")); + ok = false; + break; + } + } + const clock_t t = stop_progind() - start; + msg.format("Cancellati %ld records in %ld msec - %lg records per sec", n, t, 1000.0*n/t); + log.log(0, msg); + tab.close(); + } + return ok; +} + bool TTest_application::test(int n, TLog_report& log) { bool ok = false; @@ -303,6 +367,7 @@ bool TTest_application::test(int n, TLog_report& log) case 3: ok = test3(log); break; case 4: ok = test4(log); break; case 5: ok = test5(log); break; + case 6: ok = test6(log); break; default: ok = false; break; } return ok; @@ -343,7 +408,7 @@ void TTest_application::main_loop() TLog_report log(TR("Report")); bool ok = true; - for (int t = 1; ok && t <= 5; t++) + for (int t = 1; ok && t <= 6; t++) { if (te <= 0 || te == t) {