initialize

This commit is contained in:
Pruefer
2025-06-06 09:15:13 +02:00
commit fa7c2730f1
5817 changed files with 1339670 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>data-interface-line-dashboard</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>data-interface-line-dashboard-interface</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="data-interface-line-dashboard-interface">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
</wb-module>
</project-modules>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.8"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>

View File

@@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-interface</artifactId>
<packaging>jar</packaging>
<name>data-interface-line-dashboard-interface</name>
<version>${mes.interface.version}</version>
<parent>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard</artifactId>
<version>${mes.interface.version}</version>
</parent>
<dependencies>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-plugin</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-core</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-config-bundle</artifactId>
</dependency>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>api-structs</artifactId>
</dependency>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>api-common</artifactId>
</dependency>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-common</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-basic</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-xmlapi</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-testcenter</artifactId>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>jgoodies-looks</artifactId>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>jgoodies-forms</artifactId>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-client</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>

Binary file not shown.

View File

@@ -0,0 +1,22 @@
package com.itac.mes.datainterface.data;
import static com.itac.util.constants.imsapi.ImsApiKey.FAILURE_IMAGE_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.FAILURE_TYPE_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_FAILURE;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_REPAIR;
import com.itac.mes.datainterface.annotations.ImsApiMapping;
import com.itac.util.constants.imsapi.ImsApiKey;
public class DIFailureData {
@ImsApiMapping(key = ImsApiKey.FAILURE_CAUSE_CODE)
public String failureCauseCode;
@ImsApiMapping(key = FAILURE_IMAGE_CODE)
public String failureImageCode;
@ImsApiMapping(key = FAILURE_TYPE_CODE)
public String failureTypeCode;
@ImsApiMapping(key = QUANTITY_FAILURE)
public int quantityFailure;
@ImsApiMapping(key = QUANTITY_REPAIR)
public int quantityRepair;
}

View File

@@ -0,0 +1,107 @@
/*
* Copyright (c) 2016 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.data;
import com.itac.mes.datainterface.annotations.AInstantiationType;
import com.itac.mes.datainterface.annotations.InstantiationType;
import com.itac.mes.datainterface.factories.AConfigurableHandler;
import com.itac.mes.datainterface.parser.LineDashboardParser;
import com.itac.mes.datainterface.parser.LineDashboardParserException;
import com.itac.mes.datainterface.process.IProcessor;
import com.itac.mes.datainterface.process.ProcessorException;
import com.itac.mes.linedashboard.ResponseDetail;
import com.itac.mes.linedashboard.data.ErrorDetail;
import com.itac.mes.linedashboard.data.MachineStatusRequest;
import com.itac.mes.linedashboard.data.MesResponse;
import com.itac.mes.linedashboard.data.ProductionTimeRequest;
import com.itac.mes.linedashboard.data.QuantityAndFailureUploadRequest;
import com.itac.mes.linedashboard.data.StationResultRequest;
@AInstantiationType(type = InstantiationType.PARSER, name = "lineDashboard")
public class LineDashboardApplication extends AConfigurableHandler {
private LineDashboardParser parser;
private IProcessor processor;
public void setParser(LineDashboardParser parser) {
this.parser = parser;
}
public void setProcessor(IProcessor processor) {
this.processor = processor;
}
private ErrorDetail getErrorDetail(String detail, int code) {
ErrorDetail errorDetail = new ErrorDetail();
errorDetail.setCode(code);
errorDetail.setDetail(detail);
return errorDetail;
}
private void setResult(MesResponse mesResponse, ResponseDetail responseDetail) {
if (responseDetail == ResponseDetail.OK) {
mesResponse.setTotalResult(0);
return;
}
mesResponse.setTotalResult(1);
mesResponse.getErrorDetails().add(getErrorDetail(responseDetail.getText(), responseDetail.getCode()));
}
private void setResult(MesResponse mesResponse, ProcessResult processResult) {
mesResponse.setTotalResult(processResult.getDetailCode());
}
public void mesMachineState(MachineStatusRequest machineStatus) throws ProcessorException, LineDashboardParserException {
assert machineStatus != null;
LineDashboardDataUnit LineDashboardDataUnit = new LineDashboardDataUnit();
parser.parse(machineStatus, LineDashboardDataUnit);
// nur logging, egal ob die Daten gesendet werden konnten oder nicht
if (LineDashboardDataUnit.uploadUnitList.size() > 0) {
processor.send(LineDashboardDataUnit);
}
}
public void mesSetProductionData(ProductionTimeRequest productionTimeRequest, MesResponse mesResponse)
throws ProcessorException, LineDashboardParserException {
assert productionTimeRequest != null;
LineDashboardDataUnit LineDashboardDataUnit = new LineDashboardDataUnit();
parser.parse(productionTimeRequest, LineDashboardDataUnit);
// nur logging, egal ob die Daten gesendet werden konnten oder nicht
IProcessor.Code sendcode = processor.send(LineDashboardDataUnit);
if (sendcode == IProcessor.Code.NOT_SENT) {
// Wenn die Daten gesendet werden konnten
setResult(mesResponse, ResponseDetail.NOT_SENT);
}
}
public void mesSetStationResult(StationResultRequest stationResultRequest, MesResponse mesResponse)
throws ProcessorException, LineDashboardParserException {
assert stationResultRequest != null;
LineDashboardDataUnit LineDashboardDataUnit = new LineDashboardDataUnit();
parser.parse(stationResultRequest, LineDashboardDataUnit);
// nur logging, egal ob die Daten gesendet werden konnten oder nicht
IProcessor.Code sendcode = processor.send(LineDashboardDataUnit);
if (sendcode == IProcessor.Code.NOT_SENT) {
// Wenn die Daten gesendet werden konnten
setResult(mesResponse, ResponseDetail.NOT_SENT);
}
}
public void mesSetQuantityAndFailureData(QuantityAndFailureUploadRequest quantityAndFailureUploadRequest, MesResponse mesResponse)
throws ProcessorException, LineDashboardParserException {
assert quantityAndFailureUploadRequest != null;
LineDashboardDataUnit LineDashboardDataUnit = new LineDashboardDataUnit();
parser.parse(quantityAndFailureUploadRequest, LineDashboardDataUnit);
// nur logging, egal ob die Daten gesendet werden konnten oder nicht
IProcessor.Code sendcode = processor.send(LineDashboardDataUnit);
if (sendcode == IProcessor.Code.NOT_SENT) {
// Wenn die Daten gesendet werden konnten
setResult(mesResponse, ResponseDetail.NOT_SENT);
}
}
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.data;
import java.util.ArrayList;
/**
* @author frankp created 2010
*/
public class LineDashboardDataUnit extends BasicDataUnit {
// detailiierter Ergebnistext
public StringBuffer resultText = new StringBuffer();
/**
*
*/
public LineDashboardDataUnit() {
super();
uploadUnitList = new ArrayList<BasicUploadUnit>();
processResultList = new ArrayList<ProcessResult>();
}
}

View File

@@ -0,0 +1,341 @@
package com.itac.mes.datainterface.data;
import static com.itac.util.constants.imsapi.ImsApiKey.ACTION_AFTER_ERROR;
import static com.itac.util.constants.imsapi.ImsApiKey.BOOK_DATE;
import static com.itac.util.constants.imsapi.ImsApiKey.DATE_FROM;
import static com.itac.util.constants.imsapi.ImsApiKey.DATE_TO;
import static com.itac.util.constants.imsapi.ImsApiKey.ERROR_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.FAILURE_CAUSE_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.FAILURE_IMAGE_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.FAILURE_TYPE_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.FUNC_MODE;
import static com.itac.util.constants.imsapi.ImsApiKey.PROCESS_LAYER;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_FAIL;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_FAILURE;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_FIRST_FAIL;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_FIRST_PASS;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_FIRST_SCRAP;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_PASS;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_REPAIR;
import static com.itac.util.constants.imsapi.ImsApiKey.QUANTITY_SCRAP;
import static com.itac.util.constants.imsapi.ImsApiKey.WORKORDER_NUMBER;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Hashtable;
import java.util.List;
import com.itac.mes.client.ImsApiTools;
import com.itac.mes.datainterface.ImsApiMapTool;
import com.itac.mes.datainterface.parser.LineDashboardParser;
import com.itac.mes.imsapi.domain.container.KeyValue;
import com.itac.mes.linedashboard.data.FailureData;
import com.itac.util.constants.imsapi.ImsApiKey;
import com.itac.util.logging.LogHandler;
import com.itac.util.logging.LogLevel;
public class UploadPmQuantityUnit extends BasicUploadUnit {
private String stationNumber;
private Date bookDate;
private int processLayer;
private int quantityPass;
private int quantityFail;
private int quantityScrap;
private int quantityFirstPass;
private int quantityFirstFail;
private int quantityFirstScrap;
private String workorderNumber;
private Hashtable<String, DIFailureData> failureDataResultMap = new Hashtable<String, DIFailureData>();
/** for pmUploadQuantityAndFailureData */
private ImsApiKey[] failureDataUploadKeys = new ImsApiKey[] { ERROR_CODE, FAILURE_CAUSE_CODE, FAILURE_IMAGE_CODE,
FAILURE_TYPE_CODE, QUANTITY_FAILURE, QUANTITY_REPAIR };
private String[] sFailureDataUploadKeys = ImsApiTools.getKeys(failureDataUploadKeys);
private List<FailureData> failureDataList;
/** for method getPm... */
private ImsApiKey[] failureDataResultKeys = new ImsApiKey[] { FAILURE_CAUSE_CODE, FAILURE_IMAGE_CODE, FAILURE_TYPE_CODE,
QUANTITY_FAILURE, QUANTITY_REPAIR };
private String[] sFailureDataResultKeys = ImsApiTools.getKeys(failureDataResultKeys);
/** default 12 Monate */
private int durationFailureData = 12;
/*
bookingFailureData.length=9
bookingFailureData[0].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[0].key=BOOK_DATE
bookingFailureData[0].value=-1
bookingFailureData[1].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[1].key=PROCESS_LAYER
bookingFailureData[1].value=0
bookingFailureData[2].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[2].key=QUANTITY_FAIL
bookingFailureData[2].value=1
bookingFailureData[3].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[3].key=QUANTITY_FIRST_FAIL
bookingFailureData[3].value=88
bookingFailureData[4].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[4].key=QUANTITY_FIRST_PASS
bookingFailureData[4].value=0
bookingFailureData[5].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[5].key=QUANTITY_FIRST_SCRAP
bookingFailureData[5].value=0
bookingFailureData[6].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[6].key=QUANTITY_PASS
bookingFailureData[6].value=0
bookingFailureData[7].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[7].key=QUANTITY_SCRAP
bookingFailureData[7].value=0
bookingFailureData[8].class=com.itac.mes.imsapi.domain.container.KeyValue
bookingFailureData[8].key=WORKORDER_NUMBER
bookingFailureData[8].value=WOFUJI05
failureDataUploadKeys.length=6
failureDataUploadKeys[0]=ERROR_CODE
failureDataUploadKeys[1]=FAILURE_CAUSE_CODE
failureDataUploadKeys[2]=FAILURE_IMAGE_CODE
failureDataUploadKeys[3]=FAILURE_TYPE_CODE
failureDataUploadKeys[4]=QUANTITY_FAILURE
failureDataUploadKeys[5]=QUANTITY_REPAIR
failureDataUploadValues.length=6
failureDataUploadValues[0]=0
failureDataUploadValues[1]=
failureDataUploadValues[2]=
failureDataUploadValues[3]=
failureDataUploadValues[4]=0
failureDataUploadValues[5]=0
Finished in: 58 ms
------------------------------------------------------------------
pmGetFailureData()
Started: Tue Jun 18 09:48:37 CEST 2013
Input values:
sessionContext.class=com.itac.mes.imsapi.domain.container.IMSApiSessionContextStruct
sessionContext.sessionId=161
sessionContext.persId=1
sessionContext.locale=de_de
stationNumber=01020010
failureDataFilters.length=5
failureDataFilters[0].class=com.itac.mes.imsapi.domain.container.KeyValue
failureDataFilters[0].key=DATE_FROM
failureDataFilters[0].value=-1
failureDataFilters[1].class=com.itac.mes.imsapi.domain.container.KeyValue
failureDataFilters[1].key=DATE_TO
failureDataFilters[1].value=1371536801000
failureDataFilters[2].class=com.itac.mes.imsapi.domain.container.KeyValue
failureDataFilters[2].key=FUNC_MODE
failureDataFilters[2].value=0
failureDataFilters[3].class=com.itac.mes.imsapi.domain.container.KeyValue
failureDataFilters[3].key=PROCESS_LAYER
failureDataFilters[3].value=0
failureDataFilters[4].class=com.itac.mes.imsapi.domain.container.KeyValue
failureDataFilters[4].key=WORKORDER_NUMBER
failureDataFilters[4].value=WOFUJI05
failureDataResultKeys.length=4
failureDataResultKeys[0]=FAILURE_CAUSE_CODE
failureDataResultKeys[1]=FAILURE_IMAGE_DESC
failureDataResultKeys[2]=FAILURE_TYPE_CODE
failureDataResultKeys[3]=FAILURE_TYPE_DESC
Finished in: 109 ms
------------------------------------------------------------------
Result_pmGetFailureData
.return_value=0 ''
.failureDataResultValues[] empty
------------------------------------------------------------------
*/
/**
* @return an empty String when the station Number was not set before.
*/
public String getStationNumber() {
if (stationNumber == null) {
return "";
}
return stationNumber;
}
public void setStationNumber(String stationNumber) {
this.stationNumber = stationNumber;
}
public void setBookDate(Date bookDate) {
this.bookDate = bookDate;
}
public void setProcessLayer(int processLayer) {
this.processLayer = processLayer;
}
public void setQuantityPass(int quantityPass) {
this.quantityPass = quantityPass;
}
public void setQuantityFail(int quantityFail) {
this.quantityFail = quantityFail;
}
public void setQuantityScrap(int quantityScrap) {
this.quantityScrap = quantityScrap;
}
public void setQuantityFirstPass(int quantityFirstPass) {
this.quantityFirstPass = quantityFirstPass;
}
public void setQuantityFirstFail(int quantityFirstFail) {
this.quantityFirstFail = quantityFirstFail;
}
public void setQuantityFirstScrap(int quantityFirstScrap) {
this.quantityFirstScrap = quantityFirstScrap;
}
public void setWorkorderNumber(String workorderNumber) {
this.workorderNumber = workorderNumber;
}
/**
* for method pmUploadQuantityAndFailureData
*
* @return
*/
public KeyValue[] getBookingFailureData() {
return new KeyValue[] { new KeyValue(BOOK_DATE.name(), "" + getBookDate().getTime()),
new KeyValue(PROCESS_LAYER.name(), "" + processLayer), //
new KeyValue(QUANTITY_PASS.name(), "" + quantityPass), //
new KeyValue(QUANTITY_FAIL.name(), "" + quantityFail), //
new KeyValue(QUANTITY_SCRAP.name(), "" + quantityScrap), //
new KeyValue(QUANTITY_FIRST_FAIL.name(), "" + quantityFirstFail), //
new KeyValue(QUANTITY_FIRST_PASS.name(), "" + quantityFirstPass), //
new KeyValue(QUANTITY_FIRST_SCRAP.name(), "" + quantityFirstScrap), //
new KeyValue(WORKORDER_NUMBER.name(), workorderNumber) };
}
private Date getBookDate() {
if (bookDate == null) {
return new Date();
}
return bookDate;
}
public String[] getUploadResultKeys() {
return ImsApiTools.getKeys(ACTION_AFTER_ERROR);
}
/**
* Keys zur Sammelkarte
*
* @return
*/
public String[] getFailureDataUploadKeys() {
return sFailureDataUploadKeys;
}
public void setFailureData(List<FailureData> failureDataList) {
this.failureDataList = failureDataList;
}
/**
* Alle in der Liste {@linkplain #failureDataList} enthaltenen Fehlerdaten als KeyValueList zurückliefern
*
* @return
*/
public String[] getFailureDataUploadValues() {
List<String> failureDataUploadValuesList = new ArrayList<String>();
// alle Fehler in die Stringliste mappen
if (failureDataList != null && failureDataList.size() > 0) {
for (FailureData failureData : failureDataList) {
String sKey = failureData.getFailureTypeCode() + "#" + failureData.getFailureCauseCode() + "#"
+ failureData.getFailureImageCode();
DIFailureData savedFailure = failureDataResultMap.get(sKey);
if (savedFailure == null) {
savedFailure = new DIFailureData();
}
for (ImsApiKey key : failureDataUploadKeys) {
switch (key) {
case ERROR_CODE:
failureDataUploadValuesList.add("0");
break;
case FAILURE_CAUSE_CODE:
failureDataUploadValuesList.add(failureData.getFailureCauseCode());
break;
case FAILURE_IMAGE_CODE:
failureDataUploadValuesList.add(failureData.getFailureImageCode());
break;
case FAILURE_TYPE_CODE:
failureDataUploadValuesList.add(failureData.getFailureTypeCode());
break;
case QUANTITY_FAILURE:
failureDataUploadValuesList.add("" + failureData.getQuantityFailure());
break;
case QUANTITY_REPAIR:
failureDataUploadValuesList.add("" + failureData.getQuantityRepair());
break;
default:
break;
}
}
}
}
String[] result = new String[failureDataUploadValuesList.size()];
failureDataUploadValuesList.toArray(result);
return result;
}
/** for method getPm */
public KeyValue[] getFailureDataFilters() {
GregorianCalendar gc = new GregorianCalendar();
gc.setTimeInMillis(System.currentTimeMillis());
gc.add(Calendar.MONTH, -1 * durationFailureData);
return new KeyValue[] { new KeyValue(DATE_FROM.name(), "" + gc.getTimeInMillis()), //
new KeyValue(DATE_TO.name(), "" + System.currentTimeMillis()), //
new KeyValue(FUNC_MODE.name(), "0"), //
new KeyValue(PROCESS_LAYER.name(), "" + processLayer), //
new KeyValue(WORKORDER_NUMBER.name(), workorderNumber) };
}
/** for method getPm */
public String[] getFailureDataResultKeys() {
return sFailureDataResultKeys;
}
// fuer diese Station aus den getWerten ermittelte absolute Werte
public void setFailureDataResultValues(String[] failureDataResultValues) {
// KEYS = failureDataResultKeys
// analysieren, pro
if (failureDataResultValues == null) {
return;
}
try {
List<DIFailureData> failureDataResultList = new ImsApiMapTool<DIFailureData>().getList(DIFailureData.class,
failureDataResultKeys, failureDataResultValues);
if (failureDataResultList != null) {
// diese Werte in eine Map werfen
for (DIFailureData item : failureDataResultList) {
String key = item.failureTypeCode + "#" + item.failureCauseCode + "#" + item.failureImageCode;
failureDataResultMap.put(key, item);
}
}
} catch (Exception e) {
LogHandler.log(getClass().getSimpleName(), LogLevel.ERROR, "mapping ImsApi values to StringArray failed", e);
}
}
/** {@linkplain LineDashboardParser#DURATION_FAILURE_DATA} */
public void setDurationFailureData(int durationFailureData) {
this.durationFailureData = durationFailureData;
}
/** {@linkplain LineDashboardParser#DURATION_FAILURE_DATA} */
public int getDurationFailureData() {
return durationFailureData;
}
}

View File

@@ -0,0 +1,96 @@
package com.itac.mes.datainterface.data;
public class UploadProductionDataUnit extends BasicUploadUnit {
private String stationNumber;
/** do not use those field */
private String serialNumber = "-1";
private String serialNumberPos = "-1";
private String workOrderNumber;
private int processLayer;
private double setupCycleTime;
private double prodCycleTime;
private String processType = "M";// 'M', 'P'
private int cycleTimeForMultipleBoard;// 0: einzelnutzwen, 1, mehrfachnutzen
/**
* @return an empty String when the station Number was not set before.
*/
public String getStationNumber() {
if (stationNumber == null) {
return "";
}
return stationNumber;
}
public void setStationNumber(String stationNumber) {
this.stationNumber = stationNumber;
}
public String getWorkOrderNumber() {
if (workOrderNumber == null) {
return "";
}
return workOrderNumber;
}
public void setWorkOrderNumber(String workOrderNumber) {
this.workOrderNumber = workOrderNumber;
}
public int getProcessLayer() {
return processLayer;
}
public void setProcessLayer(int processLayer) {
this.processLayer = processLayer;
}
public double getSetupCycleTime() {
return setupCycleTime;
}
public void setSetupCycleTime(double setupCycleTime) {
this.setupCycleTime = setupCycleTime;
}
public double getProdCycleTime() {
return prodCycleTime;
}
public void setProdCycleTime(double prodCycleTime) {
this.prodCycleTime = prodCycleTime;
}
public int getCycleTimeForMultipleBoard() {
return cycleTimeForMultipleBoard;
}
public void setCycleTimeForMultipleBoard(int cycleTimeForMultipleBoard) {
this.cycleTimeForMultipleBoard = cycleTimeForMultipleBoard;
}
public String getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
public String getSerialNumberPos() {
return serialNumberPos;
}
public void setSerialNumberPos(String serialNumberPos) {
this.serialNumberPos = serialNumberPos;
}
public String getProcessType() {
return processType;
}
public void setProcessType(String processType) {
this.processType = processType;
}
}

View File

@@ -0,0 +1,176 @@
package com.itac.mes.datainterface.data;
import static com.itac.util.constants.imsapi.ImsApiKey.ERROR_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.LOWER_LIMIT;
import static com.itac.util.constants.imsapi.ImsApiKey.MEASURE_FAIL_CODE;
import static com.itac.util.constants.imsapi.ImsApiKey.MEASURE_NAME;
import static com.itac.util.constants.imsapi.ImsApiKey.MEASURE_VALUE;
import static com.itac.util.constants.imsapi.ImsApiKey.NOMINAL;
import static com.itac.util.constants.imsapi.ImsApiKey.TOLERANCE;
import static com.itac.util.constants.imsapi.ImsApiKey.UNIT;
import static com.itac.util.constants.imsapi.ImsApiKey.UPPER_LIMIT;
import java.util.ArrayList;
import java.util.List;
import com.itac.mes.client.ImsApiTools;
import com.itac.mes.linedashboard.data.StationResult;
import com.itac.util.constants.imsapi.ImsApiKey;
public class UploadStationResultUnit extends BasicUploadUnit {
private String stationNumber;
private String partNumber = "-1";
private int bomVersion = -1;
private String bomIndex = "-1";
private String bomVersionErp = "-1";
private String workOrderNumber = "";
private long bookDate = -1;
private int serialUnitTrace = 0;
// die Messdaten wie sie vom Client hochgeladen werden; diese müssen hier in die KeyValue Struktur gepresst werden.
private List<StationResult> stationResults;
private ImsApiKey[] stationResultUploadKeys = new ImsApiKey[] { ERROR_CODE, LOWER_LIMIT, MEASURE_FAIL_CODE, MEASURE_NAME,
MEASURE_VALUE, NOMINAL, TOLERANCE, UNIT, UPPER_LIMIT };
private String[] sStationResultUploadKeys = ImsApiTools.getKeys(stationResultUploadKeys);
/*
------------------------------------------------------------------
trUploadStationResult()
Started: Tue Jun 18 09:15:24 CEST 2013
Input values:
sessionContext.class=com.itac.mes.imsapi.domain.container.IMSApiSessionContextStruct
sessionContext.sessionId=161
sessionContext.persId=1
sessionContext.locale=de_de
stationNumber=01020010
partNumber=-1
bomVersion=-1
bomIndex=-1
bomVersionErp=-1
workOrderNumber=WOFUJI05
bookDate=-1
serialUnitTrace=0
stationResultUploadKeys.length=9
stationResultUploadKeys[0]=ERROR_CODE
stationResultUploadKeys[1]=LOWER_LIMIT
stationResultUploadKeys[2]=MEASURE_FAIL_CODE
stationResultUploadKeys[3]=MEASURE_NAME
stationResultUploadKeys[4]=MEASURE_VALUE
stationResultUploadKeys[5]=NOMINAL
stationResultUploadKeys[6]=TOLERANCE
stationResultUploadKeys[7]=UNIT
stationResultUploadKeys[8]=UPPER_LIMIT
stationResultUploadValues.length=9
stationResultUploadValues[0]=0
stationResultUploadValues[1]=
stationResultUploadValues[2]=0
stationResultUploadValues[3]=Rsed
stationResultUploadValues[4]=77
stationResultUploadValues[5]=75
stationResultUploadValues[6]=10
stationResultUploadValues[7]=mm
stationResultUploadValues[8]=
!Method not executed:
java.lang.reflect.InvocationTargetException
*/
/**
* @return an empty String when the station Number was not set before.
*/
public String getStationNumber() {
if (stationNumber == null) {
return "";
}
return stationNumber;
}
public String getPartNumber() {
return partNumber;
}
public int getBomVersion() {
return bomVersion;
}
public String getBomIndex() {
return bomIndex;
}
public String getBomVersionErp() {
return bomVersionErp;
}
public String getWorkOrderNumber() {
return workOrderNumber;
}
public long getBookDate() {
return bookDate;
}
public int getSerialUnitTrace() {
return 0;
}
public void setStation(String station) {
stationNumber = station;
}
public void setWorkorder(String workorderNumber) {
this.workOrderNumber = workorderNumber;
}
public void setStationResults(List<StationResult> list) {
this.stationResults = list;
}
public String[] getStationResultUploadKeys() {
return sStationResultUploadKeys;
}
public String[] getStationResultUploadValues() {
List<String> stationResultsValuesList = new ArrayList<String>();
// alle Fehler in die Stringliste mappen
if (stationResults != null && stationResults.size() > 0) {
for (StationResult stationResult : stationResults) {
for (ImsApiKey key : stationResultUploadKeys) {
switch (key) {
case ERROR_CODE:
stationResultsValuesList.add("0");
break;
case LOWER_LIMIT:
stationResultsValuesList.add(stationResult.getLowerLimit());
break;
case MEASURE_FAIL_CODE:
stationResultsValuesList.add(stationResult.getMeasureFailCode());
break;
case MEASURE_NAME:
stationResultsValuesList.add(stationResult.getMeasureName());
break;
case MEASURE_VALUE:
stationResultsValuesList.add(stationResult.getMeasureValue());
break;
case NOMINAL:
stationResultsValuesList.add(stationResult.getNominal());
break;
case TOLERANCE:
stationResultsValuesList.add(stationResult.getTolerance());
break;
case UNIT:
stationResultsValuesList.add(stationResult.getUnit());
break;
case UPPER_LIMIT:
stationResultsValuesList.add(stationResult.getUpperLimit());
break;
default:
break;
}
}
}
}
String[] result = new String[stationResultsValuesList.size()];
stationResultsValuesList.toArray(result);
return result;
}
}

View File

@@ -0,0 +1,499 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.datasource;
import static com.itac.mes.datainterface.data.smt.HTMLLogger.LOG_NAME;
import static com.itac.mes.datainterface.data.smt.MessageLogger.MSG_LOGGER;
import static com.itac.mes.linedashboard.ResponseDetail.MES_NOT_CONFIGURED_PROPERLY;
import static com.itac.mes.linedashboard.ResponseDetail.MES_NOT_INITIALIZED;
import static com.itac.mes.linedashboard.ResponseDetail.MES_SERVICE_NOT_REACHABLE;
import static com.itac.mes.linedashboard.ResponseDetail.REQUEST_IS_NULL;
import static com.itac.util.logging.LogLevel.DEBUG;
import static com.itac.util.logging.LogLevel.ERROR;
import static com.itac.util.logging.LogLevel.INFO;
import static com.itac.util.logging.LogLevel.TRACE;
import static com.itac.util.logging.LogLevel.WARN;
import java.io.StringWriter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;
import com.itac.mes.config.domain.Parameter;
import com.itac.mes.datainterface.ConfigurationException;
import com.itac.mes.datainterface.annotations.AAutoHandler;
import com.itac.mes.datainterface.annotations.ACondition;
import com.itac.mes.datainterface.annotations.AInit;
import com.itac.mes.datainterface.annotations.AInstantiationType;
import com.itac.mes.datainterface.annotations.AParamValue;
import com.itac.mes.datainterface.annotations.AParameter;
import com.itac.mes.datainterface.annotations.AParameterDefaultValue;
import com.itac.mes.datainterface.annotations.InstantiationType;
import com.itac.mes.datainterface.data.LineDashboardApplication;
import com.itac.mes.datainterface.data.RequestException;
import com.itac.mes.datainterface.data.xml.XmlSerializer;
import com.itac.mes.datainterface.messaging.Condition;
import com.itac.mes.datainterface.parser.IParser;
import com.itac.mes.datainterface.parser.LineDashboardParser;
import com.itac.mes.datainterface.parser.LineDashboardParserException;
import com.itac.mes.datainterface.process.IProcessor;
import com.itac.mes.datainterface.process.ProcessorException;
import com.itac.mes.datainterface.simulation.linedashboard.SocketAdapter;
import com.itac.mes.linedashboard.IMesServices;
import com.itac.mes.linedashboard.ResponseDetail;
import com.itac.mes.linedashboard.data.ErrorDetail;
import com.itac.mes.linedashboard.data.MachineStatusRequest;
import com.itac.mes.linedashboard.data.MesConfigurationResponse;
import com.itac.mes.linedashboard.data.MesRequest;
import com.itac.mes.linedashboard.data.MesResponse;
import com.itac.mes.linedashboard.data.MesStartRequest;
import com.itac.mes.linedashboard.data.ProductionTimeRequest;
import com.itac.mes.linedashboard.data.QuantityAndFailureUploadRequest;
import com.itac.mes.linedashboard.data.StationResultRequest;
import com.itac.util.logging.LogHandler;
/**
* @author frankp created 2011
*/
@AInstantiationType(name = "linedashboard", type = InstantiationType.DATASOURCE)
public class LineDashboardSource extends BasicDataSource implements IMesServices {
private static final String LOGGER = LineDashboardSource.class.getSimpleName();
private static final String DATASOURCE_LINE_DASHBOARD = "datasource.linedashboard";
/** Liste mit Namen der Verbindungen; diese werden instantiiert */
private static final String PORT = DATASOURCE_LINE_DASHBOARD + ".port";
private static final String AUTORUN = DATASOURCE_LINE_DASHBOARD + ".autorun";
@AParameter(name = DATASOURCE_LINE_DASHBOARD, description = "Line Dashboard Datasource",
visibility = "DataSource=com.itac.mes.datainterface.datasource.LineDashboardSource")
private Parameter paramSource;
@AParameter(name = PORT, parent = DATASOURCE_LINE_DASHBOARD, description = "interface port a plugin may connect to",
type = Integer.class)
private Parameter paramPort;
@AParameter(name = AUTORUN, parent = DATASOURCE_LINE_DASHBOARD, description = "should datasource start automatically",
type = Boolean.class)
private Parameter paramAutorun;
@AParameterDefaultValue(name = AUTORUN)
private boolean autorunDefault = true;
private boolean bInitialized;
private boolean datasourceRunning;
@ACondition
private static final Condition PLUGIN_CONNECTED = new Condition("PluginConnected");
@ACondition
private static final Condition PLUGIN_DISCONNECTED = new Condition("PluginDisconnected");
@ACondition
private static final Condition PARSE_ERROR_CONDITION = new Condition("ParseError");
private SocketAdapter socketAdapter;
@AParamValue(value = PORT)
private int iPort;
@AParameterDefaultValue(name = PORT)
private int portDefault = 33000;
private Marshaller marshaller;
@AAutoHandler(InstantiationType.APPLICATION)
private LineDashboardApplication lineDashboardApplication;
private boolean isPaused;
@AAutoHandler(InstantiationType.PARSER)
private LineDashboardParser parser;
@AAutoHandler(InstantiationType.PROCESSOR)
private IProcessor processor;
/**
* @param services
* @param configuration
* @param toolbox
* @param prefix
*/
public LineDashboardSource() {
super();
}
@AAutoHandler(InstantiationType.PARSER)
protected void setParser(IParser value) throws ConfigurationException {
if (parser == null || !(parser instanceof LineDashboardParser)) {
throw new ConfigurationException("Parser creation failed: Parser is not an instance of an LineDashboardParser");
}
parser = (LineDashboardParser) value;
}
@AParamValue(PORT)
public void setPort(Integer value) throws ConfigurationException {
iPort = value;
if ((iPort < 1024) || (iPort > 49150)) {
throw new ConfigurationException("value '" + iPort + "' parameter '" + PORT + "' out of valid range [1024,49150]");
}
}
@AParamValue(AUTORUN)
public void setAutorun(boolean value) {
super.setAutorun(value);
}
@AInit
protected void initialize() throws ConfigurationException {
try {
lineDashboardApplication.setParser(parser);
lineDashboardApplication.setProcessor(processor);
setDescription("Source=" + getName() + ", Parser=" + parser.getName() + ", Processor=" + processor.getName());
if (LogHandler.getLogLevel(MSG_LOGGER).compareTo(DEBUG) >= 0 && marshaller == null) {
// alle Klassen aus diesem Package...
Class<?>[] classes = new Class[] { MachineStatusRequest.class, ProductionTimeRequest.class, StationResultRequest.class,
QuantityAndFailureUploadRequest.class, MesConfigurationResponse.class, MesRequest.class, MesResponse.class };
JAXBContext jc;
try {
jc = JAXBContext.newInstance(classes);
marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
} catch (JAXBException e) {
LogHandler.log(MSG_LOGGER, ERROR, "no jaxb context or marshaller created");
}
} else {
// wenn das detailled logging ausgeschalten wurde auch den Marshaller killen; bei erneutem mesStart call wird
// ein
// neuer marshaller erzeugt
marshaller = null;
}
bInitialized = true;
} catch (Exception e) {
LogHandler.log(LOGGER, ERROR, "failed to initialize " + InstantiationType.DATASOURCE + " " + getName() + e.getMessage(), e);
writeMessage(ERROR, "failed to initialize " + InstantiationType.DATASOURCE + " " + getName() + e.getMessage());
throw new ConfigurationException("failed to initialize {0} {1}\n{2}", InstantiationType.DATASOURCE, getName(),
e.getMessage());
}
}
/*
* (non-Javadoc)
* @see com.itac.easyworks.datainterface.datasource.BasicDataSource#isRunning()
*/
@Override
public boolean isRunning() {
return this.datasourceRunning;
}
private void setDatasourceRunning(boolean run) {
if (this.datasourceRunning == run) {
return;
}
LogHandler.log(LOGGER, INFO, "set datasource running to '" + run + "'", new Object[0]);
this.datasourceRunning = run;
}
/*
* (non-Javadoc)
* @see com.itac.easyworks.datainterface.datasource.BasicDataSource#start()
*/
@Override
public void start() {
if (isRunning()) {
LogHandler.log(LOGGER, TRACE, "LineDashboard Datasource is already running", new Object[0]);
return;
}
LogHandler.log(LOGGER, TRACE, "starting LineDashboard Datasource", new Object[0]);
socketAdapter = new SocketAdapter(iPort, this);
socketAdapter.start();
LogHandler.log(LOGGER, INFO, "LineDashboard Datasource started", new Object[0]);
setDatasourceRunning(true);
}
protected void setStarted() {
eventHandler.raise(PLUGIN_CONNECTED);
writeMessage(INFO, "Connection from LineDashboard plugin established");
}
protected void setStopped() {
eventHandler.raise(PLUGIN_DISCONNECTED);
writeMessage(INFO, "Connection from LineDashboard plugin shutdown");
}
@Override
public void stop() {
if (!(isRunning())) {
return;
}
setDatasourceRunning(false);
socketAdapter.shutdown();
}
/**
* Beginn einer Pause. Diese Methode muss von den Datasourcen &uuml;berschrieben werden
*/
@Override
public void startPause() {
LogHandler.log(LOG_NAME, ERROR, MES_SERVICE_NOT_REACHABLE.getText());
isPaused = true;
}
/**
* Ende einer Pause. Diese Methode muss von den Datasourcen &uuml;berschrieben werden.
*/
@Override
public void endPause() {
isPaused = false;
}
/*
* (non-Javadoc)
* @see com.itac.easyworks.datainterface.datasource.BasicDataSource#unInitialize()
*/
@Override
public void unInitialize() {
stop();
}
private void checkPreconditions(MesResponse mesResponse, MesRequest mesRequest) throws RequestException {
logRequest(mesRequest);
if (mesRequest == null) {
setResponseDetail(mesResponse, mesRequest, REQUEST_IS_NULL);
throw new RequestException();
}
if (mesResponse != null) {
mesResponse.setRequestId(mesRequest.getRequestId());
}
if (getConfigurationResult() != OK) {
setResponseDetail(mesResponse, mesRequest, MES_NOT_CONFIGURED_PROPERLY);
throw new RequestException();
}
if (!bInitialized) {
setResponseDetail(mesResponse, mesRequest, MES_NOT_INITIALIZED);
throw new RequestException();
}
if (isPaused) {
setResponseDetail(mesResponse, mesRequest, MES_SERVICE_NOT_REACHABLE);
throw new RequestException();
}
setResponseDetail(mesResponse, mesRequest, ResponseDetail.OK);
}
private void setResponseDetail(MesResponse response, MesRequest request, ResponseDetail responseDetail) {
if (request != null)
response.setRequestId(Integer.valueOf(request.getRequestId()));
else {
response.setRequestId(Integer.valueOf(-1));
}
setResult(response, responseDetail);
}
private ErrorDetail getErrorDetail(String detail, int code) {
ErrorDetail errorDetail = new ErrorDetail();
errorDetail.setCode(code);
errorDetail.setDetail(detail);
return errorDetail;
}
private void setResult(MesResponse mesResponse, ResponseDetail responseDetail) {
if (responseDetail == ResponseDetail.OK) {
mesResponse.setTotalResult(0);
return;
}
mesResponse.setTotalResult(1);
mesResponse.getErrorDetails().add(getErrorDetail(responseDetail.getText(), responseDetail.getCode()));
}
private void logResponse(MesResponse mesResponse) {
if (mesResponse != null) {
LogHandler.log(LOGGER, DEBUG, "finish request " + mesResponse.getRequestId() + " with code " + mesResponse.getTotalResult());
if (LogHandler.getLogLevel(MSG_LOGGER).compareTo(DEBUG) >= 0 && marshaller != null) {
try {
@SuppressWarnings({ "rawtypes", "unchecked" })
JAXBElement<?> jexbelement = new JAXBElement(new QName(mesResponse.getClass().getSimpleName()), mesResponse.getClass(),
mesResponse);
StringWriter sWriter = new StringWriter();
marshaller.marshal(jexbelement, sWriter);
LogHandler.log(MSG_LOGGER, DEBUG, sWriter.toString());
} catch (Throwable e) {
LogHandler.log(MSG_LOGGER, WARN, "marshalling mesResponse failed, use xml printing instead");
XmlSerializer serializer = new XmlSerializer(true, true, true);
try {
LogHandler.log(MSG_LOGGER, DEBUG, serializer.serialize(mesResponse).toString());
} catch (Throwable e1) {
LogHandler.log(MSG_LOGGER, ERROR, "marshalling and xmlPrinting of mesResponse failed", e);
}
} finally {
}
}
} else {
LogHandler.log(LOGGER, DEBUG, "finish empty request");
}
}
private void logRequest(MesRequest mesRequest) {
if (mesRequest != null) {
String requestClassName = mesRequest.getClass().getSimpleName();
LogHandler.log(LOGGER, DEBUG, "start request " + mesRequest.getRequestId() + " (" + requestClassName + ")");
if (LogHandler.getLogLevel(MSG_LOGGER).compareTo(DEBUG) >= 0 && marshaller != null) {
try {
@SuppressWarnings({ "rawtypes", "unchecked" })
JAXBElement<?> jexbelement = new JAXBElement(new QName(requestClassName), mesRequest.getClass(), mesRequest);
StringWriter sWriter = new StringWriter();
sWriter.write("Request: " + requestClassName + "\n");
marshaller.marshal(jexbelement, sWriter);
LogHandler.log(MSG_LOGGER, DEBUG, sWriter.toString());
} catch (Throwable e) {
LogHandler.log(MSG_LOGGER, WARN, "marshalling mesRequest failed, use xml printing instead");
XmlSerializer serializer = new XmlSerializer(true, true, true);
try {
LogHandler.log(MSG_LOGGER, DEBUG, serializer.serialize(mesRequest).toString());
} catch (Throwable e1) {
LogHandler.log(MSG_LOGGER, ERROR, "marshalling and xmlPrinting of mesRequest failed", e);
}
}
}
} else {
LogHandler.log(LOGGER, WARN, "empty request ");
}
}
/**
* wenn die Applikation eine Exception wirft muss noch der entsprechende Code in die Response eingetragen werden
*
* @param mesResponse
* @param throwable
*/
private void handleThrowable(MesResponse mesResponse, Throwable throwable) {
// hier alle Exceptions verarbeiten
if (throwable instanceof RequestException) {
// der MesReconse- code wurde bereits im CheckPreconditions gesetzt, nichts weiter tun
} else if (throwable instanceof ProcessorException) {
LogHandler.log(LOGGER, ERROR, throwable.getMessage());
setResult(mesResponse, ResponseDetail.MES_NOT_CONNECTED);
} else if (throwable instanceof LineDashboardParserException) {
// parsing failed
LineDashboardParserException parseException = (LineDashboardParserException) throwable;
mesResponse.setTotalResult(1);
mesResponse.getErrorDetails().add(getErrorDetail(parseException.getMessage(), parseException.getResultCode()));
} else {
// der Fehler kann nicht weiter spezifiziert werden
setResult(mesResponse, ResponseDetail.PROCESSED_WITH_EXCEPTION);
}
}
@Override
public MesResponse mesMachineState(MachineStatusRequest machineStatus) {
MesResponse mesResponse = new MesResponse();
try {
checkPreconditions(mesResponse, machineStatus);
lineDashboardApplication.mesMachineState(machineStatus);
} catch (Throwable throwable) {
handleThrowable(mesResponse, throwable);
} finally {
logResponse(mesResponse);
}
return mesResponse;
}
@Override
public MesResponse mesStart(MesRequest startRequest) {
MesStartRequest mesStart = new MesStartRequest();
mesStart.setRequestId(startRequest.getRequestId());
mesStart.setEventDate(startRequest.getEventDate());
mesStart.getStartDetails().add("version=1.0");
return mesStart(mesStart);
}
@Override
public MesResponse mesStart(MesStartRequest startRequest) {
MesConfigurationResponse mesResponse = new MesConfigurationResponse();
try {
checkPreconditions(mesResponse, startRequest);
setStarted();
// braucht hier nicht implementiert werden, da diese Methode nur im plugin benutzt wird
} catch (Throwable throwable) {
handleThrowable(mesResponse, throwable);
} finally {
logResponse(mesResponse);
}
return mesResponse;
}
@Override
public MesResponse mesGetStatus(MesRequest request) {
MesResponse mesResponse = new MesResponse();
try {
checkPreconditions(mesResponse, request);
services.getAPIServices().getCalendarData();
// wenn dieser Aufruf fehlerfrei war, dann ist alles klar...
} catch (Throwable throwable) {
handleThrowable(mesResponse, throwable);
} finally {
logResponse(mesResponse);
}
return mesResponse;
}
@Override
public MesResponse mesStop(MesRequest mesRequest) {
MesResponse mesResponse = new MesResponse();
try {
checkPreconditions(mesResponse, mesRequest);
setStopped();
} catch (Throwable throwable) {
handleThrowable(mesResponse, throwable);
} finally {
logResponse(mesResponse);
}
return mesResponse;
}
@Override
public MesResponse mesSetProductionData(ProductionTimeRequest productionDataRequest) {
MesResponse mesResponse = new MesResponse();
try {
checkPreconditions(mesResponse, productionDataRequest);
lineDashboardApplication.mesSetProductionData(productionDataRequest, mesResponse);
} catch (Throwable throwable) {
handleThrowable(mesResponse, throwable);
} finally {
logResponse(mesResponse);
}
return mesResponse;
}
@Override
public MesResponse mesSetStationResult(StationResultRequest stationResultRequest) {
MesResponse mesResponse = new MesResponse();
try {
checkPreconditions(mesResponse, stationResultRequest);
lineDashboardApplication.mesSetStationResult(stationResultRequest, mesResponse);
} catch (Throwable throwable) {
handleThrowable(mesResponse, throwable);
} finally {
logResponse(mesResponse);
}
return mesResponse;
}
@Override
public MesResponse mesSetQuantityAndFailureData(QuantityAndFailureUploadRequest quantityAndFailureUploadRequest) {
MesResponse mesResponse = new MesResponse();
try {
checkPreconditions(mesResponse, quantityAndFailureUploadRequest);
lineDashboardApplication.mesSetQuantityAndFailureData(quantityAndFailureUploadRequest, mesResponse);
} catch (Throwable throwable) {
handleThrowable(mesResponse, throwable);
} finally {
logResponse(mesResponse);
}
return mesResponse;
}
}

View File

@@ -0,0 +1,418 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.parser;
import static com.itac.mes.datainterface.ParameterUpdateTool.DEFAULT_DIM_PATH;
import static com.itac.mes.linedashboard.LineDashboardFields.EVENT_DATE;
import static com.itac.mes.linedashboard.LineDashboardFields.LANE;
import static com.itac.mes.linedashboard.LineDashboardFields.LINE_NAME;
import static com.itac.mes.linedashboard.LineDashboardFields.MACHINE;
import static com.itac.mes.linedashboard.LineDashboardFields.MACHINE_NAME;
import static com.itac.mes.linedashboard.LineDashboardFields.MODULE_NAME;
import static com.itac.mes.linedashboard.LineDashboardFields.PROCESS_TYPE;
import static com.itac.mes.linedashboard.LineDashboardFields.STATUS;
import static com.itac.mes.linedashboard.LineDashboardFields.WORKORDER;
import static com.itac.util.logging.LogLevel.DEBUG;
import static com.itac.util.logging.LogLevel.ERROR;
import static com.itac.util.logging.LogLevel.INFO;
import static com.itac.util.logging.LogLevel.WARN;
import java.text.MessageFormat;
import java.util.Date;
import java.util.List;
import com.itac.mes.client.Protocol;
import com.itac.mes.config.domain.Parameter;
import com.itac.mes.datainterface.annotations.AAutoHandler;
import com.itac.mes.datainterface.annotations.AInstantiationType;
import com.itac.mes.datainterface.annotations.AParamValue;
import com.itac.mes.datainterface.annotations.AParameter;
import com.itac.mes.datainterface.annotations.AParameterDefaultValue;
import com.itac.mes.datainterface.annotations.InstantiationType;
import com.itac.mes.datainterface.data.BasicUploadUnit;
import com.itac.mes.datainterface.data.LineDashboardDataUnit;
import com.itac.mes.datainterface.data.Station;
import com.itac.mes.datainterface.data.Toolbox;
import com.itac.mes.datainterface.data.UploadPmQuantityUnit;
import com.itac.mes.datainterface.data.UploadProductionDataUnit;
import com.itac.mes.datainterface.data.UploadSmtMachineDataUnit;
import com.itac.mes.datainterface.data.UploadStationResultUnit;
import com.itac.mes.datainterface.data.smt.PmMachine;
import com.itac.mes.datainterface.data.smt.SmtConfiguration;
import com.itac.mes.datainterface.data.smt.TrMachine;
import com.itac.mes.datainterface.messaging.EventSourceInfo;
import com.itac.mes.linedashboard.data.Machine;
import com.itac.mes.linedashboard.data.MachineStatusRequest;
import com.itac.mes.linedashboard.data.ProductionTimeRequest;
import com.itac.mes.linedashboard.data.QuantityAndFailureUploadRequest;
import com.itac.mes.linedashboard.data.StationResultRequest;
import com.itac.util.date.DateConvert;
import com.itac.util.logging.LogHandler;
/**
* @author frankp created 2011
*/
@AInstantiationType(name = "linedashboard", type = InstantiationType.PARSER)
public class LineDashboardParser extends IParser {
private static final String MACHINE_STATUS_REQUEST = "machineStatusRequest";
private static final String MACHINE_MESSAGE_REQUEST = "machineMessageRequest";
private static final String PRODUCTION_DATA_REQUEST = "productionDataRequest";
private static final String STATION_RESULT_REQUEST = "stationResultRequest";
private static final String QUANTITY_FAILURE_REQUEST = "quantityFailureRequest";
private static final String CREATE_UPLOAD_FAILED = "failed to create uploadUnit for {0}: {1}";
private static final String NO_TR_MACHINE_FOUND = "no TrMachine found for line {0}, machineName {1}, module {2} and lane {3}";
private static final String NO_PM_MACHINE_FOUND = "no PmMachine found for line {0}, machineName {1}, module {2} and lane {3}";
private static final String MISSING_FIELD = "missing field {0} in {1}";
private static final String NO_MACHINE_STATUS_PROCESSING = "do no process machineStatus (stationConditions) for station {0},"
+ " switched off by configuration";
private static final String NO_CLIENT_MACHINE = "no client machine found for machineName:{0}\n";
private static final String UNABLE_TO_MAP_VALUE_INTO_STATE = "unable to map value {0} into a valid state in {1}";
private static final String PARSER_LINE_DASHBOARD = "parser.lineDashboard";
/**
* this parameter defines for how many month we should look for failure data <br>
* datatype is int<br>
* value is in mont<br>
* default value is 12
* <p>
*
* @see #durationFailureData
*/
public static final String DURATION_FAILURE_DATA = PARSER_LINE_DASHBOARD + ".durationFailureData";
@AParameter(name = PARSER_LINE_DASHBOARD, description = "LineDashboard parser", type = Void.class, dimPath = DEFAULT_DIM_PATH,
visibility = "Parser=com.itac.mes.datainterface.parser.LineDashboardParser")
private Parameter rootParam;
@AParameter(name = DURATION_FAILURE_DATA, parent = PARSER_LINE_DASHBOARD, description = "duration for failure data (month)",
type = Integer.class, resourceText = "check failure data for so many month.")
private Parameter paramLayer;
@AParameterDefaultValue(name = DURATION_FAILURE_DATA)
private Integer defFailure = 12;
private static final String LOGGER = LineDashboardParser.class.getSimpleName();
private static final String FIELD_NULL_OR_EMPTY = "field {0} in {1} is null or empty";
private static final String FIELD_OUT_OF_RANGE = "field {0} in {1} is out of range({2}..{3})";
@AAutoHandler(InstantiationType.TOOL)
private Toolbox toolbox;
@AAutoHandler(InstantiationType.TOOL)
private SmtConfiguration smtConfiguration;
/** for how many month the failure data should be checked up to now() */
@AParamValue(value = DURATION_FAILURE_DATA)
private int durationFailureData;
/**
* line based: all machine tracedata are collected by LineDashboard and sent from one machine after board leaves the line
*/
public LineDashboardParser() {
super();
}
/*
* (non-Javadoc)
* @see com.itac.easyworks.datainterface.parser.IParser#parse(java.lang.StringBuffer , java.lang.String, java.util.ArrayList,
* java.lang.StringBuffer)
*/
@Override
public Code parse(StringBuffer sb, String string, List<BasicUploadUnit> list, StringBuffer sb1) {
return Code.NOT_IMPLEMENTED;
}
private void startRequest(String requestName) throws LineDashboardParserException {
LogHandler.log(LOGGER, INFO, "start parse " + requestName);
if (getConfigurationResult() != OK) {
throw new LineDashboardParserException(Code.PARSE_ERROR, "LineDashboard Parser is not configured properly", -10010);
}
}
private void checkMachine(Machine machine, String requestName, int errorCode) throws LineDashboardParserException {
if (machine == null) {
throw new LineDashboardParserException(Code.PARSE_ERROR, MISSING_FIELD, errorCode, MACHINE, requestName);
}
checkField(machine.getMachineName(), MACHINE_NAME, requestName, errorCode - 1);
checkField(machine.getLineName(), LINE_NAME, requestName, errorCode - 2);
checkField(machine.getLane(), LANE, requestName, errorCode - 3);
checkField(machine.getModuleName(), MODULE_NAME, requestName, errorCode - 4);
}
private void checkField(String field, String fieldName, String requestName, final int code) throws LineDashboardParserException {
if (field == null || field.isEmpty()) {
throw new LineDashboardParserException(Code.PARSE_ERROR, FIELD_NULL_OR_EMPTY, code, fieldName, requestName);
}
}
private void checkField(Date dateField, String fieldName, String requestName, int code) throws LineDashboardParserException {
if (dateField == null) {
throw new LineDashboardParserException(Code.PARSE_ERROR, FIELD_NULL_OR_EMPTY, code, fieldName, requestName);
}
}
private void checkFieldRange(int value, String fieldName, String requestName, int from, int to, int code)
throws LineDashboardParserException {
if (value < from || value > to) {
throw new LineDashboardParserException(Code.PARSE_ERROR, FIELD_OUT_OF_RANGE, code, fieldName, requestName, from, to);
}
}
private void checkListNotEmpty(List<?> listObject, String fieldName, String requestName, int code)
throws LineDashboardParserException {
if (listObject == null || listObject.isEmpty()) {
throw new LineDashboardParserException(Code.PARSE_ERROR, MISSING_FIELD, code, fieldName, requestName);
}
}
/**
* Statusermittlung
*
* @param stateString
* der Statusbezeichner (muss so im toolbox-Mapping enthalten sein
* @param requestName
* Name des Request aus dem der Status ermittelt werden soll
* @param code
* fehlercode wenn Status nicht ermittelt werden kann
* @return der ermittelte Status
* @throws LineDashboardParserException
* wenn Status nicht ermittelt werden kann, mit Code PARSE_ERROR
*/
private int getStatus(String stateString, String requestName, int errorCode) throws LineDashboardParserException {
int status = toolbox.getStatus(stateString);
if (status == -1) {
// unable to map status failure
throw new LineDashboardParserException(Code.PARSE_ERROR, UNABLE_TO_MAP_VALUE_INTO_STATE, errorCode, stateString, requestName);
}
return status;
}
private PmMachine getPmMachine(Machine machine, int errorCode) throws LineDashboardParserException {
PmMachine k = smtConfiguration.getMachineListPM().getStation(machine.getLineName(),
machine.getMachineName(), machine.getLane(), machine.getModuleName());
if (k == null) {
throw new LineDashboardParserException(Code.PARSE_ERROR, NO_PM_MACHINE_FOUND, errorCode, machine.getLineName(),
machine.getMachineName(), machine.getModuleName(), machine.getLane());
}
return k;
}
/**
* ermitteln einer TR-Maschine &uuml;ber eine Maschinen Struktur
* <p>
* es werden alle benoetigten Felder geprueft
*
* @param machine
* eine Maschinenstruktur
* @return die TRMaschine zu den in der Maschine enthaltenen Werten
* @throws LineDashboardParserException
* wenn keine Maschine ermittelt werden konnte
*/
private TrMachine getTrMachine(final Machine machine, final int errorCode) throws LineDashboardParserException {
TrMachine k = smtConfiguration.getSmtMachineListTR().getStation(machine.getLineName(),
machine.getMachineName(), machine.getLane(), machine.getModuleName());
if (k == null) {
throw new LineDashboardParserException(Code.PARSE_ERROR, NO_TR_MACHINE_FOUND, errorCode, machine.getLineName(),
machine.getMachineName(), machine.getModuleName(), machine.getLane());
}
return k;
}
private String getStation(Machine machine) throws LineDashboardParserException {
Station st = null;
if ("*".equals(machine.getLineName()) && "*".equals(machine.getModuleName()) && "*".equals(machine.getLane())) {
// Sonderfall, einfache Abbildung nutzen
st = toolbox.getStation(machine.getMachineName());
if (st == null) {
throw new LineDashboardParserException(Code.PARSE_ERROR,
"station not found for machine '" + machine.getMachineName() + "' ", -10300);
}
}
if (st == null) {
TrMachine trMachine = getTrMachine(machine, -1);
if (trMachine == null) {
throw new LineDashboardParserException(Code.PARSE_ERROR,
"no tr station found for machine '" + machine.getMachineName() + "' ", -10301);
}
st = toolbox.getStation(trMachine.getName());
if (st == null) {
throw new LineDashboardParserException(Code.PARSE_ERROR, "station not found for TR-Machine '" + trMachine.getName() + "' ",
-10302);
}
}
return st.getStationNumber();
}
private Station getStation(com.itac.mes.datainterface.data.smt.Machine machine, LineDashboardDataUnit lineDashboardDataUnit,
int errorCode) throws LineDashboardParserException {
Station station = toolbox.getStation(machine.getName());
if (station == null) {
String message = MessageFormat.format(NO_CLIENT_MACHINE, machine.getName());
lineDashboardDataUnit.resultText.append(message);
throw new LineDashboardParserException(Code.PARSE_ERROR, message, errorCode);
}
LogHandler.log(LOGGER, DEBUG, MessageFormat.format("station found: {0}", station.toString()));
return station;
}
private void finalizeRequest(Throwable th, String request, int errorCode) throws LineDashboardParserException {
if (th instanceof LineDashboardParserException) {
LineDashboardParserException cpe = (LineDashboardParserException) th;
LogHandler.log(LOGGER, ERROR,
"parsing failed with code: " + cpe.getResultCode() + "/" + cpe.getCode() + "\n" + cpe.getMessage());
throw cpe;
}
LogHandler.log(LOGGER, ERROR, request, th);
throw new LineDashboardParserException(Code.PARSE_ERROR, request, errorCode);
}
public void parse(MachineStatusRequest machineStatusRequest, LineDashboardDataUnit lineDashboardDataUnit)
throws LineDashboardParserException {
try {
startRequest(MACHINE_STATUS_REQUEST);
assert machineStatusRequest != null;
eventSourceInfo = new EventSourceInfo(machineStatusRequest);
eventSourceInfo.setProtocol(new Protocol());
// Felder und Flags pruefen
checkMachine(machineStatusRequest.getMachine(), MACHINE_STATUS_REQUEST, -10500);
PmMachine pmMachine = getPmMachine(machineStatusRequest.getMachine(), -10510);
Station stationPm = getStation(pmMachine, lineDashboardDataUnit, -10511);
if (!pmMachine.getSmtSettings().isStationConditions()) {
// Keine conditions fuer diese Station verarbeiten
throw new LineDashboardParserException(Code.IGNORE, NO_MACHINE_STATUS_PROCESSING, -10503, stationPm.getStationNumber());
}
checkField(machineStatusRequest.getStatus(), STATUS, MACHINE_STATUS_REQUEST, -10504);
checkField(machineStatusRequest.getEventDate(), EVENT_DATE, MACHINE_STATUS_REQUEST, -10505);
long startDate = machineStatusRequest.getEventDate().getTime();
String condCode = toolbox.getConditionCode(machineStatusRequest.getStatus().toString());
if (condCode == null) {
LogHandler.log(LOGGER, WARN,
"Machine message code " + machineStatusRequest.getStatus().toString() + " is not mapped, ignore this message!");
condCode = machineStatusRequest.getStatus().toString();
}
if (startDate > System.currentTimeMillis()) {
LogHandler.log(LOGGER, WARN, "eventDate for " + MACHINE_STATUS_REQUEST + " is in the future!");
LogHandler.log(LOGGER, WARN, "eventDate is " + toolbox.formatDate(machineStatusRequest.getEventDate())
+ ", interface date is " + toolbox.formatDate(new Date()));
}
// kann der konfigurierte Wert gemappt werden?
String defaultCondCode = toolbox.getConditionCode(smtConfiguration.getDefaultConditionCode());
if (defaultCondCode == null) {
defaultCondCode = smtConfiguration.getDefaultConditionCode();
}
// zuerst wir versucht den Code per Text-Mapping abzubilden
UploadSmtMachineDataUnit machineConditionUnit = new UploadSmtMachineDataUnit();
machineConditionUnit.setConditionCode(condCode);
machineConditionUnit.setDefaultConditionCode(defaultCondCode);
machineConditionUnit.setStationNo(stationPm.getStationNumber());
machineConditionUnit.setStartDate(DateConvert.convertLongDateToInt(startDate));
machineConditionUnit.setEndDate(-1);
machineConditionUnit.setText(machineStatusRequest.getStatus());
// 1:line based --> per line, 0:stationBased--> station
machineConditionUnit.setBookingTarget(0);
machineConditionUnit.setParseCode(Code.OK);
lineDashboardDataUnit.uploadUnitList.add(machineConditionUnit);
} catch (Throwable cpe) {
finalizeRequest(cpe, MACHINE_STATUS_REQUEST, -10504);
}
}
public void parse(ProductionTimeRequest productionTimeRequest, LineDashboardDataUnit lineDashboardDataUnit)
throws LineDashboardParserException {
try {
startRequest(PRODUCTION_DATA_REQUEST);
assert productionTimeRequest != null;
checkMachine(productionTimeRequest.getMachine(), PRODUCTION_DATA_REQUEST, -10600);
// checkField(productionDataRequest.getProcessLayer(), PROCESS_LAYER, PRODUCTION_DATA_REQUEST, -11701)
checkField(productionTimeRequest.getWorkorder(), WORKORDER, PRODUCTION_DATA_REQUEST, -10601);
checkField(productionTimeRequest.getProcessType(), PROCESS_TYPE, PRODUCTION_DATA_REQUEST, -10602);
UploadProductionDataUnit uploadProductionDataUnit = new UploadProductionDataUnit();
uploadProductionDataUnit.setStationNumber(getStation(productionTimeRequest.getMachine()));
uploadProductionDataUnit.setProcessLayer(getProcessLayer(productionTimeRequest.getProcessLayer()));
uploadProductionDataUnit.setWorkOrderNumber(productionTimeRequest.getWorkorder());
uploadProductionDataUnit.setProdCycleTime(productionTimeRequest.getProductionTime());
uploadProductionDataUnit.setSetupCycleTime(productionTimeRequest.getSetupTime());
uploadProductionDataUnit.setProcessType(productionTimeRequest.getProcessType());
uploadProductionDataUnit.setCycleTimeForMultipleBoard(productionTimeRequest.getMultiBoard());
lineDashboardDataUnit.uploadUnitList.add(uploadProductionDataUnit);
} catch (Throwable cpe) {
finalizeRequest(cpe, PRODUCTION_DATA_REQUEST, -10604);
}
}
protected int getProcessLayer(String processLayer) throws LineDashboardParserException {
// versuchen die Lage über die Toolbox abzubilden
int iLayer = toolbox.getLayer(processLayer);
// wenn das nicht geht versuchen den übergebenen Wert als Integer zu parsen.
if (iLayer == -1) {
try {
iLayer = Integer.parseInt(processLayer);
} catch (Exception e) {
throw new LineDashboardParserException(Code.PARSE_ERROR, "unable to parse or map value for layer", -11000);
}
}
// falls das auch fehlschlägt eine Fehlermeldung werfen
return iLayer;
}
public void parse(StationResultRequest stationResultRequest, LineDashboardDataUnit lineDashboardDataUnit)
throws LineDashboardParserException {
try {
startRequest(STATION_RESULT_REQUEST);
assert stationResultRequest != null;
checkMachine(stationResultRequest.getMachine(), STATION_RESULT_REQUEST, -10700);
checkField(stationResultRequest.getEventDate(), EVENT_DATE, STATION_RESULT_REQUEST, -10710);
checkField(stationResultRequest.getWorkorder(), WORKORDER, STATION_RESULT_REQUEST, -10711);
// checkListNotEmpty(stationResultRequest.getStationResults(), STATION_RESULTS, STATION_RESULT_REQUEST, 10712)
UploadStationResultUnit uploadStationResultUnit = new UploadStationResultUnit();
uploadStationResultUnit.setStation(getStation(stationResultRequest.getMachine()));
uploadStationResultUnit.setWorkorder(stationResultRequest.getWorkorder());
uploadStationResultUnit.setStationResults(stationResultRequest.getStationResults());
lineDashboardDataUnit.uploadUnitList.add(uploadStationResultUnit);
} catch (Throwable cpe) {
finalizeRequest(cpe, STATION_RESULT_REQUEST, -10705);
}
}
public void parse(QuantityAndFailureUploadRequest quantityAndFailureUploadRequest, LineDashboardDataUnit lineDashboardDataUnit)
throws LineDashboardParserException {
try {
startRequest(QUANTITY_FAILURE_REQUEST);
assert quantityAndFailureUploadRequest != null;
checkMachine(quantityAndFailureUploadRequest.getMachine(), QUANTITY_FAILURE_REQUEST, -10800);
checkField(quantityAndFailureUploadRequest.getEventDate(), EVENT_DATE, QUANTITY_FAILURE_REQUEST, -10801);
UploadPmQuantityUnit uploadPmQuantityUnit = new UploadPmQuantityUnit();
uploadPmQuantityUnit.setDurationFailureData(durationFailureData);
uploadPmQuantityUnit.setStationNumber(getStation(quantityAndFailureUploadRequest.getMachine()));
uploadPmQuantityUnit.setWorkorderNumber(quantityAndFailureUploadRequest.getWorkorder());
uploadPmQuantityUnit.setProcessLayer(getProcessLayer(quantityAndFailureUploadRequest.getProcessLayer()));
uploadPmQuantityUnit.setBookDate(quantityAndFailureUploadRequest.getEventDate());
uploadPmQuantityUnit.setFailureData(quantityAndFailureUploadRequest.getFailureData());
uploadPmQuantityUnit.setQuantityPass(quantityAndFailureUploadRequest.getPass());
uploadPmQuantityUnit.setQuantityFirstPass(quantityAndFailureUploadRequest.getFirstPass());
uploadPmQuantityUnit.setQuantityFail(quantityAndFailureUploadRequest.getFail());
uploadPmQuantityUnit.setQuantityFirstFail(quantityAndFailureUploadRequest.getFirstFail());
uploadPmQuantityUnit.setQuantityScrap(quantityAndFailureUploadRequest.getScrap());
uploadPmQuantityUnit.setQuantityFirstScrap(quantityAndFailureUploadRequest.getFirstScrap());
lineDashboardDataUnit.uploadUnitList.add(uploadPmQuantityUnit);
} catch (Throwable cpe) {
finalizeRequest(cpe, QUANTITY_FAILURE_REQUEST, -10804);
}
}
}

View File

@@ -0,0 +1,50 @@
package com.itac.mes.datainterface.parser;
import java.text.MessageFormat;
import com.itac.mes.datainterface.parser.IParser.Code;
public class LineDashboardParserException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
private Code code;
private int resultCode;
public LineDashboardParserException(IParser.Code code, String message, int resultCode) {
super(message);
this.code = code;
this.resultCode = resultCode;
}
/**
* @param code
* @param message
* @param resultCode
* @param arguments mit diesen Argumenten wird die Message gebaut.
*/
public LineDashboardParserException(IParser.Code code, String message, int resultCode, Object... arguments) {
super(MessageFormat.format(message, arguments));
this.code = code;
this.resultCode = resultCode;
}
/**
*
* @return den Parse-Code (IGNORE, PARSE ERROR, etc
*/
public Code getCode() {
return code;
}
/**
*
* @return den Code, der auch z.B. von einer API zurueckgeliefert wird.
*/
public int getResultCode() {
return resultCode;
}
}

View File

@@ -0,0 +1,79 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.parser.xml;
import com.itac.mes.datainterface.data.xmlapi.XmlJaxbMachineConstruct;
import com.itac.mes.datainterface.gui.IMachineSimulation;
import com.itac.mes.datainterface.simulation.DefaultMachineSimulation;
import com.itac.mes.datainterface.simulation.LineDashboardSimulation;
import com.itac.mes.linedashboard.IMesServices;
import com.itac.mes.linedashboard.data.MesRequest;
import com.itac.mes.linedashboard.data.MesResponse;
public class LineDashboardXmlConstruct extends XmlJaxbMachineConstruct {
private static final String LOGGER = LineDashboardXmlConstruct.class.getSimpleName();
private LineDashboardSimulation machineSimulation;
public LineDashboardXmlConstruct(String id) {
super(id);
setMethods(IMesServices.class.getMethods());
}
@Override
public String toString() {
return "LineDashboard Simulation id(" + getId() + ") ";
}
/**
* @param machine
*/
@Override
public void setSimulation(IMachineSimulation machineSimulation) {
if (machineSimulation instanceof LineDashboardSimulation) {
this.machineSimulation = (LineDashboardSimulation) machineSimulation;
}
}
/*
* (non-Javadoc)
* @see com.itac.mes.datainterface.data.xmlapi.XmlJaxbMachineConstruct#getPackageClassPath()
*/
@Override
protected String getPackageClassPath() {
return MesRequest.class.getPackage().getName();
}
/*
* (non-Javadoc)
* @see com.itac.mes.datainterface.data.xmlapi.XmlJaxbMachineConstruct#getMachineSimulation()
*/
@Override
protected DefaultMachineSimulation getMachineSimulation() {
return machineSimulation;
}
/*
* (non-Javadoc)
* @see com.itac.mes.datainterface.data.xmlapi.XmlJaxbMachineConstruct#send(java.lang.String, java.lang.String, java.lang.Object,
* int)
*/
@Override
protected Object send(String id, String sMethod, Object requestObject, int timeout) {
Object result = machineSimulation.sendObject(sMethod, requestObject, timeout * 1000L);
if (result != null && result instanceof MesResponse) {
MesResponse response = (MesResponse) result;
getTestCase().getVariableEngine().put(id + "totalResult", response.getTotalResult());
if (response.getErrorDetails().size() > 0) {
getTestCase().getVariableEngine().put(id + "errorDetails", response.getErrorDetails());
}
}
return result;
}
}

View File

@@ -0,0 +1,105 @@
package com.itac.mes.datainterface.parser.xml;
import static com.itac.mes.datainterface.data.xmlapi.XmlMachineConstruct.ACTION_CHANGE_CONFIGURATION;
import static com.itac.mes.datainterface.parser.xml.LineDashboardXmlConstruct.ACTION_SEND;
import static com.itac.mes.datainterface.parser.xml.LineDashboardXmlConstruct.METHOD;
import java.util.ArrayList;
import java.util.List;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.itac.mes.datainterface.data.Duration;
import com.itac.mes.datainterface.data.Toolbox;
import com.itac.mes.datainterface.data.xmlapi.XmlConstruct;
import com.itac.mes.datainterface.gui.IMachineSimulation;
import com.itac.mes.datainterface.parser.MachinePluginParser;
import com.itac.mes.datainterface.simulation.LineDashboardSimulation;
import com.itac.util.date.DateConvert;
public class LineDashboardXmlParser extends MachinePluginParser {
public LineDashboardXmlParser(String name, Toolbox toolbox) {
super(name, toolbox);
}
@Override
public boolean includeSubNodes() {
return true;
}
@Override
public XmlConstruct parse(Node node) throws Exception {
NamedNodeMap attributes = node.getAttributes();
checkAttributesNotEmpty(attributes, new String[] { XmlConstruct.ID, SIMULATION, ACTION }, getName());
String id = getAttributeValue(attributes, XmlConstruct.ID);
String simulation = getAttributeValue(attributes, SIMULATION);
IMachineSimulation machine = getToolBox().getSimulation(simulation);
checkMachineSimulation(machine, getName(), simulation, id, LineDashboardSimulation.class);
String action = getAttributeValue(attributes, ACTION);
checkActions(getName(), action, id, machine.getCustomActionNames(), new String[] { ACTION_SEND, ACTION_CHANGE_CONFIGURATION });
LineDashboardXmlConstruct lineDashboardXmlConstruct = new LineDashboardXmlConstruct(id);
lineDashboardXmlConstruct.setAction(action);
lineDashboardXmlConstruct.setSimulation(machine);
if (machine.hasAction(action)) {
return lineDashboardXmlConstruct;
} else if (action.equals(ACTION_SEND)) {
checkAttributesNotEmpty(attributes, new String[] { TIMEOUT }, getName());
checkAttributes(attributes, new String[] { METHOD }, getName());
String sTimeout = getAttributeValue(attributes, TIMEOUT);
String sMethod = getAttributeValue(attributes, METHOD);
int timeout = 0;
Duration d = new Duration(sTimeout);
// ist der Wert kein Duration-Wert--> dann integer pruefen
if (d.getMillies() == Long.MIN_VALUE) {
try {
timeout = Integer.parseInt(sTimeout);
} catch (Exception e) {
throw new Exception(getIdConstructHeader(id, getName()) + ": parsing failed\n" + "attribute '" + TIMEOUT
+ "' is not a valid integer value nor a duration; required is a value in seconds!\n");
}
} else {
timeout = DateConvert.convertLongDateToInt(d.getMillies());
}
List<Node> subObjects = null;
if (node.hasChildNodes()) {
subObjects = parseSubNodes(node.getChildNodes());
}
if (((subObjects == null) || (subObjects.size() == 0)) && (sMethod == null || sMethod.isEmpty())) {
throw new Exception(getIdConstructHeader(id, getName()) + ": parsing failed for action send; no data object found in xml");
}
// subnode parsen, damit sicher ist, dass das auch beim ausfehren passt
if (subObjects != null && subObjects.size() != 0) {
lineDashboardXmlConstruct.setSubnode((Node) subObjects.get(0));
}
lineDashboardXmlConstruct.setMethod(sMethod);
lineDashboardXmlConstruct.setTimeout(timeout);
} else if (action.equals(ACTION_CHANGE_CONFIGURATION)) {
parseChangeConfiguration(lineDashboardXmlConstruct, attributes);
}
return lineDashboardXmlConstruct;
}
private List<Node> parseSubNodes(NodeList childNodes) {
List<Node> retValue = new ArrayList<Node>();
for (int i = 0; i < childNodes.getLength(); ++i) {
Node node = childNodes.item(i);
if (node.getNodeType() != 1) {
continue;
}
retValue.add(node);
}
return retValue;
}
}

View File

@@ -0,0 +1,166 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.process;
import static com.itac.util.logging.LogLevel.INFO;
import com.itac.artes.ihas.LookupException;
import com.itac.mes.api.domain.container.Result_mdcUploadStationCondition;
import com.itac.mes.core.domain.mig.exception.ItacMesErrorCodeApi;
import com.itac.mes.datainterface.annotations.AInit;
import com.itac.mes.datainterface.annotations.AInstantiationType;
import com.itac.mes.datainterface.annotations.Dispatch;
import com.itac.mes.datainterface.annotations.InstantiationType;
import com.itac.mes.datainterface.data.ProcessResult;
import com.itac.mes.datainterface.data.UploadPmQuantityUnit;
import com.itac.mes.datainterface.data.UploadProductionDataUnit;
import com.itac.mes.datainterface.data.UploadSmtMachineDataUnit;
import com.itac.mes.datainterface.data.UploadStationResultUnit;
import com.itac.mes.imsapi.domain.container.Result_mdataSetProductionCycleTime;
import com.itac.mes.imsapi.domain.container.Result_pmGetFailureData;
import com.itac.mes.imsapi.domain.container.Result_pmUploadQuantityAndFailureData;
import com.itac.mes.imsapi.domain.container.Result_trUploadStationResult;
import com.itac.util.date.DateConvert;
import com.itac.util.logging.LogHandler;
@AInstantiationType(name = "linedashboard", type = InstantiationType.PROCESSOR)
public class LineDashboardProcessor extends DefaultProcessor {
public LineDashboardProcessor() {
super();
}
@AInit
public void initProcessor() {
super.initProcessor();
}
/**
* @param uploadUnit
* @param processResult
* @return
* @throws LookupException
*/
@Dispatch(clazz = UploadStationResultUnit.class)
private Code sendStationResultUnit(UploadStationResultUnit uploadUnit, ProcessResult processResult) throws LookupException {
Code code = Code.NOT_SENT;
try {
Result_trUploadStationResult ret = services.getIMSApiService().trUploadStationResult(getImsSession(),
uploadUnit.getStationNumber(), uploadUnit.getPartNumber(), uploadUnit.getBomVersion(), uploadUnit.getBomIndex(),
uploadUnit.getBomVersionErp(), uploadUnit.getWorkOrderNumber(), uploadUnit.getBookDate(), uploadUnit.getSerialUnitTrace(),
uploadUnit.getStationResultUploadKeys(), uploadUnit.getStationResultUploadValues());
code = Code.OK;
processResult.setResultCode(code);
if (ret.return_value < 0) {
handleImsApiError(getMethodDescription(), processResult, ret.return_value);
}
} catch (Throwable t) {
handleException(t, getMethodDescription(), processResult);
}
return code;
}
/**
* @param uploadUnit
* @param processResult
* @return
* @throws LookupException
*/
@Dispatch(clazz = UploadPmQuantityUnit.class)
protected synchronized Code sendPmQuantityUnit(UploadPmQuantityUnit uploadUnit, ProcessResult processResult)
throws LookupException {
Code code = Code.NOT_SENT;
try {
// Absolutwerte zu Fehlern ermitteln
Result_pmGetFailureData getFailureData = services.getIMSApiService().pmGetFailureData(getImsSession(),
uploadUnit.getStationNumber(), uploadUnit.getFailureDataFilters(), uploadUnit.getFailureDataResultKeys());
// aus den letzten deltas und den vorigen Werten die absoluten Mengen berechnen
uploadUnit.setFailureDataResultValues(getFailureData.failureDataResultValues);
// {"sessionContext", "stationNumber", "bookingFailureData", "failureDataUploadKeys", "failureDataUploadValues"})
Result_pmUploadQuantityAndFailureData ret = services.getIMSApiService().pmUploadQuantityAndFailureData(getImsSession(),
uploadUnit.getStationNumber(), uploadUnit.getBookingFailureData(), uploadUnit.getFailureDataUploadKeys(),
uploadUnit.getFailureDataUploadValues());
code = Code.OK;
processResult.setResultCode(code);
if (ret.return_value < 0) {
handleImsApiError(getMethodDescription(), processResult, ret.return_value);
}
} catch (Throwable t) {
handleException(t, getMethodDescription(), processResult);
}
return code;
}
/**
* @param uploadUnit
* @param processResult
* @return
* @throws LookupException
*/
@Dispatch(clazz = UploadProductionDataUnit.class)
protected Code sendProductionCycleDataUnit(UploadProductionDataUnit uploadUnit, ProcessResult processResult)
throws LookupException {
Code code = Code.NOT_SENT;
try {
Result_mdataSetProductionCycleTime ret = services.getIMSApiService().mdataSetProductionCycleTime(getImsSession(),
uploadUnit.getStationNumber(), uploadUnit.getSerialNumber(), uploadUnit.getSerialNumberPos(),
uploadUnit.getWorkOrderNumber(), uploadUnit.getProcessLayer(), uploadUnit.getSetupCycleTime(),
uploadUnit.getProdCycleTime(), uploadUnit.getProcessType(), uploadUnit.getCycleTimeForMultipleBoard());
code = Code.OK;
processResult.setResultCode(code);
if (ret.return_value < 0) {
handleImsApiError(getMethodDescription(), processResult, ret.return_value);
}
} catch (Throwable t) {
handleException(t, getMethodDescription(), processResult);
}
return code;
}
/**
* @param uploadUnit
* @param processResult
* @return
* @throws LookupException
*/
@Dispatch(clazz = UploadSmtMachineDataUnit.class)
protected Code sendSmtMachineDataUnit(UploadSmtMachineDataUnit uploadUnit, ProcessResult result) throws LookupException {
LogHandler.log(getClass().getSimpleName(), INFO, "start uploading unit:\n" + uploadUnit.toString());
Code code = Code.NOT_SENT;
try {
Result_mdcUploadStationCondition retCode = services.getAPIServices().mdcUploadStationCondition(uploadUnit.getStationNo(),
uploadUnit.getConditionCode(), uploadUnit.getStartDate(), uploadUnit.getEndDate(), uploadUnit.getText(),
uploadUnit.getBookingTarget());
if (retCode.return_value == ItacMesErrorCodeApi.CONDITION_NOT_FOUND.getReturnValue()
|| retCode.return_value == ItacMesErrorCodeApi.CONDITION_NOT_FOR_LINE.getReturnValue()
|| retCode.return_value == ItacMesErrorCodeApi.CONDITION_USAGE_NOT_FOUND.getReturnValue()) {
if (uploadUnit.getEndDate() != -1) {
int startDate = uploadUnit.getStartDate() - DateConvert.convertLongDateToInt(uploadUnit.getDefaultConditionDuration());
retCode = services.getAPIServices().mdcUploadStationCondition(uploadUnit.getStationNo(),
uploadUnit.getDefaultConditionCode(), startDate, uploadUnit.getStartDate(), uploadUnit.getText(),
uploadUnit.getBookingTarget());
} else {
retCode = services.getAPIServices().mdcUploadStationCondition(uploadUnit.getStationNo(),
uploadUnit.getDefaultConditionCode(), uploadUnit.getStartDate(), uploadUnit.getEndDate(), uploadUnit.getText(),
uploadUnit.getBookingTarget());
}
}
if (retCode.return_value != 0) {
result.setResultCode(Code.NOT_SENT);
result.setDetailCode(retCode.return_value);
result.setDetailText("sendSmtMachineDataUnit() failed: " + retCode.errorString);
} else {
code = Code.OK;
}
} catch (Throwable t) {
handleException(t, "sendSmtMachineDataUnit() failed: ", result);
}
return code;
}
}

View File

@@ -0,0 +1,323 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.simulation;
import static com.itac.mes.datainterface.data.smt.MessageLogger.MSG_LOGGER;
import static com.itac.util.logging.LogLevel.DEBUG;
import static com.itac.util.logging.LogLevel.ERROR;
import static com.itac.util.logging.LogLevel.INFO;
import static com.itac.util.logging.LogLevel.WARN;
import java.io.StringWriter;
import java.lang.reflect.Method;
import java.util.Date;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;
import com.itac.mes.config.domain.Parameter;
import com.itac.mes.datainterface.ParameterUpdateTool;
import com.itac.mes.datainterface.annotations.AInit;
import com.itac.mes.datainterface.annotations.AInstantiationType;
import com.itac.mes.datainterface.annotations.AParamValue;
import com.itac.mes.datainterface.annotations.AParameter;
import com.itac.mes.datainterface.annotations.InstantiationType;
import com.itac.mes.datainterface.gui.DataInterfaceMenuAction;
import com.itac.mes.datainterface.parser.xml.LineDashboardXmlParser;
import com.itac.mes.linedashboard.IMesServices;
import com.itac.mes.linedashboard.MesServices;
import com.itac.mes.linedashboard.data.MachineStatusRequest;
import com.itac.mes.linedashboard.data.MesConfigurationResponse;
import com.itac.mes.linedashboard.data.MesRequest;
import com.itac.mes.linedashboard.data.MesResponse;
import com.itac.mes.linedashboard.data.ProductionTimeRequest;
import com.itac.mes.linedashboard.data.QuantityAndFailureUploadRequest;
import com.itac.mes.linedashboard.data.StationResultRequest;
import com.itac.util.logging.LogHandler;
/**
* @author frankp created 2010
*/
@AInstantiationType(name = "linedashboard", type = InstantiationType.MACHINESIMULATION)
public class LineDashboardSimulation extends DefaultMachineSimulation {
public static final String ID_START = "start";
public static final String ID_STOP = "stop";
public static final String ID_CLEAR = "clear";
public static final String ID_SEND = "send";
private static final String LOGGER = LineDashboardSimulation.class.getSimpleName();
private static final String SIMULATION_LINE_DASHBOARD = "simulation.lineDashboard";
private static final String INTERFACE_HOST = SIMULATION_LINE_DASHBOARD + ".interfaceHost";
private static final String INTERFACE_PORT = SIMULATION_LINE_DASHBOARD + ".interfacePort";
@AParameter(name = SIMULATION_LINE_DASHBOARD, description = "Line Dashboard Simulation",
visibility = "MachineSimulation=com.itac.mes.datainterface.simulation.LineDashboardSimulation",
dimPath = ParameterUpdateTool.DEFAULT_DIM_PATH)
private Parameter paramSimulation;
@AParameter(name = INTERFACE_HOST, parent = SIMULATION_LINE_DASHBOARD, description = "Line Dashboard interface hostname",
type = String.class)
private Parameter paramHost;
@AParameter(name = INTERFACE_PORT, parent = SIMULATION_LINE_DASHBOARD, description = "Line Dashboard interface port",
type = Integer.class)
private Parameter paramPort;
@AParamValue(value = INTERFACE_PORT)
private int iInterfacePort;
@AParamValue(value = INTERFACE_HOST)
private String sInterfaceHost;
private IMesServices lineDashboardService;
private Marshaller marshaller;
// die einzelnen Menu-Items werden hier deklariert, und spaeter geadded
private DataInterfaceMenuAction startServerMenuItem = new DataInterfaceMenuAction("start Simulation", "startSimulation", ID_START,
false);
private DataInterfaceMenuAction stopServerMenuItem = new DataInterfaceMenuAction("stop Simulation", "stopSimulation", ID_STOP,
false);
private DataInterfaceMenuAction clearServerMenuItem = new DataInterfaceMenuAction("clear Simulation", "clear", ID_CLEAR, true);
private DataInterfaceMenuAction sendServerMenuItem = new DataInterfaceMenuAction("send", "send", ID_SEND, true);
public LineDashboardSimulation() {
super();
// erzeugen und registrieren der Actions, die auh aus einem Script heraus aufgerufen werden koennen
addSimMenuItem(startServerMenuItem);
addSimMenuItem(stopServerMenuItem);
addSimMenuItem(clearServerMenuItem);
addSimMenuItem(sendServerMenuItem);
}
@AInit
public void atInit() {
startServerMenuItem.setEnabled(getConfigurationResult() == OK);
if (getConfiguration() != null && getToolbox() != null) {
lineDashboardService = new MesServices();
}
try {
checkPluginParser();
} catch (Throwable th) {
}
if (LogHandler.getLogLevel(MSG_LOGGER).compareTo(DEBUG) >= 0 && marshaller == null) {
// alle Klassen aus diesem Package...
Class<?>[] classes = new Class[] { MachineStatusRequest.class, MesConfigurationResponse.class, MesRequest.class,
MesResponse.class, ProductionTimeRequest.class, StationResultRequest.class, QuantityAndFailureUploadRequest.class };
JAXBContext jc;
try {
jc = JAXBContext.newInstance(classes);
marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
} catch (JAXBException e) {
LogHandler.log(MSG_LOGGER, ERROR, "no jaxb context or marshaller created");
}
} else {
// wenn das detailled logging ausgeschalten wurde auch den Marshaller killen; bei erneutem mesStart call wird
// ein
// neuer marshaller erzeugt
marshaller = null;
}
}
/**
* Pruefen, ob es fuer diesen Maschinentyp bereits einen Plugin Parser in der Toolbox gibt. Falls nicht einen erzeugen und
* zuweisen. Der Api-Xml-Parser kann dann auf diesen Plugin Parser zugreifen
*/
private void checkPluginParser() {
if (getToolbox().getPluginParser(getSimulationType()) == null) {
LogHandler.log(LOGGER, DEBUG, "create plugin parser for '" + getSimulationType() + "'");
getToolbox().addPluginParser(new LineDashboardXmlParser(getSimulationType(), getToolbox()));
}
}
protected void startSimulation() {
if (getConfigurationResult() != OK) {
writeMessage(ERROR, "Simulation is not configured");
return;
}
startServerMenuItem.setEnabled(false);
stopServerMenuItem.setEnabled(true);
System.setProperty(IMesServices.MES_HOST, sInterfaceHost);
System.setProperty(IMesServices.MES_PORT, String.valueOf(iInterfacePort));
// optional properties
System.setProperty(IMesServices.MES_LOG_DETAILS, "true");
MesRequest mesRequest = new MesRequest();
mesRequest.setEventDate(new Date());
logRequest(mesRequest);
MesResponse mesResponse = lineDashboardService.mesStart(mesRequest);
logResponse(mesResponse);
}
protected void stopSimulation() {
if (getConfigurationResult() != OK) {
writeMessage(ERROR, "Simulation is not configured");
return;
}
startServerMenuItem.setEnabled(true);
stopServerMenuItem.setEnabled(false);
MesRequest mesRequest = new MesRequest();
logRequest(mesRequest);
MesResponse mesResponse = lineDashboardService.mesStop(mesRequest);
logResponse(mesResponse);
}
/**
* click auf send in der Simulation
*/
public void send() {
// je nach aktiver Seite verschiedene Aktionen auslösen
MesRequest mesRequest = null;
MesResponse mesResponse = null;
switch (((ILineDashboardSimulation) getWorkerPane()).getPage()) {
case 0:
mesRequest = ((ILineDashboardSimulation) getWorkerPane()).getProductionTimeRequest();
mesRequest.setEventDate(new Date());
logRequest(mesRequest);
mesResponse = lineDashboardService.mesSetProductionData((ProductionTimeRequest) mesRequest);
break;
case 1:
mesRequest = ((ILineDashboardSimulation) getWorkerPane()).getStationResultRequest();
mesRequest.setEventDate(new Date());
logRequest(mesRequest);
mesResponse = lineDashboardService.mesSetStationResult((StationResultRequest) mesRequest);
break;
case 2:
mesRequest = ((ILineDashboardSimulation) getWorkerPane()).getUploadQuantityRequest();
mesRequest.setEventDate(new Date());
logRequest(mesRequest);
mesResponse = lineDashboardService.mesSetQuantityAndFailureData((QuantityAndFailureUploadRequest) mesRequest);
break;
case 3:
mesRequest = ((ILineDashboardSimulation) getWorkerPane()).getMachineStatusRequest();
mesRequest.setEventDate(new Date());
logRequest(mesRequest);
mesResponse = lineDashboardService.mesMachineState((MachineStatusRequest) mesRequest);
break;
default:
break;
}
logResponse(mesResponse);
}
/**
*
* Mit dieser Methode wird das Objekt an den LineDashboard Server (das Datainterface) gesendet
*
* @param object
*/
public Object sendObject(String methodName, Object requestObject, long timeoutMillies) {
// die entsprechende Methode mit dem Namen aufrufen
Method[] methods = IMesServices.class.getMethods();
Method method = null;
// gibt es diese Methode???
for (Method mMethod : methods) {
if (mMethod.getName().equals(methodName)) {
method = mMethod;
}
}
if (method == null && requestObject != null) {
// die Methode raussuchen, die als einzigen Parameter den Typ des requestObejcts annimmt
for (Method mMethod : methods) {
Class<?>[] paramTypes = mMethod.getParameterTypes();
if (paramTypes != null && paramTypes.length == 1 && mMethod.getParameterTypes()[0].equals(requestObject.getClass())) {
method = mMethod;
}
}
}
if (method == null) {
LogHandler.log(LOGGER, ERROR,
"method " + methodName + " not found in lineDashboardInterface '" + IMesServices.class.getSimpleName() + "'");
return null;
}
// das Datenobjekt bauen... im xml sind bereits alle Variablen ersetzt
Object responseObject = null;
logRequest(requestObject);
try {
responseObject = method.invoke(lineDashboardService, requestObject);
} catch (Throwable th) {
LogHandler.log(LOGGER, ERROR, "message sending failed", th);
return null;
}
logResponse(responseObject);
//
// das Ergebnis in die Daten eintragen...
//
// auf das Ergebnis warten (timeout in secs)
if (timeoutMillies > 0 && responseObject != null) {
long end = System.currentTimeMillis() + timeoutMillies;
while (System.currentTimeMillis() < end) {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
LogHandler.log(LOGGER, ERROR, "wait interrupted", e);
}
}
}
return responseObject;
}
private void clear() {
getWorkerPane().clear();
}
private void logResponse(Object responseObject) {
if (responseObject != null && responseObject instanceof MesResponse) {
MesResponse mesResponse = (MesResponse) responseObject;
LogHandler.log(LOGGER, DEBUG, "finish request " + mesResponse.getRequestId() + " with code " + mesResponse.getTotalResult());
if (LogHandler.getLogLevel(MSG_LOGGER).compareTo(DEBUG) >= 0 && marshaller != null) {
try {
@SuppressWarnings({ "rawtypes", "unchecked" })
JAXBElement<?> jexbelement = new JAXBElement(new QName(mesResponse.getClass().getSimpleName()), mesResponse.getClass(),
mesResponse);
StringWriter sWriter = new StringWriter();
marshaller.marshal(jexbelement, sWriter);
writeMessage(DEBUG, sWriter.toString());
} catch (Throwable e) {
// LogHandler.log(MSG_LOGGER, ERROR, "Error logging mesResponse details", e);
} finally {
}
}
} else {
LogHandler.log(LOGGER, DEBUG, "finish empty request");
}
}
private void logRequest(Object requestObject) {
if (requestObject != null && requestObject instanceof MesRequest) {
MesRequest mesRequest = (MesRequest) requestObject;
String requestClassName = mesRequest.getClass().getSimpleName();
LogHandler.log(LOGGER, DEBUG, "start request " + mesRequest.getRequestId() + " (" + requestClassName + ")");
if (LogHandler.getLogLevel(MSG_LOGGER).compareTo(DEBUG) >= 0 && marshaller != null) {
try {
@SuppressWarnings({ "rawtypes", "unchecked" })
JAXBElement<?> jexbelement = new JAXBElement(new QName(requestClassName), mesRequest.getClass(), mesRequest);
StringWriter sWriter = new StringWriter();
sWriter.write("Request: " + requestClassName + "\n");
marshaller.marshal(jexbelement, sWriter);
writeMessage(INFO, sWriter.toString());
} catch (Throwable e) {
// LogHandler.log(MSG_LOGGER, ERROR, "Error logging mesRequest details for " + requestClassName, e);
}
}
} else {
LogHandler.log(LOGGER, WARN, "empty request ");
}
}
}

View File

@@ -0,0 +1,193 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.simulation.linedashboard;
import static com.itac.util.logging.LogLevel.DEBUG;
import static com.itac.util.logging.LogLevel.ERROR;
import static com.itac.util.logging.LogLevel.INFO;
import static com.itac.util.logging.LogLevel.WARN;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.Socket;
import java.net.SocketException;
import java.util.Hashtable;
import com.itac.artes.ihap.ArtesRemoteException;
import com.itac.artes.ihap.FaultCode;
import com.itac.artes.ihap.IhapCall;
import com.itac.artes.ihap.IhapInputStream;
import com.itac.artes.ihap.IhapOutputStream;
import com.itac.artes.ihap.IhapProtocolException;
import com.itac.artes.ihap.serialize.ProtocolMapping;
import com.itac.artes.ihap.serialize.ProtocolMappingFactory;
import com.itac.mes.linedashboard.IMesServices;
import com.itac.util.logging.LogHandler;
/**
* @author frankp created 2010
*/
public class IhapServerEventHandler {
private static final String LOGGER = IhapServerEventHandler.class.getSimpleName();
private static final long serialVersionUID = -3032397461757597876L;
/** Map mit den Namen aller zu empfangenden Methoden */
private static Hashtable<String, Method> _methodMap;
private static int handlerCounter;
private IMesServices mesService;
private Socket _client;
private IhapOutputStream _ios;
private IhapInputStream _iis;
private boolean _isShutdown;
private String handlerName = "";
private Thread receiveThread;
private PropertyChangeListener changeListener;
public IhapServerEventHandler(Socket client, IMesServices serviceHandler, PropertyChangeListener changeListener) {
handlerCounter++;
this._client = client;
this.mesService = serviceHandler;
this.changeListener = changeListener;
// das ist der initiale Name des Empfangthreads. Wenn der iTAC.OIB.Adapter die Methode setChannelName aufruft wird
// der neue (eindeutige Name) an den Thread vergeben. Der ist dann auch mit Tools wie z.B. JvisualVM zu sehen
handlerName = "IHapServerEventHandler#" + handlerCounter;
receiveThread = new Thread(handlerName) {
@Override
public void run() {
try {
_ios = new IhapOutputStream(_client.getOutputStream());
} catch (IOException e1) {
LogHandler.log(LOGGER, ERROR, toString() + " failed to create input stream!", e1);
}
try {
_iis = new IhapInputStream(_client.getInputStream());
} catch (IOException e1) {
LogHandler.log(LOGGER, ERROR, toString() + " failed to create output stream!", e1);
}
try {
while (!_isShutdown && isConnected()) {
receiveCall();
}
} catch (Exception e) {
// keine Fehlerausgabe, wird durch shutdown() korrekt behandelt!
shutdown();
}
}
@Override
public String toString() {
return IhapServerEventHandler.this.toString();
}
};
receiveThread.start();
}
/**
* einmalig für diese Klasse eine Map aufbauen, in der alle remote aufrufbaren Methoden enthalten sind.
*/
static {
ProtocolMapping protocolMapping = ProtocolMappingFactory.getMapping(1);
_methodMap = new Hashtable<String, Method>();
Method[] methods = IMesServices.class.getDeclaredMethods();
for (Method method : methods) {
_methodMap.put(protocolMapping.getOverloadMethodName(method), method);
}
// ebenso alle Methoden der implementierten Interface eintragen
LogHandler.log(LOGGER, DEBUG, "implements interface '" + IMesServices.class.getSimpleName() + "'");
}
/**
* shutting down this connection
*/
public void shutdown() {
_isShutdown = true;
try {
_client.close();
} catch (Exception e) {
LogHandler.log(LOGGER, WARN, handlerName + " closing tcp client failed!", e);
}
if (changeListener != null) {
changeListener.propertyChange(new PropertyChangeEvent(this, "closing", null, null));
}
}
protected boolean isConnected() {
return _client.isConnected();
}
private void receiveCall() throws IOException {
try {
Exception fault = null;
Object returnValue = null;
String methodName = null;
try {
boolean boolValue = _iis.readBoolean();
if (!boolValue) {
IhapCall lCall = _iis.readCall();
methodName = lCall.getOverloadMethodName();
LogHandler.log(LOGGER, INFO, toString() + " receive method call '" + methodName + "'");
if (methodName.equals("setChannelName_string")) {
handlerName = lCall.getArgs()[0].toString();
receiveThread.setName(handlerName);
} else if (_methodMap.containsKey(methodName)) {
Method lMethod = _methodMap.get(methodName);
Object[] args = lCall.getArgs();
returnValue = lMethod.invoke(mesService, args);
LogHandler.log(LOGGER, INFO, toString() + " return value ");
} else {
throw new NoSuchMethodException();
}
}
} catch (IhapProtocolException pe) {
if (pe.getMessage().endsWith("end of file")) {
throw pe;
}
fault = new ArtesRemoteException(toString() + "Unable to read client request", pe);
_ios.writeFaultReply(FaultCode.ProtocolException, fault);
} catch (NoSuchMethodException nsm) {
fault = new ArtesRemoteException(toString() + "Unknown method '" + methodName + "'");
_ios.writeFaultReply(FaultCode.NoSuchMethodException, fault);
} catch (IOException ioe) {
throw ioe;
} catch (Exception e) {
fault = e;
_ios.writeFaultReply(FaultCode.ServiceException, fault);
}
if (fault == null) {
_ios.writeSuccessReply(returnValue);
}
} catch (SocketException socketException) {
LogHandler.log(LOGGER, ERROR, toString() + " disconnected!");
shutdown();
} catch (IOException ioe) {
if (ioe.getMessage().endsWith("end of file")) {
LogHandler.log(LOGGER, ERROR, toString() + " disconnected!");
shutdown();
} else {
LogHandler.log(LOGGER, ERROR, toString() + ": Error receiving call:" + ioe.getMessage() + "\n", ioe);
}
throw ioe;
} finally {
try {
_ios.flush();
} catch (IOException ioe) {
}
}
}
@Override
public String toString() {
return "Handler " + handlerName + " on socket(" + _client.getRemoteSocketAddress() + ")";
}
}

View File

@@ -0,0 +1,144 @@
/*
* Copyright (c) 2010 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.datainterface.simulation.linedashboard;
import static com.itac.util.logging.LogLevel.ERROR;
import static com.itac.util.logging.LogLevel.INFO;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import com.itac.mes.linedashboard.IMesServices;
import com.itac.util.logging.LogHandler;
/**
* @author frankp created 2010
*/
public class SocketAdapter implements PropertyChangeListener {
/**
*
*/
private static final String LOGGER = SocketAdapter.class.getSimpleName();
private List<IhapServerEventHandler> serverChannels = new ArrayList<IhapServerEventHandler>();
private ServerSocket serverSocket = null;
private IMesServices mesServiceHandler = null;
private boolean isShutdown = false;
private Thread socketAdapterThread;
private int listeningPort;
public SocketAdapter(final int listeningPort, final IMesServices eventHandler) {
this.listeningPort = listeningPort;
if (!startServerSocket()) {
return;
}
this.mesServiceHandler = eventHandler;
start();
}
private boolean startServerSocket() {
LogHandler.log(LOGGER, INFO, "create socket listener for port " + listeningPort);
try {
serverSocket = new java.net.ServerSocket(listeningPort);
} catch (IOException e) {
LogHandler.log(LOGGER, ERROR, "no socket listener for port " + listeningPort + " created", e);
return false;
}
LogHandler.log(LOGGER, INFO, "Listen on port " + listeningPort);
return true;
}
/**
*
*/
public final void start() {
if (serverSocket == null || serverSocket.isClosed()) {
if (!startServerSocket()) {
return;
}
}
if (socketAdapterThread != null && !socketAdapterThread.isInterrupted()) {
LogHandler.log(LOGGER, INFO, "LineDashboardSocketAdapter already running");
return;
}
LogHandler.log(LOGGER, INFO, "Startup LineDashboardSocketAdapter ");
socketAdapterThread = new Thread("LineDashboardSocketAdapter") {
@SuppressWarnings("resource")
@Override
public void run() {
while (!isShutdown) {
Socket client = null;
try {
client = serverSocket.accept();
} catch (Exception e) {
break;
}
IhapServerEventHandler handler = new IhapServerEventHandler(client, mesServiceHandler, SocketAdapter.this);
serverChannels.add(handler);
LogHandler.log(LOGGER, INFO, "Incoming socket connection from " + client.getRemoteSocketAddress());
}
}
};
socketAdapterThread.start();
LogHandler.log(LOGGER, INFO, "Startup LineDashboardSocketAdapter finished.");
}
public final void stop() {
// wenn der AcceptThread nicht läuft einfach fertig
if (socketAdapterThread == null || socketAdapterThread.isInterrupted()) {
LogHandler.log(LOGGER, INFO, "no LineDashboardSocketAdapter running");
return;
}
socketAdapterThread.interrupt();
try {
serverSocket.close();
} catch (IOException e) {
LogHandler.log(LOGGER, ERROR, "closing LineDashboardSocketAdapter failed", e);
}
}
/**
*
*/
public final void shutdown() {
LogHandler.log(LOGGER, INFO, "shutdown LineDashboardSocketAdapter for incoming Channels from DataInterface");
isShutdown = true;
try {
serverSocket.close();
for (IhapServerEventHandler channel : serverChannels) {
channel.shutdown();
}
serverChannels.clear();
} catch (Exception e) {
}
LogHandler.log(LOGGER, INFO, "Listen port closed.");
}
@Override
public final void propertyChange(final PropertyChangeEvent evt) {
LogHandler.log(LOGGER, INFO, "removing " + evt.getSource().toString());
serverChannels.remove(evt.getSource());
LogHandler.log(LOGGER, INFO, serverChannels.size() + " remaining open channel(s)");
}
}

View File

@@ -0,0 +1,4 @@
com.itac.mes.datainterface.datasource.LineDashboardSource
com.itac.mes.datainterface.parser.LineDashboardParser
com.itac.mes.datainterface.process.LineDashboardProcessor
com.itac.mes.datainterface.simulation.LineDashboardSimulation

View File

@@ -0,0 +1,16 @@
package com.itac.mes.datainterface.data;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
public class LineDashboardDataUnitTest {
@Test
public void test() {
LineDashboardDataUnit lddu = new LineDashboardDataUnit();
assertNotNull(lddu);
assertNotNull(lddu.resultText);
}
}

View File

@@ -0,0 +1,131 @@
package com.itac.mes.datainterface.data;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.junit.Test;
import com.itac.mes.imsapi.domain.container.KeyValue;
import com.itac.mes.linedashboard.data.FailureData;
public class UploadPmQuantityUnitTest {
@Test
public void test1() {
UploadPmQuantityUnit out = new UploadPmQuantityUnit();
out.setFailureData(null);
// Keine Fehlerdaten, also erwartete Länge der Liste = 0
assertEquals("erwartete Länge der Daten ist 0", 0, out.getFailureDataUploadValues().length);
out.setFailureData(new ArrayList<FailureData>());
assertEquals("erwartete Länge der Daten ist nicht 0", 0, out.getFailureDataUploadValues().length);
List<FailureData> dataList = new ArrayList<FailureData>();
FailureData failureDataItem = new FailureData();
failureDataItem.setFailureCauseCode("causeCode");
failureDataItem.setFailureImageCode("imageCode");
failureDataItem.setFailureTypeCode("typeCode");
failureDataItem.setQuantityFailure(1);
failureDataItem.setQuantityRepair(1);
dataList.add(failureDataItem);
out.setFailureData(dataList);
assertEquals("erwartete Länge der Daten ist falsch (falsche Länge FailureUploadKeys)", out.getFailureDataUploadKeys().length,
out.getFailureDataUploadValues().length);
}
@Test
public void test2() {
UploadPmQuantityUnit out = new UploadPmQuantityUnit();
assertNotNull(out.getUploadResultKeys());
}
@Test
public void testHeaderValues() {
UploadPmQuantityUnit out = new UploadPmQuantityUnit();
assertNotNull(out.getStationNumber());
assertEquals("", out.getStationNumber());
out.setStationNumber("123");
assertEquals("123", out.getStationNumber());
out.setBookDate(new Date());
out.setProcessLayer(1);
out.setQuantityFail(12);
out.setQuantityFirstFail(13);
out.setQuantityFirstPass(14);
out.setQuantityFirstScrap(15);
out.setQuantityPass(16);
out.setQuantityScrap(17);
out.setWorkorderNumber("woNumber");
assertNotNull(out.getBookingFailureData());
assertEquals(9, out.getBookingFailureData().length);
assertEquals("1", out.getBookingFailureData()[1].value);
assertEquals("16", out.getBookingFailureData()[2].value);
assertEquals("12", out.getBookingFailureData()[3].value);
assertEquals("17", out.getBookingFailureData()[4].value);
assertEquals("13", out.getBookingFailureData()[5].value);
assertEquals("14", out.getBookingFailureData()[6].value);
assertEquals("15", out.getBookingFailureData()[7].value);
assertEquals("woNumber", out.getBookingFailureData()[8].value);
}
@Test
public void testGetPmFunctionValues() {
UploadPmQuantityUnit out = new UploadPmQuantityUnit();
assertEquals(5, out.getFailureDataFilters().length);
}
@Test
public void testGetPmFailureKeys() {
UploadPmQuantityUnit out = new UploadPmQuantityUnit();
assertEquals(5, out.getFailureDataResultKeys().length);
}
@Test
public void testGetPmFailureValues() {
UploadPmQuantityUnit out = new UploadPmQuantityUnit();
out.setFailureDataResultValues(null);
assertEquals(0, out.getFailureDataUploadValues().length);
out.setFailureDataResultValues(new String[0]);
assertEquals(0, out.getFailureDataUploadValues().length);
out.setFailureDataResultValues(new String[] { "123", "imageCode", "failureTypeCode", "10", "5" });
assertEquals(0, out.getFailureDataUploadValues().length);
}
@Test
public void testUploadPassValuesWithoutFailures() {
UploadPmQuantityUnit out = new UploadPmQuantityUnit();
out.setFailureData(null);
// Keine Fehlerdaten, also erwartete Länge der Liste = 0
assertEquals("erwartete Länge der Daten ist 0", 0, out.getFailureDataUploadValues().length);
out.setFailureData(new ArrayList<FailureData>());
assertEquals("erwartete Länge der Daten ist nicht 0", 0, out.getFailureDataUploadValues().length);
out.setQuantityPass(3000);
out.setQuantityFail(4000);
out.setQuantityScrap(5000);
out.setQuantityFirstPass(300);
out.setQuantityFirstFail(400);
out.setQuantityFirstScrap(500);
KeyValue[] bookingValues = out.getBookingFailureData();
assertEquals("erwartete Länge der Daten ist falsch (falsche Länge FailureUploadKeys)", 9,
out.getBookingFailureData().length);
assertEquals("3000", bookingValues[2].value);
assertEquals("4000", bookingValues[3].value);
assertEquals("5000", bookingValues[4].value);
assertEquals("400", bookingValues[5].value);
assertEquals("300", bookingValues[6].value);
assertEquals("500", bookingValues[7].value);
}
}

View File

@@ -0,0 +1,45 @@
package com.itac.mes.datainterface.data;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
public class UploadProductionDataUnitTest {
@Test
public void test() {
UploadProductionDataUnit out = new UploadProductionDataUnit();
assertNotNull(out);
assertNotNull(out.getStationNumber());
assertNotNull(out.getWorkOrderNumber());
assertNotNull(out.getSerialNumber());
assertNotNull(out.getSerialNumberPos());
out.setSerialNumber("snr");
out.setSerialNumberPos("pos");
out.setWorkOrderNumber("workOrderNumber");
out.setStationNumber("station");
assertEquals("station", out.getStationNumber());
assertEquals("workOrderNumber", out.getWorkOrderNumber());
assertEquals("snr", out.getSerialNumber());
assertEquals("pos", out.getSerialNumberPos());
out.setProcessLayer(2);
assertEquals(2, out.getProcessLayer());
out.setCycleTimeForMultipleBoard(44);
assertEquals(44, out.getCycleTimeForMultipleBoard());
out.setProcessType("xcv");
assertEquals("xcv", out.getProcessType());
out.setProdCycleTime(2.2d);
assertEquals(2.2d, out.getProdCycleTime(), 0.01d);
out.setSetupCycleTime(9.9d);
assertEquals(9.9d, out.getSetupCycleTime(), 0.01d);
}
}

View File

@@ -0,0 +1,69 @@
package com.itac.mes.datainterface.data;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import com.itac.mes.linedashboard.data.StationResult;
public class UploadStationResultUnitTest {
@Test
public void testUnsetValuesNotNull() {
// ohne irgend etwas zu setzen darf nichts null sein
UploadStationResultUnit out = new UploadStationResultUnit();
assertNotNull(out);
assertNotNull(out.getBomIndex());
assertNotNull(out.getBomVersionErp());
assertNotNull(out.getPartNumber());
assertNotNull(out.getStationNumber());
assertNotNull(out.getStationResultUploadKeys());
assertNotNull(out.getStationResultUploadValues());
assertNotNull(out.getWorkOrderNumber());
}
@Test
public void testFixValues() {
UploadStationResultUnit out = new UploadStationResultUnit();
assertEquals(0, out.getSerialUnitTrace());
assertEquals(-1, out.getBookDate());
assertEquals(-1, out.getBomVersion());
}
@Test
public void testNormalValues() {
// ohne irgend etwas zu setzen darf nichts null sein
UploadStationResultUnit out = new UploadStationResultUnit();
assertNotNull(out);
out.setStation("station");
assertNotNull(out.getStationNumber());
assertEquals("station", out.getStationNumber());
out.setWorkorder("workorderNumber");
assertEquals("workorderNumber", out.getWorkOrderNumber());
}
@Test
public void testListValues() {
// ohne irgend etwas zu setzen darf nichts null sein
UploadStationResultUnit out = new UploadStationResultUnit();
assertNotNull(out);
List<StationResult> list = new ArrayList<StationResult>();
out.setStationResults(list);
assertEquals(0, out.getStationResultUploadValues().length);
StationResult item = new StationResult();
item.setLowerLimit("-1");
list.add(item);
out.setStationResults(list);
assertEquals(out.getStationResultUploadKeys().length, out.getStationResultUploadValues().length);
}
}

View File

@@ -0,0 +1,332 @@
package com.itac.mes.datainterface.parser;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Test;
import com.itac.mes.datainterface.ConfigurationException;
import com.itac.mes.datainterface.DataInterfaceConfiguration;
import com.itac.mes.datainterface.data.BasicUploadUnit;
import com.itac.mes.datainterface.data.LineDashboardDataUnit;
import com.itac.mes.datainterface.data.Station;
import com.itac.mes.datainterface.data.Toolbox;
import com.itac.mes.datainterface.data.UploadSmtMachineDataUnit;
import com.itac.mes.datainterface.data.smt.ContainerQuantityAdjustment;
import com.itac.mes.datainterface.data.smt.Filter;
import com.itac.mes.datainterface.data.smt.InterlockingMechanism;
import com.itac.mes.datainterface.data.smt.LineSettings;
import com.itac.mes.datainterface.data.smt.PmMachine;
import com.itac.mes.datainterface.data.smt.PmSettings;
import com.itac.mes.datainterface.data.smt.SearchReplacePattern;
import com.itac.mes.datainterface.data.smt.SetupDetails;
import com.itac.mes.datainterface.data.smt.SmtConfiguration;
import com.itac.mes.datainterface.data.smt.SmtLineConfiguration;
import com.itac.mes.datainterface.data.smt.StationMessageDetails;
import com.itac.mes.datainterface.data.smt.TrMachine;
import com.itac.mes.datainterface.data.smt.TrSettings;
import com.itac.mes.datainterface.factories.AConfigurableHandler;
import com.itac.mes.datainterface.parser.IParser.Code;
import com.itac.mes.linedashboard.data.Machine;
import com.itac.mes.linedashboard.data.MachineStatusRequest;
import com.itac.mes.linedashboard.data.ProductionTimeRequest;
import com.itac.mes.linedashboard.data.StationResultRequest;
import junit.framework.Assert;
public class LineDashboardParserTest {
private static Filter containerFilter;
private static SearchReplacePattern containerPattern;
private static Filter componentFilter;
private static SearchReplacePattern componentPattern;
private static SmtLineConfiguration lineSettings;
private static LineSettings smtLineSettings;
@BeforeClass
public static void setupTestClass() throws Exception {
containerFilter = new Filter(false, "");
containerPattern = new SearchReplacePattern("containerfilter", true, ".*", "$0");
componentFilter = new Filter(false, "");
componentPattern = new SearchReplacePattern("componentPattern", true, ".*", "$0");
lineSettings = new SmtLineConfiguration();
try {
List<SmtLineConfiguration> lineConfigList = new ArrayList<SmtLineConfiguration>();
lineConfigList.add(lineSettings);
smtLineSettings = new LineSettings("line", false, false, ContainerQuantityAdjustment.OFF, null, true, true, true, true, false,
true, false, true, SetupDetails.CONTAINERS_ONLY, false, true);
TrSettings trSmtSettings = new TrSettings(false, true, "", "", false, false, true, true, InterlockingMechanism.OFF.toString(),
false, "", false, true);
TrMachine trMachine = new TrMachine(smtLineSettings, "machine1", ".*", ".*", ".*", ".*", trSmtSettings);
lineSettings.getSmtMachineListTR().add(trMachine);
PmSettings pmSmtSettings = new PmSettings(false, StationMessageDetails.NONE);
PmMachine pmMachine = new PmMachine(smtLineSettings, "pmmachine1", ".*", "SMT1", ".*", ".*", pmSmtSettings);
lineSettings.getSmtMachineListPM().add(pmMachine);
PmSettings pmSmtSettings2 = new PmSettings(true, StationMessageDetails.NONE);
PmMachine pmMachine2 = new PmMachine(smtLineSettings, "pmmachine2", ".*", "AOI", ".*", ".*", pmSmtSettings2);
lineSettings.getSmtMachineListPM().add(pmMachine2);
} catch (Exception e) {
}
}
private SmtConfiguration getSmtConfigMock() {
SmtConfiguration smtConfigMock = mock(SmtConfiguration.class);
// when(smtConfigMock.getLineConfiguration()).thenReturn(lineSettings);
when(smtConfigMock.getComponentFilter()).thenReturn(componentFilter);
when(smtConfigMock.getContainerFilter()).thenReturn(containerFilter);
when(smtConfigMock.getComponentPattern()).thenReturn(componentPattern);
when(smtConfigMock.getContainerPattern()).thenReturn(containerPattern);
when (smtConfigMock.getSmtMachineListTR()).thenReturn(lineSettings.getSmtMachineListTR());
when (smtConfigMock.getMachineListPM()).thenReturn(lineSettings.getSmtMachineListPM());
return smtConfigMock;
}
@Test
public void createDefaultConstructorShouldWork() {
LineDashboardParser out = new LineDashboardParser();
assertNotNull(out);
}
public DataInterfaceConfiguration getConfigMock() {
DataInterfaceConfiguration mockObject = mock(DataInterfaceConfiguration.class);
when(mockObject.getValue("parser.lineDashboard.lineBased", Boolean.class)).thenReturn(false);
when(mockObject.getValue("parser.lineDashboard.defaultStation", String.class)).thenReturn("machine1");
when(mockObject.getValue("parser.lineDashboard.durationFailureData", Integer.class)).thenReturn(12);
return mockObject;
}
public Toolbox getToolboxMock() {
Toolbox mockObject = mock(Toolbox.class);
when(mockObject.hasConditionMapping()).thenReturn(true);
when(mockObject.hasMessageMapping()).thenReturn(true);
when(mockObject.getStatus("PASS")).thenReturn(0);
when(mockObject.getLayer("_T")).thenReturn(0);
when(mockObject.getLayer("_B")).thenReturn(1);
when(mockObject.getLayer("_W")).thenReturn(3);
when(mockObject.getLayer(anyString())).thenReturn(-1);
when(mockObject.getConditionCode("2")).thenReturn("Fuji2");
when(mockObject.getConditionCode("3")).thenReturn("Fuji3");
when(mockObject.getMessageCode("1")).thenReturn("Fuji_R1");
when(mockObject.getMessageCode("4")).thenReturn("-1");
when(mockObject.getMessageCode("5")).thenReturn("Fuji_R5");
when(mockObject.getFailcode("0")).thenReturn(0);
when(mockObject.getStation("Machine1")).thenReturn(new Station("Machine1", "12012010", false));
when(mockObject.getStation("machine1")).thenReturn(new Station("machine1", "12012010", false));
when(mockObject.getStation("Machine2")).thenReturn(new Station("Machine2", "12012011", false));
when(mockObject.getStation("pmmachine1")).thenReturn(new Station("pmmachine1", "12012011", false));
when(mockObject.getStation("pmmachine2")).thenReturn(new Station("pmmachine2", "12012012", false));
return mockObject;
}
@Test
public void testNormalParse() throws IllegalAccessException, InvocationTargetException, ConfigurationException {
LineDashboardParser out = new LineDashboardParser();
out.setHandler(getConfigMock(), DataInterfaceConfiguration.class);
out.setHandler(getSmtConfigMock(), SmtConfiguration.class);
out.setHandler(getToolboxMock(), Toolbox.class);
out.configure();
out.callAtInit();
assertEquals(out.getConfigurationText(), AConfigurableHandler.OK, out.getConfigurationResult());
assertNotNull(out);
Assert.assertEquals(AConfigurableHandler.OK, out.getConfigurationResult());
Assert.assertEquals(Code.NOT_IMPLEMENTED,
out.parse(new StringBuffer(), "", new ArrayList<BasicUploadUnit>(), new StringBuffer()));
}
@Test
public void testUnconfiguredParser() throws IllegalAccessException, InvocationTargetException, ConfigurationException {
LineDashboardParser out = new LineDashboardParser();
out.setHandler(getConfigMock(), DataInterfaceConfiguration.class);
out.setHandler(getSmtConfigMock(), SmtConfiguration.class);
out.setHandler(getToolboxMock(), Toolbox.class);
assertEquals(out.getConfigurationText(), AConfigurableHandler.CONFIGURATION_NOT_CHECKED, out.getConfigurationResult());
assertNotNull(out);
LineDashboardDataUnit lineDashboardDataUnit = new LineDashboardDataUnit();
try {
out.parse(new ProductionTimeRequest(), lineDashboardDataUnit);
fail("no exception thrown");
} catch (LineDashboardParserException cpe) {
assertEquals(Code.PARSE_ERROR, cpe.getCode());
assertEquals(-10010, cpe.getResultCode());
}
}
@Test
public void testParseProductionData() throws IllegalAccessException, InvocationTargetException, ConfigurationException {
LineDashboardParser out = new LineDashboardParser();
out.setHandler(getConfigMock(), DataInterfaceConfiguration.class);
out.setHandler(getSmtConfigMock(), SmtConfiguration.class);
out.setHandler(getToolboxMock(), Toolbox.class);
out.configure();
out.callAtInit();
assertEquals(out.getConfigurationText(), AConfigurableHandler.OK, out.getConfigurationResult());
assertNotNull(out);
// ohne dass checkConfig aufgerufen wurde muessen alle parse-Methoden -10010 liefern
LineDashboardDataUnit lineDashboardDataUnit = new LineDashboardDataUnit();
try {
out.parse(new ProductionTimeRequest(), lineDashboardDataUnit);
fail("no exception thrown");
} catch (LineDashboardParserException cpe) {
assertEquals(Code.PARSE_ERROR, cpe.getCode());
assertEquals(-10600, cpe.getResultCode());
}
ProductionTimeRequest pdr = new ProductionTimeRequest();
pdr.setMachine(new Machine());
// simples abbilden der Maschine
pdr.getMachine().setMachineName("machine1");
pdr.getMachine().setModuleName("*");
pdr.getMachine().setLane("*");
pdr.getMachine().setLineName("*");
pdr.setProcessType("M");
pdr.setWorkorder("emptyWorkorder");
try {
out.parse(pdr, lineDashboardDataUnit);
} catch (LineDashboardParserException cpe) {
assertEquals(Code.PARSE_ERROR, cpe.getCode());
assertEquals(-11000, cpe.getResultCode());
}
}
@Test
public void testMissingField() throws IllegalAccessException, InvocationTargetException, ConfigurationException {
LineDashboardParser out = new LineDashboardParser();
out.setHandler(getConfigMock(), DataInterfaceConfiguration.class);
out.setHandler(getSmtConfigMock(), SmtConfiguration.class);
out.setHandler(getToolboxMock(), Toolbox.class);
out.configure();
out.callAtInit();
assertEquals(out.getConfigurationText(), AConfigurableHandler.OK, out.getConfigurationResult());
assertNotNull(out);
// ohne dass checkConfig aufgerufen wurde muessen alle parse-Methoden -10010 liefern
LineDashboardDataUnit lineDashboardDataUnit = new LineDashboardDataUnit();
ProductionTimeRequest pdr = new ProductionTimeRequest();
pdr.setMachine(new Machine());
// simples abbilden der Maschine
pdr.getMachine().setMachineName("machine1");
pdr.getMachine().setModuleName("*");
pdr.getMachine().setLane("*");
pdr.getMachine().setLineName("*");
try {
out.parse(pdr, lineDashboardDataUnit);
} catch (LineDashboardParserException cpe) {
assertEquals(Code.PARSE_ERROR, cpe.getCode());
assertEquals(-10601, cpe.getResultCode());
}
pdr.setWorkorder("undefWorkorder");
try {
out.parse(pdr, lineDashboardDataUnit);
} catch (LineDashboardParserException cpe) {
assertEquals(Code.PARSE_ERROR, cpe.getCode());
assertEquals(-11000, cpe.getResultCode());
}
pdr.setProcessType("M");
try {
out.parse(pdr, lineDashboardDataUnit);
} catch (LineDashboardParserException cpe) {
assertEquals(Code.PARSE_ERROR, cpe.getCode());
assertEquals(-11000, cpe.getResultCode());
}
}
@Test
public void testParseStationResultRequest()
throws LineDashboardParserException, IllegalAccessException, InvocationTargetException, ConfigurationException {
LineDashboardParser out = new LineDashboardParser();
out.setHandler(getConfigMock(), DataInterfaceConfiguration.class);
out.setHandler(getSmtConfigMock(), SmtConfiguration.class);
out.setHandler(getToolboxMock(), Toolbox.class);
out.configure();
out.callAtInit();
assertEquals(out.getConfigurationText(), AConfigurableHandler.OK, out.getConfigurationResult());
StationResultRequest stationResultRequest = new StationResultRequest();
stationResultRequest.setEventDate(new Date());
stationResultRequest.setMachine(new Machine());
// simples abbilden der Maschine
stationResultRequest.getMachine().setMachineName("machine1");
stationResultRequest.getMachine().setModuleName("*");
stationResultRequest.getMachine().setLane("*");
stationResultRequest.getMachine().setLineName("*");
stationResultRequest.setPartNumber("partNo");
stationResultRequest.setRequestId(12334);
stationResultRequest.setWorkorder("workorder");
LineDashboardDataUnit lineDashboardDataUnit = new LineDashboardDataUnit();
out.parse(stationResultRequest, lineDashboardDataUnit);
}
@Test(expected = LineDashboardParserException.class)
public void testAssertNull()
throws LineDashboardParserException, IllegalAccessException, InvocationTargetException, ConfigurationException {
LineDashboardParser out = new LineDashboardParser();
out.setHandler(getConfigMock(), DataInterfaceConfiguration.class);
out.setHandler(getSmtConfigMock(), SmtConfiguration.class);
out.setHandler(getToolboxMock(), Toolbox.class);
out.configure();
out.callAtInit();
assertEquals(out.getConfigurationText(), AConfigurableHandler.OK, out.getConfigurationResult());
assertNotNull(out);
// ohne dass checkConfig aufgerufen wurde muessen alle parse-Methoden -10010 liefern
LineDashboardDataUnit lineDashboardDataUnit = new LineDashboardDataUnit();
out.parse((ProductionTimeRequest) null, lineDashboardDataUnit);
}
@Test
public void testParseMachineStatusRequest()
throws LineDashboardParserException, IllegalAccessException, InvocationTargetException, ConfigurationException {
LineDashboardParser out = new LineDashboardParser();
out.setHandler(getConfigMock(), DataInterfaceConfiguration.class);
out.setHandler(getSmtConfigMock(), SmtConfiguration.class);
out.setHandler(getToolboxMock(), Toolbox.class);
out.configure();
out.callAtInit();
assertEquals(out.getConfigurationText(), AConfigurableHandler.OK, out.getConfigurationResult());
assertNotNull(out);
MachineStatusRequest machineStatusRequest = new MachineStatusRequest();
machineStatusRequest.setEventDate(new Date());
machineStatusRequest.setMachine(new Machine());
// simples abbilden der Maschine
machineStatusRequest.getMachine().setMachineName("AOI");
machineStatusRequest.getMachine().setModuleName("*");
machineStatusRequest.getMachine().setLane("*");
machineStatusRequest.getMachine().setLineName("*");
machineStatusRequest.setRequestId(12334);
machineStatusRequest.setStatus("newState");
LineDashboardDataUnit lineDashboardDataUnit = new LineDashboardDataUnit();
out.parse(machineStatusRequest, lineDashboardDataUnit);
Assert.assertEquals("12012012", ((UploadSmtMachineDataUnit) lineDashboardDataUnit.uploadUnitList.get(0)).getStationNo());
}
}

View File

@@ -0,0 +1,39 @@
package com.itac.mes.linedashboard;
import java.util.Date;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import org.junit.Test;
import com.itac.mes.linedashboard.data.Machine;
import com.itac.mes.linedashboard.data.MachineStatusRequest;
public class MachineStatusTest {
@Test
public void testSerializing() throws IllegalArgumentException, XMLStreamException, IllegalAccessException, JAXBException {
MachineStatusRequest out = new MachineStatusRequest();
out.setMachine(new Machine());
out.getMachine().setLineName("line!");
out.getMachine().setMachineName("machinename");
out.getMachine().setModuleName("");
out.getMachine().setLane("1");
out.setRequestId(123);
out.setStatus("producing");
out.setEventDate(new Date());
JAXBContext jc = JAXBContext.newInstance(new Class[] { MachineStatusRequest.class });
Marshaller marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
@SuppressWarnings({ "rawtypes", "unchecked" })
JAXBElement<?> jexbelement = new JAXBElement(new QName("MachineStatusRequest"), MachineStatusRequest.class, out);
marshaller.marshal(jexbelement, System.out);
}
}

View File

@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: frankp
Build-Jdk: 1.8.0_111
Created-By: Maven Integration for Eclipse

View File

@@ -0,0 +1,7 @@
#Generated by Maven Integration for Eclipse
#Tue Oct 13 14:05:20 CEST 2020
version=9.10.00beta-DEVELOPER
groupId=com.itac.interface.interfaces
m2e.projectName=data-interface-line-dashboard-interface
m2e.projectLocation=C\:\\projects_jee\\imsinterface\\mainline\\interface\\linedashboard\\interface
artifactId=data-interface-line-dashboard-interface

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-interface</artifactId>
<packaging>jar</packaging>
<name>data-interface-line-dashboard-interface</name>
<version>${mes.interface.version}</version>
<parent>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard</artifactId>
<version>${mes.interface.version}</version>
</parent>
<dependencies>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-plugin</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-core</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-config-bundle</artifactId>
</dependency>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>api-structs</artifactId>
</dependency>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>api-common</artifactId>
</dependency>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-common</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-basic</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-xmlapi</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-testcenter</artifactId>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>jgoodies-looks</artifactId>
</dependency>
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>jgoodies-forms</artifactId>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-client</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,4 @@
com.itac.mes.datainterface.datasource.LineDashboardSource
com.itac.mes.datainterface.parser.LineDashboardParser
com.itac.mes.datainterface.process.LineDashboardProcessor
com.itac.mes.datainterface.simulation.LineDashboardSimulation

View File

@@ -0,0 +1,5 @@
#Generated by Maven
#Tue Jun 12 15:24:36 CEST 2018
version=9.00.01alpha-DEVELOPER
groupId=com.itac.interface.interfaces
artifactId=data-interface-line-dashboard-interface

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="com.itac.mes.datainterface.data.LineDashboardDataUnitTest" time="0.109" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\bin"/>
<property name="java.vm.version" value="25.111-b14"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=";"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.script" value=""/>
<property name="user.country" value="DE"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value=""/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.runtime.version" value="1.8.0_111-b14"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\endorsed"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="C:\Users\frankp\AppData\Local\Temp\"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="C:\maven\apache-maven-3.3.3\bin\..\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\MKS\IntegrityClient\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MKS\Toolkit\mksnt;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\maven\maven;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\frankp\AppData\Local\Microsoft\WindowsApps;C:\Users\frankp\AppData\Roaming\npm;c:\Program Files\nodejs\;."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="user.home" value="C:\Users\frankp"/>
<property name="user.timezone" value="Europe/Berlin"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="Cp1252"/>
<property name="user.name" value="frankp"/>
<property name="java.class.path" value="C:\maven\apache-maven-3.3.3\bin\..\boot\plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_111\jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher clean install -rf :data-interface-fuji"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="de"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_111"/>
<property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\classes"/>
<property name="sun.stderr.encoding" value="cp850"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="C:\maven\apache-maven-3.3.3\bin\.."/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="com.itac.mes.datainterface.data.LineDashboardDataUnitTest" name="test" time="0"/>
</testsuite>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="7" failures="0" name="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" time="0.282" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\bin"/>
<property name="java.vm.version" value="25.111-b14"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=";"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.script" value=""/>
<property name="user.country" value="DE"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value=""/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.runtime.version" value="1.8.0_111-b14"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\endorsed"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="C:\Users\frankp\AppData\Local\Temp\"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="C:\maven\apache-maven-3.3.3\bin\..\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\MKS\IntegrityClient\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MKS\Toolkit\mksnt;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\maven\maven;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\frankp\AppData\Local\Microsoft\WindowsApps;C:\Users\frankp\AppData\Roaming\npm;c:\Program Files\nodejs\;."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="user.home" value="C:\Users\frankp"/>
<property name="user.timezone" value="Europe/Berlin"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="Cp1252"/>
<property name="user.name" value="frankp"/>
<property name="java.class.path" value="C:\maven\apache-maven-3.3.3\bin\..\boot\plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_111\jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher clean install -rf :data-interface-fuji"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="de"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_111"/>
<property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\classes"/>
<property name="sun.stderr.encoding" value="cp850"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="C:\maven\apache-maven-3.3.3\bin\.."/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" name="testUploadPassValuesWithoutFailures" time="0.157"/>
<testcase classname="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" name="testGetPmFailureValues" time="0.125"/>
<testcase classname="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" name="testGetPmFailureKeys" time="0"/>
<testcase classname="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" name="testGetPmFunctionValues" time="0"/>
<testcase classname="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" name="test2" time="0"/>
<testcase classname="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" name="test1" time="0"/>
<testcase classname="com.itac.mes.datainterface.data.UploadPmQuantityUnitTest" name="testHeaderValues" time="0"/>
</testsuite>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="com.itac.mes.datainterface.data.UploadProductionDataUnitTest" time="0.016" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\bin"/>
<property name="java.vm.version" value="25.111-b14"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=";"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.script" value=""/>
<property name="user.country" value="DE"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value=""/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.runtime.version" value="1.8.0_111-b14"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\endorsed"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="C:\Users\frankp\AppData\Local\Temp\"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="C:\maven\apache-maven-3.3.3\bin\..\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\MKS\IntegrityClient\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MKS\Toolkit\mksnt;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\maven\maven;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\frankp\AppData\Local\Microsoft\WindowsApps;C:\Users\frankp\AppData\Roaming\npm;c:\Program Files\nodejs\;."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="user.home" value="C:\Users\frankp"/>
<property name="user.timezone" value="Europe/Berlin"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="Cp1252"/>
<property name="user.name" value="frankp"/>
<property name="java.class.path" value="C:\maven\apache-maven-3.3.3\bin\..\boot\plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_111\jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher clean install -rf :data-interface-fuji"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="de"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_111"/>
<property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\classes"/>
<property name="sun.stderr.encoding" value="cp850"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="C:\maven\apache-maven-3.3.3\bin\.."/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="com.itac.mes.datainterface.data.UploadProductionDataUnitTest" name="test" time="0.016"/>
</testsuite>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="4" failures="0" name="com.itac.mes.datainterface.data.UploadStationResultUnitTest" time="0.141" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\bin"/>
<property name="java.vm.version" value="25.111-b14"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=";"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.script" value=""/>
<property name="user.country" value="DE"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value=""/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.runtime.version" value="1.8.0_111-b14"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\endorsed"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="C:\Users\frankp\AppData\Local\Temp\"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="C:\maven\apache-maven-3.3.3\bin\..\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\MKS\IntegrityClient\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MKS\Toolkit\mksnt;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\maven\maven;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\frankp\AppData\Local\Microsoft\WindowsApps;C:\Users\frankp\AppData\Roaming\npm;c:\Program Files\nodejs\;."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="user.home" value="C:\Users\frankp"/>
<property name="user.timezone" value="Europe/Berlin"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="Cp1252"/>
<property name="user.name" value="frankp"/>
<property name="java.class.path" value="C:\maven\apache-maven-3.3.3\bin\..\boot\plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_111\jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher clean install -rf :data-interface-fuji"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="de"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_111"/>
<property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\classes"/>
<property name="sun.stderr.encoding" value="cp850"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="C:\maven\apache-maven-3.3.3\bin\.."/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="com.itac.mes.datainterface.data.UploadStationResultUnitTest" name="testUnsetValuesNotNull" time="0.141"/>
<testcase classname="com.itac.mes.datainterface.data.UploadStationResultUnitTest" name="testNormalValues" time="0"/>
<testcase classname="com.itac.mes.datainterface.data.UploadStationResultUnitTest" name="testFixValues" time="0"/>
<testcase classname="com.itac.mes.datainterface.data.UploadStationResultUnitTest" name="testListValues" time="0"/>
</testsuite>

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="8" failures="0" name="com.itac.mes.datainterface.parser.LineDashboardParserTest" time="0.594" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\bin"/>
<property name="java.vm.version" value="25.111-b14"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=";"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.script" value=""/>
<property name="user.country" value="DE"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value=""/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.runtime.version" value="1.8.0_111-b14"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\endorsed"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="C:\Users\frankp\AppData\Local\Temp\"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="C:\maven\apache-maven-3.3.3\bin\..\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\MKS\IntegrityClient\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MKS\Toolkit\mksnt;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\maven\maven;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\frankp\AppData\Local\Microsoft\WindowsApps;C:\Users\frankp\AppData\Roaming\npm;c:\Program Files\nodejs\;."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="user.home" value="C:\Users\frankp"/>
<property name="user.timezone" value="Europe/Berlin"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="Cp1252"/>
<property name="user.name" value="frankp"/>
<property name="java.class.path" value="C:\maven\apache-maven-3.3.3\bin\..\boot\plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_111\jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher clean install -rf :data-interface-fuji"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="de"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_111"/>
<property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\classes"/>
<property name="sun.stderr.encoding" value="cp850"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="C:\maven\apache-maven-3.3.3\bin\.."/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="createDefaultConstructorShouldWork" time="0.016"/>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="testParseStationResultRequest" time="0.515"/>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="testUnconfiguredParser" time="0"/>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="testParseProductionData" time="0.016"/>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="testParseMachineStatusRequest" time="0.015"/>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="testAssertNull" time="0.016"/>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="testMissingField" time="0.016"/>
<testcase classname="com.itac.mes.datainterface.parser.LineDashboardParserTest" name="testNormalParse" time="0"/>
</testsuite>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="com.itac.mes.linedashboard.MachineStatusTest" time="0.156" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\bin"/>
<property name="java.vm.version" value="25.111-b14"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=";"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.script" value=""/>
<property name="user.country" value="DE"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value=""/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="C:\projects_jee\imsinterface\mainline"/>
<property name="java.runtime.version" value="1.8.0_111-b14"/>
<property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\endorsed"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="C:\Users\frankp\AppData\Local\Temp\"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="user.variant" value=""/>
<property name="os.name" value="Windows 10"/>
<property name="classworlds.conf" value="C:\maven\apache-maven-3.3.3\bin\..\bin\m2.conf"/>
<property name="sun.jnu.encoding" value="Cp1252"/>
<property name="java.library.path" value="C:\Program Files\Java\jdk1.8.0_111\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\MKS\IntegrityClient\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MKS\Toolkit\mksnt;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\maven\maven;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\frankp\AppData\Local\Microsoft\WindowsApps;C:\Users\frankp\AppData\Roaming\npm;c:\Program Files\nodejs\;."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.0"/>
<property name="user.home" value="C:\Users\frankp"/>
<property name="user.timezone" value="Europe/Berlin"/>
<property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="Cp1252"/>
<property name="user.name" value="frankp"/>
<property name="java.class.path" value="C:\maven\apache-maven-3.3.3\bin\..\boot\plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="C:\Program Files\Java\jdk1.8.0_111\jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher clean install -rf :data-interface-fuji"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="de"/>
<property name="awt.toolkit" value="sun.awt.windows.WToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_111"/>
<property name="java.ext.dirs" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext"/>
<property name="sun.boot.class.path" value="C:\Program Files\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_111\jre\classes"/>
<property name="sun.stderr.encoding" value="cp850"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="maven.home" value="C:\maven\apache-maven-3.3.3\bin\.."/>
<property name="file.separator" value="\"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.desktop" value="windows"/>
<property name="sun.cpu.isalist" value="amd64"/>
</properties>
<testcase classname="com.itac.mes.linedashboard.MachineStatusTest" name="testSerializing" time="0.156"/>
</testsuite>

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.itac.mes.datainterface.data.LineDashboardDataUnitTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.109 sec

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.itac.mes.datainterface.data.UploadPmQuantityUnitTest
-------------------------------------------------------------------------------
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.36 sec

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.itac.mes.datainterface.data.UploadProductionDataUnitTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.094 sec

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.itac.mes.datainterface.data.UploadStationResultUnitTest
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.219 sec

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.itac.mes.datainterface.parser.LineDashboardParserTest
-------------------------------------------------------------------------------
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.438 sec

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.itac.mes.linedashboard.MachineStatusTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.234 sec

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>data-interface-line-dashboard-plugin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding/<project>=UTF-8

View File

@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="data-interface-line-dashboard-plugin">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
</wb-module>
</project-modules>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="java" version="1.8"/>
<installed facet="jst.utility" version="1.0"/>
</faceted-project>

View File

@@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-plugin</artifactId>
<packaging>jar</packaging>
<name>data-interface-line-dashboard-plugin</name>
<version>${mes.interface.version}</version>
<parent>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard</artifactId>
<version>${mes.interface.version}</version>
</parent>
<dependencies>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-common</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.linedashboard</groupId>
<artifactId>linedashboard-api</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-core-definition</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>create-project-bundle</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
<execution>
<id>zippackaging</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<classifier>zip</classifier>
<descriptors>
<descriptor>src/main/assembly/descriptor.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,21 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory/>
<includes>
<include>*dependencies*.jar</include>
</includes>
<excludes>
<exclude>*.zip</exclude>
</excludes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -0,0 +1,14 @@
package com.itac.mes.linedashboard;
public interface IMesServicesChannel extends IMesServices {
public boolean isShutdown();
public void startup();
public void shutdown();
public String getChannelName();
public void setChannelName(String channelName);
}

View File

@@ -0,0 +1,19 @@
package com.itac.mes.linedashboard;
public class LineDashboardException extends Exception {
/**
*
*/
private static final long serialVersionUID = -9180600020616111590L;
private ResponseDetail responseDetail;
public LineDashboardException(ResponseDetail responseDetail) {
this.responseDetail = responseDetail;
}
public ResponseDetail getResponseDetail() {
return responseDetail;
}
}

View File

@@ -0,0 +1,28 @@
package com.itac.mes.linedashboard;
public interface LineDashboardFields {
public static final String EVENT_DATE = "eventDate";
public static final String STATUS = "status";
public static final String MESSAGE_DETAIL = "messageDetail";
public static final String MESSAGE_STOP = "messageStop";
public static final String MESSAGE_START = "messageStart";
public static final String MESSAGE_CODE = "messageCode";
public static final String END_PRODUCTION = "endProduction";
public static final String START_PRODUCTION = "startProduction";
public static final String STATE = "state";
public static final String OPERATION = "operation";
public static final String LANE = "lane";
public static final String LINE_NAME = "lineName";
public static final String MACHINE_NAME = "machineName";
public static final String MACHINE = "machine";
public static final String MODULE_NAME = "moduleName";
public static final String WORKORDER = "workOrder";
public static final String PROCESS_LAYER = "processLayer";
public static final String PROCESS_TYPE = "processType";
public static final String STATION_RESULTS = "stationResults";
}

View File

@@ -0,0 +1,426 @@
/*
* Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.linedashboard;
import static com.itac.mes.linedashboard.ResponseDetail.OK;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Date;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.namespace.QName;
import com.itac.mes.linedashboard.data.ErrorDetail;
import com.itac.mes.linedashboard.data.MachineStatusRequest;
import com.itac.mes.linedashboard.data.MesConfigurationResponse;
import com.itac.mes.linedashboard.data.MesRequest;
import com.itac.mes.linedashboard.data.MesResponse;
import com.itac.mes.linedashboard.data.MesStartRequest;
import com.itac.mes.linedashboard.data.ProductionTimeRequest;
import com.itac.mes.linedashboard.data.QuantityAndFailureUploadRequest;
import com.itac.mes.linedashboard.data.StationResultRequest;
import com.itac.mes.linedashboard.sockets.IhapHandler;
/**
* @author frankp created 2013
*/
public class MesServices implements IMesServices {
private static String LOG_PREFIX = "ImsInterfaces LineDashboard-Plugin > ";
private static final int MIN_REQUEST_ID = 0;
private static final int MAX_REQUEST_ID = 1000000;
private static final int MIN_PORT = 1023;
private static final int MAX_PORT = 49150;
private boolean isConfigured;
private boolean isActive;
private boolean isConnected;
private String sHost;
private int iPort;
private int requestId;
private boolean logDetails = false; // default keine details loggen
private PropertyChangeListener interfaceConnectionListener;
private IMesServices interfaceConnection;
private Marshaller marshaller;
public MesServices() {
isConfigured = false;
isConnected = false;
requestId = 0;
}
/**
* Vorbedingungen sind dass der Request gesetzt ist, sowie die Konfiguration und die aktivierung des Plugin
*
* @param mesResponse
* @param mesRequest
* @throws LineDashboardException
*/
private void checkPreconditions(MesResponse mesResponse, MesRequest mesRequest) throws LineDashboardException {
if (mesRequest == null) {
throw new LineDashboardException(ResponseDetail.REQUEST_IS_NULL);
}
if (mesRequest.getRequestId() <= 0) {
mesRequest.setRequestId(getRequestId());
}
if (mesRequest.getEventDate() == null) {
mesRequest.setEventDate(new Date());
}
// Request ausgeben
logRequest(mesRequest);
// requestId aus Request in den Response uebernehmen
mesResponse.setRequestId(mesRequest.getRequestId());
// Konfigurationsprobleme checken
if (!isConfigured) {
throw new LineDashboardException(ResponseDetail.PLUGIN_NOT_CONFIGURED);
}
if (!isActive) {
throw new LineDashboardException(ResponseDetail.PLUGIN_NOT_ACTIVE);
}
if (!isConnected) {
throw new LineDashboardException(ResponseDetail.PLUGIN_NOT_CONNECTED);
}
setResponseValues(mesResponse, OK);
}
/**
* finalizing means closing communication channel and loggin response Object
*
* @param connection
* the used connection
* @param responseObject
* the responseObject
*/
private void finalizeRequest(IMesServicesChannel connection, MesResponse responseObject) {
if (connection != null) {
connection.shutdown();
}
logResponse(responseObject);
}
/**
* gets a new communication cahnnel with specified name
*
* @param channelName
* the name for the channel
* @param connectionListener
* @return
* @throws IOException
*/
private IMesServicesChannel getConnection(String channelName, PropertyChangeListener connectionListener) throws IOException {
IMesServicesChannel serviceChannel = IhapHandler.connect(sHost, iPort, channelName, connectionListener,
IMesServicesChannel.class.getClassLoader(), null);
// Kanal Ueberwachung starten
serviceChannel.startup();
isConnected = true;
return serviceChannel;
}
// convenient method
private ErrorDetail getErrorDetail(String detail, int code) {
ErrorDetail errorDetail = new ErrorDetail();
errorDetail.setCode(code);
errorDetail.setDetail(detail);
return errorDetail;
}
// creates an almost unique id
private int getRequestId() {
requestId += 1;
if (requestId >= MAX_REQUEST_ID) {
requestId = MIN_REQUEST_ID;
}
return requestId;
}
private void handleThrowable(MesResponse response, Throwable throwable) {
response.setTotalResult(IMesServices.MES_RESULT_NOT_OK);
if (throwable instanceof LineDashboardException) {
setResponseValues(response, ((LineDashboardException) throwable).getResponseDetail());
} else if (throwable instanceof IOException) {
response.getErrorDetails().add(getErrorDetail(throwable.getMessage(), ResponseDetail.COMMUNICATION_FAILURE.getCode()));
} else {
response.getErrorDetails().add(getErrorDetail(throwable.getMessage(), ResponseDetail.PROCESSED_WITH_EXCEPTION.getCode()));
throwable.printStackTrace();
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void logResponse(MesResponse mesResponse) {
if (mesResponse == null) {
System.out.println(LOG_PREFIX + "finish empty request");
return;
}
System.out.println(LOG_PREFIX + "finish request " + mesResponse.getRequestId() + " with code " + mesResponse.getTotalResult());
if (logDetails) {
try {
System.out.print(LOG_PREFIX);
JAXBElement<?> jexbelement = new JAXBElement(new QName(mesResponse.getClass().getSimpleName()), mesResponse.getClass(),
mesResponse);
marshaller.marshal(jexbelement, System.out);
} catch (Throwable e) {
System.out.print("-> Error logging mesResponse details");
} finally {
System.out.println();
}
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void logRequest(MesRequest mesRequest) {
System.out
.print(LOG_PREFIX + "start request " + mesRequest.getRequestId() + " (" + mesRequest.getClass().getSimpleName() + ")");
if (logDetails) {
try {
JAXBElement<?> jexbelement = new JAXBElement(new QName(mesRequest.getClass().getSimpleName()), mesRequest.getClass(),
mesRequest);
marshaller.marshal(jexbelement, System.out);
} catch (Throwable e) {
System.out.print("-> Error logging mesRequest details");
}
}
System.out.println();
}
private void setResponseValues(MesResponse response, ResponseDetail responseDetail) {
if (responseDetail == ResponseDetail.OK) {
response.setTotalResult(IMesServices.MES_RESULT_OK);
return;
}
response.setTotalResult(IMesServices.MES_RESULT_NOT_OK);
response.getErrorDetails().add(getErrorDetail(responseDetail.getText(), responseDetail.getCode()));
}
@Override
public MesResponse mesMachineState(MachineStatusRequest machineStatus) {
MesResponse responseObject = new MesResponse();
IMesServicesChannel connection = null;
try {
checkPreconditions(responseObject, machineStatus);
connection = getConnection("machineStatus", null);
responseObject = connection.mesMachineState(machineStatus);
} catch (Throwable throwable) {
handleThrowable(responseObject, throwable);
} finally {
finalizeRequest(connection, responseObject);
}
return responseObject;
}
@Override
public MesResponse mesStart(MesRequest mesRequest) {
MesStartRequest mesStart = new MesStartRequest();
mesStart.setRequestId(mesRequest.getRequestId());
mesStart.setEventDate(mesRequest.getEventDate());
return mesStart(mesStart);
}
@Override
public MesResponse mesStart(MesStartRequest mesRequest) {
MesResponse responseObject = new MesResponse();
try {
// zuerst die properties pruefen und Werte uebernehmen
if (System.getProperties().containsKey(MES_LOG_PREFIX)) {
LOG_PREFIX = System.getProperty(MES_LOG_PREFIX);
}
if (System.getProperties().containsKey(MES_LOG_DETAILS)) {
String sLogDetails = System.getProperty(MES_LOG_DETAILS);
logDetails = sLogDetails.equalsIgnoreCase(Boolean.TRUE.toString()) || sLogDetails.equals("1");
}
if (logDetails && marshaller == null) {
// alle Klassen aus diesem Package...
Class<?>[] classes = new Class[] { MachineStatusRequest.class, ProductionTimeRequest.class, StationResultRequest.class,
QuantityAndFailureUploadRequest.class, MesConfigurationResponse.class, MesRequest.class, MesResponse.class };
JAXBContext jc;
try {
jc = JAXBContext.newInstance(classes);
marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
} catch (JAXBException e) {
System.err.println(LOG_PREFIX + "no jaxb context or marshaller created");
responseObject.getErrorDetails().add(getErrorDetail("no jaxb context or marshaller created", -1));
}
} else {
// wenn das detailled loggin ausgeschlaten wurde auch den marshaller killen; bei erneutem mesStart call wird ein
// neuer marshaller erzeugt
marshaller = null;
}
// ab jetzt fachlich checken
if (mesRequest == null) {
throw new LineDashboardException(ResponseDetail.REQUEST_IS_NULL);
}
if (isActive) {
setResponseValues(responseObject, ResponseDetail.OK);
return responseObject;
}
if (!isConfigured) {
boolean ok = true;
try {
sHost = System.getProperty(MesServices.MES_HOST).toString();
} catch (Exception exception) {
String err = MessageFormat.format("{0}setting value for property {1} failed", LOG_PREFIX, MES_HOST);
System.err.println(err);
responseObject.getErrorDetails().add(getErrorDetail(err, -1));
ok = false;
}
try {
String sPort = System.getProperty(MesServices.MES_PORT).toString();
iPort = Integer.parseInt(sPort);
if ((iPort < MIN_PORT) || (iPort > MAX_PORT)) {
String err = MessageFormat.format("{0}setting value for property {1} failed, value {2} is out of range {3}..{4}",
LOG_PREFIX, MES_PORT, sPort, MIN_PORT, MAX_PORT);
System.err.println(err);
responseObject.getErrorDetails().add(getErrorDetail(err, -1));
ok = false;
}
} catch (Exception exception) {
String err = MessageFormat.format("{0}setting value for property {1} failed:{2}", LOG_PREFIX, MES_PORT,
exception.getClass().getSimpleName());
System.err.println(err);
responseObject.getErrorDetails().add(getErrorDetail(err, -1));
ok = false;
}
if (!ok) {
throw new LineDashboardException(ResponseDetail.WRONG_COMMUNICATION_PROPERTIES);
}
isConfigured = true;
}
if (!isActive) {
interfaceConnectionListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
IhapHandler ihapHandler = (IhapHandler) evt.getSource();
System.out.println(LOG_PREFIX + ihapHandler.getChannelName() + " was closed by iTAC.MES.Suite DataInterface");
}
};
try {
if (interfaceConnection != null) {
if (((IMesServicesChannel) interfaceConnection).isShutdown()) {
interfaceConnection = null;
isConnected = false;
}
}
interfaceConnection = getConnection("interfaceConnection", interfaceConnectionListener);
long start = System.nanoTime();
responseObject = interfaceConnection.mesStart(mesRequest);
long finished = System.nanoTime();
System.out.println(LOG_PREFIX + "roundtrip = " + ((finished - start) / 1000L) + " microseconds");
isActive = true;
} catch (IOException e) {
throw new LineDashboardException(ResponseDetail.COMMUNICATION_FAILURE);
}
}
} catch (LineDashboardException cse) {
handleThrowable(responseObject, cse);
} finally {
logResponse(responseObject);
}
return responseObject;
}
@Override
public MesResponse mesGetStatus(MesRequest mesRequest) {
MesResponse responseObject = new MesResponse();
try {
checkPreconditions(responseObject, mesRequest);
responseObject = interfaceConnection.mesGetStatus(mesRequest);
} catch (Throwable throwable) {
handleThrowable(responseObject, throwable);
} finally {
logResponse(responseObject);
}
return responseObject;
}
@Override
public MesResponse mesStop(MesRequest mesRequest) {
MesResponse responseObject = new MesResponse();
try {
checkPreconditions(responseObject, mesRequest);
responseObject = interfaceConnection.mesStop(mesRequest);
} catch (Throwable throwable) {
handleThrowable(responseObject, throwable);
} finally {
logResponse(responseObject);
}
isActive = false;
isConfigured = false;
isConnected = false;
if (interfaceConnection != null) {
((IMesServicesChannel) interfaceConnection).shutdown();
}
return responseObject;
}
@Override
public MesResponse mesSetProductionData(ProductionTimeRequest productionDataRequest) {
MesResponse responseObject = new MesResponse();
IMesServicesChannel connection = null;
try {
checkPreconditions(responseObject, productionDataRequest);
connection = getConnection("productionData", null);
responseObject = connection.mesSetProductionData(productionDataRequest);
} catch (Throwable throwable) {
handleThrowable(responseObject, throwable);
} finally {
finalizeRequest(connection, responseObject);
}
return responseObject;
}
@Override
public MesResponse mesSetStationResult(StationResultRequest stationResultRequest) {
MesResponse responseObject = new MesResponse();
IMesServicesChannel connection = null;
try {
checkPreconditions(responseObject, stationResultRequest);
connection = getConnection("stationResult", null);
responseObject = connection.mesSetStationResult(stationResultRequest);
} catch (Throwable throwable) {
handleThrowable(responseObject, throwable);
} finally {
finalizeRequest(connection, responseObject);
}
return responseObject;
}
@Override
public MesResponse mesSetQuantityAndFailureData(QuantityAndFailureUploadRequest quantityAndFailureUploadRequest) {
MesResponse responseObject = new MesResponse();
IMesServicesChannel connection = null;
try {
checkPreconditions(responseObject, quantityAndFailureUploadRequest);
connection = getConnection("quantityAndFailureData", null);
responseObject = connection.mesSetQuantityAndFailureData(quantityAndFailureUploadRequest);
} catch (Throwable throwable) {
handleThrowable(responseObject, throwable);
} finally {
finalizeRequest(connection, responseObject);
}
return responseObject;
}
}

View File

@@ -0,0 +1,46 @@
package com.itac.mes.linedashboard;
public enum ResponseDetail {
// WARNINGS, HINTS: positive values
//
OK("", 0),
// Plugin-ERRORS: negative values
REQUEST_IS_NULL("request is null", -10001), //
/** any call to MES before mesConfigure was called properly */
PLUGIN_NOT_CONFIGURED("plugin not configured", -10002), //
PLUGIN_NOT_ACTIVE("plugin not active", -10003), //
PLUGIN_NOT_CONNECTED("plugin not connected " + ResponseDetail.MES_DATA_INTERFACE, -10004), //
COMMUNICATION_FAILURE("communication failure", -10005), //
WRONG_COMMUNICATION_PROPERTIES("communication properties wrong", -10006), //
// Errors from Data Interface negative values
MES_NOT_CONNECTED(ResponseDetail.MES_DATA_INTERFACE + "is not connected", -20000), //
MES_NOT_CONFIGURED_PROPERLY(ResponseDetail.MES_DATA_INTERFACE + "is not properly configured", -20001), //
MES_NOT_INITIALIZED(ResponseDetail.MES_DATA_INTERFACE + "is not initialized", -20002), //
PARSED_WITH_EXCEPTION(ResponseDetail.MES_DATA_INTERFACE + "caught an exception on parsing request", -20003), //
PROCESSED_WITH_EXCEPTION(ResponseDetail.MES_DATA_INTERFACE + "caught an exception on processing request", -20004), //
SERIALNUMBER_NOT_ALLOWED(ResponseDetail.MES_DATA_INTERFACE + "Serialnumber not allowed", -20005), //
PARSE_PROBLEM(ResponseDetail.MES_DATA_INTERFACE + "has a problem parsing the request", -20006), //
NOT_SENT(ResponseDetail.MES_DATA_INTERFACE + "did not sent data", -20007), //
MES_SERVICE_NOT_REACHABLE("iTAC.MES.Suite service is not reachable", -20008), //
;
private static final String MES_DATA_INTERFACE = "iTAC.MES.Suite DataInterface ";
private int code;
private String text;
private ResponseDetail(String text, int code) {
this.text = text;
this.code = code;
}
public int getCode() {
return code;
}
public String getText() {
return text;
}
}

View File

@@ -0,0 +1,59 @@
/*
* Copyright (c) 2008 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
package com.itac.mes.linedashboard.sockets;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.lang.reflect.Proxy;
import com.itac.mes.datainterface.data.IMesServicesLog;
import com.itac.mes.datainterface.socket.BaseIhapHandler;
import com.itac.mes.linedashboard.IMesServicesChannel;
/**
* This handler delegates IMesService calls to a socket server for Linedashboard Interface
*
* @author frankp
*
*/
public class IhapHandler extends BaseIhapHandler {
/**
* This handler is responsible for calling all IMesServices functions at a socket server for this type.<br>
*
* @param host
* the host where the server listens
* @param port
* the port the server listens
* @param channelName
* the name of the channel. As every channel has a unique name it is possible to debug server/client side
* @param connectionStateCloseListener
* detect wether a
* @param classLoader
* a classloader to override default class loader
* @param log
* the mesLog. if null prints direct to System.out/System.err
* @return the reference to a base Handler
* @throws IOException
* thrown if no connection was established (server not available)
*/
public static IMesServicesChannel connect(String host, int port, String channelName,
PropertyChangeListener connectionStateCloseListener, ClassLoader classLoader, IMesServicesLog log) throws IOException {
// create a default connection, not bound to any type
BaseIhapHandler handler = createHandler(host, port, channelName, connectionStateCloseListener, classLoader, log);
// create a proxy for a specific type (Interface)
IMesServicesChannel mesServiceChannel = (IMesServicesChannel) Proxy.newProxyInstance(classLoader,
new Class[] { IMesServicesChannel.class }, handler);
// set the channel name and transport it top server
mesServiceChannel.setChannelName(channelName);
return mesServiceChannel;
}
}

View File

@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema id="message" targetNamespace="linedashboard.mes.itac.com" xmlns="com.linedashboard.mes" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:Q1="linedashboard.mes.itac.com" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" jxb:version="1.0">
<xs:annotation>
<xs:appinfo>
<jxb:globalBindings>
<jxb:javaType name="java.util.Date" xmlType="xs:dateTime" parseMethod="com.itac.mes.linedashboard.DateAdapter.parseDate" printMethod="com.itac.mes.linedashboard.DateAdapter.printDate" />
</jxb:globalBindings>
</xs:appinfo>
</xs:annotation>
<xs:complexType name="Machine">
<xs:annotation>
<xs:documentation>Complete information for a machine. Used in iTAC.MES.Suite to find a corresponding stationNumber.</xs:documentation>
</xs:annotation>
<xs:attribute name="lineName" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The line name this machine belongs to</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="machineName" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The machine name as used in linedashboard.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="moduleName" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The name (or number) of a module. May remain empty if module is not available.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="lane" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>If not applicable (single lane ) use a fix identifier (e.g. "1").
Otherwise send an identifier for the lane.
For operations which does not belong to a specific lane send the static value "UNDEFINED"
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="MesResponse">
<xs:annotation>
<xs:documentation>
Every request is answered by a response, at least containing a totalresult for complete Operation and the
request id from its corresponding request.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="errorDetails" type="Q1:ErrorDetail" minOccurs="0" maxOccurs="unbounded"></xs:element>
</xs:sequence>
<xs:attribute name="requestId" type="xs:int" use="required">
<xs:annotation>
<xs:documentation>
An value identifying the call. Every response has the same requestId as it's corresponding request.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="totalResult" use="required">
<xs:annotation>
<xs:documentation>0 = OK 1 = NOT_OK</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:annotation>
<xs:documentation>0 = OK 1 = NOT_OK</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int">
<xs:enumeration value="0"></xs:enumeration>
<xs:enumeration value="1"></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="MesRequest">
<xs:annotation>
<xs:documentation>Every request from linedashboard to MES extends this message.</xs:documentation>
</xs:annotation>
<xs:attribute name="requestId" type="xs:int" use="required">
<xs:annotation>
<xs:documentation>This is the request Id, to be found on both sides
and both on request and response. This information
could help on
error analysis.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="eventDate" type="xs:dateTime" use="required">
<xs:annotation>
<xs:documentation>The date and time a request is created.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="MachineStatusRequest">
<xs:annotation>
<xs:documentation>Used whenever a machine changes its state.</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="Q1:MesRequest">
<xs:sequence>
<xs:element name="machine" type="Q1:Machine" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>The machine descriptor.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="status" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The new status for the machine. This status is valid from the (inherited field) eventDate.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="MesConfigurationResponse">
<xs:complexContent>
<xs:extension base="Q1:MesResponse">
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ErrorDetail">
<xs:attribute name="detail" type="xs:string"></xs:attribute>
<xs:attribute name="code" type="xs:int" use="required"></xs:attribute>
</xs:complexType>
<xs:complexType name="StationResultRequest">
<xs:complexContent>
<xs:extension base="Q1:MesRequest">
<xs:sequence>
<xs:element name="stationResults" type="Q1:StationResult" maxOccurs="unbounded" minOccurs="0"></xs:element>
<xs:element name="machine" type="Q1:Machine" minOccurs="1" maxOccurs="1"></xs:element>
</xs:sequence>
<xs:attribute name="partNumber" type="xs:string">
<xs:annotation>
<xs:documentation>Partnumber must be set, if empty a -1 is used in API call</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="workorder" type="xs:string"></xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ProductionTimeRequest">
<xs:complexContent>
<xs:extension base="Q1:MesRequest">
<xs:sequence>
<xs:element name="machine" type="Q1:Machine"></xs:element>
</xs:sequence>
<xs:attribute name="workorder" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="processLayer" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="productionTime" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="setupTime" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="processType" default="M">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="1"></xs:length>
<xs:enumeration value="M">
<xs:annotation>
<xs:documentation>Machine workstep</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="P">
<xs:annotation>
<xs:documentation>Person workstep</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="multiBoard" type="xs:int" use="required"></xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="StationResult">
<xs:attribute name="lowerLimit" type="xs:string"></xs:attribute>
<xs:attribute name="upperLimit" type="xs:string"></xs:attribute>
<xs:attribute name="measureName" type="xs:string"></xs:attribute>
<xs:attribute name="measureFailCode" type="xs:string"></xs:attribute>
<xs:attribute name="measureValue" type="xs:string"></xs:attribute>
<xs:attribute name="nominal" type="xs:string"></xs:attribute>
<xs:attribute name="tolerance" type="xs:string"></xs:attribute>
<xs:attribute name="type" type="xs:string"></xs:attribute>
<xs:attribute name="unit" type="xs:string"></xs:attribute>
</xs:complexType>
<xs:complexType name="QuantityAndFailureUploadRequest">
<xs:complexContent>
<xs:extension base="Q1:MesRequest">
<xs:sequence>
<xs:element name="machine" type="Q1:Machine"></xs:element>
<xs:element name="failureData" type="Q1:FailureData" minOccurs="1" maxOccurs="unbounded"></xs:element>
</xs:sequence>
<xs:attribute name="workorder" type="xs:string"></xs:attribute>
<xs:attribute name="processLayer" type="xs:string"></xs:attribute>
<xs:attribute name="pass" type="xs:int" use="required"></xs:attribute>
<xs:attribute name="fail" type="xs:int" use="required"></xs:attribute>
<xs:attribute name="scrap" type="xs:int" use="required"></xs:attribute>
<xs:attribute name="firstPass" type="xs:int" use="required"></xs:attribute>
<xs:attribute name="firstFail" type="xs:int" use="required"></xs:attribute>
<xs:attribute name="firstScrap" type="xs:int" use="required"></xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="FailureData">
<xs:attribute name="failureCauseCode" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="failureImageCode" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="failureTypeCode" type="xs:string" use="required"></xs:attribute>
<xs:attribute name="quantityFailure" type="xs:int" use="required"></xs:attribute>
<xs:attribute name="quantityRepair" type="xs:int" use="required"></xs:attribute>
</xs:complexType>
</xs:schema>

View File

@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: frankp
Build-Jdk: 1.8.0_111
Created-By: Maven Integration for Eclipse

View File

@@ -0,0 +1,7 @@
#Generated by Maven Integration for Eclipse
#Tue Oct 13 14:05:18 CEST 2020
version=9.10.00beta-DEVELOPER
groupId=com.itac.interface.interfaces
m2e.projectName=data-interface-line-dashboard-plugin
m2e.projectLocation=C\:\\projects_jee\\imsinterface\\mainline\\interface\\linedashboard\\plugin
artifactId=data-interface-line-dashboard-plugin

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard-plugin</artifactId>
<packaging>jar</packaging>
<name>data-interface-line-dashboard-plugin</name>
<version>${mes.interface.version}</version>
<parent>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-line-dashboard</artifactId>
<version>${mes.interface.version}</version>
</parent>
<dependencies>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-common</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.linedashboard</groupId>
<artifactId>linedashboard-api</artifactId>
</dependency>
<dependency>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>data-interface-core-definition</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>create-project-bundle</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
<execution>
<id>zippackaging</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<classifier>zip</classifier>
<descriptors>
<descriptor>src/main/assembly/descriptor.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

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