// short StoreEvent(String timestamp, String deviceName, String dataItemId, String value); private short handleStoreEvent(System.Collections.Specialized.NameValueCollection queryString, StreamWriter writer) { short storeEventReturn = ReturnValue.ERROR; //default XElement returnElement; String timestamp, dataItemId, condition, value, code, nativeCode; if ((returnElement = handleStoreSampleStoreEventCommon(queryString, out timestamp, out dataItemId, out condition, out value, out code, out nativeCode)) == null) { if (value == null) { returnElement = MachineAPIError.createError(MachineAPIError.UNRECOGNIZEDDATA, "The value is missing."); } else if (condition != null) { returnElement = MachineAPIError.createError(MachineAPIError.UNRECOGNIZEDDATA, "The storeEvent should not define \"condition\"."); } else { try { storeEventReturn = sharedData.StoreEvent(timestamp, dataItemId, value, code, nativeCode); if (storeEventReturn == ReturnValue.SUCCESS) { returnElement = new XElement(MTConnectNameSpace.mtStreams + "Acknowledge", new XAttribute("dateTime", Util.GetDateTime())); } else //not possible { returnElement = MachineAPIError.createError(MachineAPIError.UNRECOGNIZEDDATA); } } catch (AgentException e) { returnElement = MachineAPIError.createError(MachineAPIError.UNRECOGNIZEDDATA, e.Message); } } } returnElement.Save(writer); return(storeEventReturn); }
public short StoreEvent(String timestamp, String dataItemId, String value, String code, String nativeCode) { return(data.StoreEvent(timestamp, dataItemId, value, code, nativeCode)); }