public void SetPortToolLength(Port port, CLength length) { //Check port if ((int)port >= NumPorts || (int)port < 0) { if (UserErrorEvent != null) { UserErrorEvent(UUID, new Cerror(Cerror.cErrorCodes.PORT_NOT_IN_RANGE, "Port not in range.")); } } else { //decimas de milimetro m_Frames_02.WriteLength(System.Convert.ToUInt16((ushort)(length.ToMillimeters() * 10))); m_Frames_02.ReadLength(); } }
public new async Task WritePortLengthAsync(Port port, CLength length) { // SyncLock ServiceStackJBC01_Lock if (connectErrorStatus != EnumConnectError.NO_ERROR) { return; } try { await m_hostService.SetPortLengthAsync(m_hostStnUUID, (dc_EnumConstJBCdc_Port)port, length.ToMillimeters(), dc_EnumConstJBCdc_LengthUnit.MILLIMETERS); Info_Port[port].ToolStatus.Length = length; } catch (FaultException <faultError> faultEx) { RaiseEventError(faultEx, System.Reflection.MethodBase.GetCurrentMethod().Name); } catch (Exception ex) { RaiseEventError(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } // End SyncLock }