Full text
João Gabriel Ramos Ferreira Bernardo A contribution for data processing and interoperability in Industry 4.0 Tese de Mestrado Mestrado em Engenharia de Sistemas Trabalho efetuado sob a orientação dos Professora Doutora Leonilde Varela Professor Doutor Luís Ferreira Outubro de 2019
A contribution for data processing and interoperability in Industry 4.0. ii DIREITOS DE AUTOR E CONDIÇÕES DE UTILIZAÇÃO DO TRABALHO POR TERCEIROS Este é um trabalho académico que pode ser utilizado por terceiros desde que respeitadas as regras e boas práticas internacionalmente aceites, no que concerne aos direitos de autor e direitos conexos. Assim, o presente trabalho pode ser utilizado nos termos previstos na licença abaixo indicada. Caso o utilizador necessite de permissão para poder fazer um uso do trabalho em condições não previstas no licenciamento indicado, deverá contactar o autor, através do Repositório da Universidade do Minho. Licença concedida aos utilizadores deste trabalho Atribuição CC BY https://creativecommons.org/licenses/by/4.0/
A contribution for data processing and interoperability in Industry 4.0. iii ACKNOWLEDGMENT First, I would like to thank professor Leonilde Varela and Engineer Joana Vinhas who made the bridge between the system engineering course and the company. Without this opportunity, the project would not be possible. I would like to thank my advisors, professor Leonilde Varela for the continuous support and professor Luis Ferreira for sharing his knowledge with me. My sincere gratitude and congratulations to the process engineering department of ZF Ponte de Lima for their patience and help along the process. They have the task to integrate all the company processes using not many resources. Without the IT manufacturing team help, the code would not be completed until today. A special thanks to my mentor in-company, Diogo Silva, for the motivation and help. Lastly, a profound thank to my brother, parents and family for encouraging me through the entire process. Without my mom and dad supports I could not be who I am today. To all my sincere and profound thank you.
A contribution for data processing and interoperability in Industry 4.0. iv STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho.
A contribution for data processing and interoperability in Industry 4.0. v RESUMO Espera-se que a Indústria 4.0 seja uma mudança significativa no crescimento das empresas. O objetivo é agrupar informações importantes de toda a cadeia de suprimentos da empresa, proporcionando uma tomada de decisão mais acertada, ao mesmo tempo que permite interações entre seres humanos e máquinas em tempo real. Sistemas autônomos equipados com Tecnologias da Informação possibilitam a Indústria 4.0 como a Internet das Coisas (IoT), sistemas ciber-físicos (CPS) e Big Data e analytics. A IoT coleta informações de cada peça do grande quebra-cabeça que é o processo de fabricação. Cloud Computing lida com armazenamento de toda essa informação em um só lugar. As pessoas compartilham informações em toda a empresa, na cadeia de abastecimento e níveis hierárquicos por meio da integração de sistemas. Por fim, Big Data e analytics são de inteligência que melhorarão a Indústria 4.0. Os métodos e ferramentas da Indústria 4.0 são projetadas para aumentar a interoperabilidade entre os stakeholders. Para tornar possível essa interoperabilidade, um padrão em toda a empresa deve ser implementado. Dois modelos de referência para a Indústria 4.0 foram estudados - RAMI 4.0 e IIRA. RAMI 4.0, a iniciativa alemã, concentra-se na digitalização industrial, enquanto IIRA, a iniciativa americana, foca no mundo da Internet das Coisas, como energia, saúde e transporte. As duas iniciativas visam obter dados inteligentes dos processos e, ao mesmo tempo, permitir a interoperabilidade entre os sistemas. Representantes dos dois modelos de referência estão a trabalhar juntos para discutir os padrões de interface tecnológica que podem ser usados pelas empresas que entram nessa nova era. Este estudo visa a interoperabilidade entre sistemas. Embora deva haver um modelo para orientar a empresa na Indústria 4.0, esse modelo deve ser mutável e flexível o suficiente para lidar com diferenças no processo de fabricação, como exemplo a indústria 4.0 automotiva não terá a mesma abordagem que a Indústria 4.0 de aviação. PALAVRAS-CHAVE IIoT, Indústria 4.0, Integração de sistemas, Interoperabilidade, Padronização.
A contribution for data processing and interoperability in Industry 4.0. vi ABSTRACT Industry 4.0 is expected to drive a significant change in companies’ growth. The idea is to cluster important information from all the company’s supply chain, enabling valuable decision-making while permitting interactions between machines and humans in real time. Autonomous systems powered with Information Technologies are enablers of Industry 4.0 – like Internet of Things (IoT), Cyber Physical-Systems (CPS) and Big Data and analytics. IoT gather information from every piece of the big puzzle which is the manufacturing process. Cloud Computing store all that information in one place. People share information across the company, between its supply chain and hierarchical levels through integration of systems. Finally, Big Data and analytics are of intelligence that will improve Industry 4.0. Methods and tools in Industry 4.0 are designed to increase interoperability across industrial stakeholders. In order to make the complete process possible, standardisation must be implemented across the company. Two reference models for Industry 4.0 were studied - RAMI 4.0 and IIRA. RAMI 4.0, a German initiative, focuses on industrial digitalization while IIRA, an American initiative, focuses on “Internet of Things” world, i.e. energy, healthcare and transportation. The two initiatives aim to obtain intelligence data from processes while enabling interoperability among systems. Representatives from the two reference models are working together on the technological interface standards that could be used by companies joining this new era. This study aims at the interoperability between systems. Even though there must be a model to guide the company into Industry 4.0, this model ought to be mutable and flexible enough to handle differences in manufacturing process, as an example automotive industry 4.0 will not have the same approach as aviation Industry 4.0. KEYWORDS IIoT, Industry 4.0, Interoperability, Systems Integration, Standardization.
A contribution for data processing and interoperability in Industry 4.0. vii CONTENTS Acknowledgment ...................................................................................................................... iii Resumo ....................................................................................................................................... v Abstract ..................................................................................................................................... vi List of figures .............................................................................................................................. x Abbreviations and Acronyms .................................................................................................... xi 1. Motivation and background ............................................................................................... 1 1.1 Objectives .................................................................................................................... 1 1.2 Structure of the Dissertation ....................................................................................... 2 2. Literature Review ................................................................................................................ 3 2.1 Historic Background ..................................................................................................... 3 2.2 Third Industry Revolution ............................................................................................ 5 2.2.1 Sensors ................................................................................................................. 5 2.2.2 Actuators .............................................................................................................. 5 2.2.3 Programmable logic controllers (PLC) .................................................................. 5 2.2.4 Communication and OPC ..................................................................................... 6 2.2.5 Supervisory Control and Data Acquisition (SCADA) ............................................. 6 2.2.6 Manufacturing Execution System (MES) .............................................................. 7 2.2.7 Enterprise Resource Planning (ERP) ..................................................................... 7 2.3 Industry 4.0 (I4.0) ........................................................................................................ 7 2.3.1 Enabling Technologies .......................................................................................... 9 2.3.2 Industry 4.0 implementation ............................................................................. 10 2.3.3 Systems integration ............................................................................................ 11 2.3.4 Cyber-physical systems (CPS) ............................................................................. 13 2.3.5 Reference Architecture Model of Industry 4.0 (RAMI 4.0) ................................ 13 2.3.6 Reference Architecture (IIRA) ............................................................................ 17 2.3.7 IIRA and RAMI 4.0 interoperability .................................................................... 21 2.4 Technologies .............................................................................................................. 24 2.4.1 Database ............................................................................................................. 24
A contribution for data processing and interoperability in Industry 4.0. viii 2.4.2 Structured Query Language (SQL) ...................................................................... 24 2.4.3 Conceptual database design .............................................................................. 25 2.4.4 Logical database design ...................................................................................... 25 2.4.5 Physical database design .................................................................................... 26 2.4.6 Views .................................................................................................................. 26 2.4.7 MS Office Access ................................................................................................ 26 2.4.8 Microsoft .NET and Microsoft .NET Framework ................................................ 27 2.4.9 Microsoft Visual Studio .NET .............................................................................. 27 2.4.10 Object Relational Mapping ................................................................................. 27 2.4.11 ActiveX Data Objects, ADO.NET and Entity Framework .................................... 27 2.4.12 Simulation........................................................................................................... 28 2.4.13 Knime Analytics platform ................................................................................... 28 2.4.14 Power BI ............................................................................................................. 28 3. Company Profile ................................................................................................................ 29 3.1 ZF Group .................................................................................................................... 29 3.2 Company Information systems .................................................................................. 31 4. Problem Description ......................................................................................................... 32 5. Proposed Improvements .................................................................................................. 32 5.1.1 Contribution ....................................................................................................... 32 5.1.2 Development of the conceptual model ............................................................. 33 5.1.3 Development of the logical model ..................................................................... 34 5.1.4 Development of SQL physical model ................................................................. 34 5.1.5 Integrating SQL and Visual Studio ...................................................................... 35 5.1.6 Knime and Simio Analysis ................................................................................... 36 5.1.7 Tools for decision-making towards Industry 4.0 – under development ............ 37 6. Conclusion ......................................................................................................................... 39 6.1 Difficulties .................................................................................................................. 39 6.2 Overview .................................................................................................................... 39 6.3 Future works .............................................................................................................. 40 Bibliography.............................................................................................................................. 43
A contribution for data processing and interoperability in Industry 4.0. ix Annex I – Data Dictionary: entities description ....................................................................... 47 Annex II – Data Dictionary: relationship description ............................................................... 47 Annex III – Data Dictionary: attributes description .................................................................. 47 Annex IV – referential integrity ................................................................................................ 50 Annex V – SQL structure statement ......................................................................................... 51 Annex VI – SQL views ............................................................................................................... 51 Annex VII – C# input class......................................................................................................... 53 Annex VIII – C# department class ............................................................................................. 53 Annex IX – C# priority class ...................................................................................................... 53 Annex X – C# localization class ................................................................................................. 54 Annex XI – C# issue class .......................................................................................................... 54 Annex XII – C# project code ..................................................................................................... 55 Annex XIII – Graphical User Interface ...................................................................................... 68
A contribution for data processing and interoperability in Industry 4.0. 5 2.2 Third Industry Revolution 2.2.1 Sensors As stated by Macedo (2017), sensors in general transmits an electric signal from a received impulse. Their goal is to send a signal to the command center (that can be a programmable logic controller or other industrial computer). 2.2.2 Actuators A piece of hardware dispositive that converts a signal from a controller to a physical magnitude. Actuators are responsible for actuation of mechanical systems, on summary actuators can convert electrical energy into mechanical energy (e.g., compressed air in pneumatics and oil in hydraulics) (Macedo, 2017). 2.2.3 Programmable logic controllers (PLC) According to Alphonsus & Abdullah (2016) the first PLC came in the late 1960s in automotive industry. The authors state that PLC is the central component and are determinant in any autonomous system. The basic blocks are: • Rack assembly; • Power supply; • Programming device; • Input/Output sector; • Central processing unit. According to Macedo (2017) the PLC receive data from sensors, command buttons and other inputs, execute instructions from a program saved on his memory, and builds a system response by modifying the state of the outputs where all the actuators are connected. Figure 2 exhibit sensors, PLC and actuators:
A contribution for data processing and interoperability in Industry 4.0. 6 Figure 2 - PLC (source: Alphonsus & Abdullah, 2016) 2.2.4 Communication and OPC Open Platform Communications (OPC) arrive two decades after the first PLC. OPC foundation defines standards between communication from controllers regardless of the communication protocols used by their manufacturers (Macedo, 2017). According to the author, the primary goal is to transfer real data across PLCs, distributed control systems, Supervisory Control and Data Acquisition (SCADA), Human Machine Interface (HMI) and other production applications. OPC data access depends on the technology DCOM (distributed component object model) with security limitations and closed to Windows platform. Those problems led the OPC Foundation to create a new protocol in 2006: OPC unified architecture (OPC UA), that is more flexible and adaptable (Macedo, 2017). 2.2.5 Supervisory Control and Data Acquisition (SCADA) Supervisory Control and Data Acquisition (SCADA) are mainly associated with critical infrastructures that request high level of support in real time such as chemical processes, railways, water treatment and distribution and power plants (Macedo, 2017).
A contribution for data processing and interoperability in Industry 4.0. 7 2.2.6 Manufacturing Execution System (MES) According to Huang, Mohanty, Ashfahani, & Pratama (2018) a manufacturing execution system (MES) “is used to monitor the information flow from manufacturing objects on the manufacturing shop floor”. Manufacturing objects are work in process, workstation, tools and employees. 2.2.7 Enterprise Resource Planning (ERP) According to Slack, Chamber, & Johnston (2009), ERP is an information system that integrate all enterprise information from different functions (and that information most of the times comes in high volumes), necessary to the planning and controlling of the operations. This integration occurs in a common database where all information can be shared. As stated by the authors, this control informs when and where the activity must occur, who is responsible and how much capacity will be needed to complete the task and so on. 2.3 Industry 4.0 (I4.0) Germany has global leadership in the manufacturing sector (Kagermann, Wahlster, & Helbig, 2013). Global competition is becoming more aggressive every year. Not only Germany is taking measures to mitigate this impact but also the U.S.A is avoiding deindustrialization with initiatives to promote advanced manufacturing (Fiesp, 2017). The term “Industrie 4.0” (Industry 4.0) proposed in Hannover Fair in 2011 was announced in 2013 as a German strategic action to implement technologies mainly Cloud Computing, Internet of Things (IoT) and cyber-physical systems (CPS) in a way to revolutionize the manufacturing industry (Xu et al., 2018). As stated by the authors, Industry 4.0 collects information from sensors, artificial intelligence, data analytics to improve manufacturing work in real-time. Industry 4.0 planning is to achieve all these three major integrations, with addition to hardware, software, data and information integration (Xu et al., 2018). The term Industry 4.0 described in 2016 by Smit, Kreutzer, Moeller, & Carlberg is: “the organization of production processes based on technology and devices autonomously communicating with each other along the value chain: a model of the ‘smart’ factory of the future where computer-driven systems monitor physical processes, create a virtual copy of
A contribution for data processing and interoperability in Industry 4.0. 8 the physical world and make decentralized decisions based on self-organization mechanisms”. With the increasing of digital manufacturing, physical objects are integrated into the information network. As stated by Smit et al. (2016) for the success of Industry 4.0 there must be a standardization of systems, platforms, protocols, flexibility to adjust to new business models, security, research and investment, and a common legal framework to support the dissemination of Industry 4.0. Wortmann, Combemale, & Barais (2017) describes Industry 4.0 as a “vision of manufacturing in which smart, interconnected production systems optimize the complete value-added chain to reduce cost and time-to-market”. Stephen (2018) affirms that Internet of Things (IoT) is expected to generate “$1.2 to $3.7 trillion value globally by 2025, in four primary forms: 1) operational efficiency, 2) predictive and preventive maintenance, 3) supply chain management, and 4) inventories and logistics. According to a survey from Mckinsey in 2016, most Industry 4.0 players (United States, Germany and Japan) expect cost and revenue increases of 10 to 15 percent. According to Ślusarczyk (2018), the 4th Industrial Revolution is happening globally and concurrently. In Europe Fiesp (2017) presents the main initiatives of Industry 4.0 across the globe: UK (High Value Manufacturing, Innovative UK), Germany (Smart Service World, Autonomik Fur Industrie 4.0, Industrie 4.0), France (Usine du Future, The Nouvelle France Industrielle), Sweden (Produktion 2030), Italy (Fabbrica Intelligente), Belgium (Made Different), Netherlands (Smart Industry), Spain (Industria Conectada 4.0), Portugal (Produtech), Austria (Produktion der Zukunft), Poland (INNOMOTO, INNOLOT), Finland (Finnish Metals and Engineering Competence Cluster, Industry Internet Business Revolution, IoT Pilot Factory). The US incentives their automatization with a more sustainable and digital industry (e.g. Advanced Manufacturing Partnership, Industrial Internet Consortium, National Robotics Initiative). In China the term “made in China 2025” is the Chinese plan to make their manufacturing industry a global leader and in 2015 Japan launched the Industry Value Chain forum to discuss Industry 4.0 and robotics. Rodič (2017) states that today, the main enabling technologies and development tendencies in Industry 4.0 are:
A contribution for data processing and interoperability in Industry 4.0. 9 • Horizontal and vertical system integration; • The Internet of Things; • The Cloud; • Big Data and analytics; • Green Information Technology; • Augmented reality; • Additive manufacturing (3D printing); • Simulation modelling; • Autonomous robots; • Cybersecurity. In summary, Industry 4.0 is the manufacturing process in an interoperability, adaptability, optimized and service-oriented approaches correlated with algorithms, big data, and high technologies. 2.3.1 Enabling Technologies The main technologies that permits the implementation of Industry 4.0 are Internet of Things (IoT), Cloud Computing, Big data storage and analytics (Sony, 2018). At the beginning of the Internet of Things, objects were connected using radio-frequency identification (RFID) technology. This enabled tracking in real-time objects identified with unique tags that were connected to the Internet. RFID is the keystone to IoT (Sony, 2018). RFID made possible today’s use of the IoT, aggregating this technology to global positioning systems, actuators, sensors operating through Wi-Fi, Bluetooth, Near Field Communication (NFC) or cellular networks (Xu, Xu, & Li, 2018). According to Vermesan & Friess (2014), IoT is the new revolution of the Internet. The goal of IoT is to enable connection with anyone, anytime and anywhere using any path/network. In 2011 the number of Internet-connected devices (ICD) surpassed the population. By 2020 ICD are expected to be a number between 26 billion and 50 billion (Vermesan & Friess, 2014) creating massive volume of data to be analysed. This large volume of data lead to the term “Cloud Computing”. This technology relies mainly on huge volume (Xu et al., 2018).
A contribution for data processing and interoperability in Industry 4.0. 10 For instance, the design of a new product can be developed by engineers and fabricators in virtual community. Those individuals may not be in the same physical place (e.g., in-company) but the information can be shared. The integration of IoT in Cloud platforms helps creating new services that would not be obvious without this high level of connectivity and analytical intelligence. The collection of a huge amount of data, results in the Big Data storage (Frank A G, Dalenogare L S, & Ayala N F, 2019). According to Grable & Lyons (2018) the term Big Data means a large amount of information that requires a more robust data process than traditional methods. This complex data analysis may provide more precise insights showing patterns that could not be realized. Together with analytics (like data mining and machine learning) it is considered one of the most important business drivers for Industry 4.0(Grable & Lyons, 2018). Wortmann, Combemale, & Barais (2017) affirm that according to these disruptions, Industry 4.0 design principles are: • Interoperability: connect people, production, devices and sensors; • Information simplicity and interconnection: collect data from sensors, reduce or even eliminate data redundancy; • Technical support: provide the right abstraction to understand the complexity of Industry 4.0; • Decentralized decision making: enable self-sufficient systems. 2.3.2 Industry 4.0 implementation McKinsey survey (2016) sustains that some manufacturers are struggling to implement Industry 4.0, as it is not clear to them what Industry 4.0 really requires. One concern of these manufacturers is the lack of courage to push though radical transformation. Figure 3 represents tools and methods necessary to implement industry 4.0:
A contribution for data processing and interoperability in Industry 4.0. 11 Figure 3 - The McKinsey Digital compass for Industry 4.0 (source: Mckinsey, 2016) One of McKinsey’s conclusion for capturing value from Industry 4.0 is that manufacturers are achieving most progress when they focus on a limited number of Industry 4.0 applications and not all of them. As stated by Fred Schulemann, Head of Digital Production at Audi AG: “We are aiming at an enormous progress in efficiency and speed particularly in engineering, controlling, administration, and decision making. But this value will only be unlocked if we manage to integrate data across the entire product lifecycle”. The World Economic Forum in 2015 (WEF, 2015) reported that 65% of companies in Europe and North America are finding it difficult to implement industrial digitalization due to the lack of interoperability or standards. KPMG survey from 2017 (Gates & Bremicker, 2017) states that one key driver for manufacturers to implement Industry 4.0, is that the enterprise must plan ahead. 2.3.3 Systems integration
A contribution for data processing and interoperability in Industry 4.0. 12 Sony (2018) declare that Industry 4.0 is possible using three kinds of integration: 1 Horizontal integration: collaboration between organizations in the value chain. With the use of digitalization, a new synergy for all the stakeholders is created. As stated by Xu et al (2018), horizontal integration handles several Information Technology (IT) systems used in different moments of the manufacturing. 2 Vertical integration: integration of several hierarchical systems within the organization are connected to the Enterprise Resource Planning (ERP) system. Xu et al. (2018) affirm that this integration work with various IT systems at different hierarchical levels. The different hierarchical levels are: shop floor, control, production and operations and enterprise planning. For the shop floor management, there are sensors and actuators. To manufacturing controlling there are programmable logic controllers (PLCs). At the next level, there is a Supervisory Control and Data Acquisition (SCADA) System. A manufacturing execution system (MES) will be for production planning and quality management. On top there is an Enterprise Resource Planning (ERP) to integrate all data from an organization into one system (i-SCOOP, 2019). The vertical integration is presented in Figure 4.
A contribution for data processing and interoperability in Industry 4.0. 13 Figure 4 - Industry 4.0 vertical integration (source: i-SCOOP, 2019) 3 End-to-end engineering integration: According to Xu et al. (2018) this process aggregate digital and real world, information from the entire value chain, different companies, and customer requirements. According to Adolphs et al. (2015) end- to-end engineering means that technical, commercial and administrative data generated in the means of production are accessible at all times within the entire supply chain. 2.3.4 Cyber-physical systems (CPS) “CPS are engineered systems that are built from, and depend upon the seamless integration of computational algorithms and physical components” (Xu et al., 2018). According to Rodič (2017) with the use of CPS it will be feasible to coordinate the intelligence network of all subsystems in a central computer, making it possible to work with rising independence. 2.3.5 Reference Architecture Model of Industry 4.0 (RAMI 4.0)
A contribution for data processing and interoperability in Industry 4.0. 14 As reported by the Federal Ministry for Economic Affairs and Energy in 2016, Germany vision is to encourage more businesses to get involved in Industry 4.0. To make it a reality, five work groups were created: 1) Reference Architectures, Standards and Norms; 2) Research and Innovation; 3) Security and Networked Systems; 4) Legal Framework; 5) Work, Education and Training. The first group main development is the reference architecture model of industrie 4.0 (RAMI 4.0), certified and published as DIN (Deutsches Institut für Normung, German Institute for Standardization) specification 91345. RAMI “enables the identification of relevant standards” and if no standard is used, RAMI helps to identify gaps in the missing architecture. A common vocabulary between machines communication is the basic requirement to ensure interoperability in Industry 4.0 (Federal Ministry for Economic Affairs and Energy, 2016). RAMI 4.0 is a three-dimensional map (Figure 5) showing the most important aspects of industrie 4.0 (Federal Ministry for Economic Affairs and Energy, 2018): Figure 5 - RAMI 4.0 (source Federal Ministry for Economic Affairs and Energy, 2018)
A contribution for data processing and interoperability in Industry 4.0. 21 Figure 10 - Functional Domains, Crosscutting Functions and System Characteristics (source: Lin et al., 2019) 2.3.7 IIRA and RAMI 4.0 interoperability (Fiesp, 2017) states that representatives of Industrie 4.0 in Germany are meeting with representatives of Industrial Internet Consortium from U.S.A to discuss the technological interface standards. In Germany and the U.S.A there have been an increase on creation and usage of testbeds to simulate productive systems and evaluate the reference architecture (Fiesp, 2017). As reported by the Federal Ministry for Economic Affairs and Energy at the beginning of march 2016, Industrie 4.0 started to cooperate more closely with IIC. The former initiative focuses on industrial digitalization while the latter focus on Internet of Things world, like energy, healthcare and transportation, stressing cross-industry communication and interoperability. Both initiatives complement each other as they both aim at obtaining intelligence data from processes while enabling interoperability among systems. IIRA and RAMI4.0 have different emphasis in scope and depth, but these different perspectives can complement each other in addressing challenges into digitalization. “For
A contribution for data processing and interoperability in Industry 4.0. 22 example, industrial analytics, an idea that is emphasized in IIRA would be beneficial for building intelligent Industrie 4.0 systems” (Lin et al., 2018). Comparison between IIRA and RAMI 4.0 are done in Figure 11. Figure 11 – Correspondences between architectures (source: Lin et al., 2018) Interoperability can be defined as “the ability of two or more systems or components to exchange information and to use this exchanged information” (Blanc-Serrier, Ducq, & Vallespir, 2018). Figure 12 represents the interoperability between the two references architectures studied: IIRA crosscutting functions and domains RAMI4.0 Physical Systems (not formally defined) Physical aspect of the Asset Layer Physical components, documents, software and human actors Control Domain Functions performed by the industrial assets or control systems executing closed-loop control that may involve sensing, control and actuation. Integration Layer Digitally represents the physical assets and their digital capability; Provides computer-aided control of the technical process; generates events from the assets Functional Layer If the functions are Industry 4.0 compliant then they refer to the functional layer Connectivity and Distributed Data Management and Integration Crosscutting Function Communication Layer Provides standard communication for services and event/data to the information layer Provides control commands to the integration layer Information Domain Functions for collecting, transforming and analyzing data to acquire high-level intelligence of the entire system Information Layer Describes (logical) services and events/data of an asset (technical functionality) with regard to its role in the Industrie 4.0 system (as a “semantic selfdescription”) Operations and Application Domains Functions for assets and control systems management and maintenance to ensure their continuing operations Functions for applying use-case-specific logic, rules and models based on the information obtained from the information domain to achieve system-wide optimization of operations Functional Layer The runtime environment for applications and technical functionality enabling tasks in support of the business processes Business Domain Functions for integrating information across business systems and applications to achieve business objectives, such as work planning, customer relation management (CRM), enterprise resource planning (ERP), manufacturing execution system (MES), etc. Business Layer Orchestrating functions to form business processing and linking between different business processes in supporting of the business models under the legal and regulatory constraints
A contribution for data processing and interoperability in Industry 4.0. 23 Figure 12 - IIRA and RAMI4.0 interoperability (source: Lin et al., 2018)
A contribution for data processing and interoperability in Industry 4.0. 24 2.4 Technologies This topic presents the importance of the tools that made possible the contribution. All tools were developed in Windows platform. 2.4.1 Database This technology can aid an optimized approach where data consistency will enable a readily data analysis to support decision-making. Database architecture methodology assist the planning, management and control, modelling the base requirements in a standard (Connolly & Begg, 2005). The relational database is being used for more than 30 years all over the world. This kind of database changed significantly the way the productivity of organizations. The development of this technology created a more intuitive use. Therefore, the database is not a department property, but a resource shared thought the enterprise (Connolly & Begg, 2005). Cristian (2017) affirms that the database involves share of data and applications and present countless benefits, like: • Reduce and even eliminate data redundancy using data integrity, thus avoiding copies of the same data. With this minimization, data consistency may be maximized. • Security measures to avoid data manipulation from people without authorization. • The database allow access by multiple users at the same time. The database management system (DBMS) is a software that allow the creation, maintenance, control and access to databases. DBMS interacts with applications created by the user that can be written in procedural language (that describes how to do something) coming from the third generation of programming language (3GL) like C, C++, C#, Java, Visual Basic, COBOL, Fortran, Ada and Pascal or though the integration of programming languages from the fourth generation (4GL) (that describes what shall be done) with 3GL like the structure query language (Connolly & Begg, 2005). Using this integration there is a segregation between data structure (where the data is stored) and applications (Connolly & Begg, 2005). 2.4.2 Structured Query Language (SQL)
A contribution for data processing and interoperability in Industry 4.0. 25 According to Connolly & Begg (2005), SQL is a language developed to use the relationships between tables and transform inputs in outputs using two components: • Data definition language – DDL to define the database structure and control the information; • Data manipulation language – DML to retrieve and update data. SQL is a global standard to define and manipulate relational databases (Connolly & Begg, 2005). 2.4.3 Conceptual database design The conceptual database design is independent of all implementation details such as: hardware, software, applications and programming languages (Connolly & Begg, 2005). According to Connolly & Begg (2005) a conceptual model comprises: • Entity types; • Relationship types – using entity-relationship modelling; • Attributes and their domains: a user can define the meaning and sources of the values that attributes can hold; • Primary and alternate keys: primary key identifies rows uniquely within the relation; • Integrity constraints: which ensures that the data is accurate, for example: no primary key can be null (cannot have an unknown value). Entity-relationship model grant data integrity and their adequate usage to solve a problem from the company. It creates a model free of ambiguities and avoiding the differentiated understandability between architects, programmers and final users (Connolly & Begg, 2005). Data dictionary is produced thought out the development of the model. This dictionary identify entities, relationship and attributes description (Connolly & Begg, 2005). 2.4.4 Logical database design The logical database design phase maps the conceptual model onto a logical model. The logical model is influenced by the data model (for example, relational model) but is independent of a particular DBMS and other physical considerations (Connolly & Begg, 2005).
A contribution for data processing and interoperability in Industry 4.0. 26 According to the authors, relational databases have certain amount of data redundancy. This redundancy is in the form of a primary key from table A, acting as foreign key in table B, to enable modelling relationships. Also stated by the authors, the derived structures from the conceptual model relationships, are identified in the logical model: • One-to-many (1, N) relationship: parent entity must be identified as well as child entity. To represent the relationship using a foreign key, the primary key from the parent entity will be a foreign key in the child entity. Connolly & Begg (2005) affirms that integrity constraints are represented in logical model. These actions can be performed in the child entity if a value from its parent entity is modified: • NO ACTION is to prevent the update or deletion, • CASCADE is to automatically update or delete any reference child row when parent row is deleted, • SET NULL command automatically set a foreign key to null. 2.4.5 Physical database design The physical database design is tailored to a specific DBMS. There is feedback between physical and logical design as the decisions from the physical model can alter the logic behind the database (Connolly & Begg, 2005). SQL enable multiple users input at the same time (Connolly & Begg, 2005). 2.4.6 Views The view is a virtual relation that does not exist in the current database, but can produce a new table with useful information (Connolly & Begg, 2005). They are dynamic, implying that changes made in the base data table will be updated automatically in the view (Connolly & Begg, 2005). 2.4.7 MS Office Access MS Office Access or MS Access is used for relational DBMS for Microsoft Windows environment. It provides a Graphical User Interface (GUI) to create tables, queries, forms, reports and customized applications using macro in Visual Basic for Applications (VBA)
A contribution for data processing and interoperability in Industry 4.0. 27 language, it also provides a “wizard” to simplify the process for building applications (Connolly & Begg, 2005). 2.4.8 Microsoft .NET and Microsoft .NET Framework Microsoft .NET is the current evolution in Microsoft’s Web solution strategy. Microsoft .NET have various tools, services and technologies such as Windows Server, business processes with xml, application center, mobile server, object-relational database management system and Microsoft Visual Studio .NET (Connolly & Begg, 2005). According to the authors, Microsoft .NET Framework, in addition to .NET, has two main components that are: • Common Runtime Language (CRL): loads, executes and manages codes like C#, C++, F#, J#, Java, Visual Basic. In CRL one language can call another language, inherit and modify objects from another language. • .NET Framework Class Libraries: is a collection of interfaces, types and classes that integrate with CRL providing standards. The three main components are: windows forms, APS.NET (to support Web development) and ADO.NET. 2.4.9 Microsoft Visual Studio .NET Microsoft Visual Studio .NET is an integrated suite of application development tools such as J#, C#, C++) (Connolly & Begg, 2005). This integrated development environment (IDE) includes many aspects of software development such as compilers, code completion tools, graphical designers(visual-studio-ide @ docs.microsoft.com, 2019). 2.4.10 Object Relational Mapping Object relational mapping is a technique that abstracts the communication between two different programming paradigms like, object-oriented models and relational databases Various technologies were offered to handle this gap between object-oriented and relational databases, like Entity Framework from Microsoft (Zimányi, E., Jallow, B., Kashef, 2018). 2.4.11 ActiveX Data Objects, ADO.NET and Entity Framework ActiveX Data Objects (ADO) is a programming tool for database connection (Connolly & Begg, 2005).
A contribution for data processing and interoperability in Industry 4.0. 28 In ADO just one request to a database can be made using a single connection. On the other hand, ADO.NET that is designed by .NET framework can request multiple transactions using a single connection (ado-difference @ net-informations.com). Entity framework is an open source ORM framework for ADO.NET which simplifies mapping between objects to columns of relational database (Tannock, 2016). As referred by Tannock (2016), entity framework let developers focus on the business domain. The application cannot be limited by what the database is able to do. 2.4.12 Simulation For simulation, it was used the software Simio. According to Vik, Dias, Pereira, & Oliveira (2012) Simio supports: • 3D animation; • Importing data from excel worksheets; • Writing own logic functions in languages like C++ and Visual Basic; • Creating own libraries and objects. 2.4.13 Knime Analytics platform For workflow, it was used the Knime Analytics platform (Konstanz Information Miner). This environment allows easy visual assembly, dynamic data analysis and data cleaning. It is suited to process files in csv, xls, xlsx, xml, url and relational databases (eg., SQL, MySQL, Oracle) (Feltrin, 2015). 2.4.14 Power BI Power BI converts all data that comes from reports, worksheets, charts and emails into charts and graphs that are more meaningful to the reader (power bi @ docs.microsoft.com, 2019).
A contribution for data processing and interoperability in Industry 4.0. 29 3. COMPANY PROFILE 3.1 ZF Group The following topic presents the company profile where this master thesis was developed. In the year 2000 was founded Safelife, a bag plant part of Dalphimetal Group. In May of the same year, in Vila Nova de Cerveira started the production, research and development activities. In November occurred the delivery of the first bag to the group PSA (known as PSA Peugeot Citroën from 1991 to 2016). In January 2001 started the construction of the facility at Industrial area in Gemieira, Ponte de Lima. In October, the production was transferred to new facilities in Ponte de Lima. In January 2004 was founded Safebag (airbags modules assembly plant) and in the same month was acquired a building in Fornelos, Ponte de Lima. In April 2004 started the production and delivery of the first airbag to Renault. In October 2005 Dalphimetal group was acquired by TRW Automotive. In February 2008, Safe Life and Safebag lines were reorganized by products and were integrated as Ponte de Lima Plant. In May 2015 TRW Automotive was acquired by ZF Friedrichshafen AG. Ponte de Lima plant integrated the ZF Active and Passive safety technologies division. ZF Group have seven divisions: 1) Car Powertrain: Manual, automatic and dual clutch transmissions, axle drivers and powertrain modules; 2) Car Chassis Technology: Chassis systems, chassis components and suspension technology; 3) Commercial Vehicle Technology: Truck and Van driveline technologies, axle and transmission systems for buses and coaches and steering systems; 4) Industrial Technology: Off-Highway systems, industrial drives, marine and special driveline technology, test systems, aviation and wind power technologies; 5) E-Mobility: Electronic systems, electric traction drive and system house; 6) ZF Aftermarket: Independent aftermarket, original equipment service / specific original equipment, manufacturing, services and friction materials group;
A contribution for data processing and interoperability in Industry 4.0. 30 7) Active & Passive Safety Technology: braking systems, steering systems, occupant safety systems, electronics and body control systems. Figure 13 shows the worldwide ZF presence for occupant safety systems: Figure 13 Occupant safety systems worldwide (adapted from ZF Friedrichshafen AG, September 2017) In 2018, Safebag delivered approximately 14 million airbag modules. The clients were: PSA, Seat-Volkswagen, GM, Renault-Nissan, Volvo, Ford, Hyundai, Fiat and Jaguar. Figure 14 shows millions of units sold in 2018 among five airbags modules: Figure 14 - Million units sold in 2018 According to Fernandes (2018) in 2017 ZF had a revenue of 36.4 billion Euros and Safebag had a revenue, at the same year, of 192 million Euros. Engineering Centers & Support Manufacturing Facilities Facility Type Canada Midland Mexico Chihuahua (2) La Laguna Reynosa USA Mesa, Arizona Washington/Romeo, MI Brazil Limeira Germany Alfdorf Aschaffenburg Aschau Laage France Paris Italy Moncalieri Bricherasio Portugal Vila Nova Ponte de Lima (2) Spain Porriño Valladolid Vigo Czech Republic Stara Boleslav Poland Czestochowa (2) Romania Timisoara Roman Tunisia Ben Arous South Africa Atlantis India RTSSL Chennai TSSW Pune TSSW Gurgaon China Anting Shanghai TFASS Changchun TFASS Chengdu TFASS Foshan Wuhan Xian Zhangjiagang Korea TASS Seoul Thailand TSST Rayong Japan Yokohama
A contribution for data processing and interoperability in Industry 4.0. 37 Figure 19 - simulation model Figure 20 - simulation experience SQL had an efficiency of almost 97% and Excel almost 4%. The initial capacity of 52 users in scenario2 from the experiment was acquired from the real usage of the integrated system developed in SQL, where 52 different employees made requests. The workflow created in Knime is as show in Figure 21: Figure 21 - knime workflow 5.1.7 Tools for decision-making towards Industry 4.0 – under development The shop floor employees must assemble airbags modules as informed by the logistics module in their integrated system for enterprise management (SAP ERP). Logistics informs the reference to produce, the quantity and the delivery date. The production presents the lines, the employees times, quantities and the traceability to check the planning and the real data.
A contribution for data processing and interoperability in Industry 4.0. 38 This integration is to stop using an Excel sheet where the shop floor employees enter the product they do as their will. The tool was developed in web using PHP.
A contribution for data processing and interoperability in Industry 4.0. 39 6. CONCLUSION 6.1 Difficulties Several literatures focus on Industry 4.0 but according to Wortmann et al. (2017) “only few papers address modelling for smart product which is supposed to control its production processes in many visions on Industry 4.0”. Overall, 61% publications contribute with methods, 17% share concepts but less often publications commit with analyses, metrics or tools. Handling technical issues while having a business background are challenging. To develop interoperability, tools and methods created in programming languages must be connected. Having just one background is not enough. 6.2 Overview Structuring a reference architecture entails a high level of abstraction to gather specific stakeholders needs and technologies. Even so, the main requirements are simple to understand: connectivity and communication to collect data and disseminate information across the enterprise in order to improve decision-making. As industrial revolutions happen, its complexity raises the skills needed by the works. Intellectual labour will become increasingly more important relative to physical labour. Industry 4.0 will be an inevitable disruption to all global enterprises. Companies that act locally will also be impacted by this revolution. Industry 4.0 aims not only on smart manufacturing but also on increasing efficiency. Enhance the creation of more favourable conditions for the best performance of industrial processes are needed in Europe not only to avoid the impact of the workforce bottleneck (where more people are leaving the market than people going in the market), but also to prevent the loss of industrial leadership to emerging economies. All company must be involved in this revolution. Lack of employee engagement, skepticism, and fear can cause the failure of the project. Industry 4.0 must be implemented at a slow pace but constant pace (this transformation may take years), although technological evolution still happens, and this development is at a fast pace.
A contribution for data processing and interoperability in Industry 4.0. 40 How to implement Industry 4.0 constantly dealing with these technological changes are huge concerns to be taken into consideration. Machine learning (ML) and predictions are the second phase of Industry 4.0, but without a good architecture implemented in Industry 4.0 first phase, ML will not deliver feasible responses for decision-making. The theme Industry 4.0 demands a continued study, not only because there are lots of documents, tools and methods to make Industry 4.0 possible, but also because it is highly connected with the Information Technology world. This world of information keeps its dynamics. Reference architectures in Industry 4.0 are in development. There will not be a model that every company can follow and create his entire smart manufacturing from it. Industry 4.0 in railway or aviation sectors will not share the same approach as Industry 4.0 in automotive industry, simple because the final product is different. Even so, a standard architecture across companies must be implemented. One solution from one company may be related to the solution from another company. The information system developed aims at integrating employees, the identified issues, and the responsible to act in resolving the issue. Once in a common database, it is easier to share information across departments. 6.3 Future works The information created by the company must be measured, using data analysis. Lord Kelvin affirms: “When you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of meagre and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely in your thoughts advanced to the state of Science, whatever the matter may be.” (Kaganski, Majak, Karjust, & Toompalu, 2017). Knime analytics platform could be used for this task: organizing data (removing data that is not important to the analysis), statistics, data mining and machine learning with minimal or no programming. The platform created in C# in Windows Forms must be developed in web for the following reasons:
A contribution for data processing and interoperability in Industry 4.0. 41 • The SQL must be restructured. Some attributes must be implemented in their own table and new relationships must be created (for example, one issue can have more than one end date). • In C# programming, an update might not be shared among users, causing some employees to have the newest version and some to have the older version. • All users must have their credentials (login, password and email) while with every update there must be a traceability of who did what where.
A contribution for data processing and interoperability in Industry 4.0. 42
A contribution for data processing and interoperability in Industry 4.0. 43 BIBLIOGRAPHY ado-difference @ net-informations.com. (n.d.). Retrieved from http://netinformations.com/faq/ado/ado-difference.htm Adolphs, P., Bedenbender, H., Dirzus, D., Ehlich, M., Epple, U., Hankel, M., … Wollschlaeger, M. (2015). The Reference Architecture Model Industry 4.0 (RAMI 4.0). Zvei, (July). Retrieved from https://www.zvei.org/presse-medien/publikationen/dasreferenzarchitekturmodell-industrie-40-rami-40/ Alphonsus, E. R., & Abdullah, M. O. (2016). A review on the applications of programmable logic controllers (PLCs). Renewable and Sustainable Energy Reviews, 60, 1185–1205. https://doi.org/10.1016/j.rser.2016.01.025 Blanc-Serrier, S., Ducq, Y., & Vallespir, B. (2018). Organisational interoperability characterisation and evaluation using enterprise modelling and graph theory. Computers in Industry, 101(April), 67–80. https://doi.org/10.1016/j.compind.2018.04.012 Carvalho, M. S. V. R. (2018). Modelos de Referência e Interoperabilidade no Âmbito da Indústria 4.0: caso de demostração PRODUTECH SIF na indústria transformadora. Connolly, T., & Begg, C. (2005). Database Systems: a practical approach to Design, Implementation and Management (4th ed.). Pearson Education Limited. Cristian, M. (2017). The importance of databases in economy - some general coordinates. Revista Economica, 6, 5–9. Federal Ministry for Economic Affairs and Energy. (2016). Digitization of Industrie - Plattform Industrie 4.0. Federal Ministry for Economic Affairs and Energy. (2018). Alignment Report for Reference Architectural Model for Industrie 4.0 / Intelligent Manufacturing System Architecture. Feltrin, L. (2015). KNIME an Open Source Solution for Predictive Analytics in the Geosciences [Software and Data Sets]. IEEE Geoscience and Remote Sensing Magazine, 3(4). https://doi.org/10.1109/MGRS.2015.2496160 Fernandes, F. S. (2018). safebag: airbags made in ponte de lima equipam automoveis. Retrieved from https://www.jornaldenegocios.pt/negocios-iniciativas/premiosexportacao---internacionalizacao/detalhe/safebag-airbags-made-in-ponte-de-lima- equipam-automoveis
A contribution for data processing and interoperability in Industry 4.0. 44 Fiesp. (2017). A corrida tecnológica rumo à Indústria 4.0 : quem está na pole position? Frank A G, Dalenogare L S, & Ayala N F. (2019). Industry 4.0 technologies: Implementation patterns in manufacturing companies. International Journal of Production Economics, 210, 15–20. https://doi.org/10.1016/j.ijpe.2019.01.004 Gates, D., & Bremicker, M. (2017). Beyond the hype: separating ambition from reality in i4.0. Retrieved from https://assets.kpmg/content/dam/kpmg/xx/pdf/2017/05/beyond-the- hype.pdf Gotze, J. (2016). Reference Architectures for Industry 4.0. Retrieved from https://coe.qualiware.com/reference-architectures-for-industry-4-0/ Grable, J. E., & Lyons, A. C. (2018). An Introduction to Big Data. Economics and Investment Management, 72(5), 17–20. Huang, S., Mohanty, S., Ashfahani, A., & Pratama, M. (2018). The Study on Indoor Localization for Manufacturing Execution System. 2018 15th International Conference on Control, Automation, Robotics and Vision, ICARCV 2018, 1863–1867. https://doi.org/10.1109/ICARCV.2018.8581192 i-SCOOP. (2019). Retrieved from https://www.i-scoop.eu/industry-4-0/ Kaganski, S., Majak, J., Karjust, K., & Toompalu, S. (2017). Implementation of Key Performance Indicators Selection Model as Part of the Enterprise Analysis Model. Procedia CIRP, 63, 283–288. https://doi.org/10.1016/j.procir.2017.03.143 Kagermann, H., Wahlster, W., & Helbig, J. (2013). Recommendations for implementing the strategic initiative industrie 4.0. Lin, S.-W., Miller, B., Durand, J., Bleakley, G., Chigani, A., Martin, R., & Crawford, M. (2019). The Industrial Internet of Things Volume G1 : Reference Architecture. Lin, S.-W., Murphy, B., Clauer, E., Loewen, U., Neubert, R., Bachmann, G., & Hankel, M. (2018). Architecture Alignment and Interoperability An Industrial Internet Consortium and Plattform Industrie 4.0 Joint Whitepaper, 19. Retrieved from http://www.iiconsortium.org/pdf/JTG2_Whitepaper_final_20171205.pdf Lydon, B. (n.d.). RAMI 4.0 Reference Architectural Model for Industrie 4.0: three-dimensional map showing how to approach Industry 4.0 in a structured manner. Retrieved from https://www.isa.org/intech/20190405/ Macedo, M. A. (2017). Automação e integração de equipamentos na indústria cerâmica. Mckinsey. (2016). McKinsey Digital 2016. Retrieved from
A contribution for data processing and interoperability in Industry 4.0. 45 https://www.mckinsey.com/~/media/mckinsey/business functions/mckinsey digital/our insights/getting the most out of industry 4 0/mckinsey_industry_40_2016.ashx Mulrow, C. D. (2014). Systematic Reviews Rationale for systematic reviews, (May), 1–4. https://doi.org/10.1136/bmj.309.6954.597 power bi @ docs.microsoft.com. (2019). Retrieved from https://docs.microsoft.com/enus/learn/modules/explore-power-bi-service/1-why-power-bi RAMI4.0 - a reference framework for digitalisation. (2018). Rodič, B. (2017). Industry 4.0 and the New Simulation Modelling Paradigm. Organizacija, 50(3), 193–207. https://doi.org/10.1515/orga-2017-0017 Russom, P. (2011). Big Data Analytics Fourth Quarter 2011. Sabo, F. (2015). Industry 4.0 - A Comparison of the Status in Europe and the USA, (January). Slack, N., Chamber, S., & Johnston, R. (2009). Administração da Produção. (E. A. S.A., Ed.) (3. ed). Ślusarczyk, B. (2018). Industry 4.0 - are we ready? https://doi.org/10.17512/pjms.2018.17.1.19 Smit, J., Kreutzer, S., Moeller, C., & Carlberg, M. (2016). Industry 4.0. Sony, M. (2018). Industry 4.0 and lean management: a proposed integration model and research propositions. Production and Manufacturing Research, 6(1), 416–432. https://doi.org/10.1080/21693277.2018.1540949 Stephen, E. (2018). Why Manufacturing Digitalization Matters and How Countries Are Supporting It, (April), 1–66. Tannock, J. D. T. (2016). Entity Framework. Organizational Behavior, 123. Vermesan, O., & Friess, P. (2014). Chapter 1 Introduction. Internet of Things – From Research and Innovation to Market Deployment. River Publishers. Vik, P., Dias, L., Pereira, G., & Oliveira, J. (2012). Using Simio for the Specification of an Integrated Automated Weighing, 1534–1546. visual-studio-ide @ docs.microsoft.com. (2019). Retrieved from https://docs.microsoft.com/en-us/visualstudio/get-started/visual-studio-ide?view=vs- 2019 WEF. (2015). Industrial Internet of Things : Unleashing the Potential of Connected Products and Services. Wortmann, A., Combemale, B., & Barais, O. (2017). A Systematic Mapping Study on Modeling
A contribution for data processing and interoperability in Industry 4.0. 46 for Industry 4.0. https://doi.org/10.1109/MODELS.2017.14 Xu, L. Da, Xu, E. L., & Li, L. (2018). Industry 4.0: state of the art and future trends. International Journal of Production Research, 56(8), 2941–2962. https://doi.org/10.1080/00207543.2018.1444806 Zimányi, E., Jallow, B., Kashef, S. (2018). Object Relational Mapping and Entity Framework, 1– 16.
A contribution for data processing and interoperability in Industry 4.0. 53 ANNEX VII – C# INPUT CLASS 1. namespace GAM_Projeto 2. { 3. using System; 4. using System.Collections.Generic; 5. 6. public partial class input 7. { 8. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214: DoNotCallOverridableMethodsInConstructors")] 9. public input() 10. { 11. this.Issues = new HashSet<issue>(); 12. } 13. 14. public int inputId { get; set; } 15. public string inputName { get; set; } 16. 17. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227: CollectionPropertiesShouldBeReadOnly")] 18. public virtual ICollection<issue> Issues { get; set; } 19. } 20. } ANNEX VIII – C# DEPARTMENT CLASS 1. namespace GAM_Projeto 2. { 3. using System; 4. using System.Collections.Generic; 5. 6. public partial class department 7. { 8. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214: DoNotCallOverridableMethodsInConstructors")] 9. public department() 10. { 11. this.Issues = new HashSet<issue>(); 12. } 13. 14. public int departmentId { get; set; } 15. public string departmentName { get; set; } 16. 17. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227: CollectionPropertiesShouldBeReadOnly")] 18. public virtual ICollection<issue> Issues { get; set; } 19. } 20. } ANNEX IX – C# PRIORITY CLASS 1. namespace GAM_Projeto 2. { 3. using System; 4. using System.Collections.Generic; 5. 6. public partial class priority 7. {
A contribution for data processing and interoperability in Industry 4.0. 54 8. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214: DoNotCallOverridableMethodsInConstructors")] 9. public priority() 10. { 11. this.Issues = new HashSet<issue>(); 12. } 13. 14. public int priorityId { get; set; } 15. public Nullable<int> priorityNumber { get; set; } 16. 17. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227: CollectionPropertiesShouldBeReadOnly")] 18. public virtual ICollection<issue> Issues { get; set; } 19. } 20. } ANNEX X – C# LOCALIZATION CLASS 1. namespace GAM_Projeto 2. { 3. using System; 4. using System.Collections.Generic; 5. 6. public partial class localization 7. { 8. public int localizationId { get; set; } 9. public string localizationName { get; set; } 10. } 11. } ANNEX XI – C# ISSUE CLASS 1. namespace GAM_Projeto 2. { 3. using System; 4. using System.Collections.Generic; 5. 6. public partial class issue 7. { 8. public int issueId { get; set; } 9. public string issueDescription { get; set; } 10. public string action { get; set; } 11. public Nullable<System.DateTime> startDate { get; set; } 12. public Nullable<System.DateTime> forecastDate { get; set; } 13. public Nullable<System.DateTime> endDate { get; set; } 14. public string localization { get; set; } 15. public string input { get; set; } 16. public string department { get; set; } 17. public Nullable<int> priority { get; set; } 18. public Nullable<bool> actionConcluded { get; set; } 19. public Nullable<bool> actionCancelled { get; set; } 20. public Nullable<bool> actionContinued { get; set; } 21. public Nullable<int> fkidInput { get; set; } 22. public Nullable<int> fkidDepartment { get; set; } 23. public Nullable<int> fkidPriority { get; set; } 24. public string remarks { get; set; } 25. public Nullable<System.DateTime> timestamp { get; set; } 26. public string responsibleName { get; set; } 27. public Nullable<int> responsibleNumber { get; set; } 28. public string situation { get; set; }
A contribution for data processing and interoperability in Industry 4.0. 55 29. 30. public virtual department department_ { get; set; } 31. public virtual input input_ { get; set; } 32. public virtual priority priority_ { get; set; } 33. } 34. } ANNEX XII – C# PROJECT CODE 1. using System; 2. using System.Collections.Generic; 3. using System.ComponentModel; 4. using System.Data; 5. using System.Drawing; 6. using System.Linq; 7. using System.Text; 8. using System.Threading.Tasks; 9. using System.Windows.Forms; 10. using System.Data.Entity; 11. using Excel = Microsoft.Office.Interop.Excel; 12. using Microsoft.Office.Interop; 13. 14. 15. namespace GAM_Projeto 16. { 17. 18. public partial class Form1 : Form 19. { 20. public Form1() 21. { 22. InitializeComponent(); 23. } 24. //Issue e tabelas consulta 25. public GAMEntities context = new GAMEntities(); 26. GAMEntities db = new GAMEntities(); 27. //view 28. GAMEntities1 context2 = new GAMEntities1(); 29. //TPessoal 30. GestaoPessoalEntities context3 = new GestaoPessoalEntities(); 31. 32. 33. private void Form1_Load(object sender, EventArgs e) 34. { 35. // TODO: This line of code loads data into the 'gAMDataSet.Issue' table. You can move, or remove it, as needed. 36. this.issueTableAdapter.Fill(this.gAMDataSet.Issue); 37. txtboxcontadororiginal.Visible = false; 38. txtboxcontadoreditado.Visible = false; 39. dateTimePickeratual.Text = string.Format("{0: yyyy-MM- dd}", DateTime.UtcNow); 40. dateTimePickerInicio.Text = string.Format("{0: yyyy-MM- dd}", DateTime.UtcNow); 41. dateTimePickerPrevista.Text = string.Format("{0: yyyy-MM- dd}", DateTime.UtcNow); 42. dateTimePickerPrevista.Enabled = true; 43. dateTimePickeratual.Enabled = false; 44. dateTimePickeratual.Visible = false; 45. dateTimePickerTimestamp.Visible = false; 46. txtboxnomeresponsavelBD.Visible = false; 47. txtboxnumeroresponsavelBD.Visible = false; 48. txtboxnomeresponsavelFORM.Visible = false; 49. txtboxnumeroresponsavelFORM.Visible = false; 50. txtemail.Visible = false;
A contribution for data processing and interoperability in Industry 4.0. 56 51. txtlocal.Visible = false; 52. int i = advancedDataGridViewIssue.Rows.GetRowCount(DataGridViewElementSt ates.Visible); 53. lbcount.Text = Convert.ToString(i); 54. //renomear as colunas da base de dados para inglês e nao visualizar a co luna 55. advancedDataGridViewIssue.Columns["situaçãoDataGridViewTextBoxColumn"].H eaderText = "Situation"; 56. advancedDataGridViewIssue.Columns["idIssueDataGridViewTextBoxColumn"].He aderText = "Id"; 57. advancedDataGridViewIssue.Columns["idIssueDataGridViewTextBoxColumn"].Vi sible = false; 58. advancedDataGridViewIssue.Columns["descriçãoDataGridViewTextBoxColumn1"] .HeaderText = "Issue"; 59. advancedDataGridViewIssue.Columns["açãoCorretivaDataGridViewTextBoxColum n"].HeaderText = "Action"; 60. advancedDataGridViewIssue.Columns["dataInícioDataGridViewTextBoxColumn"] .HeaderText = "Start"; 61. advancedDataGridViewIssue.Columns["dataPrevistaDataGridViewTextBoxColumn "].HeaderText = "Preview"; 62. advancedDataGridViewIssue.Columns["Data_Fecho"].HeaderText = "Forecast / End"; 63. advancedDataGridViewIssue.Columns["localDataGridViewTextBoxColumn"].Head erText = "Project or Location"; 64. advancedDataGridViewIssue.Columns["departamentoAfetadoDataGridViewTextBo xColumn"].HeaderText = "Department"; 65. advancedDataGridViewIssue.Columns["prioridadeDataGridViewTextBoxColumn1" ].HeaderText = "Priority"; 66. advancedDataGridViewIssue.Columns["nomeResponsavelDataGridViewTextBoxCol umn1"].HeaderText = "Responsible"; 67. advancedDataGridViewIssue.Columns["observaçãoDataGridViewTextBoxColumn"] .HeaderText = "Remarks"; 68. advancedDataGridViewIssue.Columns["numeroResponsavelDataGridViewTextBoxC olumn1"].HeaderText = "Responsible_Number"; 69. advancedDataGridViewIssue.Columns["numeroResponsavelDataGridViewTextBoxC olumn1"].Visible = false; 70. advancedDataGridViewIssue.Columns["açãoConcluídaDataGridViewCheckBoxColu mn"].HeaderText = "Concluded"; 71. advancedDataGridViewIssue.Columns["açãoConcluídaDataGridViewCheckBoxColu mn"].Visible = false; 72. advancedDataGridViewIssue.Columns["açãoCanceladaDataGridViewCheckBoxColu mn"].HeaderText = "Cancelled"; 73. advancedDataGridViewIssue.Columns["açãoCanceladaDataGridViewCheckBoxColu mn"].Visible = false; 74. advancedDataGridViewIssue.Columns["açãoContínuaDataGridViewCheckBoxColum n"].HeaderText = "Ongoing"; 75. advancedDataGridViewIssue.Columns["açãoContínuaDataGridViewCheckBoxColum n"].Visible = false; 76. dateTimePickerInicio.Enabled = false; 77. //resize columns 78. advancedDataGridViewIssue.Columns["descriçãoDataGridViewTextBoxColumn1"] .Width = 250; 79. advancedDataGridViewIssue.Columns["açãoCorretivaDataGridViewTextBoxColum n"].Width = 180; 80. advancedDataGridViewIssue.Columns["prioridadeDataGridViewTextBoxColumn1" ].Width = 65; 81. Initialize(); 82. } 83. //add in a textbox the responsible number, to compare with previous register ed in the function *private void txtboxnumeroresponsavelFORM_TextChanged(object send er, EventArgs e)* 84. private void dgvpessoal_CellClick(object sender, DataGridViewCellEventArgs e ) 85. { 86. int ind = e.RowIndex; 87. DataGridViewRow selectedRows = dgvpessoal.Rows[ind];
A contribution for data processing and interoperability in Industry 4.0. 57 88. txtboxnumeroresponsavelFORM.Text = selectedRows.Cells[2].Value.ToString( ); 89. } 90. private void Initialize() 91. { 92. //Iniciar combobox 93. //prioridade 94. comboBoxPrioridade.DataSource = context.priority.ToList(); 95. comboBoxPrioridade.DisplayMember = "priorityNumber"; 96. comboBoxPrioridade.ValueMember = "priorityId"; 97. comboBoxPrioridade.Text = "0"; 98. //input 99. comboBoxInput.DataSource = context.input.ToList(); 100. comboBoxInput.DisplayMember = "inputName"; 101. comboBoxInput.ValueMember = "IinputId"; 102. comboBoxInput.Text = null; 103. //departamento 104. comboBoxDepartamento.DataSource = context.department.ToList(); 105. comboBoxDepartamento.DisplayMember = "departmentName"; 106. comboBoxDepartamento.ValueMember = "departmentId"; 107. comboBoxDepartamento.Text = null; 108. //Funcao para atualizar as situacoes dos issues 109. RefreshStatus(); 110. 111. 112. //todos os registros da view 113. var view = from concat_Lineas_Regiao in context2.concat_Lineas_Regiao 114. select new 115. { 116. concat_Lineas_Regiao.Isla, 117. }; 118. dataGridSQLView.DataSource = view.ToList(); 119. //preencher o datagrid no total de acordo com o tamanho da linha, projet o ou local 120. dataGridSQLView.Columns["Isla"].AutoSizeMode = DataGridViewAutoSizeColum nMode.Fill; 121. //alterar nome da coluna 122. dataGridSQLView.Columns["Isla"].HeaderText = "Project or Location"; 123. 124. //todos os registros de pessoal 125. var pes = from pessoal in context3.TPessoals.OrderBy(s => s.Numero) 126. select new 127. { 128. pessoal.id, 129. pessoal.Numero, 130. pessoal.Nome, 131. pessoal.Tipo, 132. }; 133. dgvpessoal.DataSource = pes.Where(a => a.Tipo.Contains("I")).ToList(); 134. this.dgvpessoal.Columns["id"].Visible = false; 135. this.dgvpessoal.Columns["Tipo"].Visible = false; 136. //preencher o datagrid no total de acordo com o tamanho do nome 137. dgvpessoal.Columns["Nome"].AutoSizeMode = DataGridViewAutoSizeColumnMode .Fill; 138. //alterar nome das colunas 139. dgvpessoal.Columns["Nome"].HeaderText = "Name"; 140. dgvpessoal.Columns["Numero"].HeaderText = "Number"; 141. //Colocar campo como vazio assim que o formulario abre e se for chamada a função Initialize() 142. textBoxIssue.Text = ""; 143. textBoxAcaoCorretiva.Text = ""; 144. txtboxnomeresponsavelBD.Text = ""; 145. txtboxnumeroresponsavelBD.Text = ""; 146. } 147.
A contribution for data processing and interoperability in Industry 4.0. 58 148. //save register 149. private void button1Save_Click_1(object sender, EventArgs e) 150. { 151. dateTimePickerTimestamp.Text = string.Format("{0: yyyy-MM- ddTHH:mm:ss}", DateTime.UtcNow); 152. // o local escolhido vai para o textbox local 153. foreach (DataGridViewRow dr in dgvpessoal.Rows) 154. { 155. foreach (DataGridViewRow er in dataGridSQLView.Rows) 156. { 157. if (er.Cells["Escolher"].Value != null && er.Cells["Escolher"].V alue.ToString().ToLower() != "false") 158. { 159. txtlocal.Text = Convert.ToString(er.Cells["Isla"].Value); 160. } 161. } 162. //o nome e o numero do funcionario selecionado vai para textbox func ionario 163. { 164. if (dr.Cells["Selecionar"].Value != null && dr.Cells["Selecionar "].Value.ToString().ToLower() != "false") 165. { 166. txtboxnumeroresponsavelBD.Text = Convert.ToString(dr.Cells[" Numero"].Value); 167. txtboxnomeresponsavelBD.Text = Convert.ToString(dr.Cells["No me"].Value); 168. } 169. } 170. } 171. //os campos do formulario nao podem ser deixados vazio 172. int issueid = Convert.ToInt32(labelIssueID.Text); 173. if (textBoxIssue.Text == "") 174. { 175. MessageBox.Show("Empty Issue", "Error", MessageBoxButtons.OK, Messag eBoxIcon.Error); 176. return; 177. } 178. else if (textBoxAcaoCorretiva.Text == "") 179. { 180. MessageBox.Show("Empty Action", "Error", MessageBoxButtons.OK, Messa geBoxIcon.Error); 181. return; 182. } 183. else if (comboBoxInput.Text == "") 184. { 185. MessageBox.Show("Empty Input", "Error", MessageBoxButtons.OK, Messag eBoxIcon.Error); 186. return; 187. } 188. else if (comboBoxDepartamento.Text == "") 189. { 190. MessageBox.Show("Empty Department", "Error", MessageBoxButtons.OK, M essageBoxIcon.Error); 191. return; 192. } 193. else if (txtboxnomeresponsavelBD.Text == "") 194. { 195. MessageBox.Show("Responsible was not selected", "Error", MessageBoxB uttons.OK, MessageBoxIcon.Error); 196. return; 197. } 198. else if (txtlocal.Text == "") 199. { 200. MessageBox.Show("Project or Location was not selected", "Error", Mes sageBoxButtons.OK, MessageBoxIcon.Error); 201. return;
A contribution for data processing and interoperability in Industry 4.0. 59 202. } 203. 204. if (issueid == 0) 205. { 206. //create an issue object if id = 0 207. issue problema = new issue 208. { 209. //inserir os texto na tabela issue no SQL 210. issueDescription = textBoxIssue.Text, 211. action = textBoxAcaoCorretiva.Text, 212. actionConcluded = checkBoxAcaoConcluida.Checked, 213. actionCancelled = checkBoxAcaoCancelada.Checked, 214. actionContinued = ckacaocontinua.Checked, 215. startDate = dateTimePickerInicio.Value, 216. forecastDate = dateTimePickerPrevista.Value, 217. endDate = dateTimePickerEnd.Value, 218. input = Convert.ToString(comboBoxInput.Text), 219. department = Convert.ToString(comboBoxDepartamento.Text), 220. priority= Convert.ToInt32(comboBoxPrioridade.Text), 221. localization = Convert.ToString(txtlocal.Text), 222. timestamp = dateTimePickerTimestamp.Value, 223. remarks = txtobs.Text, 224. responsibleName = txtboxnomeresponsavelBD.Text, 225. responsibleNumber = Convert.ToInt32(txtboxnumeroresponsavelBD.Te xt), 226. //inserir as chaves estrangeiras na tabela issue no SQL 227. fkidPriority = Convert.ToInt32(comboBoxPrioridade.SelectedValue) , 228. fkidInput = Convert.ToInt32(comboBoxInput.SelectedValue), 229. fkidDepartment = Convert.ToInt32(comboBoxDepartamento.SelectedVa lue), 230. }; 231. context.issues.Add(problema); 232. MessageBox.Show(this, "Data saved successfully", "Saved", MessageBox Buttons.OK, MessageBoxIcon.Information); 233. context.SaveChanges(); 234. labelIssueID.Text = "0"; 235. advancedDataGridViewIssue.SelectionMode = DataGridViewSelectionMode. RowHeaderSelect; 236. //Refresh datagrid 237. issueTableAdapter.Fill(gAMDataSet.Issue); 238. advancedDataGridViewIssue.Invalidate(); 239. advancedDataGridViewIssue.Refresh(); 240. RefreshStatus(); 241. textBoxAcaoCorretiva.Text = ""; 242. txtpesquisarfuncionario.Text = ""; 243. txtboxnomeresponsavelBD.Text = ""; 244. txtboxnumeroresponsavelBD.Text = ""; 245. checkBoxAcaoConcluida.Checked = false; 246. checkBoxAcaoCancelada.Checked = false; 247. ckacaocontinua.Checked = false; 248. int i = advancedDataGridViewIssue.Rows.GetRowCount(DataGridViewEleme ntStates.Visible); 249. lbcount.Text = Convert.ToString(i); 250. } 251. //data modification 252. else 253. { 254. var issueToUpdate = context.issues.SingleOrDefault(issue => issue.is sueId == issueid); 255. if (issueToUpdate != null) 256. { 257. //modificar os atributos da tabela issue 258. issueToUpdate.issueDescription = textBoxIssue.Text; 259. issueToUpdate.action = textBoxAcaoCorretiva.Text; 260. issueToUpdate.actionConcluded = checkBoxAcaoConcluida.Checked;
A contribution for data processing and interoperability in Industry 4.0. 60 261. issueToUpdate.actionCancelled = checkBoxAcaoCancelada.Checked; 262. issueToUpdate.actionContinued = ckacaocontinua.Checked; 263. issueToUpdate.startDate = dateTimePickerInicio.Value; 264. issueToUpdate.forecastDate = dateTimePickerPrevista.Value; 265. issueToUpdate.endDate = dateTimePickerEnd.Value; 266. issueToUpdate.input = comboBoxInput.Text; 267. issueToUpdate.department = comboBoxDepartamento.Text; 268. issueToUpdate.localization = txtlocal.Text; 269. issueToUpdate.priority = Convert.ToInt32(comboBoxPrioridade.Text ); 270. issueToUpdate.timestamp = dateTimePickerTimestamp.Value; 271. issueToUpdate.remarks = txtobs.Text; 272. issueToUpdate.responsibleName = txtboxnomeresponsavelBD.Text; 273. issueToUpdate.responsibleNumber = Convert.ToInt32(txtboxnumerore sponsavelBD.Text); 274. //modificar as chaves estrangeiras 275. issueToUpdate.fkidPriority = Convert.ToInt32(comboBoxPrioridade. SelectedValue); 276. issueToUpdate.fkidInput = Convert.ToInt32(comboBoxInput.Selected Value); 277. issueToUpdate.fkidDepartment = Convert.ToInt32(comboBoxDepartame nto.SelectedValue); 278. MessageBox.Show("Changes made", "Successfully", MessageBoxButton s.OK, MessageBoxIcon.Information); 279. context.SaveChanges(); 280. labelIssueID.Text = "0"; 281. advancedDataGridViewIssue.SelectionMode = DataGridViewSelectionM ode.RowHeaderSelect; 282. //Refresh datagrid 283. issueTableAdapter.Fill(gAMDataSet.Issue); 284. advancedDataGridViewIssue.Invalidate(); 285. advancedDataGridViewIssue.Refresh(); 286. checkBoxAcaoConcluida.Checked = false; 287. checkBoxAcaoCancelada.Checked = false; 288. ckacaocontinua.Checked = false; 289. txtpesquisarlinha.Text = ""; 290. Initialize(); 291. } 292. } 293. } 294. //data selection 295. private void advancedDataGridViewIssue_SelectionChanged_1(object sender, Eve ntArgs e) 296. { 297. DataGridViewRow selectedRow = null; 298. if (advancedDataGridViewIssue.SelectedRows.Count > 0) 299. { 300. selectedRow = advancedDataGridViewIssue.SelectedRows[0]; 301. } 302. 303. if (selectedRow == null) 304. return; 305. dateTimePickerPrevista.Enabled = false; 306. labelIssueID.Text = selectedRow.Cells["idIssueDataGridViewTextBoxColumn" ].Value.ToString(); 307. textBoxIssue.Text = selectedRow.Cells["descriçãoDataGridViewTextBoxColum n1"].Value.ToString(); 308. textBoxAcaoCorretiva.Text = selectedRow.Cells["açãoCorretivaDataGridView TextBoxColumn"].Value.ToString(); 309. checkBoxAcaoConcluida.Checked = Convert.ToBoolean(selectedRow.Cells["açã oConcluídaDataGridViewCheckBoxColumn"].Value.ToString()); 310. checkBoxAcaoCancelada.Checked = Convert.ToBoolean(selectedRow.Cells["açã oCanceladaDataGridViewCheckBoxColumn"].Value.ToString()); 311. ckacaocontinua.Checked = Convert.ToBoolean(selectedRow.Cells["açãoContín uaDataGridViewCheckBoxColumn"].Value.ToString());
A contribution for data processing and interoperability in Industry 4.0. 61 312. txtobs.Text = selectedRow.Cells["observaçãoDataGridViewTextBoxColumn"].V alue.ToString(); 313. dateTimePickerInicio.Text = selectedRow.Cells["dataInícioDataGridViewTex tBoxColumn"].Value.ToString(); 314. dateTimePickerPrevista.Text = selectedRow.Cells["dataPrevistaDataGridVie wTextBoxColumn"].Value.ToString(); 315. dateTimePickerEnd.Text = selectedRow.Cells["Data_Fecho"].Value.ToString( ); 316. txtboxnomeresponsavelBD.Text = selectedRow.Cells["nomeResponsavelDataGri dViewTextBoxColumn1"].Value.ToString(); 317. txtboxnumeroresponsavelBD.Text = selectedRow.Cells["numeroResponsavelDat aGridViewTextBoxColumn1"].Value.ToString(); 318. comboBoxInput.Text = selectedRow.Cells["inputDataGridViewTextBoxColumn1" ].Value.ToString(); 319. txtlocal.Text = selectedRow.Cells["localDataGridViewTextBoxColumn"].Valu e.ToString(); 320. comboBoxDepartamento.Text = selectedRow.Cells["departamentoAfetadoDataGr idViewTextBoxColumn"].Value.ToString(); 321. comboBoxPrioridade.Text = selectedRow.Cells["prioridadeDataGridViewTextB oxColumn1"].Value.ToString(); 322. } 323. 324. 325. //atualizar as situacoes de cada issue 326. private void RefreshStatus() 327. { 328. for (int x = 0; x < advancedDataGridViewIssue.Rows.Count; x++) 329. 330. if (advancedDataGridViewIssue.Rows[x].Cells["idIssueDataGridViewText BoxColumn"].Value != null && !string.IsNullOrEmpty(Convert.ToString(this.advancedDat aGridViewIssue.Rows[x].Cells["açãoCanceladaDataGridViewCheckBoxColumn"].Value)) && ! string.IsNullOrEmpty(Convert.ToString(this.advancedDataGridViewIssue.Rows[x].Cells[" açãoConcluídaDataGridViewCheckBoxColumn"].Value))) 331. { 332. if (this.advancedDataGridViewIssue.Rows[x].Cells["idIssueDataGri dViewTextBoxColumn"].Value == null) 333. { 334. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDataGr idViewTextBoxColumn"].Value = null; 335. } 336. { 337. if (Convert.ToBoolean(this.advancedDataGridViewIssue.Rows[x] .Cells["açãoCanceladaDataGridViewCheckBoxColumn"].Value) == true) 338. { 339. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Style.BackColor = Color.Gray; 340. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Value = "Cancelled"; 341. //insere a situacao do issue na tabela "issue" da base d e dados 342. int ID = Convert.ToInt32(this.advancedDataGridViewIssue. Rows[x].Cells["idIssueDataGridViewTextBoxColumn"].Value); 343. var issue = context.issues.Where(s => s.issueId == ID).F irstOrDefault(); 344. issue.situation = "Cancelled"; 345. context.SaveChanges(); 346. } 347. else if (Convert.ToBoolean(this.advancedDataGridViewIssue.Ro ws[x].Cells["açãoConcluídaDataGridViewCheckBoxColumn"].Value) == true) 348. { 349. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Style.BackColor = Color.Green; 350. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Value = "Concluded"; 351. //insere a situacao do issue na tabela "issue" da base d e dados
A contribution for data processing and interoperability in Industry 4.0. 62 352. int ID = Convert.ToInt32(this.advancedDataGridViewIssue. Rows[x].Cells["idIssueDataGridViewTextBoxColumn"].Value); 353. var issue = context.issues.Where(s => s.issueId == ID).F irstOrDefault(); 354. issue.situation = "Concluded"; 355. context.SaveChanges(); 356. } 357. else if (Convert.ToBoolean(this.advancedDataGridViewIssue.Ro ws[x].Cells["açãoContínuaDataGridViewCheckBoxColumn"].Value) == true) 358. { 359. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Style.BackColor = Color.Orange; 360. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Value = "Ongoing"; 361. //insere a situacao do issue na tabela "issue" da base d e dados 362. int ID = Convert.ToInt32(this.advancedDataGridViewIssue. Rows[x].Cells["idIssueDataGridViewTextBoxColumn"].Value); 363. var issue = context.issues.Where(s => s.issueId == ID).F irstOrDefault(); 364. issue.situation = "Ongoing"; 365. context.SaveChanges(); 366. } 367. else if (Convert.ToDateTime(this.advancedDataGridViewIssue.R ows[x].Cells["Data_Fecho"].Value) >= Convert.ToDateTime(dateTimePickeratual.Text) && Convert.ToBoolean(this.advancedDataGridViewIssue.Rows[x].Cells["açãoCanceladaDataGr idViewCheckBoxColumn"].Value) == false && Convert.ToBoolean(this.advancedDataGridVie wIssue.Rows[x].Cells["açãoConcluídaDataGridViewCheckBoxColumn"].Value) == false) 368. { 369. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Style.BackColor = Color.Orange; 370. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Value = "Processing"; 371. //insere a situacao do issue na tabela "issue" da base d e dados 372. int ID = Convert.ToInt32(this.advancedDataGridViewIssue. Rows[x].Cells["idIssueDataGridViewTextBoxColumn"].Value); 373. var issue = context.issues.Where(s => s.issueId == ID).F irstOrDefault(); 374. issue.situation = "Processing"; 375. context.SaveChanges(); 376. } 377. else if (Convert.ToDateTime(this.advancedDataGridViewIssue.R ows[x].Cells["Data_Fecho"].Value) < Convert.ToDateTime(dateTimePickeratual.Text) && Convert.ToBoolean(this.advancedDataGridViewIssue.Rows[x].Cells["açãoCanceladaDataGri dViewCheckBoxColumn"].Value) == false && Convert.ToBoolean(this.advancedDataGridView Issue.Rows[x].Cells["açãoConcluídaDataGridViewCheckBoxColumn"].Value) == false) 378. { 379. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Style.BackColor = Color.Red; 380. this.advancedDataGridViewIssue.Rows[x].Cells["situaçãoDa taGridViewTextBoxColumn"].Value = "Delay"; 381. //insere a situacao do issue na tabela "issue" da base d e dados 382. int ID = Convert.ToInt32(this.advancedDataGridViewIssue. Rows[x].Cells["idIssueDataGridViewTextBoxColumn"].Value); 383. var issue = context.issues.Where(s => s.issueId == ID).F irstOrDefault(); 384. issue.situation = "Delay"; 385. context.SaveChanges(); 386. } 387. } 388. } 389. } 390. //ordenar o datagrid