diff --git a/IOB-MAN/IOBManPanel.cs b/IOB-MAN/IOBManPanel.cs index f50a7b75..d8c2a0b4 100644 --- a/IOB-MAN/IOBManPanel.cs +++ b/IOB-MAN/IOBManPanel.cs @@ -38,7 +38,6 @@ namespace IOB_MAN private void btnOpen_Click(object sender, EventArgs e) { apriChild(); - //apriDumpAgent(); } private void apriChild() diff --git a/IOB-UT/baseUtils.cs b/IOB-UT/baseUtils.cs index 07cb547b..e5ffd8ad 100644 --- a/IOB-UT/baseUtils.cs +++ b/IOB-UT/baseUtils.cs @@ -342,20 +342,27 @@ namespace IOB_UT { NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); String sIpAddr = string.Empty; - foreach (NetworkInterface adapter in nics) + try { - if (sIpAddr == String.Empty)// only return IP Address from first card + foreach (NetworkInterface adapter in nics) { - IPInterfaceProperties properties = adapter.GetIPProperties(); - foreach (var item in properties.UnicastAddresses) + if (sIpAddr == String.Empty)// only return IP Address from first card { - if (item.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + IPInterfaceProperties properties = adapter.GetIPProperties(); + foreach (var item in properties.UnicastAddresses) { - sIpAddr = item.Address.ToString(); + if (item.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + { + sIpAddr = item.Address.ToString(); + } } } } } + catch(Exception exc) + { + lg.Error(exc); + } return sIpAddr; } /// diff --git a/IOB-WIN/AdapterForm.cs b/IOB-WIN/AdapterForm.cs index 56b2cd4a..efb8eafd 100644 --- a/IOB-WIN/AdapterForm.cs +++ b/IOB-WIN/AdapterForm.cs @@ -113,21 +113,7 @@ namespace IOB_WIN #region gestione form e visibilità - /// - /// apre agent di dump in CMD - /// - private static void apriDumpAgent() - { - string path = Application.StartupPath; - try - { - Process.Start(string.Format(@"{0}\..\..\dump\dump.exe", path)); - } - catch - { - Process.Start(string.Format(@"{0}\dump\dump.exe", path)); - } - } + /// /// File configurazione default /// @@ -661,12 +647,6 @@ namespace IOB_WIN // fix buttons start/stop/dump start.Enabled = false; stop.Enabled = true; - if (utils.CRB("openDumpOnStart")) - { - displayTaskAndLog("Dump Window starting"); - apriDumpAgent(); - displayTaskAndLog("Dump Windows OK"); - } displayTaskAndLog("Start Timers"); // inizializzo contatori fast/mid/slow diff --git a/IOB-WIN/App.config b/IOB-WIN/App.config index 08d8a6a8..dfbab3bd 100644 --- a/IOB-WIN/App.config +++ b/IOB-WIN/App.config @@ -38,7 +38,6 @@ - diff --git a/IOB-WIN/IOB-WIN.csproj b/IOB-WIN/IOB-WIN.csproj index 7b1a475f..59e07daa 100644 --- a/IOB-WIN/IOB-WIN.csproj +++ b/IOB-WIN/IOB-WIN.csproj @@ -106,10 +106,6 @@ TestForm.cs - - - Always - Always @@ -201,11 +197,6 @@ Always - - - - PreserveNewest - Designer diff --git a/IOB-WIN/IobSiemensTorri.cs b/IOB-WIN/IobSiemensTorri.cs index 0a2f1c5a..c5885913 100644 --- a/IOB-WIN/IobSiemensTorri.cs +++ b/IOB-WIN/IobSiemensTorri.cs @@ -348,8 +348,10 @@ namespace IOB_WIN { answ = string.Format(@"{0}\{1}", utils.confDir, utils.CRS(keyFile)); } - catch - { } + catch(Exception exc) + { + lg.Error(exc); + } return answ; } diff --git a/IOB-WIN/MainForm.cs b/IOB-WIN/MainForm.cs index a168a6a3..08dcc6d0 100644 --- a/IOB-WIN/MainForm.cs +++ b/IOB-WIN/MainForm.cs @@ -413,7 +413,12 @@ namespace IOB_WIN // ferma tutti i child form... foreach (var ChildForm in this.MdiChildren) { - ChildForm.Close(); + try + { + ChildForm.Close(); + } + catch + { } } } diff --git a/IOB-WIN/Program.cs b/IOB-WIN/Program.cs index fffacbee..15225e03 100644 --- a/IOB-WIN/Program.cs +++ b/IOB-WIN/Program.cs @@ -6,11 +6,6 @@ namespace IOB_WIN { static class Program { - [DllImport("kernel32.dll", SetLastError = true)] - static extern bool AllocConsole(); - - [DllImport("kernel32.dll", SetLastError = true)] - static extern bool FreeConsole(); /// /// Punto di ingresso principale dell'applicazione. /// @@ -19,7 +14,12 @@ namespace IOB_WIN { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); + try + { + Application.Run(new MainForm()); + } + catch(Exception exc) + { } } } } diff --git a/IOB-WIN/dump/Test.bat b/IOB-WIN/dump/Test.bat deleted file mode 100644 index e80e3f07..00000000 --- a/IOB-WIN/dump/Test.bat +++ /dev/null @@ -1 +0,0 @@ -ping -t %1 \ No newline at end of file diff --git a/IOB-WIN/dump/build.bat b/IOB-WIN/dump/build.bat deleted file mode 100644 index afc9d957..00000000 --- a/IOB-WIN/dump/build.bat +++ /dev/null @@ -1 +0,0 @@ -cl dump.c ws2_32.lib \ No newline at end of file diff --git a/IOB-WIN/dump/dump.c b/IOB-WIN/dump/dump.c deleted file mode 100644 index cad2cef3..00000000 --- a/IOB-WIN/dump/dump.c +++ /dev/null @@ -1,184 +0,0 @@ -#include -#ifdef _WIN32 -#include -#else -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#include -#include - -#define PORT 7878 -#define HOST "localhost" -#define BUFFER_SIZE 1024 - -#ifndef _WIN32 -#define SOCKET int -#define closesocket close -#endif - -void cleanup_and_exit(int ret) -{ -#ifdef _WIN32 - WSACleanup(); -#endif - exit(ret); -} - -void usage() -{ - fprintf(stderr, "Usage: dump [-t timeout] [host] [port] [file]\n host defaults to localhost\n port defaults to 7878\n file defaults to stdout\n"); - exit(0); -} - -int main(int argc, char **argv) -{ - char hostname[100]; - SOCKET sd; - struct sockaddr_in pin; - struct hostent *hp; - char buffer[BUFFER_SIZE]; - int port; - FILE *file; - char dump = 0; - char **argvp = argv; - time_t start = 0; - int remaining = 1, timeout = 0, nfds; - struct fd_set fds; - struct timeval tv, *tvp = 0; - -#ifdef _WIN32 - WSADATA wsaData; - if (WSAStartup(MAKEWORD(2,0), &wsaData) != 0) { - fprintf(stderr, "WSAStartup failed\n"); - cleanup_and_exit(1); - } -#endif - - if (argc > 1) { - if (strcmp(argv[1], "-h") == 0) { - usage(); - } else if (strcmp(argv[1], "-t") == 0) { - if (argc < 3) { - fprintf(stderr, "Missing timeout argument\n"); - usage(); - } - timeout = atoi(argv[2]); - argc -= 2; - argvp += 2; - } - } - - strcpy(hostname,HOST); - if (argc > 1) { - strcpy(hostname,argvp[1]); - } - - port = PORT; - if (argc > 2) { - port = atoi(argvp[2]); - } - - file = stdout; - if (argc > 3) { - file = fopen(argvp[3], "w"); - if (file == NULL) { - perror("fopen"); - fprintf(stderr, "Cannot open file %s\n", argv[3]); - exit(1); - } - dump = 1; - } - - /* go find out about the desired host machine */ - if ((hp = gethostbyname(hostname)) == (void*) 0) { - perror("gethostbyname"); - cleanup_and_exit(1); - } - - /* fill in the socket structure with host information */ - memset(&pin, 0, sizeof(pin)); - pin.sin_family = AF_INET; - memcpy(&pin.sin_addr.s_addr, hp->h_addr, hp->h_length); - pin.sin_port = htons(port); - - /* grab an Internet domain socket */ - if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { - perror("socket"); - cleanup_and_exit(1); - } - - /* connect to PORT on HOST */ - if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) { - perror("connect"); - cleanup_and_exit(1); - } - - if (dump) { - printf("Connected to %s port %d\n", hostname, port); - } - - /* wait for a message to come back from the server */ - if (timeout > 0) { - start = time(0); - remaining = timeout; - tv.tv_usec = 0; - tvp = &tv; - } -#ifdef _WIN32 - nfds = 1; -#else - nfds = sd + 1; -#endif - while (remaining > 0) { - int n; - - FD_ZERO(&fds); - FD_SET(sd, &fds); - tv.tv_sec = remaining; - n = select(nfds, &fds, (fd_set*) 0, (fd_set*) 0, tvp); - if (n < 0) { - closesocket(sd); - perror("recv"); - cleanup_and_exit(1); - } else if (n > 0) { - int count = recv(sd, buffer, BUFFER_SIZE, 0); - if (count == -1) { - closesocket(sd); - perror("recv"); - cleanup_and_exit(1); - } - if (count == 0) - break; - fwrite(buffer, 1, count, file); - if (dump) { - fputc('.', stdout); - fflush(stdout); - } - fflush(file); - } - - if (timeout > 0) { - time_t now = time(0); - remaining -= (int) (now - start); - start = now; - } - } - - if (dump) printf("\nFinished\n"); - - fclose(file); - closesocket(sd); -#ifdef _WIN32 - WSACleanup(); -#endif - - return 0; -} diff --git a/IOB-WIN/dump/dump.exe b/IOB-WIN/dump/dump.exe deleted file mode 100644 index caa249c9..00000000 Binary files a/IOB-WIN/dump/dump.exe and /dev/null differ diff --git a/Jenkinsfile b/Jenkinsfile index b3510953..4d21bc5b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=199']) { + withEnv(['NEXT_BUILD_NUMBER=200']) { // env.versionNumber = VersionNumber(versionNumberString : '1.17.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '1.17.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'