Compare commits

..

378 Commits

Author SHA1 Message Date
= ab2abc7c2e Merge remote-tracking branch 'CMS/develop' into develop 2020-06-24 11:26:08 +02:00
= 8ac729f9bf Merge remote-tracking branch 'refs/remotes/teamdev/develop'
Conflicts:
	Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/processo.ts
	Thermo.Active/wwwroot/src/app_modules_thermo/processo/components/processo.vue
2020-06-24 11:25:37 +02:00
= 6cabb05270 fix produzione e selezione riscaldi 2020-06-24 11:23:55 +02:00
Samuele Locatelli 9515269f39 Fix contention on ncAdapter (high level) maybe? 2020-06-23 18:46:49 +02:00
Samuele Locatelli 821f91b318 Merge branch 'feature/check/alarms' into cleanup 2020-06-23 18:22:38 +02:00
Samuele Locatelli 6c96d8f259 update vers number 2020-06-23 18:18:17 +02:00
Samuele Locatelli ed946dcd33 forced visible for status bit on recipe parameters 2020-06-23 18:18:07 +02:00
Samuele Locatelli 684ccab8a0 Fix path for Active CLient in Release 2020-06-23 18:17:44 +02:00
Samuele Locatelli d88f3f3d47 Prod controller: single NC object + fix naming prod/prod 2020-06-23 18:17:27 +02:00
Samuele Locatelli ce02165197 Warmers controller: single NC object 2020-06-23 18:17:12 +02:00
Samuele Locatelli e53f233f42 Recipe controller: single NC object 2020-06-23 18:17:04 +02:00
Alessio 6789f9162b fix gantt component 2020-06-23 16:44:11 +02:00
Samuele Locatelli aa78101506 change config prod x vue.js UI 2020-06-23 16:09:18 +02:00
Samuele Locatelli fe4f91d4ae only siemens HMI doesn't really disconnect 2020-06-23 15:08:13 +02:00
Samuele Locatelli fcc404f048 fix connect return value 2020-06-23 15:07:30 +02:00
Alessio aefad3422c fix component for the gantt graphic 2020-06-22 17:08:39 +02:00
Alessio 04f67ac97c fix component for the gantt graphic 2020-06-22 17:00:39 +02:00
Alessio 9eefbe43cc fix processo modal 2020-06-22 15:50:43 +02:00
Samuele Locatelli c5bb2f5658 Merge branch 'feature/check/alarms' into develop 2020-06-22 15:22:44 +02:00
Samuele Locatelli 7424af263f Server: with Paolo Possanzini for fixing stsatic json/ttf 2020-06-22 15:22:09 +02:00
Alessio 8e5d1f82cb add component for the gantt graphic 2020-06-22 15:14:31 +02:00
Samuele Locatelli 3bd3c5e516 change on wwwroot data for ActiveClient 2020-06-22 14:20:42 +02:00
Samuele Locatelli f6182aa622 fix path for active client & prettybin 2020-06-22 13:19:58 +02:00
Samuele Locatelli d7590f46fe developer mode for testing client 2020-06-22 13:19:13 +02:00
Samuele Locatelli ed8f87c6d3 Pretty bin for active client! 2020-06-22 13:19:01 +02:00
Alessio d315eaeca2 fix clock 2020-06-22 11:48:17 +02:00
Alessio ee4356105a fix preriscaldo dashboard 2020-06-22 11:19:42 +02:00
Alessio e921177b38 fix preriscaldo dashboard 2020-06-22 11:11:15 +02:00
Alessio a133b5d49a fix preriscaldo dashboard 2020-06-22 10:53:08 +02:00
Alessio de271c10af fix point 7 and 12 2020-06-22 10:20:18 +02:00
Samuele Locatelli a82fc98348 Merge branch 'cleanup' into develop 2020-06-19 19:28:22 +02:00
Samuele Locatelli 5b2841c01b Executed code-cleanup on solution 2020-06-19 19:28:07 +02:00
Samuele Locatelli 5d3edf46c6 Refactoring: MODELS 2020-06-19 19:06:02 +02:00
Samuele Locatelli 50c4d72464 Merge branch 'feature/add/ProdInfo' into develop 2020-06-19 18:39:06 +02:00
Samuele Locatelli 870d525c41 Code cleanup from #if false 2020-06-19 18:36:44 +02:00
= 0b0523cb28 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-19 18:13:38 +02:00
= 34ab4d7adb Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-19 18:08:16 +02:00
= b5d1bc37cf riscaldi inferiore 2020-06-19 18:07:34 +02:00
= fdeb79c7e2 riscaldi con selezioni a lazo :) 2020-06-19 18:00:33 +02:00
Samuele Locatelli cdc7b49387 fixed seed duplicating data for features 2020-06-19 17:22:37 +02:00
Samuele Locatelli c5cd0b1c92 Merge branch 'develop' into feature/add/ProdInfo 2020-06-19 16:38:59 +02:00
Samuele Locatelli a48ca84178 Removed duplicated task for prodInfo check 2020-06-19 16:38:36 +02:00
Samuele Locatelli fa9325c504 Fix DB persistence methods 2020-06-19 16:37:32 +02:00
Alessio 9a7c40e020 fix style programmazione preriscaldo 2020-06-19 15:52:09 +02:00
Alessio 25444bf1a3 fix dashboard 2020-06-19 15:43:10 +02:00
Samuele Locatelli 7a73cc4b08 Merge branch 'develop' into feature/add/ProdInfo 2020-06-19 15:32:38 +02:00
Samuele Locatelli dc17731a5c Completed update of errors istance name 2020-06-19 15:32:29 +02:00
Alessio 32510556d6 add usage of prodService 2020-06-19 15:20:46 +02:00
Samuele Locatelli be747c7e39 UPdate CmsError istance name 2020-06-19 15:17:21 +02:00
Samuele Locatelli 7a48f34fb9 Start vers 0.9.5 2020-06-19 15:04:15 +02:00
Samuele Locatelli 1fe26026b6 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into feature/add/ProdInfo 2020-06-19 14:53:25 +02:00
Alessio 65ee4154f1 fix style buttons opzioni 2020-06-19 14:53:19 +02:00
Samuele Locatelli 18bc2da627 Merge branch 'develop' into feature/add/ProdInfo 2020-06-19 14:50:43 +02:00
Samuele Locatelli 20a829b50b Fix server startup for TMP file creation 2020-06-19 14:50:29 +02:00
Samuele Locatelli b287da9b95 Fix TMP folder ThermoActive 2020-06-19 14:50:07 +02:00
Samuele Locatelli 688420c42b Reading of Warming data: thread delayed 2020-06-19 14:49:42 +02:00
Alessio 279dfb6bb0 fix opzioni 2020-06-19 14:34:35 +02:00
= e6dcbf11ac fix style 2020-06-19 14:07:49 +02:00
= 5e4fecdc6f fix 2020-06-19 14:00:40 +02:00
= c55f0eddcd Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-19 13:55:06 +02:00
= 92b9cea7d8 fix opzioni 2020-06-19 13:54:18 +02:00
Alessio 86370282ed fix point 12 2020-06-19 12:53:24 +02:00
Alessio 6dcffeb72b fix dashboard 2020-06-19 12:43:22 +02:00
Alessio e17d5c25de Merge remote-tracking branch 'origin/develop' into develop 2020-06-19 12:33:30 +02:00
Alessio ad589992f3 add prodService and fix dashboard 2020-06-19 12:33:23 +02:00
= de4dfdcbb0 fix grafici 2020-06-19 12:03:19 +02:00
= 49e3242f3f Merge remote-tracking branch 'CMS/develop' into develop 2020-06-19 11:04:20 +02:00
= dafafbca13 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-19 10:47:48 +02:00
= daf9c93309 fix pirometro inferiore 2020-06-19 10:45:48 +02:00
= eedd1bee1f fix termo superiore 2020-06-19 10:41:47 +02:00
Alessio 5aa519ea72 add list of components and arch-interface to the dashboard 2020-06-19 10:26:55 +02:00
Samuele Locatelli a2efd0d3f3 Merge branch 'develop' into feature/add/ProdInfo 2020-06-18 17:14:37 +02:00
Samuele Locatelli 62b0a6d481 forced recipe param error false in debug for UI 2020-06-18 17:14:24 +02:00
= 20013ef3e4 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-18 17:10:29 +02:00
= 4a4223957d fix 2020-06-18 17:10:17 +02:00
Samuele Locatelli bbc5d131ad New risk data (actual) from Marco Carissoni, new version 2020-06-18 17:02:05 +02:00
Samuele Locatelli 2741c56a22 commented actual visible/enabled for recipe for UI 2020-06-18 17:01:26 +02:00
Alessio e12c5e6b62 fix point 8 and 6 2020-06-18 16:50:47 +02:00
= 1329b7d91f fix dashboard grid size 2020-06-18 16:47:04 +02:00
Alessio 062aa0ad27 Merge remote-tracking branch 'origin/develop' into develop 2020-06-18 16:36:24 +02:00
Alessio 997f8fdfb4 Auto stash before merge of "develop" and "origin/develop" 2020-06-18 16:36:13 +02:00
= 6134047b61 fix 2020-06-18 16:36:06 +02:00
= eb4ad92f3e fix dashboard layout 2020-06-18 16:31:16 +02:00
= f54f96a42f Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-18 15:40:02 +02:00
= 8fcd50d47b disattivazione sliders and numeric 2020-06-18 15:39:27 +02:00
Alessio 23e8767604 add bottom line 2020-06-18 14:40:57 +02:00
Alessio c11f9028db fix font family 2020-06-18 14:08:46 +02:00
Alessio ad196ad788 fix dashboard 2020-06-18 12:00:04 +02:00
Alessio f906a05969 add component to dashboard 2020-06-18 10:31:17 +02:00
Samuele Locatelli 8742cbee18 ver 0.9.3 for testing, prettybin lib management 2020-06-18 08:22:52 +02:00
Samuele Locatelli 7ed56b3a68 Merge branch 'feature/add/ProdInfo' into develop 2020-06-17 18:35:56 +02:00
Samuele Locatelli 54685853bb Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-17 18:35:49 +02:00
Samuele Locatelli fa060cb839 updated for prodInfo setup and pz target 2020-06-17 18:34:56 +02:00
= 91872776f0 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-17 17:42:08 +02:00
= 77d8a6dbac Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-17 17:41:19 +02:00
= d030f09709 fix clock 2020-06-17 17:41:00 +02:00
= 8858602f9c fix gauge and dashboard layout 2020-06-17 17:36:11 +02:00
Samuele Locatelli 3574dffaa6 Fix strobe/ack for new prodInfo data 2020-06-17 17:20:38 +02:00
Samuele Locatelli ed74fb9b37 Fix compilation path for client 2020-06-17 16:58:16 +02:00
Alessio c0fdf9668b fix layout processo 2020-06-17 15:31:25 +02:00
Samuele Locatelli 97c4ce8c26 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-17 14:52:04 +02:00
Samuele Locatelli 12dc55ef8c Completed prodInfo initial integration, beta test 2020-06-17 14:48:53 +02:00
Samuele Locatelli cc68908084 Added DB migration 2020-06-17 14:48:32 +02:00
Alessio 99279824ef fix buttons 2020-06-17 11:51:06 +02:00
Alessio 36c5ff8def fix paddle 2020-06-17 11:37:38 +02:00
= d32f00bde6 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-17 09:55:05 +02:00
= 8eed4ec2eb fix chart 2020-06-17 09:53:40 +02:00
= c249d7a9be Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-17 09:49:56 +02:00
= 0b8f0adb96 fix chart 2020-06-17 09:49:43 +02:00
Alessio aae6aa8c09 fix layout avvio produzione modal 2020-06-17 09:33:57 +02:00
Alessio 3d9458002b apply shrink 2020-06-17 08:59:33 +02:00
Alessio b84ca57735 Merge branch 'newfeature/paddle' into develop 2020-06-17 08:32:19 +02:00
Samuele Locatelli a6cdf864ae FIrst version of prodInfo DB persistence 2020-06-16 19:28:27 +02:00
Samuele Locatelli 125532639a Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-16 18:04:43 +02:00
Samuele Locatelli fac2b5fa8d Merge branch 'develop' into feature/add/risk 2020-06-16 18:03:45 +02:00
Samuele Locatelli 928c0d20f9 Fixed method for WebAPI + signal-r interference 2020-06-16 18:02:42 +02:00
Alessio d74f886a06 add labels to svgchart 2020-06-16 16:44:31 +02:00
= 685c77e721 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-16 15:59:14 +02:00
= 808e3f1223 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-16 15:58:52 +02:00
Alessio 3c2bc0a48e fix a slider 2020-06-16 15:33:24 +02:00
Alessio ef98320bdc fixing colors 2020-06-16 15:20:01 +02:00
Alessio 9094d3eb50 other add and fix for svgchart 2020-06-16 15:08:15 +02:00
Alessio a4c704fad6 add svgchart to other modals 2020-06-16 14:42:53 +02:00
= 7915adfc3c fix prevuoto 2020-06-16 14:13:45 +02:00
= be7f268d2f fix layout 2020-06-16 14:04:58 +02:00
= 5064d30221 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-16 13:52:40 +02:00
= f0ceb42b92 svgchart 2020-06-16 13:52:32 +02:00
Alessio a135ad689a fix chart 2020-06-16 12:13:11 +02:00
Alessio 29020bb948 add chart 2020-06-16 11:44:36 +02:00
Alessio e0bd76d0b7 fix unit of measure 2020-06-16 11:44:25 +02:00
Alessio 3a18b0e5d3 fix avvio-produzione 2020-06-16 08:55:44 +02:00
Samuele Locatelli 87703058ac Merge branch 'develop' into feature/add/risk 2020-06-16 08:29:44 +02:00
Samuele Locatelli 6776a4894d Added readout for area + fix others 2020-06-16 08:29:27 +02:00
Alessio cd478f16e4 autoscroll and focus 2020-06-16 08:27:56 +02:00
Samuele Locatelli 695d6841f0 Merge branch 'develop' into feature/add/risk 2020-06-15 19:31:25 +02:00
Samuele Locatelli 6f81be6ebe Removed old method + fix startup 2020-06-15 19:29:17 +02:00
Samuele Locatelli 41563cc332 Removed old single param write method 2020-06-15 19:12:22 +02:00
= 2493f0117e Merge remote-tracking branch 'CMS/develop' into develop 2020-06-15 17:13:28 +02:00
= 8370141583 fix 2020-06-15 17:13:05 +02:00
= 7fe7539fe8 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-15 17:12:57 +02:00
= 8f7c780edd fix binding 2020-06-15 17:12:07 +02:00
Alessio 040eed1fcd autoscroll and focus on formato and pirometro 2020-06-15 16:55:36 +02:00
Samuele E. Locatelli f5f41e4c65 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-15 16:46:34 +02:00
Samuele E. Locatelli 2043417668 changed thread period (250->500) for recipe 2020-06-15 16:44:46 +02:00
= 579fa79bb6 autoscroll and focus 2020-06-15 16:37:40 +02:00
= d482a7551b Merge remote-tracking branch 'CMS/develop' into develop 2020-06-15 16:20:34 +02:00
= d3a9de2a3b Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-15 16:10:40 +02:00
= 9347ed95b7 fix recipe confirm & signarl comunications 2020-06-15 16:10:32 +02:00
Alessio 0be93533d7 fix positioning of the paddle butotn 2020-06-15 16:10:09 +02:00
Alessio 90e03e2160 add data bounding on the svg images 2020-06-15 15:45:35 +02:00
Samuele Locatelli ec6ba38e8b Merge branch 'feature/add/risk' into develop 2020-06-15 14:47:50 +02:00
Samuele Locatelli 6de2453bb4 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-15 14:47:40 +02:00
Samuele Locatelli 935d7879e7 Added signal-r send for data 2020-06-15 14:46:25 +02:00
Alessio 4c907a2474 fix positioning paddle 2020-06-15 13:50:08 +02:00
= c0306d9644 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-15 13:30:28 +02:00
= 80e67bb793 fix scritture signalr... 2020-06-15 13:30:04 +02:00
Alessio ebd0921753 writing data server side (other modals) 2020-06-15 12:38:15 +02:00
Samuele Locatelli fa54e5d1e9 Merge branch 'feature/add/risk' into develop 2020-06-15 11:40:48 +02:00
Samuele Locatelli 55e1961cf2 Added methods for mode selection 2020-06-15 11:40:30 +02:00
Alessio fe82ea006b Merge branch 'develop' into newfeature/paddle 2020-06-15 10:49:53 +02:00
Samuele Locatelli 1f110b009b fixed ScaleFactor mgmt 2020-06-15 10:25:55 +02:00
Samuele Locatelli 6fafed419f INitial ScaleFactor setup 2020-06-15 10:19:51 +02:00
Alessio 4c5a61d69f Merge remote-tracking branch 'origin/develop' into develop 2020-06-15 10:03:23 +02:00
Alessio cd18c6a9d3 adding and fix positioning of labels in the svg 2020-06-15 10:03:06 +02:00
Alessio 23df0dbc24 adding and fix positioning of label for the data 2020-06-15 10:01:23 +02:00
Samuele Locatelli fbe3f68397 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-15 09:05:06 +02:00
Samuele E. Locatelli 0a1400389f update try-catch on NcAdapter for status strb/ack 2020-06-15 09:03:40 +02:00
Samuele E. Locatelli ae6767a89d Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-06-12 22:26:59 +02:00
Samuele E. Locatelli d3f48fdcdd added try/catch on str decode 2020-06-12 22:26:35 +02:00
Samuele Locatelli 903f1a9638 ok MsgBlock setup, not ok type/section serializ 2020-06-12 21:01:03 +02:00
Samuele Locatelli 1155cf1680 Merge branch 'feature/add/risk' into develop 2020-06-12 19:17:41 +02:00
Samuele Locatelli 6f51ff274a note on error on reading 2020-06-12 19:16:44 +02:00
Samuele Locatelli 4030919f9e Preliminary add of ModBlock configurazion and load 2020-06-12 19:16:31 +02:00
Samuele Locatelli e56a5daefc added modules error msg 2020-06-12 18:42:32 +02:00
Samuele Locatelli 6d2ffff97b fix recipe error msg 2020-06-12 18:42:20 +02:00
Samuele Locatelli 134aaf31d4 refresh classname step --> thermo 2020-06-12 18:42:00 +02:00
Samuele Locatelli 7b76ea602e Fix logging in warmers WebApi 2020-06-12 18:32:21 +02:00
Samuele Locatelli 108cd688cd Added log in recipe WebApi methods 2020-06-12 18:22:53 +02:00
Samuele Locatelli 06eb1a4bc8 fix logger class name 2020-06-12 18:22:29 +02:00
Samuele Locatelli 08dd11701e Merge branch 'feature/add/risk' into develop 2020-06-12 17:50:19 +02:00
Samuele Locatelli 2f5eaed707 start new version 2020-06-12 17:49:09 +02:00
Samuele E. Locatelli 7d072f9bd6 check condition for recipeLiveData consistence 2020-06-12 17:45:15 +02:00
Samuele Locatelli cb72e13724 Merge branch 'feature/add/risk' into develop 2020-06-12 17:18:56 +02:00
Samuele Locatelli 6e5bf0888f change LiveData init 2020-06-12 17:17:33 +02:00
Samuele Locatelli 4fa253fd3b fixn recipe editing for action required too early 2020-06-12 17:17:05 +02:00
Samuele Locatelli 169c07fc1a new method for material dimension % calc 2020-06-12 17:00:15 +02:00
= fbe619e498 scrittura dati lato server (formato) 2020-06-12 16:59:03 +02:00
= e3f9a09063 layout select 2020-06-12 16:33:51 +02:00
= 097de061bf fix layout box in article 2020-06-12 16:19:19 +02:00
= 1c623cf512 Merge remote-tracking branch 'CMS/develop' into develop 2020-06-12 16:08:05 +02:00
= cbaa4bb359 fix loading stylecss 2020-06-12 16:06:05 +02:00
= 1e5fd252d4 fix layout bordered labels 2020-06-12 15:55:07 +02:00
Alessio d8580afd77 Merge remote-tracking branch 'origin/develop' into develop 2020-06-12 15:45:45 +02:00
Alessio ce5869f90a add label 2020-06-12 15:45:30 +02:00
Alessio dd8793a31d add class for the svg's labels 2020-06-12 15:44:52 +02:00
= 5c17d598bb fix import togglebutton 2020-06-12 15:29:43 +02:00
Samuele Locatelli 82a25ae070 completed test for ACK to PLC 2020-06-12 15:07:22 +02:00
= 614105c35a fix layout raffreddamento 2020-06-12 15:01:18 +02:00
= fd6648432f fix layout controstampo 2020-06-12 14:56:02 +02:00
= 4a17830c07 controstampo 2020-06-12 14:25:20 +02:00
Alessio 0b5a49122d Merge remote-tracking branch 'origin/develop' into develop 2020-06-12 14:16:08 +02:00
Alessio 407d95e8e3 add some cards in the modals 2020-06-12 14:15:55 +02:00
= 6032712414 fix imbutitura 2020-06-12 14:11:04 +02:00
= 1fb1bba657 fix layout pirometro 2020-06-12 13:59:16 +02:00
= 75b4337c75 fix riscalti rendering delay 2020-06-12 13:02:07 +02:00
= 40664d6136 fix riscaldi 2020-06-12 13:00:36 +02:00
= 73d5b93c59 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-12 12:54:13 +02:00
= bb80dc5a38 fix layout riscaldi 2020-06-12 12:52:47 +02:00
Alessio e070a6be6e add some cards in the modals 2020-06-12 12:29:06 +02:00
= 34779f5a31 fix layout ciclo 2020-06-12 12:13:51 +02:00
= c80cdb8644 fix layout quote 2020-06-12 11:48:18 +02:00
Samuele Locatelli 50d0c4a948 Added flux for recipe/risk setup conf on request 2020-06-12 11:39:26 +02:00
= a5436bb717 fix layout formato 2020-06-12 11:33:00 +02:00
Alessio 2f9dbd8111 fix 2020-06-12 11:12:02 +02:00
= 8abc6f00c0 fix modal height 2020-06-12 10:55:58 +02:00
= a282429e3c Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-12 10:46:46 +02:00
Alessio 49c85f347a delete previous buttons zoom 2020-06-12 10:45:24 +02:00
Alessio f58068b4f7 Merge remote-tracking branch 'origin/develop' into develop 2020-06-12 10:41:51 +02:00
Alessio 11fb2c2355 fix binding riscaldi 2020-06-12 10:41:29 +02:00
= ba3a340815 .keyboard layout 2020-06-12 09:58:17 +02:00
= 8a1b28020e pan & zoom su riscaldi 2020-06-12 09:51:30 +02:00
= 00dcc638fc fix footer 2020-06-12 09:37:22 +02:00
Samuele Locatelli cd2f21fe01 preliminary management of config request strb/ack 2020-06-11 19:45:31 +02:00
= ebbaa76054 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-11 18:32:17 +02:00
= 8324bcf297 riscaldi 2020-06-11 18:28:50 +02:00
Alessio f9de12a971 various fix in the modals 2020-06-11 16:38:28 +02:00
Alessio 2f8c6d643a add some property 2020-06-11 15:04:35 +02:00
Samuele Locatelli b14d506eb2 Merge branch 'feature/add/risk' into develop 2020-06-11 14:33:18 +02:00
= ccf8cd265e warmers 2020-06-11 14:31:20 +02:00
Samuele Locatelli 82e400b08d COmpleted warmers read/save data 2020-06-11 14:31:03 +02:00
= dd6f280c96 Merge remote-tracking branch 'teamdev/newfeature/Warmers' into develop 2020-06-11 14:20:47 +02:00
Alessio ade296ce56 Merge remote-tracking branch 'origin/develop' into develop 2020-06-11 14:02:50 +02:00
Alessio 8dd26f73d1 fix numerics, sliders and labels 2020-06-11 14:00:00 +02:00
Samuele Locatelli a03571793e Added partial methods for warmers sale post edit 2020-06-11 13:18:08 +02:00
Samuele Locatelli 1d77adc01c Fix recipe load / save with warmers 2020-06-11 13:17:33 +02:00
= 73be1bb58b rimozione commenti di property non più usate 2020-06-11 12:44:33 +02:00
= a5a76d35c4 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-11 12:43:50 +02:00
= 782caef28a quote 2020-06-11 12:42:39 +02:00
= 61a5c50476 formato & quote. 2020-06-11 12:29:30 +02:00
Alessio 9fac539cfd fix numerics, sliders and labels 2020-06-11 12:28:08 +02:00
= d0276438a4 fix binding formato 2020-06-11 12:01:19 +02:00
= 4f947f0b65 fix slider 2020-06-11 11:17:49 +02:00
Samuele Locatelli c7b96e4d78 Merge branch 'feature/add/risk' into develop 2020-06-11 11:11:14 +02:00
Samuele Locatelli 3a17e13224 fix div0 for VUMin and warmers config setup tested 2020-06-11 11:10:39 +02:00
Samuele Locatelli f28cbfe2ec fix board config: 16 channels 2020-06-11 11:10:15 +02:00
= 3efcfef9d8 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-11 10:56:21 +02:00
= e5961d7685 keyboard postion on focus 2020-06-11 10:54:21 +02:00
Alessio cbfd2fe3c5 Merge branch 'develop' into newfeature/paddle 2020-06-11 10:48:23 +02:00
Alessio 01ac4b071e fix get on the service 2020-06-11 10:48:03 +02:00
Alessio 06f85a3e3e fix buttons of the footer 2020-06-11 10:44:44 +02:00
Alessio 2a51a1535d add put functions to the service 2020-06-11 10:09:55 +02:00
Alessio d987cef604 add service and store for Warmers 2020-06-11 10:07:40 +02:00
Samuele Locatelli 5400408355 start new versione (to check warmers config) 2020-06-10 19:21:36 +02:00
Samuele Locatelli 78c046f117 Merge branch 'feature/add/risk' into develop 2020-06-10 19:15:31 +02:00
Samuele Locatelli 339c9e1220 Setup params write methods added 2020-06-10 19:14:32 +02:00
= c3b211fa01 layout footer bar 2020-06-10 17:52:53 +02:00
= eca0787248 fix minifooter 2020-06-10 17:31:28 +02:00
= 0bda8aa748 layout... 2020-06-10 17:26:51 +02:00
= 2f8277924a modali e fix disegno 2020-06-10 16:29:40 +02:00
Samuele Locatelli 1862fe641b Fix & test write for CH load (1..1024) 2020-06-10 16:29:27 +02:00
= fd0c51a72d pulizia 2020-06-10 16:18:27 +02:00
= 4a3dba9399 pulizia 2020-06-10 16:13:45 +02:00
= eaff5729dc Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-10 15:25:02 +02:00
= aa2bd2d1a1 fix formato 2020-06-10 15:24:54 +02:00
Alessio 6586840f27 fix some property 2020-06-10 14:48:45 +02:00
= 8b447ade4a fix footer buttons layout 2020-06-10 14:46:39 +02:00
Alessio 20a864bfb5 fix all the numeric 2020-06-10 14:19:19 +02:00
Alessio 819051002e fix formato 2020-06-10 13:44:10 +02:00
= d2e0a4eb15 fix loop modali 2020-06-10 12:53:55 +02:00
= c6a108d29a refactoring processo apertura modale 2020-06-10 12:48:05 +02:00
= 133bec82e4 fix 2020-06-10 12:22:22 +02:00
= 9aff944b49 Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-10 12:21:27 +02:00
= d51c900173 fix 2020-06-10 12:20:50 +02:00
= a87b2623e0 refactoring formato e chiamata modali 2020-06-10 12:19:27 +02:00
Alessio 6d98d185f7 cancelled showTast 2020-06-10 12:13:42 +02:00
Alessio 8743f1f924 replaced input with numeric and deleted default from the property 2020-06-10 12:10:58 +02:00
= 0d042b8698 rimozione del tastierino ovunque 2020-06-10 11:40:31 +02:00
= e29358c4ef Merge remote-tracking branch 'teamdev/develop' into develop 2020-06-10 11:28:43 +02:00
= 44bb957508 components 2020-06-10 11:28:25 +02:00
Alessio 5f7941f479 add sliders to stampo on formato modal 2020-06-10 10:37:11 +02:00
Samuele Locatelli d21efcb78f Merge branch 'feature/add/prodData' into feature/add/risk 2020-06-09 19:14:29 +02:00
Samuele Locatelli 6d52ccdc9c Continuing warmers & recipe fix & config 2020-06-09 19:13:57 +02:00
= c857cffbe5 fix modal height 2020-06-09 12:36:05 +02:00
= d71bfe36ba binding gauge header 2020-06-09 12:32:11 +02:00
= b52c2d740f fix input edit 2020-06-09 12:08:09 +02:00
= 2fd2012dd3 fix layout 2020-06-09 11:29:27 +02:00
= d7859a61fa fix layout maschera principale 2020-06-09 11:11:09 +02:00
= 835ba31638 Merge remote-tracking branch 'teamdev/newfeature/ricetta' into develop 2020-06-09 10:40:34 +02:00
= 1ea2f3182a Merge branch 'newfeature/riscaldi' into develop 2020-06-09 10:28:34 +02:00
Samuele Locatelli bdc0ce1aa5 Added method for Prod Info & Cycle data read 2020-06-08 22:30:37 +02:00
Samuele Locatelli 31519c303b Added signal-r prod data push 2020-06-08 22:07:37 +02:00
Samuele Locatelli 0cfbbe069a Fix Filesystem IO 4 recipe 2020-06-08 21:22:14 +02:00
Samuele E. Locatelli 04f9a8155e Update vers number 2020-06-08 19:46:04 +02:00
Samuele Locatelli de8daee8f9 Merge branch 'feature/add/risk' into develop 2020-06-08 19:41:22 +02:00
Samuele Locatelli 8ccd5fc06b Added load save update methods 2020-06-08 19:41:02 +02:00
Alessio d653391253 fix riscaldi modal 2020-06-08 16:37:52 +02:00
Alessio 7ba5090dd3 fix riscaldi superiori 2020-06-08 16:24:22 +02:00
Samuele Locatelli 698fd47177 Added file method for template/current/load/save 2020-06-08 15:44:59 +02:00
Alessio 08c6ca521a fix sub-menù 2020-06-08 14:38:39 +02:00
Alessio 8d661f0bda fix sub-menù 2020-06-08 12:21:15 +02:00
Alessio a44813c8a4 add the sub-menù to the components in production 2020-06-08 11:34:03 +02:00
Samuele Locatelli f48ee73ede Merge branch 'feature/add/risk' into develop 2020-06-08 11:14:39 +02:00
Samuele Locatelli 3dedafd43f update load/save call from WebApi 2020-06-08 11:02:18 +02:00
Samuele Locatelli 020d8304a5 DRAFT: Recipe local persistence file 2020-06-05 23:13:46 +02:00
Samuele Locatelli 2a66160e84 Added warmers resistances output 2020-06-05 21:28:25 +02:00
Samuele Locatelli a52d76bb5b Abbozzata gestione esterna x warmers 2020-06-05 19:54:38 +02:00
Samuele Locatelli 112f6ed697 refresh state machine status 2020-06-05 19:47:17 +02:00
Samuele Locatelli 9798b5a993 Added overview real calculation 2020-06-05 19:38:30 +02:00
Samuele Locatelli c28c77bec9 Merge branch 'feature/add/risk' into develop 2020-06-05 18:51:35 +02:00
Samuele Locatelli 9232597888 UPdate methods for recipe edit confirm/cancel 2020-06-05 18:51:15 +02:00
Alessio f3b3028167 fix gauge positioning and dimensions 2020-05-25 16:28:24 +02:00
Damiano 6dc2678ecb Svg modifies dashboard 2020-05-22 16:29:16 +02:00
Alessio 99ea0958cd fix input tag 2020-05-22 15:47:25 +02:00
Alessio 2c578a7944 add function to tastierino 2020-05-22 15:15:44 +02:00
Alessio 2237e78dd0 fix call for tastierino and add prop for value 2020-05-22 13:01:09 +02:00
Alessio 71e16325b9 fix and add tastierino to other modals 2020-05-22 10:33:07 +02:00
Alessio 5f2540210f Merge branch 'newfeature/dashboard' into newfeature/ricetta 2020-05-22 08:31:48 +02:00
Damiano 42d162c029 Merge remote-tracking branch 'origin/newfeature/dashboard' into newfeature/dashboard 2020-05-21 16:05:47 +02:00
Damiano 3b1528fd07 fix modifies dashboard3 component 2020-05-21 16:02:54 +02:00
Alessio ef2f3d7874 fix style archinterface 2020-05-21 15:08:38 +02:00
Alessio 16782271a4 fix dashboard and archinterface 2020-05-21 13:52:10 +02:00
Damiano 955d52b977 fix position elements dashboard 2020-05-21 12:00:33 +02:00
Alessio 439c70f70d fix typing for tag input 2020-05-21 11:17:41 +02:00
Alessio d86e6b053a fix reference of recipe in the modals 2020-05-21 10:38:22 +02:00
Alessio 36099630a9 add hr to the dashboard 2020-05-21 09:58:46 +02:00
Alessio e42266ffc2 fix reference of recipe in the modals 2020-05-21 09:47:54 +02:00
Alessio d0fabaac69 add recipeService calls to main 2020-05-20 16:47:13 +02:00
Alessio 22310fa8a7 add recipeService 2020-05-20 16:19:23 +02:00
Alessio 0365bfd7b2 Merge branch 'develop' into newfeature/ricetta 2020-05-20 14:54:52 +02:00
Alessio 786a0b234d fix dashboard 2020-05-20 12:59:21 +02:00
Alessio 7a52c9ffa5 fix dashboard 2020-05-20 11:39:25 +02:00
Alessio eeded21849 Merge branch 'newfeature/programmazione-preriscaldo' into newfeature/dashboard 2020-05-20 09:38:13 +02:00
Alessio 414d8ab889 rename dashboard.less 2020-05-20 09:35:23 +02:00
Alessio a353a0f628 delete row.svg 2020-05-20 09:30:39 +02:00
Alessio 5ed8386e2b fix dashboard 2020-05-20 09:29:16 +02:00
Francesco Guerrieri 74c85acd2b fix styles svg dashboard 2020-05-19 20:02:54 +02:00
Alessio a39cefbfba fix z-index 2020-05-19 15:51:25 +02:00
Alessio 328d5f618e fix button close of prerisclado dashboard 2020-05-19 15:22:38 +02:00
Alessio ada12efca2 fix preriscaldo dashboard 2020-05-19 15:19:13 +02:00
Alessio 20a271290d fix preriscaldo dashboard 2020-05-19 15:15:44 +02:00
Damiano 74a998696f optimization dashboard component 2020-05-18 17:48:45 +02:00
Alessio 2e8f0f6066 fix svg dashboard 2020-05-18 15:21:58 +02:00
Alessio 2199c86229 add second dashboard 2020-05-18 15:09:06 +02:00
Damiano e93711fc96 fix background color dashboard 2020-05-18 14:55:55 +02:00
Alessio f4223d6de0 fix opening dashboard 2020-05-18 12:51:24 +02:00
Damiano 61ad9a934f Merge remote-tracking branch 'origin/newfeature/programmazione-preriscaldo' into newfeature/programmazione-preriscaldo 2020-05-18 12:24:48 +02:00
Alessio fcab3a8e3d fix dashboard gauge 2020-05-18 12:20:00 +02:00
Damiano 769699a130 add-components-dashboard 2020-05-18 11:54:52 +02:00
Alessio 02a8dc4ef7 fix positioning dashboard 2020-05-18 11:54:14 +02:00
Alessio 8efdf51863 fix background dashboard 2020-05-18 11:51:16 +02:00
Alessio bbec4b5306 fix the merge of the dashboard 2020-05-18 11:42:52 +02:00
Francesco Guerrieri 06d4dc316d Merge remote-tracking branch 'origin/newfeature/programmazione-preriscaldo' into newfeature/programmazione-preriscaldo 2020-05-18 11:30:35 +02:00
Francesco Guerrieri 1bf5534380 fix styles svg 2020-05-18 11:27:12 +02:00
Alessio 1fb1445677 Merge branch 'newfeature/paddle' into newfeature/dashboard 2020-05-18 11:16:24 +02:00
Damiano 39bd0a2eb8 modify dashboard3 drawing 2020-05-18 11:04:20 +02:00
Alessio b41417da56 fix dashboard 2020-05-18 11:03:53 +02:00
Damiano 7d496ee811 fix row svg-dashboard 2020-05-18 09:56:24 +02:00
Francesco Guerrieri 1a3f7972a1 fixed styles dashboard header 2020-05-15 16:45:23 +02:00
Alessio 535082d311 fix svg dashboard 2020-05-15 15:49:42 +02:00
Damiano ead2383084 fix path-svg 2020-05-15 15:41:19 +02:00
Francesco Guerrieri 627fd320ae fix style dashboard 2020-05-15 15:09:11 +02:00
Francesco Guerrieri c14e24caa2 fix status dashboard 2020-05-15 10:02:24 +02:00
Francesco Guerrieri 492836c2eb fix styles dashboard 2020-05-15 09:32:54 +02:00
Alessio fe3374c16a fix dashboard 2020-05-14 16:59:29 +02:00
Alessio 69767cf627 fix dashboard 2020-05-14 16:43:25 +02:00
Damiano f46e818d18 Auto stash before merge of "newfeature/programmazione-preriscaldo" and "origin/newfeature/programmazione-preriscaldo" 2020-05-14 16:40:56 +02:00
Alessio 4b3b0b6228 fix dashboard 2020-05-14 11:13:48 +02:00
Alessio 2a030da24a fix archinterface and dashboard 2020-05-14 11:02:47 +02:00
Francesco Guerrieri 98ecbe05de fix arch interface 2020-05-14 09:48:49 +02:00
Alessio 0c48eec85c fix dashboard 2020-05-14 09:44:44 +02:00
Damiano eb631908bf svg drawings dashboard 2020-05-13 16:56:27 +02:00
Francesco Guerrieri a2fa132ee2 insert arch interface in header dashboard 2020-05-13 12:23:19 +02:00
Francesco Guerrieri 92380255a6 fix component dashboard 2020-05-13 11:57:58 +02:00
francesco.guerrieri 3532ef89f5 add dashboard component 2020-05-11 14:11:17 +02:00
Alessio 9a21aae816 fix dashboard 2020-05-08 15:24:21 +02:00
Damiano 4830160763 fix "circle-dashboard" 2020-05-08 12:31:31 +02:00
Alessio 821f0276c7 fix style dashboard 2020-05-08 12:00:12 +02:00
Alessio 4b2553056c add dashboard 2020-05-07 16:25:36 +02:00
508 changed files with 18814 additions and 13817 deletions
+6 -12
View File
@@ -1,21 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config
namespace Client.Config
{
public static class Config
{
public static SubModels.Client ClientConfig;
public static SubModels.Connection ConnectionConfig;
public static SubModels.VendorHmi VendorHmiConfig;
public static SubModels.Client ClientConfig;
public static SubModels.Connection ConnectionConfig;
public static SubModels.VendorHmi VendorHmiConfig;
public static SubModels.ProdSoftware ProdSoftwareConfig { get; set; }
public static string TextEditorPath { get; set; }
public static SubModels.Software[] ExtSoftwaresConfig { get; set; }
public static SubModels.Software[] ExtSoftwaresConfig { get; set; }
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
<RenderingMethod>GPU</RenderingMethod> <!-- GPU/CPU -->
<ShowVirtualKeyboard>false</ShowVirtualKeyboard>
<RunningOnSecondaryScreen>false</RunningOnSecondaryScreen>
<DeveloperMode>false</DeveloperMode>
<DeveloperMode>true</DeveloperMode>
</Client>
<Connection>
<ServerUrl>localhost</ServerUrl>
+270 -274
View File
@@ -1,280 +1,276 @@
using Client.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
using System.Xml.Schema;
namespace Client.Config
{
public class ConfigController
{
const String ChromeScheme = "chrome";
public static void ReadStartupConfig()
{
// Read validation file
XmlSchemaSet readerSettings = new XmlSchemaSet();
// Add Schema
readerSettings.Add(null, Constants.STARTUP_CONFIG_SCHEMA_PATH);
// Open file reader
XDocument xmlConfigFile = XDocument.Load(Constants.STARTUP_CONFIG_PATH);
// Validate file
xmlConfigFile.Validate(readerSettings, ValidationHandler);
// Read XML Config
Config.ClientConfig = xmlConfigFile
.Descendants(Constants.CLIENT_CONFIG_KEY)
.Select(x => new SubModels.Client()
{
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value),
RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value),
RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value),
ShowVirtualKeyboard = ValidateVirtualKeyboard(x.Element("ShowVirtualKeyboard").Value),
DeveloperMode = ValidateDeveloperMode(x.Element("DeveloperMode").Value),
IsSCM = ValidateIsSCM(x.Element("IsSCM").Value)
}).FirstOrDefault();
Config.ConnectionConfig = xmlConfigFile
.Descendants(Constants.CONNECTION_CONFIG_KEY)
.Select(x => new SubModels.Connection()
{
ServerUrl = ValidateServerUrl(x.Element("ServerUrl").Value),
ServerPort = ValidateServerPort(x.Element("ServerPort").Value),
Id = ValidateClientID(x.Element("Id").Value),
DeleteCahceFolderOnStartup = ValidateDelCache(x.Element("DeleteCahceFolderOnStartup").Value),
}).FirstOrDefault();
Config.VendorHmiConfig = xmlConfigFile
.Descendants(Constants.VENDORHMI_CONFIG_KEY)
.Select(x => new SubModels.VendorHmi()
{
FollowNcWindow = ValidateFollowNcWin(x.Element("FollowNcWindow").Value)
}).FirstOrDefault();
Config.ProdSoftwareConfig = new SubModels.ProdSoftware();
Config.ExtSoftwaresConfig = new SubModels.Software[] { };
//ReadConfig Url compositing
Config.ConnectionConfig.ReadConfigUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.ConfigPage;
Config.ConnectionConfig.StartingUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.StartingPage;
//ErrorPage content
if (File.Exists(Constants.errorPageFile))
Config.ConnectionConfig.ErrorPage = File.ReadAllText(Constants.errorPageFile);
else
throw new Exception(@"File Error: """ + Constants.errorPageFile + @""" not found");
}
private static void ValidationHandler(object sender, ValidationEventArgs e)
{
throw new Exception(@"Configuration Error: " + e.Message);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region PROPERTIES_VALIDATOR
private static String ValidateServerUrl(String value)
{
if (!String.IsNullOrWhiteSpace(value))
return value;
else
throw new Exception(@"Configuration Error: ""Connection - ServerUrl"" is not a valid URL");
}
private static ushort ValidateServerPort(String value)
{
if (ushort.TryParse(value, out ushort Port))
return Port;
else
throw new Exception(@"Configuration Error: ""Connection - ServerPort"" is not a valid Id of CMS-Client");
}
private static String ValidateArgumentUrl(String value)
{
Uri NewUrl;
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
return value;
else
throw new Exception(@"Argument Url Error: is not a valid URL");
}
private static Color ValidateTranspColor(String value)
{
Color color;
try
{
color = ColorTranslator.FromHtml(value);
return color;
}
catch (Exception)
{
throw new Exception(@"Configuration Error: ""Client - TranspColor"" is not a valid Hex Color");
}
}
private static Constants.Rendering ValidateRendering(string value)
{
if (value.ToUpper().Equals("CPU"))
return Constants.Rendering.CPU;
else if (value.ToUpper().Equals("GPU"))
return Constants.Rendering.GPU;
else
throw new Exception(@"Configuration Error: ""Client - RenderingMethod"" is not a valid Rendering Method");
}
private static bool ValidateSecScreen(string value)
{
Boolean secScreen;
if (Boolean.TryParse(value, out secScreen))
return secScreen;
else
throw new Exception(@"Configuration Error: ""Client - RunningOnSecondaryScreen"" is not a valid Boolean Type");
}
private static bool ValidateIsSCM(string value)
{
Boolean IsSCM;
if (Boolean.TryParse(value, out IsSCM))
return IsSCM;
using Client.Utils;
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using System.Xml.Schema;
namespace Client.Config
{
public class ConfigController
{
const String ChromeScheme = "chrome";
public static void ReadStartupConfig()
{
// Read validation file
XmlSchemaSet readerSettings = new XmlSchemaSet();
// Add Schema
readerSettings.Add(null, Constants.STARTUP_CONFIG_SCHEMA_PATH);
// Open file reader
XDocument xmlConfigFile = XDocument.Load(Constants.STARTUP_CONFIG_PATH);
// Validate file
xmlConfigFile.Validate(readerSettings, ValidationHandler);
// Read XML Config
Config.ClientConfig = xmlConfigFile
.Descendants(Constants.CLIENT_CONFIG_KEY)
.Select(x => new SubModels.Client()
{
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value),
RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value),
RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value),
ShowVirtualKeyboard = ValidateVirtualKeyboard(x.Element("ShowVirtualKeyboard").Value),
DeveloperMode = ValidateDeveloperMode(x.Element("DeveloperMode").Value),
IsSCM = ValidateIsSCM(x.Element("IsSCM").Value)
}).FirstOrDefault();
Config.ConnectionConfig = xmlConfigFile
.Descendants(Constants.CONNECTION_CONFIG_KEY)
.Select(x => new SubModels.Connection()
{
ServerUrl = ValidateServerUrl(x.Element("ServerUrl").Value),
ServerPort = ValidateServerPort(x.Element("ServerPort").Value),
Id = ValidateClientID(x.Element("Id").Value),
DeleteCahceFolderOnStartup = ValidateDelCache(x.Element("DeleteCahceFolderOnStartup").Value),
}).FirstOrDefault();
Config.VendorHmiConfig = xmlConfigFile
.Descendants(Constants.VENDORHMI_CONFIG_KEY)
.Select(x => new SubModels.VendorHmi()
{
FollowNcWindow = ValidateFollowNcWin(x.Element("FollowNcWindow").Value)
}).FirstOrDefault();
Config.ProdSoftwareConfig = new SubModels.ProdSoftware();
Config.ExtSoftwaresConfig = new SubModels.Software[] { };
//ReadConfig Url compositing
Config.ConnectionConfig.ReadConfigUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.ConfigPage;
Config.ConnectionConfig.StartingUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.StartingPage;
//ErrorPage content
if (File.Exists(Constants.errorPageFile))
Config.ConnectionConfig.ErrorPage = File.ReadAllText(Constants.errorPageFile);
else
throw new Exception(@"File Error: """ + Constants.errorPageFile + @""" not found");
}
private static void ValidationHandler(object sender, ValidationEventArgs e)
{
throw new Exception(@"Configuration Error: " + e.Message);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region PROPERTIES_VALIDATOR
private static String ValidateServerUrl(String value)
{
if (!String.IsNullOrWhiteSpace(value))
return value;
else
throw new Exception(@"Configuration Error: ""Connection - ServerUrl"" is not a valid URL");
}
private static ushort ValidateServerPort(String value)
{
if (ushort.TryParse(value, out ushort Port))
return Port;
else
throw new Exception(@"Configuration Error: ""Connection - ServerPort"" is not a valid Id of CMS-Client");
}
private static String ValidateArgumentUrl(String value)
{
Uri NewUrl;
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
return value;
else
throw new Exception(@"Argument Url Error: is not a valid URL");
}
private static Color ValidateTranspColor(String value)
{
Color color;
try
{
color = ColorTranslator.FromHtml(value);
return color;
}
catch (Exception)
{
throw new Exception(@"Configuration Error: ""Client - TranspColor"" is not a valid Hex Color");
}
}
private static Constants.Rendering ValidateRendering(string value)
{
if (value.ToUpper().Equals("CPU"))
return Constants.Rendering.CPU;
else if (value.ToUpper().Equals("GPU"))
return Constants.Rendering.GPU;
else
throw new Exception(@"Configuration Error: ""Client - RenderingMethod"" is not a valid Rendering Method");
}
private static bool ValidateSecScreen(string value)
{
Boolean secScreen;
if (Boolean.TryParse(value, out secScreen))
return secScreen;
else
throw new Exception(@"Configuration Error: ""Client - RunningOnSecondaryScreen"" is not a valid Boolean Type");
}
private static bool ValidateIsSCM(string value)
{
Boolean IsSCM;
if (Boolean.TryParse(value, out IsSCM))
return IsSCM;
else
throw new Exception(@"Configuration Error: ""Client - IsSCM"" is not a valid Boolean Type");
}
private static bool ValidateVirtualKeyboard(string value)
{
Boolean keyboard;
if (Boolean.TryParse(value, out keyboard))
return keyboard;
else
throw new Exception(@"Configuration Error: ""Client - ShowVirtualKeyboard"" is not a valid Boolean Type");
}
private static bool ValidateDeveloperMode(string value)
{
Boolean DeveloperMode;
if (Boolean.TryParse(value, out DeveloperMode))
return DeveloperMode;
else
throw new Exception(@"Configuration Error: ""Client - DeveloperMode"" is not a valid Boolean Type");
}
private static Boolean ValidateFollowNcWin(String value)
{
Boolean FollowNc;
if (Boolean.TryParse(value, out FollowNc))
return FollowNc;
else
throw new Exception(@"Configuration Error: ""VendorHmi - FollowNcWindow"" is not a valid Boolean Type");
}
private static ushort ValidateClientID(String value)
{
ushort Client;
if (ushort.TryParse(value, out Client))
return Client;
else
throw new Exception(@"Configuration Error: ""Connection - Id"" is not a valid Id of CMS-Client");
}
private static Boolean ValidateDelCache(String value)
{
Boolean DelCache;
if (Boolean.TryParse(value, out DelCache))
return DelCache;
else
throw new Exception(@"Configuration Error: ""Connection - DeleteCahceFolderOnStartup"" is not a valid Boolean Type");
}
private static String ValidateSFTPath(String value)
{
if (File.Exists(value))
return value;
else
throw new Exception(@"Configuration Error: File """ + value + @""" not found");
}
private static String ValidateSFTSName(String value)
{
if (!String.IsNullOrEmpty(value))
{
if (value.Count() <= 3)
return value;
else
throw new Exception(@"Configuration Error: Short Name """ + value + @""" cannot be over 3 Letters");
}
else
throw new Exception(@"Configuration Error: ""Client - IsSCM"" is not a valid Boolean Type");
}
private static bool ValidateVirtualKeyboard(string value)
{
Boolean keyboard;
if (Boolean.TryParse(value, out keyboard))
return keyboard;
else
throw new Exception(@"Configuration Error: ""Client - ShowVirtualKeyboard"" is not a valid Boolean Type");
}
private static bool ValidateDeveloperMode(string value)
{
Boolean DeveloperMode;
if (Boolean.TryParse(value, out DeveloperMode))
return DeveloperMode;
else
throw new Exception(@"Configuration Error: ""Client - DeveloperMode"" is not a valid Boolean Type");
}
private static Boolean ValidateFollowNcWin(String value)
{
Boolean FollowNc;
if (Boolean.TryParse(value, out FollowNc))
return FollowNc;
else
throw new Exception(@"Configuration Error: ""VendorHmi - FollowNcWindow"" is not a valid Boolean Type");
}
private static ushort ValidateClientID(String value)
{
ushort Client;
if (ushort.TryParse(value, out Client))
return Client;
else
throw new Exception(@"Configuration Error: ""Connection - Id"" is not a valid Id of CMS-Client");
}
private static Boolean ValidateDelCache(String value)
{
Boolean DelCache;
if (Boolean.TryParse(value, out DelCache))
return DelCache;
else
throw new Exception(@"Configuration Error: ""Connection - DeleteCahceFolderOnStartup"" is not a valid Boolean Type");
}
private static String ValidateSFTPath(String value)
{
if(File.Exists(value))
return value;
else
throw new Exception(@"Configuration Error: File """+ value + @""" not found");
}
private static String ValidateSFTSName(String value)
{
if (!String.IsNullOrEmpty(value))
{
if (value.Count() <= 3)
return value;
else
throw new Exception(@"Configuration Error: Short Name """ + value + @""" cannot be over 3 Letters");
}
else
throw new Exception(@"Configuration Error: Software Short Name Must be setted");
}
private static bool ValidateInMainMenuBar(String value)
{
if (!String.IsNullOrEmpty(value))
{
return Boolean.Parse(value);
}
else
}
private static bool ValidateInMainMenuBar(String value)
{
if (!String.IsNullOrEmpty(value))
{
return Boolean.Parse(value);
}
else
throw new Exception(@"Configuration Error: In-Main-Menu-Bar Must be setted");
}
private static String ValidateSFTLName(String value)
{
if (!String.IsNullOrEmpty(value))
return value;
else
throw new Exception(@"Configuration Error: Software Long Name Must be setted");
}
private static String ExtractBase64Icon(String value)
{
Image im = Icon.ExtractAssociatedIcon(value).ToBitmap();
MemoryStream m = new MemoryStream();
im.Save(m, ImageFormat.Png);
return "data:image/png;base64," + Convert.ToBase64String(m.ToArray());
}
#endregion
}
}
private static String ValidateSFTLName(String value)
{
if (!String.IsNullOrEmpty(value))
return value;
else
throw new Exception(@"Configuration Error: Software Long Name Must be setted");
}
private static String ExtractBase64Icon(String value)
{
Image im = Icon.ExtractAssociatedIcon(value).ToBitmap();
MemoryStream m = new MemoryStream();
im.Save(m, ImageFormat.Png);
return "data:image/png;base64," + Convert.ToBase64String(m.ToArray());
}
#endregion
}
}
-1
View File
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
-4
View File
@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Client.Utils.Constants;
namespace Client.Config.SubModels
+1 -5
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config.SubModels
{
@@ -15,6 +11,6 @@ namespace Client.Config.SubModels
public string ReadConfigUrl { get; set; }
public Boolean DeleteCahceFolderOnStartup { get; set; }
public Boolean BypassReadConfiguration { get; set; }
public string ErrorPage { get; set; }
public string ErrorPage { get; set; }
}
}
+1 -7
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config.SubModels
namespace Client.Config.SubModels
{
public class ProdSoftware
{
+3 -7
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Client.Config.SubModels
{
@@ -15,8 +11,8 @@ namespace Client.Config.SubModels
public string ProdEnabled { get; set; }
public string ProdPath { get; set; }
public string Autorun { get; set; }
public string EditorPath { get; set; }
public string EditorPath { get; set; }
public List<Software> ExtSoftwares { get; set; }
}
}
+2 -7
View File
@@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace Client.Config.SubModels
{
[DataContract]
public class Software
{
{
[DataMember]
public string id { get; set; }
[DataMember]
-4
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Config.SubModels
{
+25 -30
View File
@@ -1,44 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Utils
namespace Client.Utils
{
public static class Constants
{
//Folders
public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
public static string BROWSER_CACHE_FOLDER = BASE_PATH + "LocalStorage";
public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\";
//public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
public static string BROWSER_CACHE_FOLDER = BASE_PATH + "LocalStorage";
public static string STARTUP_CONFIG_SCHEMA_PATH = BASE_PATH + "ClientValidator.xsd";
public static string STARTUP_CONFIG_PATH = BASE_PATH + "Config.xml";
public static string CEF_PATH = BASE_PATH + "CEF";
public static string CEF_X86_PATH = BASE_PATH + "CEF\\Release_X86";
public static string CEF_X64_PATH = BASE_PATH + "CEF\\Release_X64";
public static string CEF_LOCALES_PATH = BASE_PATH + "CEF\\Resources\\locales";
public static string CEF_EXCEPTIONLOG_PATH = BASE_PATH + "ExceptionLog";
public static string errorPageFile = BASE_PATH + "error.pg";
public static string JOB_OPENING_PATH = "C:\\CMS\\ACTIVE\\TMP\\clientTmpJob\\";
public static string PART_PRG_FOLDER = "C:\\PartPrg";
public static string STARTUP_CONFIG_PATH = BASE_PATH + "lib\\Config.xml";
public static string CEF_PATH = BASE_PATH + "CEF";
public static string CEF_X86_PATH = BASE_PATH + "CEF\\Release_X86";
public static string CEF_X64_PATH = BASE_PATH + "CEF\\Release_X64";
public static string CEF_LOCALES_PATH = BASE_PATH + "CEF\\Resources\\locales";
public static string CEF_EXCEPTIONLOG_PATH = BASE_PATH + "ExceptionLog";
public static string errorPageFile = BASE_PATH + "error.pg";
public static string JOB_OPENING_PATH = "C:\\CMS\\ThermoActive\\TMP\\clientTmpJob\\";
public static string PART_PRG_FOLDER = "C:\\PartPrg";
//Config Names
public const string CONFIG_KEY = "Config";
public const string CLIENT_CONFIG_KEY = "Client";
public const string CONNECTION_CONFIG_KEY = "Connection";
public const string VENDORHMI_CONFIG_KEY = "VendorHmi";
public const string EXTSFT_CONFIG_KEY = "ExtSoftwares";
public const string SFT_CONFIG_KEY = "Software";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public enum Rendering {GPU = 0, CPU = 1 };
public const string CONFIG_KEY = "Config";
public const string CLIENT_CONFIG_KEY = "Client";
public const string CONNECTION_CONFIG_KEY = "Connection";
public const string VENDORHMI_CONFIG_KEY = "VendorHmi";
public const string EXTSFT_CONFIG_KEY = "ExtSoftwares";
public const string SFT_CONFIG_KEY = "Software";
public const string JOB_MAIN_FILENAME = "main.cnc";
public const string JOB_METADATA_FILENAME = "metadata.json";
public enum Rendering { GPU = 0, CPU = 1 };
//BROWSER OBJECT NAME -> The first letter must be Lower-Case (CEF Settings)
public const string BROWSER_JS_OBJ_NAME = "cmsClient";
//Nc States
public enum NcState { HIDE = 0, SHOW = 1, SHOWPROD = 2 };
@@ -68,13 +63,13 @@ namespace Client.Utils
//KEYBOARD Constants
public const int KEYB_HEIGHT = 377;
public const int KEYB_WIDTH = 1134;
public const int KEYB_WIDTH = 1134;
public const int KEYB_Y_OFFSET = 15;
public const string KEYB_EXE_NAME = "OSK.EXE";
public const string KEYB_PROC_NAME = "OSK";
public const string StartingPage = "index.html";
public const string UPLOAD_PAGE = "/api/file_manager/upload";
public const string UPLOAD_PAGE = "/api/file_manager/upload";
public const string UPLOAD_ADD_QUEUE = "/api/file_manager/queue/add";
public const string ConfigPage = "api/configuration/client";
public const string errorPageUrl = @"error://error/";
-1
View File
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+8 -3
View File
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
</configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;libs" />
</assemblyBinding>
</runtime>
</configuration>
+22 -23
View File
@@ -1,13 +1,13 @@
using Chromium;
using Active_Client.Browser_Tools.Models;
using Active_Client.Browser_Tools.Models.Errors;
using Active_Client.Browser_Tools.Models.Metadata;
using Active_Client.View;
using Chromium;
using Chromium.Remote;
using Chromium.Remote.Event;
using Chromium.WebBrowser;
using Client.Config;
using Client.Config.SubModels;
using Client.Utils;
using Active_Client.Browser_Tools.Models;
using Active_Client.Browser_Tools.Models.Errors;
using Active_Client.Browser_Tools.Models.Metadata;
using Active_Client.View;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -15,13 +15,12 @@ using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Management;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using static Client.Utils.Constants;
using System.Management;
using Chromium.Remote;
using System.Text;
namespace Active_Client.Browser_Tools
{
@@ -56,7 +55,7 @@ namespace Active_Client.Browser_Tools
{
mainForm = f;
AddDynamicProperty("RECENT_FOLDER_KEY").PropertyGet += getProp;
AddDynamicProperty("RECENT_FOLDER_KEY").PropertyGet += getProp;
AddFunction("minimizeForm").Execute += minimizeForm;
AddFunction("maximizeForm").Execute += maximizeForm;
@@ -383,7 +382,7 @@ namespace Active_Client.Browser_Tools
Path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\",
Type = "SPFO"
});
try
{
// Network Folders
@@ -429,7 +428,7 @@ namespace Active_Client.Browser_Tools
try
{
if(p == RECENT_FOLDER_KEY)
if (p == RECENT_FOLDER_KEY)
{
filelist = GetLastUploadedFiles();
}
@@ -556,9 +555,9 @@ namespace Active_Client.Browser_Tools
// }
//}
foreach(FileModel file in files)
foreach (FileModel file in files)
{
if(!file.IsMain)
if (!file.IsMain)
form.Add(new ByteArrayContent(File.ReadAllBytes(file.AbsolutePath)), "file", Path.GetFileName(file.AbsolutePath));
}
@@ -745,13 +744,13 @@ namespace Active_Client.Browser_Tools
func = e.Arguments[1],
file = p
};
Thread t = new Thread(startNewEditor);
t.Start();
}
public void startNewEditor()
{
{
Process proc = new Process
{
StartInfo = new ProcessStartInfo()
@@ -769,7 +768,7 @@ namespace Active_Client.Browser_Tools
public void cleanFileWatcher(object sender, CfrV8HandlerExecuteEventArgs e)
{
if(watcher != null)
if (watcher != null)
{
watcher.EnableRaisingEvents = false;
@@ -832,7 +831,7 @@ namespace Active_Client.Browser_Tools
else
isFirst = false;
stringBuilder.Append(stringVal);
stringBuilder.Append(stringVal);
}
File.WriteAllLines(RECENT_FILE_PATH, stringBuilder.ToString()
@@ -865,7 +864,7 @@ namespace Active_Client.Browser_Tools
{
if (file.FileExist && !file.IsMain)
files.Add(file);
}
}
// Check if software need to upload all the files
@@ -881,7 +880,7 @@ namespace Active_Client.Browser_Tools
files.Add(new FileModel()
{
AbsolutePath = subfileName,
FileExist = true,
FileExist = true,
IsDirectory = false,
IsMain = false,
Name = Path.GetFileName(subfileName),
@@ -969,7 +968,7 @@ namespace Active_Client.Browser_Tools
//Task to execute
var task = new CfrTask();
task.Execute += (s, e) =>
{
{
context.Enter();
var args = new CfrV8Value[] { arguments };
functionIstance.ExecuteFunction(null, args); //execute callback, nothing happens here
@@ -1176,7 +1175,7 @@ namespace Active_Client.Browser_Tools
{
// Find metadata.json file
var file = zipArchive.Entries.Where(x => x.FullName == JOB_METADATA_FILENAME).FirstOrDefault();
if(file == null)
if (file == null)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_corrupted_model")));
return;
@@ -1342,7 +1341,7 @@ namespace Active_Client.Browser_Tools
{
ZipFile.CreateFromDirectory(JOB_OPENING_PATH, jobPath);
}
catch(Exception ex)
catch (Exception ex)
{
e.SetReturnValue(JsonConvert.SerializeObject(new ErrorContainer("error_save_file")));
return;
-4
View File
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Errors
{
+1 -7
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
namespace Active_Client.Browser_Tools.Models
{
public class FileModel
{
-3
View File
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
-3
View File
@@ -1,9 +1,6 @@
using Active_Client.Browser_Tools.Models.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Metadata
namespace Active_Client.Browser_Tools.Models.Metadata
{
public class ImageParam
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models.Metadata
{
@@ -1,9 +1,6 @@
using Active_Client.Browser_Tools.Models.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Active_Client.Browser_Tools.Models
{
+8 -2
View File
@@ -35,7 +35,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>..\Thermo.Active\bin\Client_Debug\x64\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -44,7 +44,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>..\Thermo.Active\bin\Client\x64\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -288,4 +288,10 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Target Name="AfterBuild">
<ItemGroup>
<MoveToLibFolder Exclude="Config.xml" Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" />
</ItemGroup>
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
</Target>
</Project>
+28 -31
View File
@@ -1,21 +1,17 @@
using Chromium;
using Active_Client.View;
using Chromium;
using Chromium.Event;
using Chromium.WebBrowser;
using Chromium.WebBrowser.Event;
using Client.Config;
using Client.Utils;
using Active_Client.View;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Management;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Active_Client
@@ -37,8 +33,8 @@ namespace Active_Client
//Crate General Exception Handler
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(GeneralExMethod);
//Read App Configuration
//Read App Configuration
readConfiguration();
//Initialize Chromium
@@ -66,9 +62,9 @@ namespace Active_Client
Application.SetCompatibleTextRenderingDefault(false);
//Check Graphic Card in Energy Saving mode
checkGraphicCard();
//Run the Loading Form
checkGraphicCard();
//Run the Loading Form
Application.Run(new OpeningForm());
//Run the Main-Browser Form
@@ -76,14 +72,14 @@ namespace Active_Client
//Force show Taskbar
NcWindow.ShowTaskBar();
}
}
#endregion
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region CONFIG_METHODS
//Sub-Method used to read the configuration
//Sub-Method used to read the configuration
static private void readConfiguration()
{
//Read the Config
@@ -107,7 +103,8 @@ namespace Active_Client
{
//Prepare List of Cards
String Cardlist = "";
foreach (ManagementObject card in VideoCards){
foreach (ManagementObject card in VideoCards)
{
Cardlist = Cardlist + " - " + card["Name"] + "\n";
}
@@ -121,7 +118,7 @@ namespace Active_Client
{
//code if key Not Exist add it and restart
Registry.SetValue(keyName, valueName, "GpuPreference=1;");
MessageBox.Show("Active has foundthis Graphic Cards:\n\n" + Cardlist +"\nThe graphic configuration has been setted. Press Ok to restart the Application",Application.ProductName);
MessageBox.Show("Active has foundthis Graphic Cards:\n\n" + Cardlist + "\nThe graphic configuration has been setted. Press Ok to restart the Application", Application.ProductName);
Application.Restart();
Environment.Exit(0);
}
@@ -143,10 +140,10 @@ namespace Active_Client
if (CfxRuntime.PlatformArch == CfxPlatformArch.x64)
CfxRuntime.LibCefDirPath = Constants.CEF_X64_PATH;
else
CfxRuntime.LibCefDirPath = Constants.CEF_X86_PATH;
//Add the event variables
CfxRuntime.LibCefDirPath = Constants.CEF_X86_PATH;
//Add the event variables
ChromiumWebBrowser.OnBeforeCfxInitialize += Chromium_OnBeforeCfxInitialize;
ChromiumWebBrowser.OnBeforeCommandLineProcessing += Chromium_OnBeforeCommandLineProcessing;
@@ -167,11 +164,11 @@ namespace Active_Client
static void Chromium_OnBeforeCommandLineProcessing(CfxOnBeforeCommandLineProcessingEventArgs e)
{
if (Config.ClientConfig.RenderingMethod == Constants.Rendering.CPU)
e.CommandLine.AppendSwitch("--disable-gpu");
e.CommandLine.AppendSwitch("--disable-gpu");
e.CommandLine.AppendSwitch("--enable-transparent-visuals");
e.CommandLine.AppendSwitch("--disable-pinch");
e.CommandLine.AppendSwitch("--enable-media-stream");
e.CommandLine.AppendSwitch("--enable-media-stream");
e.CommandLine.AppendSwitch("--enable-usermedia-screen-capture");
e.CommandLine.AppendSwitch("--no-proxy-server");
@@ -188,7 +185,7 @@ namespace Active_Client
e.Settings.CachePath = Constants.BROWSER_CACHE_FOLDER;
e.Settings.LocalesDirPath = Constants.CEF_LOCALES_PATH;
e.Settings.ResourcesDirPath = CfxRuntime.LibCefDirPath;
e.Settings.Locale = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName ;
e.Settings.Locale = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
}
@@ -218,10 +215,10 @@ namespace Active_Client
MessageBoxDefaultButton.Button1
);
Environment.Exit(-1);
}
}
private static void GeneralExMethod(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception)args.ExceptionObject;
-1
View File
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+5 -17
View File
@@ -1,26 +1,14 @@
using Microsoft.WindowsAPICodePack.Taskbar;
using Client.Config;
using Client.Config;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Client.Utils;
using System.IO;
namespace Active_Client.View
{
public partial class LoadingForm : MetroFramework.Forms.MetroForm
{
//Constructor
{
//Constructor
public LoadingForm()
{
InitializeComponent();
@@ -37,7 +25,7 @@ namespace Active_Client.View
}
//Set window Position
this.Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
this.Location = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
}
+21 -22
View File
@@ -1,16 +1,15 @@
using Chromium;
using Active_Client.Browser_Tools;
using Chromium;
using Chromium.Event;
using Chromium.Remote.Event;
using Chromium.WebBrowser;
using Client.Config;
using Client.Utils;
using Active_Client.Browser_Tools;
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using static Client.Utils.Constants;
using System.Diagnostics;
namespace Active_Client.View
{
@@ -31,7 +30,7 @@ namespace Active_Client.View
private LoadingForm LdFrm;
private static IntPtr MainHandle;
private static IntPtr NcHandle;
private static IntPtr ProdHandle;
private static IntPtr ProdHandle;
private int X = 0, Y = 0;
private string BrokenUrl;
private Boolean closeRight = false;
@@ -54,7 +53,7 @@ namespace Active_Client.View
//Setup the Icon
if (Config.ClientConfig.IsSCM)
this.Icon = Properties.Resources.MAESTRO_ACTIVE_ICON;
//Start Client Setting
InitializeClientSettings();
@@ -83,7 +82,7 @@ namespace Active_Client.View
{
var candidate = Screen.PrimaryScreen;
// If primary screen is not full HD find another screen
if(candidate.WorkingArea.Width != 1920)
if (candidate.WorkingArea.Width != 1920)
{
foreach (var s in Screen.AllScreens)
{
@@ -125,7 +124,7 @@ namespace Active_Client.View
if (Config.VendorHmiConfig.Type == 3)
NcWindow.MinimizeNcWindow();
if (Config.VendorHmiConfig.Enabled)
NcFrm.Hide();
if (Config.ProdSoftwareConfig.Enabled)
@@ -148,7 +147,7 @@ namespace Active_Client.View
{
ShowNCWindow();
}
else if(NcWindow.State == NcState.SHOWPROD)
else if (NcWindow.State == NcState.SHOWPROD)
{
ShowProdWindow();
}
@@ -172,7 +171,7 @@ namespace Active_Client.View
//Close the NC HMI && Stop Following Nc
if (Config.VendorHmiConfig.Enabled)
NcWindow.CloseNcWindow(false);
if (Config.ProdSoftwareConfig.Enabled)
NcWindow.CloseProdWindow(false);
@@ -186,7 +185,7 @@ namespace Active_Client.View
try
{
CfxRuntime.Shutdown();
}
catch (Exception)
{
@@ -197,7 +196,7 @@ namespace Active_Client.View
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if(!closeRight)
if (!closeRight)
e.Cancel = true;
}
@@ -272,7 +271,7 @@ namespace Active_Client.View
private void BeforeDownload(object sender, CfxOnBeforeDownloadEventArgs e)
{
e.Callback.Continue("",true);
e.Callback.Continue("", true);
}
//On browser Load-Error. Event Handler called by Browser
@@ -478,7 +477,7 @@ namespace Active_Client.View
private void ShowWindow()
{
if(Config.ClientConfig.DeveloperMode && Width < 1920 && Height < 1080)
if (Config.ClientConfig.DeveloperMode && Width < 1920 && Height < 1080)
{
double ratio = (((double)Width) / 1920.0) * 100.0;
//Funzione sperimentale presa da Forum CEF
@@ -513,7 +512,7 @@ namespace Active_Client.View
w = NcFrm.Width;
h = NcFrm.Height;
}
else if(Config.ProdSoftwareConfig.Enabled)
else if (Config.ProdSoftwareConfig.Enabled)
{
w = ProdFrm.Width;
h = ProdFrm.Height;
@@ -560,8 +559,8 @@ namespace Active_Client.View
if (InvokeRequired)
Invoke((MethodInvoker)delegate ()
{
//Set Message Status
LdFrm.Show(Message);
//Set Message Status
LdFrm.Show(Message);
LdFrm.Focus();
});
else
@@ -705,7 +704,7 @@ namespace Active_Client.View
//Hide NC Method
public void HideAUXWindow()
{
if ((!Config.VendorHmiConfig.Enabled && !Config.ProdSoftwareConfig.Enabled) || (NcFrm==null && ProdFrm == null))
if ((!Config.VendorHmiConfig.Enabled && !Config.ProdSoftwareConfig.Enabled) || (NcFrm == null && ProdFrm == null))
return;
//Invoke method if is needed or call the method in STD mode
@@ -728,7 +727,7 @@ namespace Active_Client.View
else
{
if (NcFrm != null && NcFrm.Owner != null)
if (NcFrm != null && NcFrm.Owner != null)
NcFrm.Owner = null;
if (ProdFrm != null && ProdFrm.Owner != null)
ProdFrm.Owner = null;
@@ -770,7 +769,7 @@ namespace Active_Client.View
if (ss.Bounds.Width != 1920 && ss.Bounds.Height != 1080)
{
HideLoadingWindow();
if(Config.VendorHmiConfig.Enabled)
if (Config.VendorHmiConfig.Enabled)
NcWindow.CloseNcWindow(false);
if (Config.ProdSoftwareConfig.Enabled)
NcWindow.CloseProdWindow(false);
@@ -778,8 +777,8 @@ namespace Active_Client.View
}
}
}
else
{
else
{
if (Config.ClientConfig.DeveloperMode)
{
//Set the Prymary screen Size
@@ -789,7 +788,7 @@ namespace Active_Client.View
this.Height = ps.Bounds.Height;
}
}
}
else
{
if (ps.Bounds.Width != 1920 && ps.Bounds.Height != 1080)
+3 -10
View File
@@ -1,18 +1,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
namespace Active_Client.View
{
public partial class NcForm : Form
{
public NcForm(Color TranspColor,int PosX,int PosY)
public NcForm(Color TranspColor, int PosX, int PosY)
{
InitializeComponent();
@@ -37,7 +30,7 @@ namespace Active_Client.View
private void NcForm_FormClosing(object sender, FormClosingEventArgs e)
{
if(e.CloseReason == CloseReason.UserClosing)
if (e.CloseReason == CloseReason.UserClosing)
e.Cancel = true;
}
}
+30 -31
View File
@@ -1,9 +1,8 @@
using Chromium.Remote;
using Active_Client.Properties;
using Chromium.Remote;
using Client.Config;
using Client.Utils;
using Active_Client.Properties;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
@@ -60,7 +59,7 @@ namespace Active_Client.View
private static int LastX, LastY;
private static int LastWidth = 1024, LastHeight = 768;
private static IntPtr hhook;
private static IntPtr hhookWindow;
private static IntPtr hhookWindow;
private static IntPtr keybhook;
private static IntPtr MainViewHandle;
private static IntPtr TaskBarHandle;
@@ -70,7 +69,7 @@ namespace Active_Client.View
private static uint ProdProcessPID;
private static uint ActualPID;
private static WinEventDelegate procDelegate;
private static WinEventDelegate procDelegateWindow;
private static WinEventDelegate procDelegateWindow;
private static keyboardHookProc keybDelegate;
private static uint LastdwmsEventTime;
private static uint LastHookedPID;
@@ -102,13 +101,13 @@ namespace Active_Client.View
private static int ActiveWindowNCWindowStyle;
private static int ActiveWindowNCWindowBorder;
private static uint ActiveWindowNCPopUp;
private static uint ActiveNCWindowNCPopUp;
private static uint ActiveNCWindowNCPopUp;
public static MainForm mainFrm;
private static string prodEXEname;
private static string prodEXEname;
public static NcState State { get { return state; } }
private static NcState state;
@@ -263,8 +262,8 @@ namespace Active_Client.View
//Maximize Window if is Osai
if (Config.VendorHmiConfig.Type == 3)
ShowWindow(ncprocess.MainWindowHandle, SW_SHOWMAXIMIZED);
ShowWindow(ncprocess.MainWindowHandle, SW_SHOWMAXIMIZED);
return 0;
}
@@ -681,8 +680,8 @@ namespace Active_Client.View
//Stop following Nc Window (bring-to-font the main window) -> ONLY FOR OSAI System!
public static void StopNcFollowing()
{
//Detach the hook
{
//Detach the hook
if (hhook != IntPtr.Zero)
UnhookWinEvent(hhook);
@@ -984,9 +983,9 @@ namespace Active_Client.View
#region WINDOWS_EVENT_OVERRIDE
private static void WinEventProcWindow(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
{
//Read the actual ID of the Process
{
//Read the actual ID of the Process
GetWindowThreadProcessId(hwnd, out ActualWindowPID);
if (ActualWindowPID == NcProcessPID && NcProcessPID != 0 && hWinEventHook != ncprocess.MainWindowHandle)
{
@@ -998,7 +997,7 @@ namespace Active_Client.View
ActiveWindowNCPopUp = ((uint)ActiveWindowNCWindowStyle & WS_POPUP);
//if it has the border and a title execute focus
if (ActiveWindowNCWindowStyle != 0 && (((ActiveWindowNCWindowBorder == WS_BORDER) && ReadWindowTitle(hwnd) != "") || (ActiveWindowNCPopUp == WS_POPUP) ))
if (ActiveWindowNCWindowStyle != 0 && (((ActiveWindowNCWindowBorder == WS_BORDER) && ReadWindowTitle(hwnd) != "") || (ActiveWindowNCPopUp == WS_POPUP)))
{
if (eventType == EVENT_OBJECT_CREATE)
{
@@ -1006,8 +1005,8 @@ namespace Active_Client.View
}
else if (eventType == EVENT_OBJECT_DESTROY)
SetWindowPos(MainViewHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
}
}
}
}
@@ -1036,13 +1035,13 @@ namespace Active_Client.View
//if it has the border and a title execute focus
if (ActiveNCWindowStyle != 0 && ((ActiveNCWindowBorder == WS_BORDER && ReadWindowTitle(hwnd) != "") || (ActiveNCWindowNCPopUp == WS_POPUP)) && hwnd != ncprocess.MainWindowHandle)
{
Console.WriteLine("Handle: " + hwnd + " MainWindowHandle" + ncprocess.MainWindowHandle);
SetWindowPos(ncprocess.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
Console.WriteLine("Handle: " + hwnd + " MainWindowHandle" + ncprocess.MainWindowHandle);
SetWindowPos(ncprocess.MainWindowHandle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
}
}
//If the PID is the STEP-HMI Process
}
//If the PID is the STEP-HMI Process
if (ActualPID == MainProcessPID)
{
if (!IsIconic(MainViewHandle))
@@ -1088,9 +1087,9 @@ namespace Active_Client.View
//Hook Keyboard Handle
private static void KeybEventProc(int nCode, IntPtr wParam, IntPtr lParam)
{
int Key = Marshal.ReadInt32(lParam);
//Elaborate Hotkey
int Key = Marshal.ReadInt32(lParam);
//Elaborate Hotkey
if (wParam == HWND_KEYDOWN || wParam == HWND_SYSKEYDOWN)
{
if (Key == 0xA4 || Key == 0xA5)
@@ -1120,7 +1119,7 @@ namespace Active_Client.View
if (wParam == HWND_SYSKEYDOWN || wParam == HWND_KEYDOWN)
mainFrm.keyPressedHandler(altPressed, ctrlPressed, shiftPressed, Key);
}
if((wParam == HWND_SYSKEYDOWN || wParam == HWND_KEYDOWN) && !altPressed && (KeybPID == MainProcessPID || KeybPID == ProdProcessPID) && state == NcState.SHOW)
if ((wParam == HWND_SYSKEYDOWN || wParam == HWND_KEYDOWN) && !altPressed && (KeybPID == MainProcessPID || KeybPID == ProdProcessPID) && state == NcState.SHOW)
{
//IF Siemens
if (Config.VendorHmiConfig.Type == 2)
+49 -54
View File
@@ -1,22 +1,15 @@
using Microsoft.WindowsAPICodePack.Taskbar;
using Client.Config;
using Client.Config;
using Client.Config.SubModels;
using Client.Utils;
using Microsoft.WindowsAPICodePack.Taskbar;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Linq;
using System.IO;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Client.Utils;
using System.IO;
using MetroFramework;
using Newtonsoft.Json;
using Client.Config.SubModels;
namespace Active_Client.View
{
@@ -27,7 +20,7 @@ namespace Active_Client.View
private HttpWebResponse ConnTestResponse;
private String ConnTestError;
private Task ConnTask;
private ushort WaitDot=1;
private ushort WaitDot = 1;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#region WINDOW_START_&_BEHAVIOUR_METHOD
@@ -63,9 +56,9 @@ namespace Active_Client.View
private void LoadingForm_Load(object sender, EventArgs e)
{
//Force on Desktop 1
this.DesktopLocation = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
//Start Backgroud Task
this.DesktopLocation = new Point((Screen.PrimaryScreen.Bounds.Width / 2) - (this.Width / 2), (Screen.PrimaryScreen.Bounds.Height / 2) - (this.Height / 2));
//Start Backgroud Task
ConnTask = Task.Run(() => BagroundWorker());
}
@@ -126,28 +119,29 @@ namespace Active_Client.View
setOpacity(1);
//Show the loading state on the app ICON
this.Invoke((MethodInvoker)delegate () {TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate, this.Handle); });
//try to Request
if(!Config.ConnectionConfig.BypassReadConfiguration)
this.Invoke((MethodInvoker)delegate () { TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate, this.Handle); });
//try to Request
if (!Config.ConnectionConfig.BypassReadConfiguration)
{
setStatus("Connecting to " + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort, "");
Boolean error=false;
do {
Boolean error = false;
do
{
if (error == true)
return;
} while (!testConnection(new Uri(Config.ConnectionConfig.ReadConfigUrl),out error));
} while (!testConnection(new Uri(Config.ConnectionConfig.ReadConfigUrl), out error));
}
//Set App Opacity (Only Siemens)
if(Config.VendorHmiConfig.Type == 2)
if (Config.VendorHmiConfig.Type == 2)
setOpacity(0.85);
//Open Nc Window
setStatus("Opening NC Window... ", "");
setStatus("Opening NC Window... ", "");
if (Config.VendorHmiConfig.Enabled)
if (!OpenNcWindow())
return;
@@ -160,13 +154,13 @@ namespace Active_Client.View
var exename = Path.GetFileNameWithoutExtension(Config.ProdSoftwareConfig.Path);
if (!OpenProdWindow(Config.ProdSoftwareConfig.Path, exename))
return;
}
//Set App Opacity
}
//Set App Opacity
setOpacity(1);
//Close the Window
closeWindow();
closeWindow();
}
@@ -195,7 +189,7 @@ namespace Active_Client.View
//Sub-Method used to test the connection
private bool testConnection(Uri url,out Boolean error)
private bool testConnection(Uri url, out Boolean error)
{
Boolean Connected = false;
error = false;
@@ -224,8 +218,8 @@ namespace Active_Client.View
//Check if it's connected
if (Connected)
{
// var jsonDefinition = new { ncVendor = "", showHMI = "", ncIp = "", ncPort = "", prodEnabled = "", prodPath = "", extPrograms = "" };
{
// var jsonDefinition = new { ncVendor = "", showHMI = "", ncIp = "", ncPort = "", prodEnabled = "", prodPath = "", extPrograms = "" };
var jsonDefinition = new ServerConfigModel();
setStatus("Connected!", "");
@@ -237,20 +231,20 @@ namespace Active_Client.View
{
var ConfigResponse = JsonConvert.DeserializeAnonymousType(reader.ReadToEnd(), jsonDefinition);
if(!String.IsNullOrWhiteSpace(ConfigResponse.NcVendor) && !String.IsNullOrWhiteSpace(ConfigResponse.ShowHMI))
if (!String.IsNullOrWhiteSpace(ConfigResponse.NcVendor) && !String.IsNullOrWhiteSpace(ConfigResponse.ShowHMI))
{
string ncVendorName = ConfigResponse.NcVendor.ToUpper();
string ncVendorHMI = ConfigResponse.ShowHMI.ToUpper();
Config.VendorHmiConfig.IpAddress = ConfigResponse.NcIp.ToUpper();
Config.VendorHmiConfig.Port = ConfigResponse.NcPort.ToUpper();
string ProdEnabled = ConfigResponse.ProdEnabled.ToUpper();
Config.VendorHmiConfig.IpAddress = ConfigResponse.NcIp.ToUpper();
Config.VendorHmiConfig.Port = ConfigResponse.NcPort.ToUpper();
string ProdEnabled = ConfigResponse.ProdEnabled.ToUpper();
string ProdPath = ConfigResponse.ProdPath.ToUpper();
string Autorun = ConfigResponse.Autorun.ToUpper();
//Read the Server Type
if (ncVendorName.Equals("DEMO"))
Config.VendorHmiConfig.Type = 0;
Config.VendorHmiConfig.Type = 0;
else if (ncVendorName.Equals("FANUC"))
Config.VendorHmiConfig.Type = 1;
else if (ncVendorName.Equals("SIEMENS"))
@@ -271,8 +265,8 @@ namespace Active_Client.View
Config.VendorHmiConfig.Enabled = true;
else
Config.VendorHmiConfig.Enabled = false;
//Autorun
//Autorun
if (Autorun.ToUpper().Equals("TRUE"))
Config.ClientConfig.Autorun = true;
else
@@ -290,9 +284,9 @@ namespace Active_Client.View
Config.TextEditorPath = ConfigResponse.EditorPath;
if (ConfigResponse.ExtSoftwares != null)
Config.ExtSoftwaresConfig = ConfigResponse.ExtSoftwares.ToArray();
return true;
Config.ExtSoftwaresConfig = ConfigResponse.ExtSoftwares.ToArray();
return true;
}
}
@@ -303,8 +297,8 @@ namespace Active_Client.View
setStatus("Error!", "Error While loading the configuration");
return false;
}
}
}
else
{
@@ -331,29 +325,30 @@ namespace Active_Client.View
//Sub-Method used to open the NC Window
private bool OpenNcWindow()
{
switch(NcWindow.StartNcWindow())
switch (NcWindow.StartNcWindow())
{
case 0: return true;
case 1: {
case 1:
{
setStatus("Close the application!", "NC Path not found: " + NcWindow.ProcessPath);
return false;
};
return false;
};
case 2:
{
setStatus("Close the application!", "Unable to start the NC application: ");
return false;
};
}
}
return false;
}
//Sub-Method used to open the NC Window
private bool OpenProdWindow(string ExePath,string ExeName)
private bool OpenProdWindow(string ExePath, string ExeName)
{
switch (NcWindow.StartProdWindow(ExePath, ExeName))
{
+1 -8
View File
@@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
namespace Active_Client.View
@@ -1,10 +1,7 @@
using Thermo.Active.CmsConnectGateway.Builders;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.CmsConnectGateway.Builders;
namespace Thermo.Active.CmsConnectGateway
{
@@ -52,7 +49,7 @@ namespace Thermo.Active.CmsConnectGateway
config.dnsPrefixes = dnsPrefixes;
return this;
}
public GatewayNetworkConfiguration GenerateConfiguration()
{
@@ -93,7 +90,7 @@ namespace Thermo.Active.CmsConnectGateway
return config;
}
}
}
@@ -1,10 +1,7 @@
using Thermo.Active.CmsConnectGateway.Builders;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.CmsConnectGateway.Builders;
namespace Thermo.Active.CmsConnectGateway
{
@@ -79,7 +76,7 @@ namespace Thermo.Active.CmsConnectGateway
//Controls empty spaces
CheckNoEmptySpaces(config.address, "Address");
if(config.username != null)
if (config.username != null)
CheckNoEmptySpaces(config.username, "Username");
if (config.password != null)
CheckNoEmptySpaces(config.password, "Password");
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Thermo.Active.CmsConnectGateway.Builders
{
@@ -51,13 +47,13 @@ namespace Thermo.Active.CmsConnectGateway.Builders
}
internal void CheckNoEmptySpaces(string strToCheck,string paramName)
internal void CheckNoEmptySpaces(string strToCheck, string paramName)
{
if (strToCheck.Contains(" "))
throw new FormatException("BAD FORMAT - param \"" + paramName + "\" must be without empty spaces");
}
private bool EvaluateIPV4(string stringValue, out IPAddress address)
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.CmsConnectGateway.Events
{
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.CmsConnectGateway.Exceptions
{
public class GatewayException: Exception
public class GatewayException : Exception
{
public GatewayException(string message): base(message)
public GatewayException(string message) : base(message)
{
}
}
@@ -1,7 +1,5 @@
using Renci.SshNet;
using Renci.SshNet.Common;
using Thermo.Active.CmsConnectGateway.Events;
using Thermo.Active.CmsConnectGateway.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -11,6 +9,8 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Thermo.Active.CmsConnectGateway.Events;
using Thermo.Active.CmsConnectGateway.Exceptions;
namespace Thermo.Active.CmsConnectGateway
{
@@ -127,7 +127,7 @@ namespace Thermo.Active.CmsConnectGateway
/// <exception cref="GatewayException"></exception>
public GatewayNetworkConfiguration ReadGatewayNetworkConfiguration()
{
return ElaborateConfigFromSshNetworkCommand( SendSSHCommand(SSH_GET_NETWORK_COMMAND) );
return ElaborateConfigFromSshNetworkCommand(SendSSHCommand(SSH_GET_NETWORK_COMMAND));
}
@@ -184,9 +184,9 @@ namespace Thermo.Active.CmsConnectGateway
}
hand(this, ev);
};
// Create a task and not start it.
Task t = new Task (() => action(delay, handler));
Task t = new Task(() => action(delay, handler));
t.Start();
}
@@ -217,7 +217,7 @@ namespace Thermo.Active.CmsConnectGateway
}
#endregion
//---------------------------------------------------------------------------------------------------
#region SSH_commands_preparations_sub_methods
@@ -255,7 +255,7 @@ namespace Thermo.Active.CmsConnectGateway
return command.ToString();
}
//SSH command generator for Network setting
private string GenerateSshNetworkCommand(GatewayNetworkConfiguration configuration)
@@ -272,7 +272,7 @@ namespace Thermo.Active.CmsConnectGateway
IPNetwork tempIpNetw = IPNetwork.Parse(configuration.ipAddress, configuration.netMaskAddress);
command.Append(configuration.ipAddress).Append("/").Append(tempIpNetw.Cidr).Append(" ");
if(configuration.defaultGatewayAddress != null)
if (configuration.defaultGatewayAddress != null)
command.Append(configuration.defaultGatewayAddress);
}
@@ -298,7 +298,7 @@ namespace Thermo.Active.CmsConnectGateway
{
StringBuilder command = new StringBuilder(SSH_SET_DNSSUFFIX_COMMAND);
if(configuration.dnsPrefixes != null)
if (configuration.dnsPrefixes != null)
command.Append(string.Join(",", configuration.dnsPrefixes));
return command.ToString();
@@ -368,7 +368,7 @@ namespace Thermo.Active.CmsConnectGateway
if (!stringValue.Contains('/'))
throw new GatewayException("Internal Gateway Error during read (bad format): " + IP_ADDR_LABEL + stringValue);
string [] tempAddr = stringValue.Split('/');
string[] tempAddr = stringValue.Split('/');
//Check if has lenght == 2
if (tempAddr.Length != 2)
throw new GatewayException("Internal Gateway Error during read (bad format): " + IP_ADDR_LABEL + stringValue);
@@ -445,7 +445,7 @@ namespace Thermo.Active.CmsConnectGateway
if (tempStr.Length == 0)
configuration.dnsPrefixes = null;
else
configuration.dnsPrefixes = tempStr.Where(X=> !String.IsNullOrEmpty(X)).ToList();
configuration.dnsPrefixes = tempStr.Where(X => !String.IsNullOrEmpty(X)).ToList();
}
}
@@ -473,7 +473,7 @@ namespace Thermo.Active.CmsConnectGateway
if (!stringValue.Contains(':'))
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
string[] tempAddr = stringValue.Split(':');
//Check if has lenght == 2
if (tempAddr.Length != 2)
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
@@ -510,7 +510,7 @@ namespace Thermo.Active.CmsConnectGateway
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
if (tempAddr.Length != 2)
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
//Set the username
configuration.username = tempLogin[0];
//Set the password
@@ -524,7 +524,7 @@ namespace Thermo.Active.CmsConnectGateway
throw new GatewayException("Internal Gateway Error during read (bad format): " + PROXY_ADDR_LABEL + stringValue);
configuration.port = tempPort;
}
}
}
@@ -538,7 +538,7 @@ namespace Thermo.Active.CmsConnectGateway
{
string[] tempStr = stringValue.Trim('"').Split(',');
for (int i=0;i<tempStr.Length;i++)
for (int i = 0; i < tempStr.Length; i++)
tempStr[i] = tempStr[i].Trim();
if (tempStr.Length == 0)
@@ -562,7 +562,7 @@ namespace Thermo.Active.CmsConnectGateway
}
private bool EvaluateIPV4(string stringValue,out IPAddress address)
private bool EvaluateIPV4(string stringValue, out IPAddress address)
{
Regex rgx = new Regex(@"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
@@ -583,7 +583,7 @@ namespace Thermo.Active.CmsConnectGateway
//Override sendCommand for single command
private List<string> SendSSHCommand(string command)
{
return SendSSHCommand(new List<string> {command});
return SendSSHCommand(new List<string> { command });
}
@@ -594,12 +594,12 @@ namespace Thermo.Active.CmsConnectGateway
List<string> returnedValues = new List<string>();
//Create the SSH Gateway
SshClient _sshGateway = new SshClient(this.host, this.username, this.password);
SshClient _sshGateway = new SshClient(this.host, this.username, this.password);
try
{
//Connect
_sshGateway.Connect();
foreach(string cmd in command)
foreach (string cmd in command)
{
//Run command
sshCmd = _sshGateway.RunCommand(cmd);
@@ -655,7 +655,7 @@ namespace Thermo.Active.CmsConnectGateway
private void SendSSHReboot(int seconds)
{
//Send SSH Command
SendSSHCommand(SSH_GW_REBOOT_COMMAND + seconds);
SendSSHCommand(SSH_GW_REBOOT_COMMAND + seconds);
//Wait the time for reboot
Thread.Sleep((seconds + 5) * 1000);
@@ -708,7 +708,7 @@ namespace Thermo.Active.CmsConnectGateway
}
} while (!disconnected);
//Phase 2 Wait Re-connection Cycle
bool connected = false;
do
@@ -716,7 +716,7 @@ namespace Thermo.Active.CmsConnectGateway
try
{
//If TimeSpan > TOT MIN -> Exception
if((DateTime.Now - nowAfterReboot) > TimeSpan.FromMinutes(REBOOT_MINUTES_MAX))
if ((DateTime.Now - nowAfterReboot) > TimeSpan.FromMinutes(REBOOT_MINUTES_MAX))
throw new GatewayException("Timeout Error during reboot - Gateway not found during reboot");
//Try Connection
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
namespace Thermo.Active.CmsConnectGateway
@@ -13,8 +10,8 @@ namespace Thermo.Active.CmsConnectGateway
public class GatewayNetworkConfiguration
{
internal GatewayNetworkConfiguration() {}
public Boolean hasDhcp { get; internal set;}
internal GatewayNetworkConfiguration() { }
public Boolean hasDhcp { get; internal set; }
public IPAddress ipAddress { get; internal set; }
public IPAddress netMaskAddress { get; internal set; }
public IPAddress defaultGatewayAddress { get; internal set; }
@@ -23,18 +20,18 @@ namespace Thermo.Active.CmsConnectGateway
public override string ToString()
{
return "hasDhcp: " + hasDhcp + Environment.NewLine +
"ipAddress: " + (ipAddress != null ? ipAddress.ToString() : "null") + Environment.NewLine +
"netMaskAddress: " + (netMaskAddress != null ? netMaskAddress.ToString() : "null") + Environment.NewLine +
"defaultGatewayAddress: " + (defaultGatewayAddress != null ? defaultGatewayAddress.ToString() : "null") + Environment.NewLine +
"dnsAddresses: " + (dnsAddresses != null ? string.Join(",", dnsAddresses) : "null") + Environment.NewLine +
"dnsPrefixes: " + (dnsPrefixes != null ? string.Join(",", dnsPrefixes) : "null");
return "hasDhcp: " + hasDhcp + Environment.NewLine +
"ipAddress: " + (ipAddress != null ? ipAddress.ToString() : "null") + Environment.NewLine +
"netMaskAddress: " + (netMaskAddress != null ? netMaskAddress.ToString() : "null") + Environment.NewLine +
"defaultGatewayAddress: " + (defaultGatewayAddress != null ? defaultGatewayAddress.ToString() : "null") + Environment.NewLine +
"dnsAddresses: " + (dnsAddresses != null ? string.Join(",", dnsAddresses) : "null") + Environment.NewLine +
"dnsPrefixes: " + (dnsPrefixes != null ? string.Join(",", dnsPrefixes) : "null");
}
}
public class GatewayProxyConfiguration
{
internal GatewayProxyConfiguration(){}
internal GatewayProxyConfiguration() { }
public Boolean hasProxy { get; internal set; }
public string address { get; internal set; }
public uint port { get; internal set; }
@@ -45,12 +42,12 @@ namespace Thermo.Active.CmsConnectGateway
public override string ToString()
{
return "hasProxy: " + hasProxy + Environment.NewLine +
"address: " + (address != null ? address.ToString() : "null") + Environment.NewLine +
"port: " + (port != 0 ? port.ToString() : "null") + Environment.NewLine +
"username: " + (username != null ? username : "null") + Environment.NewLine +
"password: " + (password != null ? password : "null") + Environment.NewLine +
"noproxyAddresses: " + (noproxyAddresses != null ? string.Join(",", noproxyAddresses) : "null");
return "hasProxy: " + hasProxy + Environment.NewLine +
"address: " + (address != null ? address.ToString() : "null") + Environment.NewLine +
"port: " + (port != 0 ? port.ToString() : "null") + Environment.NewLine +
"username: " + (username != null ? username : "null") + Environment.NewLine +
"password: " + (password != null ? password : "null") + Environment.NewLine +
"noproxyAddresses: " + (noproxyAddresses != null ? string.Join(",", noproxyAddresses) : "null");
}
}
}
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -14,6 +14,7 @@
<xs:element name="name" type="xs:string" />
<xs:element name="description" type="xs:string" />
<xs:element name="format" type="xs:string" />
<xs:element name="scaleFactor" type="xs:int" default="1"/>
</xs:all>
</xs:complexType>
</xs:element>
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
using System.Collections.Generic;
namespace Thermo.Active.Config
{
/// <summary>
/// Live data for Thermo Active
/// </summary>
public class LiveData
{
/// <summary>
/// Current loaded recipe
/// </summary>
public string RecipeName = "current.json";
/// <summary>
/// Dictionary of all parameters and values
/// </summary>
public Dictionary<string, double> RecipeParameters;
/// <summary>
/// Dictionary of all channels and relative setpoints
/// </summary>
public Dictionary<int, int> ChannelSetpoints;
}
}
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
@@ -0,0 +1 @@

+17 -8
View File
@@ -1,8 +1,8 @@
using Thermo.Active.Model.ConfigModels;
using System.Collections.Generic;
using Thermo.Active.Model.ConfigModels;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.Scada;
using System.Collections.Generic;
namespace Thermo.Active.Config
{
@@ -11,7 +11,7 @@ namespace Thermo.Active.Config
public static ServerConfigModel ServerStartupConfig;
public static NcConfigModel NcConfig;
public static List<ExtSoftwareModel> ExtSoftwaresConfig;
public static SoftwareProdConfigModel SoftwareProdConfig;
public static SoftwareProdConfigModel SoftwareProdConfig;
public static MachineModel MachineConfig;
public static List<MaintenanceConfigModel> MaintenancesConfig;
public static ContactModel CmsContactConfig;
@@ -32,10 +32,8 @@ namespace Thermo.Active.Config
public static List<NcSoftKeysModel> NcSoftKeysConfig;
public static List<AlarmsConfigModel> InitialAlarmsConfig;
public static List<HeadsConfigModel> HeadsConfig;
public static List<RecipeConfigModel> RecipeConfig;
public static List<ModBlockConfigModel> ModBlockConfig;
public static List<RiskResistModel> RiskResistConfig;
public static List<RiskChannelModel> RiskChannelConfig;
public static CmsConnectConfigModel CmsConnectConfig;
public static AreasConfigModel ProductionConfig;
@@ -46,7 +44,7 @@ namespace Thermo.Active.Config
public static AreasConfigModel ScadaConfig;
public static AreasConfigModel JobEditorConfig;
public static AreasConfigModel UsersConfig;
public static List<ScadaSchemaModel> ProductionScadaSchema = new List<ScadaSchemaModel>();
public static List<ScadaSchemaModel> ConfiguredScadaSchema = new List<ScadaSchemaModel>();
@@ -55,5 +53,16 @@ namespace Thermo.Active.Config
public static List<string> MacrosConfig;
public static string CMSMainProgramContent;
// Thermo
public static List<RecipeConfigModel> RecipeConfig;
public static List<ModBlockConfigModel> ModBlockConfig;
public static List<RiskResistModel> RiskResistConfig;
public static List<RiskChannelModel> RiskChannelConfig;
public static List<RiskBoardModel> RiskBoardConfig;
public static LiveData RecipeLiveData = new LiveData();
}
}
+241 -21
View File
@@ -1,6 +1,4 @@
using Thermo.Active.Model.ConfigModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -12,6 +10,9 @@ using System.Xml;
using System.Xml.Linq;
using System.Xml.Schema;
using System.Xml.Serialization;
using Thermo.Active.Model.ConfigModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.Utils;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.SupportFunctions;
@@ -39,7 +40,28 @@ namespace Thermo.Active.Config
// ReadCMSConnectConfig();
ReadMacros();
ReadScadaFile();
//ReadMainProgram();
}
catch (XmlException ex)
{
ExceptionManager.ManageError(ERROR_LEVEL.FATAL,
"Error while reading file: " + ex.SourceUri +
"\n Error: " + ex.Message,
true
);
}
catch (Exception ex)
{
var message = ex.Message;
if (ex.InnerException != null)
message += "\n" + ex.InnerException.Message;
ExceptionManager.ManageError(ERROR_LEVEL.FATAL, message, true);
}
}
public static void ReadLastRecipe()
{
try
{
ReadLiveData();
}
catch (XmlException ex)
{
@@ -259,8 +281,6 @@ namespace Thermo.Active.Config
public static void ReadServerConfig()
{
//CalculateHash(SERVER_CONFIG_PATH);
// Get server file handler
XDocument xmlConfigFile = GetXmlHandlerWithValidator(SERVER_CONFIG_SCHEMA_PATH, SERVER_CONFIG_PATH);
@@ -594,7 +614,8 @@ namespace Thermo.Active.Config
SubCategory_2 = x.Element("subCategory_2").Value,
Name = x.Element("name").Value,
Description = x.Element("description").Value,
Format = x.Element("format").Value
Format = x.Element("format").Value,
ScaleFactor = Convert.ToInt16(x.Element("scaleFactor").Value)
})
.ToList();
}
@@ -644,7 +665,8 @@ namespace Thermo.Active.Config
{
Id = Convert.ToInt16(x.Value),
Dimensione = Convert.ToInt16(x.Attribute("dimensione").Value),
Potenza = Convert.ToInt16(x.Attribute("potenza").Value)
Potenza = Convert.ToInt16(x.Attribute("potenza").Value),
Modello = x.Attribute("modello").Value
})
.ToList();
@@ -671,23 +693,52 @@ namespace Thermo.Active.Config
int numCol = -1;
int ResistId = 0;
int oldRow = 0;
int currRow = 0;
RiskChannelConfig = new List<RiskChannelModel>();
int currIdBoard = 0;
RiskBoardConfig = new List<RiskBoardModel>();
RiskResistConfig = new List<RiskResistModel>();
RiskChannelConfig = new List<RiskChannelModel>();
// inizializzo le 64 schede a 0 canali...
for (int idxBoard = 0; idxBoard < 64; idxBoard++)
{
RiskBoardConfig.Add(new RiskBoardModel()
{
IdBoard = idxBoard,
NumChannels = 0
});
}
// ciclo x calcolare i canali
foreach (var riflettore in Riflettori)
{
// ciclo sulle resistente
// ciclo sulle resistenze
foreach (var resistenza in riflettore.Resistenze)
{
// cerco la scheda dato il canale... 16 ch x ogni scheda
currIdBoard = (resistenza.Canale - 1) / 16;
// cerco se ho già la scheda
var boardFound = RiskBoardConfig.Find(item => item.IdBoard == currIdBoard);
if (boardFound == null)
{
RiskBoardConfig.Add(new RiskBoardModel()
{
IdBoard = currIdBoard,
NumChannels = 1
});
}
else
{
boardFound.NumChannels += 1;
}
// cerco se ho già il canale
var found = RiskChannelConfig.Find(item => item.IdChannel == resistenza.Canale);
if (found == null)
var chanFound = RiskChannelConfig.Find(item => item.IdChannel == resistenza.Canale);
if (chanFound == null)
{
// cerco il TIPO...
var riferimento = Riferimenti.Find(x => x.Id == resistenza.Tipo);
if(riferimento!=null)
if (riferimento != null)
{
RiskChannelConfig.Add(new RiskChannelModel()
{
@@ -695,10 +746,15 @@ namespace Thermo.Active.Config
IdReflector = riflettore.Tipo,
SetpointRecipe = 0,
SetpointThermo = 0,
MaxPower = riferimento.Potenza
MaxPower = riferimento.Potenza,
NumResist = 1,
CalcIchMin = riferimento.Modello.Contains("Quarzo")
});
}
else
{
chanFound.NumResist += 1;
}
}
}
@@ -790,14 +846,178 @@ namespace Thermo.Active.Config
.Select(x => x.Value)
.ToList();
}
public static void ReadMainProgram()
/// <summary>
/// Try to load live data from json persistence file
/// </summary>
public static bool ReadLiveData()
{
if (File.Exists(MAIN_PROGRAM_CONFIG_PATH))
bool answ = false;
if (File.Exists(LIVE_RECIPE_PATH))
{
CMSMainProgramContent = File.ReadAllText(MAIN_PROGRAM_CONFIG_PATH);
// load all text data
var rawData = File.ReadAllText(LIVE_RECIPE_PATH);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
}
catch
{ }
answ = true;
}
else
{
// reload from template...
var rawData = File.ReadAllText(RECIPE_TEMPLATE_PATH);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
}
catch
{ }
// salva current
SaveRecipeCurrent();
answ = true;
}
// rendo se fatto
return answ;
}
/// <summary>
/// Try to load selected recipe to live data (memory and json persistence file)
/// </summary>
public static bool LoadRecipe(string filePath)
{
bool answ = false;
// check file extension
string fileName = Path.GetFileName(filePath);
if (!fileName.EndsWith(".json"))
{
fileName += ".json";
filePath += ".json";
}
// check filePath...
if (!filePath.Contains(RECIPE_DIRECTORY) && filePath != RECIPE_TEMPLATE_PATH)
{
// aggiungo base path!
filePath = RECIPE_DIRECTORY + filePath;
}
if (File.Exists(filePath))
{
answ = true;
// load all text data
var rawData = File.ReadAllText(filePath);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
}
catch
{ }
// update current live data!
SaveRecipeCurrent();
}
// rendo se fatto
return answ;
}
/// <summary>
/// Try to load template recipe
/// </summary>
public static bool LoadTemplate()
{
bool answ = false;
// check filePath...
if (File.Exists(RECIPE_TEMPLATE_PATH))
{
answ = true;
// load all text data
var rawData = File.ReadAllText(RECIPE_TEMPLATE_PATH);
try
{
// deserialize to object
RecipeLiveData = JsonConvert.DeserializeObject<LiveData>(rawData);
// update NAME
RecipeLiveData.RecipeName = $"{DateTime.Now:yyyyMMss_HHmmss}.json";
}
catch
{ }
// update current live data!
SaveRecipeCurrent();
}
// rendo se fatto
return answ;
}
/// <summary>
/// Try to write live data to json persistence file
/// </summary>
public static bool SaveRecipeCurrent()
{
bool answ = false;
try
{
answ = true;
// serialize
string rawData = JsonConvert.SerializeObject(RecipeLiveData);
// save live!
var dir = Path.GetDirectoryName(LIVE_RECIPE_PATH);
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
File.WriteAllText(LIVE_RECIPE_PATH, rawData);
}
catch
{ }
// rendo se fatto
return answ;
}
/// <summary>
/// Try to save live recipe as NEW template
/// </summary>
public static bool SaveRecipeTemplate()
{
RecipeLiveData.RecipeName = "template.json";
return SaveRecipe(RECIPE_TEMPLATE_PATH);
}
/// <summary>
/// Try to save live recipe to selected filePath
/// </summary>
public static bool SaveRecipe(string filePath)
{
bool answ = false;
try
{
answ = true;
string fileName = Path.GetFileName(filePath);
if (!fileName.EndsWith(".json"))
{
fileName += ".json";
filePath += ".json";
}
// fix name!
RecipeLiveData.RecipeName = fileName;
// serialize
string rawData = JsonConvert.SerializeObject(RecipeLiveData);
// save live!
File.WriteAllText(LIVE_RECIPE_PATH, rawData);
// check filePath...
if (!filePath.Contains(RECIPE_DIRECTORY) && filePath != RECIPE_TEMPLATE_PATH)
{
// aggiungo base path!
filePath = RECIPE_DIRECTORY + filePath;
}
// save!
File.WriteAllText(filePath, rawData);
}
catch
{ }
// rendo se fatto
return answ;
}
public static string CalculateHash(string filename)
@@ -32,6 +32,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -52,9 +55,13 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="LiveData.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServerConfig.cs" />
<Compile Include="ServerConfigController.cs" />
<Content Include="Recipes\.placeholder.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="Report\Programs.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
@@ -175,5 +182,12 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Config\Recipes\template.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net462" />
</packages>
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
+293 -198
View File
@@ -1,12 +1,4 @@
using CMS_CORE_Library.Models;
using Thermo.Active.Config;
using Thermo.Active.Core;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.NC;
using Thermo.Active.Utils;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -18,15 +10,25 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using TeamDev.SDK.MVVM;
using Thermo.Active.Core;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
using Thermo.Active.Model.DTOModels.ThModules;
using Thermo.Active.Model.DTOModels.ThRecipe;
using Thermo.Active.Model.DTOModels.ThWarmers;
using Thermo.Active.NC;
using Thermo.Active.Utils;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.ExceptionManager;
using Thermo.Active.Model.DTOModels.Recipe;
public static class ThreadsFunctions
{
public static int recipeRtCounter = 0;
public static int modulesRtCounter = 0;
public static bool reconnectionIsRunning = false;
private static ConcurrentDictionary<string, long> Timers = new ConcurrentDictionary<string, long>();
@@ -51,11 +53,6 @@ public static class ThreadsFunctions
{
sw.Restart();
//if(errorCounter == MAX_NUM_OF_WATCHDOG_ERROR)
//{
//}
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
@@ -87,6 +84,132 @@ public static class ThreadsFunctions
}
}
/// <summary>
/// Manage status/command words for actions
/// </summary>
public static void ManageStatusCommand()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Manage status command
libraryError = ncAdapter.ManageStatusCommand();
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(250, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException ex)
{
ncAdapter.Dispose();
}
}
/// <summary>
/// Manage action for conf request
/// </summary>
public static void ManageConfRequest()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Manage status command
libraryError = ncAdapter.ManageConfRequest();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(2000, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException ex)
{
ncAdapter.Dispose();
}
}
/// <summary>
/// Manage action for conf request
/// </summary>
public static void ManageProdUpdate()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
//// Manage status command
//libraryError = ncAdapter.ManageProdUpdate();
//if (libraryError.errorCode != 0)
// ManageLibraryError(libraryError);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(1000, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException ex)
{
ncAdapter.Dispose();
}
}
public static void ReadAlarms()
{
NcAdapter ncAdapter = new NcAdapter();
@@ -306,10 +429,13 @@ public static class ThreadsFunctions
// Send through signalR
MessageServices.Current.Publish(SEND_EXPIRED_MAINTENANCES_DATA, null, expiredMaintenances);
// 2020.06.18 commentata da indicazione di Lucio Maranta (NON dovrebbe servire ora)
#if false
//Manage Candies
libraryError = ncAdapter.ManageCandies();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
ManageLibraryError(libraryError);
#endif
}
else
RestoreConnection();
@@ -377,52 +503,6 @@ public static class ThreadsFunctions
}
}
#if false
public static void ReadHeadsData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get Data from config and PLC
libraryError = ncAdapter.GetHeadsData(out List<DTOHeadModel> heads);
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
else
// Send through signalR
MessageServices.Current.Publish(SEND_HEADS_DATA, null, heads);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
#endif
public static void ReadAxesNamesData()
{
NcAdapter ncAdapter = new NcAdapter();
@@ -511,102 +591,6 @@ public static class ThreadsFunctions
}
}
#if false
public static void ReadActiveProgramData()
{
NcFileAdapter ncAdapter = new NcFileAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get Data from config and PLC
libraryError = ncAdapter.GetActiveProgramInfo(out DTOActiveProgramDataModel active);
if (libraryError.IsError())
ManageLibraryError(libraryError);
else
// Send through signalR
MessageServices.Current.Publish(SEND_ACTIVE_PROGRAM_DATA, null, active);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(400, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
#endif
#if false
public static void ReadPartProgramQueueData()
{
NcFileAdapter ncAdapter = new NcFileAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Read data
libraryError = ncAdapter.UpdateQueue();
if (libraryError.IsError())
ManageLibraryError(libraryError);
libraryError = ncAdapter.GetSelectedProcessQueue(out List<DTOQueueModel> queue);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_QUEUE_DATA, null, queue);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
#endif
public static void ReadScadaData()
{
NcAdapter ncAdapter = new NcAdapter();
@@ -694,12 +678,94 @@ public static class ThreadsFunctions
ncAdapter.Dispose();
}
}
public static void ReadRecipeData()
public static void ReadProdInfoData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get new data from PLC (and log if changed...)
libraryError = ncAdapter.ReadProdInfoData(out ThermoModels.ProdInfoModel prodInfoData);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_PROD_INFO_DATA, null, prodInfoData);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
public static void ReadProdCycleData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get new data from PLC
libraryError = ncAdapter.ReadProdCycleData(out ThermoModels.ProdCycleModel prodCycleData);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_PROD_CYCLE_DATA, null, prodCycleData);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
public static void ReadRecipeData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
@@ -713,7 +779,7 @@ public static class ThreadsFunctions
recipeRtCounter--;
bool onlyRt = recipeRtCounter > 0;
//check reset...
recipeRtCounter = recipeRtCounter < 0 ? 5 : recipeRtCounter;
recipeRtCounter = recipeRtCounter < 0 ? 4 : recipeRtCounter;
sw.Restart();
@@ -735,7 +801,7 @@ public static class ThreadsFunctions
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(250, (int)sw.ElapsedMilliseconds));
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
@@ -745,11 +811,8 @@ public static class ThreadsFunctions
}
public static void ReadWarmersData()
{
// TODO FIXME
#if false
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
@@ -764,21 +827,60 @@ public static class ThreadsFunctions
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
List<ScadaSchemaModel> scadaToRead = ProductionScadaSchema.Concat(SubscribedScada).ToList();
// Get new data from PLC
libraryError = ncAdapter.ReadScadasData(scadaToRead, out List<DTOScadaModel> scadas);
libraryError = ncAdapter.ReadWarmers(out Dictionary<int, DTOWarmers> currWarmers);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_SCADA_DATA, null, scadas);
// pubblico
MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, currWarmers);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(1800, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
public static void ReadAreaData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get new data from PLC... info x area lastra... la % di X / Y
libraryError = ncAdapter.GetWarmMaterialArea(out Dictionary<string, double> currAreaPerc);
if (libraryError.IsError())
ManageLibraryError(libraryError);
// pubblico
MessageServices.Current.Publish(SEND_THERMO_AREA_DATA, null, currAreaPerc);
}
else
RestoreConnection();
sw.Stop();
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
@@ -787,16 +889,12 @@ public static class ThreadsFunctions
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
#endif
}
}
public static void ReadModulesData()
{
// TODO FIXME
#if false
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
@@ -811,31 +909,28 @@ public static class ThreadsFunctions
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
List<ScadaSchemaModel> scadaToRead = ProductionScadaSchema.Concat(SubscribedScada).ToList();
// Get new data from PLC
libraryError = ncAdapter.ReadScadasData(scadaToRead, out List<DTOScadaModel> scadas);
libraryError = ncAdapter.ReadModulesBlock(out Dictionary<int, DTOModulesBlock> currModules);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_SCADA_DATA, null, scadas);
MessageServices.Current.Publish(SEND_THERMO_MODULE_DATA, null, currModules);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
Thread.Sleep(CalcSleepTime(250, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
#endif
}
}
public static void ReadM154Data()
{
@@ -1025,9 +1120,9 @@ public static class ThreadsFunctions
ICollection<CultureInfo> cultureInfos = new List<CultureInfo>();
// Get nc available language
CmsError cmsError = ncAdapter.numericalControl.NC_GetAvailableLanguages(ref cultureInfos);
if (cmsError.IsError())
ManageLibraryError(cmsError);
CmsError libraryError = ncAdapter.numericalControl.NC_GetAvailableLanguages(ref cultureInfos);
if (libraryError.IsError())
ManageLibraryError(libraryError);
// Filter available language with
availableLanguages = availableLanguages.Where(x => cultureInfos.Any(y => y.TwoLetterISOLanguageName == x.IsoId)).ToList();
@@ -1086,15 +1181,15 @@ public static class ThreadsFunctions
ThreadsHandler.Stop();
StatReset();
NcAdapter ncAdapter = new NcAdapter();
CmsError cmsError = NO_ERROR;
CmsError libraryError = NO_ERROR;
// Run loop until NC is connected
while (!ncAdapter.numericalControl.NC_IsConnected())
{
// Try reconnection
cmsError = ncAdapter.Connect();
if (cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || cmsError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
ManageLibraryError(cmsError);
else if (cmsError.errorCode != CMS_ERROR_CODES.OK)
libraryError = ncAdapter.Connect();
if (libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || libraryError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
ManageLibraryError(libraryError);
else if (libraryError.errorCode != CMS_ERROR_CODES.OK)
{
ncAdapter.Dispose();
}
@@ -1105,7 +1200,7 @@ public static class ThreadsFunctions
Thread.Sleep(1000);
}
if (!cmsError.IsError())
if (!libraryError.IsError())
{
if (ServerStartupConfig.AutoOpenCmsClient)
StartCMSClient();
@@ -1137,12 +1232,12 @@ public static class ThreadsFunctions
ConnThread.Abort();
}
public static void ManageLibraryError(CmsError cmsError)
public static void ManageLibraryError(CmsError libraryError)
{
switch (cmsError.errorCode)
switch (libraryError.errorCode)
{
case CMS_ERROR_CODES.NC_PROD_ERROR:
ManageError(ERROR_LEVEL.WARNING, cmsError.localizationKey);
ManageError(ERROR_LEVEL.WARNING, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.NOT_CONNECTED:
@@ -1152,7 +1247,7 @@ public static class ThreadsFunctions
case CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND:
case CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND:
case CMS_ERROR_CODES.OPTION_NOT_CONSISTENT:
ManageError(ERROR_LEVEL.FATAL, cmsError.localizationKey);
ManageError(ERROR_LEVEL.FATAL, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING:
@@ -1160,11 +1255,11 @@ public static class ThreadsFunctions
break;
case CMS_ERROR_CODES.SELECTED_PROCESS:
ManageError(ERROR_LEVEL.WARNING, cmsError.localizationKey);
ManageError(ERROR_LEVEL.WARNING, libraryError.localizationKey);
break;
case CMS_ERROR_CODES.INTERNAL_ERROR:
ManageException(ERROR_LEVEL.FATAL, cmsError.exception);
ManageException(ERROR_LEVEL.FATAL, libraryError.exception);
break;
}
}
@@ -1191,7 +1286,7 @@ public static class ThreadsFunctions
{
if (ThreadsHandler.RunningThreadStatus.ContainsKey(value.Key) && Counter[value.Key] != 0)
{
ThreadsHandler.RunningThreadStatus[value.Key] = (Timers[value.Key] / Counter[value.Key]) + " mS";
ThreadsHandler.RunningThreadStatus[value.Key] = $"{(Timers[value.Key] / Counter[value.Key])} ms x {Counter[value.Key]}";
Timers[value.Key] = 0;
Counter[value.Key] = 0;
}
+11 -6
View File
@@ -11,25 +11,30 @@ namespace Thermo.Active.Core
private static List<Action> ThreadsFunctionsList = new List<Action>
{
ThreadsFunctions.ManageWatchdog,
ThreadsFunctions.ManageStatusCommand,
ThreadsFunctions.ManageConfRequest,
ThreadsFunctions.ReadAlarms,
ThreadsFunctions.ReadPowerOnData,
ThreadsFunctions.StatThread,
ThreadsFunctions.ReadProcessesPPStatus,
//ThreadsFunctions.ReadProcessesPPStatus,
ThreadsFunctions.ReadEnabledFunctionality,
ThreadsFunctions.ReadExpiredMaintenances,
ThreadsFunctions.ReadAxesPositionsData,
//ThreadsFunctions.ReadAxesPositionsData,
ThreadsFunctions.ReadUserSoftKeysData,
//ThreadsFunctions.ReadHeadsData,
ThreadsFunctions.ReadAxesNamesData,
//ThreadsFunctions.ReadAxesNamesData,
//ThreadsFunctions.ReadActiveProgramData,
//ThreadsFunctions.ReadPartProgramQueueData,
ThreadsFunctions.ReadScadaData,
ThreadsFunctions.ReadM154Data, // levare?
// ThreadsFunctions.ReadNcSoftKeysData,
ThreadsFunctions.ReadGaugeData,
ThreadsFunctions.ReadProdInfoData,
ThreadsFunctions.ReadProdCycleData,
ThreadsFunctions.ReadRecipeData,
ThreadsFunctions.ReadWarmersData,
ThreadsFunctions.ReadModulesData
ThreadsFunctions.ReadAreaData,
ThreadsFunctions.ReadModulesData,
ThreadsFunctions.ReadScadaData,
ThreadsFunctions.ReadM154Data // levare?
};
private static Action ThreadSetupCmsConnect = ThreadsFunctions.SetupCmsConnect;
+5 -5
View File
@@ -1,12 +1,12 @@
using Thermo.Active.Core.Properties;
using Thermo.Active.Model;
using Thermo.Active.Utils;
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using TeamDev.SDK.MVVM;
using Thermo.Active.Core.Properties;
using Thermo.Active.Model;
using Thermo.Active.Utils;
namespace Thermo.Active.Core
{
@@ -125,7 +125,7 @@ namespace Thermo.Active.Core
public static void StopThread()
{
if (SiemensHmi!= null && SiemensHmi.IsAlive)
if (SiemensHmi != null && SiemensHmi.IsAlive)
SiemensHmi.Abort();
}
@@ -1,15 +1,13 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using System;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.IO;
using System.Linq;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using static Thermo.Active.Config.ServerConfig;
using System.Diagnostics;
using Thermo.Active.Config;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
{
@@ -37,7 +35,7 @@ namespace Thermo.Active.Database.Controllers
var index = userIds.IndexOf(-1);
if (userIds.IndexOf(-1) != -1)
ifNoUser = true;
List<int> ncAlarmDescIds = dbCtx
.AlarmDescriptions
.Where(x => x.Title.Contains(title))
@@ -45,7 +43,7 @@ namespace Thermo.Active.Database.Controllers
.ToList();
// Get Plc messages ids
List<int> plcAlarmDescIds =
List<int> plcAlarmDescIds =
plcMessages
.Where(x => x.Value.IndexOf(title, StringComparison.OrdinalIgnoreCase) >= 0)
//.Where(x => x.Value.Contains(title))
@@ -60,8 +58,8 @@ namespace Thermo.Active.Database.Controllers
.Where(x =>
x.TimeStamp >= startDate && x.TimeStamp <= endDate // Filter by date
&& sources.Contains(x.Source) // Check source
&& ( (ifNoUser && x.Users.Count() == 0) || x.Users.Any(y => userIds.Any(z => z == y.UserId))) // Check user
&&
&& ((ifNoUser && x.Users.Count() == 0) || x.Users.Any(y => userIds.Any(z => z == y.UserId))) // Check user
&&
((x.Source == ALARM_SOURCE.NC && ncAlarmDescIds.Contains(x.AlarmDescriptionId.Value)) // Check if message is contained in NC messages
|| (x.Source == ALARM_SOURCE.PLC && plcAlarmDescIds.Contains(x.AlarmId))) // Check if message is contained in PLC messages
).OrderByDescending(t => t.AlarmOccurrenceId);
@@ -137,7 +135,7 @@ namespace Thermo.Active.Database.Controllers
{
int numberOfRows = CountRows();
if(numberOfRows >= ServerStartupConfig.MaxAlarmsRows)
if (numberOfRows >= ServerStartupConfig.MaxAlarmsRows)
{
dbCtx.Database.ExecuteSqlCommand("DELETE FROM alarm_occurrence LIMIT {0}", ServerStartupConfig.AlarmToDelete);
}
@@ -151,7 +149,7 @@ namespace Thermo.Active.Database.Controllers
public void EmptyAlarms()
{
int numberOfRows = CountRows();
dbCtx.Database.ExecuteSqlCommand("DELETE FROM alarm_occurrence LIMIT {0}", numberOfRows);
}
@@ -1,8 +1,8 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
@@ -59,8 +59,8 @@ namespace Thermo.Active.Database.Controllers
{
return dbCtx
.FunctionsAccess
.Select( x => new DTORuntimeFunctionalityModel()
{
.Select(x => new DTORuntimeFunctionalityModel()
{
Id = x.FunctionAccessId,
Area = x.Area,
Name = x.Name,
@@ -1,6 +1,6 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Config.ServerConfig;
namespace Thermo.Active.Database.Controllers
@@ -1,8 +1,8 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
@@ -1,13 +1,13 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.MaintenanceModels;
using Thermo.Active.Utils;
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Entity;
using System.IO;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.MaintenanceModels;
using Thermo.Active.Utils;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
@@ -42,7 +42,7 @@ namespace Thermo.Active.Database.Controllers
foreach (PerformedMaintenanceModel maintenance in maintList)
{
if(maintenance.ControlWord != -2)
if (maintenance.ControlWord != -2)
valRet.Add(new DTOPerformModel()
{
Date = maintenance.Date,
@@ -64,7 +64,7 @@ namespace Thermo.Active.Database.Controllers
where m1.MaintenanceId == maintenances.MaintenanceId
select m1.Date
).Max()
select maintenances)
select maintenances)
.Include("Maintainer")
.ToList();
@@ -78,7 +78,7 @@ namespace Thermo.Active.Database.Controllers
CounterValue = (int)counterValue,
Date = DateTime.Now,
MaintenanceId = maintenanceId,
MaintainerId = userId,
MaintainerId = userId,
ControlWord = controlWord
};
@@ -204,7 +204,7 @@ namespace Thermo.Active.Database.Controllers
// find maintenances to be updated into db
var old = dbCtx.Maintenances.FirstOrDefault(x => x.MaintenanceId == item.MaintenanceId);
if(old != null)
if (old != null)
// Update model
old = MaintenancesConfig.Where(x => x.Id == item.MaintenanceId).Select(x =>
{
@@ -397,14 +397,14 @@ namespace Thermo.Active.Database.Controllers
cw = -1;
SupportFunctions.ConvertStringMachineNumberIntoNumber(machineNumber, out bool containsLetters, out int intMachineVal);
if (!GetDataFromMaintenancePassword(password, containsLetters, out int pwdMachineNumber, out int pwdHours, out cw))
if (!GetDataFromMaintenancePassword(password, containsLetters, out int pwdMachineNumber, out int pwdHours, out cw))
return false;
// Check machine number
if(intMachineVal == pwdMachineNumber)
if (intMachineVal == pwdMachineNumber)
{
// Convert plcCounter in hours and check if password is expired
if(((plcCounter/3600) - pwdHours) <= 50)
if (((plcCounter / 3600) - pwdHours) <= 50)
{
return true; // Ok
}
@@ -458,10 +458,10 @@ namespace Thermo.Active.Database.Controllers
tmpPassword4 = tmpPassword5.Remove(tmpPassword5.Length - 1);
// Create tmpPassoword3
foreach(char c in tmpPassword4)
foreach (char c in tmpPassword4)
{
// If tmpPassword is empty copy the first character
if(tmpPassword3.Length == 0)
if (tmpPassword3.Length == 0)
{
tmpPassword3 = c.ToString();
}
@@ -0,0 +1,161 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
namespace Thermo.Active.Database.Controllers
{
public class ProdInfoController : IDisposable
{
private DatabaseContext dbCtx;
public ProdInfoController()
{
// Initialize database context
dbCtx = new DatabaseContext();
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
/// <summary>
/// Get record by NumDone
/// </summary>
/// <param name="num"></param>
/// <returns></returns>
public ProdInfoModel FindByNumDone(int num)
{
return dbCtx
.ProdInfo
.Where(x => x.NumDone == num)
.SingleOrDefault();
}
/// <summary>
/// Get historical paginated data from DB (DESC ordered
/// </summary>
/// <param name="numStart"></param>
/// <param name="numRecord"></param>
/// <returns></returns>
public List<ProdInfoModel> GetPaginated(int numStart, int numRecord)
{
// cehck numEnd
int numEnd = numStart - numRecord;
if (numEnd < 0)
numEnd = 0;
// retrieve
return dbCtx
.ProdInfo
.Where(x => x.NumDone <= numStart && x.NumDone > numEnd)
.OrderByDescending(x => x.DtEvent)
.ToList();
}
/// <summary>
/// Create new prodInfo record on DB
/// </summary>
/// <param name="NumTarget"></param>
/// <param name="NumDone"></param>
/// <param name="TimeWarm"></param>
/// <param name="TimeVent"></param>
/// <param name="TimeVacuum"></param>
/// <param name="TimeCycleGross"></param>
/// <param name="TimeCycleNet"></param>
/// <param name="MaterialTempEndWarm"></param>
/// <param name="MaterialTempEndVent"></param>
/// <param name="MoldTemp"></param>
/// <param name="VacuumReadVal"></param>
/// <param name="MouldEnergyOUT"></param>
/// <param name="MouldEnergyIN"></param>
/// <returns></returns>
public ProdInfoModel Create(short NumTarget, short NumDone, int TimeWarm, int TimeVent, int TimeVacuum, int TimeCycleGross, int TimeCycleNet, double MaterialTempEndWarm, double MaterialTempEndVent, double MoldTemp, double VacuumReadVal, double MouldEnergyOUT, double MouldEnergyIN)
{
// Create database machine model
ProdInfoModel prodData = new ProdInfoModel()
{
DtEvent = DateTime.UtcNow,
NumTarget = NumTarget,
NumDone = NumDone,
TimeWarm = TimeWarm,
TimeVent = TimeVent,
TimeVacuum = TimeVacuum,
TimeCycleGross = TimeCycleGross,
TimeCycleNet = TimeCycleNet,
MaterialTempEndWarm = MaterialTempEndWarm,
MaterialTempEndVent = MaterialTempEndVent,
MoldTemp = MoldTemp,
VacuumReadVal = VacuumReadVal,
MouldEnergyOUT = MouldEnergyOUT,
MouldEnergyIN = MouldEnergyIN
};
try
{
// Add to database
dbCtx.ProdInfo.Add(prodData);
// Commit changes
dbCtx.SaveChanges();
}
catch
{ }
return prodData;
}
/// <summary>
/// Process table and keep only maxKeep most recent ones
/// </summary>
/// <param name="maxKeep"></param>
/// <returns></returns>
public bool PurgeOldest(int maxKeep)
{
bool answ = false;
// check if purge needed
int numRec = dbCtx.ProdInfo.Count();
if (numRec > maxKeep)
{
ProdInfoModel firstToDelete = (ProdInfoModel)(from p in dbCtx.ProdInfo
orderby p.DtEvent descending
select p).Skip(maxKeep).Take(1);
// call deletion
dbCtx
.ProdInfo
.RemoveRange(
dbCtx
.ProdInfo
.Where(x => x.DtEvent <= firstToDelete.DtEvent)
);
try
{
// save!
dbCtx.SaveChanges();
answ = true;
}
catch
{ }
}
return answ;
}
/// <summary>
/// Process table and delete all record (truncate)
/// </summary>
/// <returns></returns>
public bool PurgeAll()
{
bool answ = false;
try
{
dbCtx
.Database
.ExecuteSqlCommand("TRUNCATE TABLE prodInfo");
}
catch
{ }
return answ;
}
}
}
@@ -1,10 +1,8 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
@@ -30,12 +28,12 @@ namespace Thermo.Active.Database.Controllers
public void UpdateQueue()
{
dbCtx.Queue.RemoveRange(dbCtx.Queue);
var dbRows = new List<QueueItemsModel>();
foreach (var item in PartProgramQueue)
{
// Create database model
dbRows =item.Value.Select(x => new QueueItemsModel()
dbRows = item.Value.Select(x => new QueueItemsModel()
{
Id = x.Id,
AbsolutePath = x.AbsolutePath,
@@ -49,7 +47,7 @@ namespace Thermo.Active.Database.Controllers
// Add to db
dbCtx.Queue.AddRange(dbRows);
}
dbCtx.SaveChanges();
}
@@ -65,14 +63,14 @@ namespace Thermo.Active.Database.Controllers
item.RemainingReps = reps;
dbCtx.SaveChanges();
}
public void DeleteItem(int processId, int id)
{
QueueItemsModel item = dbCtx.Queue.FirstOrDefault(x => x.Id == id && x.Process == processId);
if(item == null)
if (item == null)
return;
dbCtx.Queue.Remove(item);
@@ -84,7 +82,7 @@ namespace Thermo.Active.Database.Controllers
{
var dbQueue = dbCtx.Queue.ToList();
bool foundData = false;
foreach(var entity in dbQueue)
foreach (var entity in dbQueue)
{
// Check if process queue exists
if (!PartProgramQueue.ContainsKey(entity.Process))
@@ -111,13 +109,13 @@ namespace Thermo.Active.Database.Controllers
QueueRunningIndexes[entity.Process] = entity.Id - 1;
}
}
public void UpdateQueueIdsAndSave(int processId)
{
// Fix new ids
for (int i = 0; i < PartProgramQueue[processId].Count(); i++)
PartProgramQueue[processId][i].Id = i + 1;
UpdateQueue();
}
}
@@ -1,9 +1,5 @@
using Thermo.Active.Database.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using Thermo.Active.Database.Redis;
namespace Thermo.Active.Database.Controllers
{
@@ -41,7 +37,7 @@ namespace Thermo.Active.Database.Controllers
redUtil.man.setRSV(redisHash, RepsDone);
}
public static bool WriteAlarmsConfigCurr(Dictionary<string,string> alarms)
public static bool WriteAlarmsConfigCurr(Dictionary<string, string> alarms)
{
string redisHash = redUtil.man.redHash(redisAlmCurr);
return redUtil.man.redSaveHashDict(redisHash, alarms);
@@ -1,7 +1,7 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
namespace Thermo.Active.Database.Controllers
{
@@ -1,10 +1,10 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Database.Controllers
{
@@ -1,10 +1,10 @@
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web.Helpers;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
@@ -34,7 +34,7 @@ namespace Thermo.Active.Database.Controllers
// Commit changes
dbCtx.SaveChanges();
using(MachinesUsersController machController = new MachinesUsersController())
using (MachinesUsersController machController = new MachinesUsersController())
{
machController.Create(MachineConfig.MachineId, user.UserId, 3);
}
@@ -166,13 +166,13 @@ namespace Thermo.Active.Database.Controllers
var tmpUser = dbCtx
.Users
.Where(x => x.Deleted == false) // Get not deleted users
.Join( dbCtx.MachinesUsers,
.Join(dbCtx.MachinesUsers,
u => u.UserId,
m => m.UserId,
m => m.UserId,
(u, m) => new { Users = u, MachinesUsers = m }
)
.Where(x => x.MachinesUsers.Role.Level < MIN_CMS_ROLE)
.ToList();
.ToList();
return tmpUser
.Select(x => new DTOMessageUserModel() // Return DTOUserModel
@@ -184,7 +184,7 @@ namespace Thermo.Active.Database.Controllers
})
.GroupBy(elem => elem.Id).Select(group => group.First())
.ToList();
}
}
}
#region User Manager
@@ -210,7 +210,7 @@ namespace Thermo.Active.Database.Controllers
Language = x.Language,
Role = machineController.GetUserRoleData(MachineConfig.MachineId, x.UserId)
}).Where(
x=> x.Role.Level < MIN_CMS_ROLE)
x => x.Role.Level < MIN_CMS_ROLE)
.ToList();
}
}
+8 -5
View File
@@ -1,16 +1,15 @@
using Microsoft.Win32;
using MySql.Data.Entity;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Database.Migrations;
using Thermo.Active.Model.DatabaseModels;
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Globalization;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Database.Migrations;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.ExceptionManager;
@@ -42,6 +41,10 @@ namespace Thermo.Active.Database
public DbSet<AlarmNoteModel> AlarmsNotes { get; set; }
public DbSet<AlarmFileModel> AlarmFiles { get; set; }
// thermo!
public DbSet<ProdInfoModel> ProdInfo { get; set; }
// Create migration string
public static string CONNECTION_STRING = "Server = " + "localhost" + "; Database=" + DATABASE_NAME + ";Uid=" + DATABASE_USER + ";Pwd=" + DATABASE_PWD + ";";
@@ -82,7 +85,7 @@ namespace Thermo.Active.Database
{
// Run migrations and seed.
migrator.Update();
}
}
FindOrCreateMachineUniqueId();
@@ -1,8 +1,7 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class ThermoStart : DbMigration
{
public override void Up()
@@ -10,268 +9,268 @@ namespace Thermo.Active.Database.Migrations
CreateTable(
"dbo.alarm_description",
c => new
{
id = c.Int(nullable: false),
title = c.String(unicode: false),
})
{
id = c.Int(nullable: false),
title = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.alarm_file",
c => new
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
user_id = c.Int(),
})
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.user_id);
CreateTable(
"dbo.user",
c => new
{
id = c.Int(nullable: false, identity: true),
username = c.String(nullable: false, unicode: false),
first_name = c.String(unicode: false),
last_name = c.String(unicode: false),
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
deleted = c.Boolean(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
username = c.String(nullable: false, unicode: false),
first_name = c.String(unicode: false),
last_name = c.String(unicode: false),
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
deleted = c.Boolean(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.alarm_occurrence",
c => new
{
id = c.Int(nullable: false, identity: true),
alarm_id = c.Int(nullable: false),
alarm_description_id = c.Int(),
source = c.Int(nullable: false),
type = c.Int(nullable: false),
processes = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
alarm_id = c.Int(nullable: false),
alarm_description_id = c.Int(),
source = c.Int(nullable: false),
type = c.Int(nullable: false),
processes = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.alarm_description", t => t.alarm_description_id)
.Index(t => t.alarm_description_id);
CreateTable(
"dbo.alarm_user",
c => new
{
user_id = c.Int(nullable: false),
alarm_occurence_id = c.Int(nullable: false),
})
{
user_id = c.Int(nullable: false),
alarm_occurence_id = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.user_id, t.alarm_occurence_id })
.ForeignKey("dbo.alarm_occurrence", t => t.alarm_occurence_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id)
.Index(t => t.alarm_occurence_id);
CreateTable(
"dbo.alarm_note",
c => new
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
alarm_desc_id = c.Int(nullable: false),
source = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id);
CreateTable(
"dbo.family",
c => new
{
id = c.Short(nullable: false),
name = c.String(unicode: false),
right_size = c.Byte(nullable: false),
left_size = c.Byte(nullable: false),
tcp_table = c.Byte(nullable: false),
gamma = c.Byte(nullable: false),
rotation_type = c.Byte(nullable: false),
cooling_byte = c.Byte(nullable: false),
max_speed = c.Int(nullable: false),
max_load = c.Byte(nullable: false),
min_load_pct_autoload = c.Byte(nullable: false),
max_load_pct_autoload = c.Byte(nullable: false),
dynamic_compensation = c.Byte(nullable: false),
min_load_dynamic_comp = c.Byte(nullable: false),
max_load_dynamic_comp = c.Byte(nullable: false),
life_type = c.Byte(nullable: false),
nominal_life = c.Int(nullable: false),
revive_delta = c.Int(nullable: false),
})
{
id = c.Short(nullable: false),
name = c.String(unicode: false),
right_size = c.Byte(nullable: false),
left_size = c.Byte(nullable: false),
tcp_table = c.Byte(nullable: false),
gamma = c.Byte(nullable: false),
rotation_type = c.Byte(nullable: false),
cooling_byte = c.Byte(nullable: false),
max_speed = c.Int(nullable: false),
max_load = c.Byte(nullable: false),
min_load_pct_autoload = c.Byte(nullable: false),
max_load_pct_autoload = c.Byte(nullable: false),
dynamic_compensation = c.Byte(nullable: false),
min_load_dynamic_comp = c.Byte(nullable: false),
max_load_dynamic_comp = c.Byte(nullable: false),
life_type = c.Byte(nullable: false),
nominal_life = c.Int(nullable: false),
revive_delta = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.favorite_user_softkey",
c => new
{
user_softkey_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
})
{
user_softkey_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.user_softkey_id, t.user_id });
CreateTable(
"dbo.function_access",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
write_level_min = c.Int(nullable: false),
read_level_min = c.Int(nullable: false),
area = c.String(unicode: false),
enabled = c.Boolean(nullable: false),
plc_id = c.Int(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
write_level_min = c.Int(nullable: false),
read_level_min = c.Int(nullable: false),
area = c.String(unicode: false),
enabled = c.Boolean(nullable: false),
plc_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
unique_id = c.String(unicode: false),
})
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
unique_id = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine_user",
c => new
{
id = c.Int(nullable: false, identity: true),
machine_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
role_id = c.Int(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
machine_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
role_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine", t => t.machine_id, cascadeDelete: true)
.ForeignKey("dbo.role", t => t.role_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => new { t.machine_id, t.user_id }, unique: true, clustered: true, name: "unique_machine_user")
.Index(t => t.role_id);
CreateTable(
"dbo.role",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
level = c.Int(nullable: false),
})
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
level = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.maintenance_file",
c => new
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
maintenance_id = c.Int(nullable: false),
user_id = c.Int(),
})
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
maintenance_id = c.Int(nullable: false),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.maintenance_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance",
c => new
{
id = c.Int(nullable: false),
intervall = c.Double(),
deadline = c.DateTime(nullable: false, precision: 0),
type = c.Int(nullable: false),
counter_id = c.Int(nullable: false),
title = c.String(unicode: false),
description = c.String(unicode: false),
unit_of_measure = c.Int(),
creation_date = c.DateTime(nullable: false, precision: 0),
last_expiration_date = c.DateTime(precision: 0),
user_id = c.Int(),
})
{
id = c.Int(nullable: false),
intervall = c.Double(),
deadline = c.DateTime(nullable: false, precision: 0),
type = c.Int(nullable: false),
counter_id = c.Int(nullable: false),
title = c.String(unicode: false),
description = c.String(unicode: false),
unit_of_measure = c.Int(),
creation_date = c.DateTime(nullable: false, precision: 0),
last_expiration_date = c.DateTime(precision: 0),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance_note",
c => new
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
maintenance_id = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
maintenance_id = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id)
.Index(t => t.maintenance_id);
CreateTable(
"dbo.performed_maintenance",
c => new
{
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
control_word = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
maintainers_id = c.Int(),
})
{
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
control_word = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
maintainers_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.maintainers_id)
.ForeignKey("dbo.maintenance", t => t.maintenance, cascadeDelete: true)
.Index(t => t.maintenance)
.Index(t => t.maintainers_id);
CreateTable(
"dbo.queue",
c => new
{
id = c.Int(nullable: false),
process = c.Int(nullable: false),
part_program_name = c.String(unicode: false),
reps = c.Int(nullable: false),
remaining_reps = c.Int(nullable: false),
absolute_path = c.String(unicode: false),
status = c.Int(nullable: false),
})
{
id = c.Int(nullable: false),
process = c.Int(nullable: false),
part_program_name = c.String(unicode: false),
reps = c.Int(nullable: false),
remaining_reps = c.Int(nullable: false),
absolute_path = c.String(unicode: false),
status = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.id, t.process });
CreateTable(
"dbo.session",
c => new
{
id = c.Int(nullable: false, identity: true),
token = c.String(unicode: false),
machine_user_id = c.Int(nullable: false),
first_login = c.DateTime(nullable: false, precision: 0),
})
{
id = c.Int(nullable: false, identity: true),
token = c.String(unicode: false),
machine_user_id = c.Int(nullable: false),
first_login = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine_user", t => t.machine_user_id, cascadeDelete: true)
.Index(t => t.machine_user_id);
}
public override void Down()
{
DropForeignKey("dbo.session", "machine_user_id", "dbo.machine_user");
@@ -0,0 +1,29 @@
// <auto-generated />
namespace Thermo.Active.Database.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class AddedProdInfoModel : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddedProdInfoModel));
string IMigrationMetadata.Id
{
get { return "202006170558519_AddedProdInfoModel"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,37 @@
namespace Thermo.Active.Database.Migrations
{
using System.Data.Entity.Migrations;
public partial class AddedProdInfoModel : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.ProdInfo",
c => new
{
DtEvent = c.DateTime(nullable: false, precision: 0),
NumTarget = c.Short(nullable: false),
NumDone = c.Short(nullable: false),
TimeWarm = c.Int(nullable: false),
TimeVent = c.Int(nullable: false),
TimeVacuum = c.Int(nullable: false),
TimeCycleGross = c.Int(nullable: false),
TimeCycleNet = c.Int(nullable: false),
MaterialTempEndWarm = c.Double(nullable: false),
MaterialTempEndVent = c.Double(nullable: false),
MoldTemp = c.Double(nullable: false),
VacuumReadVal = c.Double(nullable: false),
MouldEnergyOUT = c.Double(nullable: false),
MouldEnergyIN = c.Double(nullable: false),
})
.PrimaryKey(t => t.DtEvent);
}
public override void Down()
{
DropTable("dbo.ProdInfo");
}
}
}
File diff suppressed because one or more lines are too long
@@ -1,13 +1,10 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using System.Data.Entity.Migrations;
using static Thermo.Active.Model.Constants.FUNCTIONALITY_NAMES;
using static Thermo.Active.Model.Constants.AREAS;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Model.Constants.AREAS;
using static Thermo.Active.Model.Constants.FUNCTIONALITY_NAMES;
internal sealed class Configuration : DbMigrationsConfiguration<Thermo.Active.Database.DatabaseContext>
{
@@ -30,7 +27,7 @@ namespace Thermo.Active.Database.Migrations
new RoleModel() { RoleId = (int)ROLE_IDS.CUSTOMER_MAINTAINER, Level = 10, Name = "Maintainer" }
);
context.FunctionsAccess.AddOrUpdate(
context.FunctionsAccess.AddOrUpdate(x => x.Name,
// General Function, if plcId is 0 then the functionality is not connected to the NC
new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
File diff suppressed because it is too large Load Diff
@@ -113,6 +113,7 @@
<ItemGroup>
<Compile Include="Controllers\AlarmsController.cs" />
<Compile Include="Controllers\FunctionsAccessController.cs" />
<Compile Include="Controllers\ProdInfoController.cs" />
<Compile Include="Controllers\MachinesController.cs" />
<Compile Include="Controllers\MaintenancesController.cs" />
<Compile Include="Controllers\QueueController.cs" />
@@ -126,6 +127,10 @@
<Compile Include="Migrations\202004241109233_Thermo-Start.Designer.cs">
<DependentUpon>202004241109233_Thermo-Start.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202006170558519_AddedProdInfoModel.cs" />
<Compile Include="Migrations\202006170558519_AddedProdInfoModel.Designer.cs">
<DependentUpon>202006170558519_AddedProdInfoModel.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Redis\redUtil.cs" />
@@ -165,6 +170,9 @@
<EmbeddedResource Include="Migrations\202004241109233_Thermo-Start.resx">
<DependentUpon>202004241109233_Thermo-Start.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202006170558519_AddedProdInfoModel.resx">
<DependentUpon>202006170558519_AddedProdInfoModel.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class AlarmsConfigModel
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class AreasConfigModel
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class CmsConnectConfigModel
{
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace Thermo.Active.Model.ConfigModels
{
@@ -6,7 +6,7 @@ namespace Thermo.Active.Model.ConfigModels
public class MaintenanceConfigModel
{
public int Id { get; set; }
public Dictionary<string, string> LocalizedName { get; set; }
public Dictionary<string, string> LocalizedName { get; set; }
public TimeSpan Intervall { get; set; }
public DateTime Deadline { get; set; }
public string Type { get; set; }
@@ -20,7 +20,7 @@ namespace Thermo.Active.Model.ConfigModels
{
public Boolean Visible { get; set; }
public string Name { get; set; }
public string Company { get; set; }
public string Company { get; set; }
public string Email { get; set; }
public string PhoneNumber { get; set; }
public string WebSite { get; set; }
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model
{
@@ -11,6 +6,6 @@ namespace Thermo.Active.Model
{
public string Title { get; set; }
public string Message { get; set; }
public ERROR_LEVEL ErrorLevel { get; set; }
public ERROR_LEVEL ErrorLevel { get; set; }
}
}
@@ -6,10 +6,10 @@ namespace Thermo.Active.Model.ConfigModels
public class ModBlockConfigModel
{
public int Id;
public Dictionary<string,string> LocalizedLabels { get; set; }
public Dictionary<string, string> LocalizedLabels { get; set; }
public TACT_MBLOCK_TYPE Type { get; set; }
public TACT_MBLOCK_SECTION Section { get; set; }
public int IdParam{ get; set; }
public int IdParam { get; set; }
public bool ShowDelay { get; set; }
public int Priority { get; set; }
}
@@ -1,18 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class NcConfigModel
public class NcConfigModel
{
public string NcVendor { get; set; }
public bool ShowNcHMI { get; set; }
public string NcIpAddress { get; set; }
public ushort NcPort { get; set; }
public string NcUniqueId { get; set; }
public string NcUniqueId { get; set; }
public string NcName { get; set; }
public string SharedPath { get; set; }
public string SharedName { get; set; }
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.ConfigModels
{
@@ -12,5 +11,6 @@ namespace Thermo.Active.Model.ConfigModels
public string Name { get; set; }
public string Description { get; set; }
public string Format { get; set; }
public int ScaleFactor { get; set; }
}
}
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.ConfigModels
{
@@ -19,6 +18,7 @@ namespace Thermo.Active.Model.ConfigModels
public int Id;
public int Potenza;
public int Dimensione;
public string Modello;
}
public class RiskResistModel
{
@@ -35,5 +35,12 @@ namespace Thermo.Active.Model.ConfigModels
public int SetpointRecipe;
public int SetpointThermo;
public int MaxPower;
public int NumResist;
public bool CalcIchMin;
}
public class RiskBoardModel
{
public int IdBoard;
public int NumChannels;
}
}
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
namespace Thermo.Active.Model.ConfigModels
{
@@ -11,7 +6,7 @@ namespace Thermo.Active.Model.ConfigModels
{
public CultureInfo Language { get; set; }
public int ServerPort { get; set; }
public string ServerAddress { get; set; }
public string ServerAddress { get; set; }
public bool EnableDirectoryBrowsing { get; set; }
public string DatabaseAddress { get; set; }
public bool AutoOpenCmsClient { get; set; }
@@ -19,7 +14,7 @@ namespace Thermo.Active.Model.ConfigModels
public string MTCFolderPath { get; set; }
public string MTCApplicationName { get; set; }
public bool CmsConnectReady { get; set; }
public bool CmsConnectReady { get; set; }
public int MaxAlarmsRows { get; set; }
public int AlarmToDelete { get; set; }
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.ConfigModels
namespace Thermo.Active.Model.ConfigModels
{
public class SoftwareProdConfigModel
{
@@ -9,7 +9,7 @@ namespace Thermo.Active.Model.ConfigModels
public Dictionary<string, string> LocalizedNames { get; set; }
public int Category { get; set; }
public bool IsActive { get; set; }
public bool IsVisible { get; set; }
public bool IsVisible { get; set; }
public bool OperatorConfirmationNeeded { get; set; }
public List<SubKeysModel> SubKeys { get; set; }
public int PlcId { get; set; }
+13 -5
View File
@@ -198,18 +198,22 @@ namespace Thermo.Active.Model
}
// Config File Names
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
//public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).Replace("\\lib", "");
#if DEBUG
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client_Debug\x64\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client_Debug\x84\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client_Debug\x86\" + CLIENT_EXE_NAME;
public static string WEBSITE_DIRECTORY = Path.Combine(BASE_PATH, "..", "wwwroot");
#else
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client\x64\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client\x86\" + CLIENT_EXE_NAME;
public static string WEBSITE_DIRECTORY = BASE_PATH + "\\view";
#endif
public const string CONFIG_DIRECTORY = "Config\\";
public const string RECIPE_DIRECTORY = "Recipes\\";
public const string RECIPE_TEMPLATE_PATH = CONFIG_DIRECTORY + RECIPE_DIRECTORY + "template.json";
public const string LIVE_RECIPE_PATH = TEMP_FOLDER + RECIPE_DIRECTORY + "current.json";
public const string RESOURCE_DIRECTORY = @"Thermo.Active.Config.Config.";
public const string SERVER_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"serverConfigValidator.xsd";
public const string SERVER_CONFIG_PATH = CONFIG_DIRECTORY + "serverConfig.xml";
@@ -252,6 +256,7 @@ namespace Thermo.Active.Model
public const string MAIN_PROGRAM_CONFIG_PATH = CONFIG_DIRECTORY + "customMainProgram.txt";
public static string LANGUAGE_PACK_DIRECTORY = BASE_PATH + "\\languages\\";
public static string LANGUAGE_SCHEMA_PATH = BASE_PATH + "\\LanguageValidator.xsd";
@@ -294,7 +299,10 @@ namespace Thermo.Active.Model
public const string SEND_THERMO_RECIPE_OVERWIEW = "SEND_THERMO_RECIPE_OVERWIEW";
public const string SEND_THERMO_MODULE_DATA = "SEND_THERMO_MODULE_DATA";
public const string SEND_THERMO_WARMERS_DATA = "SEND_THERMO_WARMERS_DATA";
public const string SEND_THERMO_AREA_DATA = "SEND_THERMO_AREA_DATA";
public const string SEND_THERMO_GAUGE_DATA = "SEND_THERMO_GAUGE_DATA";
public const string SEND_THERMO_PROD_INFO_DATA = "SEND_THERMO_PROD_INFO_DATA";
public const string SEND_THERMO_PROD_CYCLE_DATA = "SEND_THERMO_PROD_CYCLE_DATA";
public const string BROADCAST_DATA = "BROADCAST_DATA";
@@ -341,7 +349,7 @@ namespace Thermo.Active.Model
public const string CMS_FOLDER_PATH = @"C:\CMS\";
public const string ALARM_ATTACHMENT_PATH = @"C:\CMS\Active\attachment\alarm\";
public const string TEMP_FOLDER = @"C:\CMS\Active\TMP\";
public const string TEMP_FOLDER = @"C:\CMS\ThermoActive\TMP\";
public const string TEMP_PP_FOLDER = TEMP_FOLDER + @"pp\";
public const string JOB_TMP_DIRECTORY = TEMP_PP_FOLDER + @"job\";
public const string QUEUE_TMP_FOLDER = TEMP_PP_FOLDER + @"queue\";
@@ -1,10 +1,9 @@
using CMS_CORE_Library.Utils;
using Thermo.Active.Model.DatabaseModels;
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.DTOModels.AlarmModels
@@ -46,7 +46,7 @@ namespace Thermo.Active.Model.DTOModels.AlarmModels
listAreEquals = item.PlcAlarms.All(PlcAlarms.Contains);
if (!listAreEquals)
return false;
// Check list's elements
listAreEquals = item.ProcessAlarms.All(ProcessAlarms.Contains);
if (!listAreEquals)
@@ -160,7 +160,7 @@ namespace Thermo.Active.Model.DTOModels.AlarmModels
{
public DateTime DateTime;
public bool RestorationIsEnabled;
public override bool Equals(object obj)
{
if (!(obj is DTOPlcAlarmModel item))
@@ -1,10 +1,6 @@
using Thermo.Active.Model.DatabaseModels;
using System;
using System.Collections.Generic;
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.Model.DatabaseModels;
namespace Thermo.Active.Model.DTOModels.AlarmModels
{
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Thermo.Active.Model.DTOModels
{
@@ -35,11 +34,11 @@ namespace Thermo.Active.Model.DTOModels
return false;
if (!CheckAxesDictionaries(machine, item.machine))
return false;
if (!CheckAxesDictionaries(programmePos , item.programmePos))
if (!CheckAxesDictionaries(programmePos, item.programmePos))
return false;
if (!CheckAxesDictionaries(toGo, item.toGo))
return false;
return true;
}
@@ -1,6 +1,6 @@
using Thermo.Active.Model.ConfigModels;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Globalization;
using Thermo.Active.Model.ConfigModels;
namespace Thermo.Active.Model.DTOModels
{
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels
{
@@ -1,7 +1,4 @@
using CMS_CORE_Library.Models;
using System.Linq;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.Models.ThermoModels;
using static CMS_CORE_Library.Models.ThermoModels;
namespace Thermo.Active.Model.DTOModels
{
@@ -1,6 +1,4 @@
using System;
using System.Linq;
using System.Reflection;
namespace Thermo.Active.Model.DTOModels
{
@@ -18,7 +16,7 @@ namespace Thermo.Active.Model.DTOModels
public string PlcVersion { get; set; }
public string UnitOfMeasurement { get; set; }
public string ServerVersion { get; set; }
public string CoreLibraryVersion { get; set; }
public string CoreLibraryVersion { get; set; }
private DateTime buildDate;
private Version v;
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels
namespace Thermo.Active.Model.DTOModels
{
public class DTONcSoftKeyModel
{

Some files were not shown because too many files have changed in this diff Show More