本文整理汇总了C#中ClearCanvas.Dicom.Network.AssociationParameters类的典型用法代码示例。如果您正苦于以下问题:C# AssociationParameters类的具体用法?C# AssociationParameters怎么用?C# AssociationParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssociationParameters类属于ClearCanvas.Dicom.Network命名空间,在下文中一共展示了AssociationParameters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetRemoteHostName
private static string GetRemoteHostName(AssociationParameters association)
{
string remoteHostName = null;
try
{
if (association.RemoteEndPoint != null)
{
try
{
IPHostEntry entry = Dns.GetHostEntry(association.RemoteEndPoint.Address);
remoteHostName = entry.HostName;
}
catch
{
remoteHostName = association.RemoteEndPoint.Address.ToString();
}
}
}
catch (Exception e)
{
remoteHostName = null;
Platform.Log(LogLevel.Warn, e, "Unable to resolve remote host name for auditing.");
}
return remoteHostName;
}
开发者ID:nhannd,项目名称:Xian,代码行数:26,代码来源:FindScpExtension.cs
示例2: BeginInstancesTransferAuditLogger
public static void BeginInstancesTransferAuditLogger(List<StorageInstance> instances, AssociationParameters parms)
{
Dictionary<string, AuditPatientParticipantObject> list = new Dictionary<string, AuditPatientParticipantObject>();
foreach (StorageInstance instance in instances)
{
string key = instance.PatientId + instance.PatientsName;
if (!list.ContainsKey(key))
{
AuditPatientParticipantObject patient =
new AuditPatientParticipantObject(instance.PatientsName, instance.PatientId);
list.Add(key, patient);
}
}
foreach (AuditPatientParticipantObject patient in list.Values)
{
// Audit Log
BeginTransferringDicomInstancesAuditHelper audit =
new BeginTransferringDicomInstancesAuditHelper(ServerPlatform.AuditSource,
EventIdentificationContentsEventOutcomeIndicator.Success,
parms, patient);
foreach (StorageInstance instance in instances)
{
if (patient.PatientId.Equals(instance.PatientId)
&& patient.PatientsName.Equals(instance.PatientsName))
{
audit.AddStorageInstance(instance);
}
}
ServerAuditHelper.LogAuditMessage(audit);
}
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:35,代码来源:AssociationAuditLogger.cs
示例3: ConvertToDicomFile
/// <summary>
/// Converts a <see cref="DicomMessage"/> instance into a <see cref="DicomFile"/>.
/// </summary>
/// <remarks>This routine sets the Source AE title, </remarks>
/// <param name="message"></param>
/// <param name="filename"></param>
/// <param name="assocParms"></param>
/// <returns></returns>
protected static DicomFile ConvertToDicomFile(DicomMessage message, string filename, AssociationParameters assocParms)
{
// This routine sets some of the group 0x0002 elements.
DicomFile file = new DicomFile(message, filename);
file.SourceApplicationEntityTitle = assocParms.CallingAE;
file.TransferSyntax = message.TransferSyntax;
return file;
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:17,代码来源:StorageScp.cs
示例4: DicomClient
private DicomClient(AssociationParameters assoc, IDicomClientHandler handler)
{
_remoteEndPoint = assoc.RemoteEndPoint;
_socket = null;
_network = null;
_closedEvent = null;
_timeout = 10;
_handler = handler;
_assoc = assoc;
}
开发者ID:khaha2210,项目名称:radio,代码行数:10,代码来源:DicomClient.cs
示例5: DicomInstancesTransferredAuditHelper
/// <summary>
/// Constructor.
/// </summary>
public DicomInstancesTransferredAuditHelper(DicomAuditSource auditSource, EventIdentificationTypeEventOutcomeIndicator outcome,
EventIdentificationTypeEventActionCode action,
AssociationParameters parms)
: base("DicomInstancesTransferred")
{
AuditMessage.EventIdentification = new EventIdentificationType();
AuditMessage.EventIdentification.EventID = CodedValueType.DICOMInstancesTransferred;
AuditMessage.EventIdentification.EventActionCode = action;
AuditMessage.EventIdentification.EventActionCodeSpecified = true;
AuditMessage.EventIdentification.EventDateTime = Platform.Time.ToUniversalTime();
AuditMessage.EventIdentification.EventOutcomeIndicator = outcome;
InternalAddActiveDicomParticipant(parms);
InternalAddAuditSource(auditSource);
}
开发者ID:khaha2210,项目名称:radio,代码行数:19,代码来源:DicomInstancesTransferredAuditHelper.cs
示例6: QueryAuditHelper
public QueryAuditHelper(DicomAuditSource auditSource,
EventIdentificationTypeEventOutcomeIndicator outcome,
AssociationParameters parms)
: base("Query")
{
AuditMessage.EventIdentification = new EventIdentificationType();
AuditMessage.EventIdentification.EventID = CodedValueType.Query;
AuditMessage.EventIdentification.EventActionCode = EventIdentificationTypeEventActionCode.E;
AuditMessage.EventIdentification.EventActionCodeSpecified = true;
AuditMessage.EventIdentification.EventDateTime = Platform.Time.ToUniversalTime();
AuditMessage.EventIdentification.EventOutcomeIndicator = outcome;
InternalAddActiveDicomParticipant(parms);
InternalAddAuditSource(auditSource);
}
开发者ID:scottshea,项目名称:monodicom,代码行数:16,代码来源:QueryAuditHelper.cs
示例7: BeginTransferringDicomInstancesAuditHelper
public BeginTransferringDicomInstancesAuditHelper(DicomAuditSource auditSource, EventIdentificationContentsEventOutcomeIndicator outcome,
AssociationParameters parms,
AuditPatientParticipantObject patient)
: base("BeginTransferringDicomInstances")
{
AuditMessage.EventIdentification = new EventIdentificationContents();
AuditMessage.EventIdentification.EventID = EventID.BeginTransferringDICOMInstances;
AuditMessage.EventIdentification.EventActionCode = EventIdentificationContentsEventActionCode.E;
AuditMessage.EventIdentification.EventActionCodeSpecified = true;
AuditMessage.EventIdentification.EventDateTime = Platform.Time.ToUniversalTime();
AuditMessage.EventIdentification.EventOutcomeIndicator = outcome;
InternalAddAuditSource(auditSource);
InternalAddActiveDicomParticipant(parms);
InternalAddParticipantObject(patient.PatientId + patient.PatientsName, patient);
}
开发者ID:nhannd,项目名称:Xian,代码行数:18,代码来源:BeginTransferringDicomInstancesAuditHelper.cs
示例8: VerifyAssociation
public static bool VerifyAssociation(IDicomServerContext context, AssociationParameters assocParms, out DicomRejectResult result, out DicomRejectReason reason)
{
string calledTitle = (assocParms.CalledAE ?? "").Trim();
string callingAE = (assocParms.CallingAE ?? "").Trim();
result = DicomRejectResult.Permanent;
reason = DicomRejectReason.NoReasonGiven;
var extendedConfiguration = LocalDicomServer.GetExtendedConfiguration();
if (!extendedConfiguration.AllowUnknownCaller && ServerDirectory.GetRemoteServersByAETitle(callingAE).Count == 0)
{
reason = DicomRejectReason.CallingAENotRecognized;
}
else if (calledTitle != context.AETitle)
{
reason = DicomRejectReason.CalledAENotRecognized;
}
else
{
return true;
}
return false;
}
开发者ID:nhannd,项目名称:Xian,代码行数:24,代码来源:AssociationVerifier.cs
示例9: NegotiateAssociation
private static bool NegotiateAssociation(AssociationParameters cp, ServerAssociationParameters sp)
{
foreach (DicomPresContext clientContext in cp.GetPresentationContexts())
{
TransferSyntax selectedSyntax = null;
foreach (DicomPresContext serverContext in sp.GetPresentationContexts())
{
if (clientContext.AbstractSyntax.Uid.Equals(serverContext.AbstractSyntax.Uid))
{
foreach (TransferSyntax ts in serverContext.GetTransfers())
{
if (clientContext.HasTransfer(ts))
{
selectedSyntax = ts;
break;
}
}
}
if (selectedSyntax != null)
break;
}
if (selectedSyntax != null)
{
clientContext.ClearTransfers();
clientContext.AddTransfer(selectedSyntax);
clientContext.SetResult(DicomPresContextResult.Accept);
}
else
{
// No contexts accepted, set if abstract or transfer syntax reject
clientContext.SetResult(0 == sp.FindAbstractSyntax(clientContext.AbstractSyntax)
? DicomPresContextResult.RejectAbstractSyntaxNotSupported
: DicomPresContextResult.RejectTransferSyntaxesNotSupported);
}
}
bool anyValidContexts = false;
foreach (DicomPresContext clientContext in cp.GetPresentationContexts())
{
if (clientContext.Result == DicomPresContextResult.Accept)
{
anyValidContexts = true;
break;
}
}
if (anyValidContexts == false)
{
return false;
}
return true;
}
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:54,代码来源:DicomServer.cs
示例10: InternalAddActiveDicomParticipant
protected void InternalAddActiveDicomParticipant(AssociationParameters parms)
{
if (parms is ClientAssociationParameters)
{
_participantList.Add(
new AuditMessageActiveParticipant(CodedValueType.Source, "AETITLE=" + parms.CallingAE, null, null,
parms.LocalEndPoint.Address.ToString(), NetworkAccessPointTypeEnum.IpAddress, null));
_participantList.Add(
new AuditMessageActiveParticipant(CodedValueType.Destination, "AETITLE=" + parms.CalledAE, null, null,
parms.RemoteEndPoint.Address.ToString(), NetworkAccessPointTypeEnum.IpAddress, null));
}
else
{
_participantList.Add(
new AuditMessageActiveParticipant(CodedValueType.Source, "AETITLE=" + parms.CallingAE, null, null,
parms.RemoteEndPoint.Address.ToString(), NetworkAccessPointTypeEnum.IpAddress, null));
_participantList.Add(
new AuditMessageActiveParticipant(CodedValueType.Destination, "AETITLE=" + parms.CalledAE, null,null,
parms.LocalEndPoint.Address.ToString(), NetworkAccessPointTypeEnum.IpAddress, null));
}
}
开发者ID:scottshea,项目名称:monodicom,代码行数:21,代码来源:DicomAuditHelper.cs
示例11: OnAssociationEstablished
/// <summary>
/// Event handlers called when association has been established.
/// </summary>
/// <param name="assoc">The association</param>
protected void OnAssociationEstablished(AssociationParameters assoc)
{
if (_assocStats == null)
_assocStats = new TransmissionStatistics(string.Format("DICOM association from {0} [{1}:{2}] to {3}",
assoc.CallingAE,
assoc.RemoteEndPoint.Address,
assoc.RemoteEndPoint.Port,
assoc.CalledAE));
// start recording
_assocStats.Begin();
}
开发者ID:nhannd,项目名称:Xian,代码行数:16,代码来源:AssociationStatisticsRecorder.cs
示例12: AAssociateAC
public AAssociateAC(AssociationParameters assoc)
{
_assoc = assoc;
}
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:4,代码来源:PDU.cs
示例13: OnAssociationAborted
/// <summary>
/// Event handler called when an association has been aborted.
/// </summary>
/// <param name="assoc">The aborted association</param>
/// <param name="reason">The abort reason</param>
protected void OnAssociationAborted(AssociationParameters assoc, DicomAbortReason reason)
{
if (_assocStats == null)
return;
// update the association statistics
_assocStats.IncomingBytes = assoc.TotalBytesRead;
_assocStats.OutgoingBytes = assoc.TotalBytesSent;
// signal stop recording.. the statistic object will fill out whatever
// it needs at this point based on what we have set
_assocStats.End();
}
开发者ID:nhannd,项目名称:Xian,代码行数:18,代码来源:AssociationStatisticsRecorder.cs
示例14: OnDicomMessageSent
/// <summary>
/// Event handler called while a DICOM message has been sent.
/// </summary>
/// <param name="assoc">The association</param>
/// <param name="dcmMsg">The request DICOM message sent</param>
private void OnDicomMessageSent(
AssociationParameters assoc,
DicomMessage dcmMsg)
{
if (_assocStats == null)
return;
// update the association stats
_assocStats.IncomingBytes = assoc.TotalBytesRead;
_assocStats.OutgoingBytes = assoc.TotalBytesSent;
_assocStats.OutgoingMessages++;
}
开发者ID:nhannd,项目名称:Xian,代码行数:18,代码来源:AssociationStatisticsRecorder.cs
示例15: scu_NetworkError
private void scu_NetworkError(object sender, AssociationParameters e)
{
MessageBox.Show("A network error has occurred");
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:4,代码来源:CFindPerformanceTestForm.cs
示例16: AssociationParameters
protected AssociationParameters(AssociationParameters parameters)
{
_appCtxNm = parameters._appCtxNm;
_calledAe = parameters._calledAe;
_callingAe = parameters._callingAe;
_implClass = parameters._implClass;
_implVersion = parameters._implVersion;
_localEndPoint = parameters._localEndPoint;
_localMaxPduLength = parameters._localMaxPduLength;
_remoteMaxPduLength = parameters._remoteMaxPduLength;
_readTimeout = parameters._readTimeout;
_receiveBufferSize = parameters._receiveBufferSize;
_remoteEndPoint = parameters._remoteEndPoint;
_sendBufferSize = parameters._sendBufferSize;
_writeTimeout = parameters._writeTimeout;
_connectTimeout = parameters._connectTimeout;
foreach (byte id in parameters._presContexts.Keys)
{
AddPresentationContext(id,parameters._presContexts[id].AbstractSyntax);
foreach (TransferSyntax ts in parameters._presContexts[id].GetTransfers())
{
AddTransferSyntax(id,ts);
}
SetRoleSelect(id, parameters._presContexts[id].GetRoleSelect());
}
}
开发者ID:scottshea,项目名称:monodicom,代码行数:30,代码来源:AssociationParameters.cs
示例17: SendAssociateRequest
/// <summary>
/// Method used to send an association request.
/// </summary>
/// <param name="associate">The parameters used in the association request.</param>
public void SendAssociateRequest(AssociationParameters associate)
{
_assoc = associate;
var pdu = new AAssociateRQ(_assoc);
State = DicomAssociationState.Sta5_AwaitingAAssociationACOrReject;
EnqueuePdu(pdu.Write());
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:14,代码来源:NetworkBase.cs
示例18: OnVerifyAssociation
protected override DicomPresContextResult OnVerifyAssociation(AssociationParameters association, byte pcid)
{
if (Device == null)
return DicomPresContextResult.Accept;
if (!Device.AllowStorage)
{
return DicomPresContextResult.RejectUser;
}
if (Device.AcceptKOPR)
{
DicomPresContext context = association.GetPresentationContext(pcid);
if (context.AbstractSyntax.Equals(SopClass.KeyObjectSelectionDocumentStorage)
||context.AbstractSyntax.Equals(SopClass.GrayscaleSoftcopyPresentationStateStorageSopClass)
||context.AbstractSyntax.Equals(SopClass.BlendingSoftcopyPresentationStateStorageSopClass)
||context.AbstractSyntax.Equals(SopClass.ColorSoftcopyPresentationStateStorageSopClass)
||context.AbstractSyntax.Equals(SopClass.PseudoColorSoftcopyPresentationStateStorageSopClass))
return DicomPresContextResult.Accept;
return DicomPresContextResult.RejectUser;
}
return DicomPresContextResult.Accept;
}
开发者ID:nhannd,项目名称:Xian,代码行数:25,代码来源:StorageScp.cs
示例19: ProcessRawPDU
private bool ProcessRawPDU(RawPDU raw)
{
try
{
switch (raw.Type)
{
case 0x01:
{
_assoc = new ServerAssociationParameters();
var pdu = new AAssociateRQ(_assoc);
pdu.Read(raw);
State = DicomAssociationState.Sta3_AwaitingLocalAAssociationResponsePrimative;
OnReceiveAssociateRequest(_assoc as ServerAssociationParameters);
if (State != DicomAssociationState.Sta13_AwaitingTransportConnectionClose &&
State != DicomAssociationState.Sta6_AssociationEstablished)
{
Platform.Log(LogLevel.Error, "Association incorrectly not accepted or rejected, aborting.");
return false;
}
//if derived class call SendAssociateAccept, it has fired this event
//if (AssociationEstablished != null)
// AssociationEstablished(_assoc);
return true;
}
case 0x02:
{
var pdu = new AAssociateAC(_assoc);
pdu.Read(raw);
State = DicomAssociationState.Sta6_AssociationEstablished;
OnReceiveAssociateAccept(_assoc);
if (AssociationEstablished != null)
AssociationEstablished(_assoc);
return true;
}
case 0x03:
{
var pdu = new AAssociateRJ();
pdu.Read(raw);
State = DicomAssociationState.Sta13_AwaitingTransportConnectionClose;
if (AssociationRejected != null)
AssociationRejected(pdu.Source, pdu.Reason);
OnReceiveAssociateReject(pdu.Result, pdu.Source, pdu.Reason);
return true;
}
case 0x04:
{
var pdu = new PDataTF();
pdu.Read(raw);
return ProcessPDataTF(pdu);
}
case 0x05:
{
var pdu = new AReleaseRQ();
pdu.Read(raw);
State = DicomAssociationState.Sta8_AwaitingAReleaseRPLocalUser;
OnReceiveReleaseRequest();
return true;
}
case 0x06:
{
var pdu = new AReleaseRP();
pdu.Read(raw);
State = DicomAssociationState.Sta13_AwaitingTransportConnectionClose;
if (AssociationReleased != null)
AssociationReleased(_assoc);
OnReceiveReleaseResponse();
return true;
}
case 0x07:
{
var pdu = new AAbort();
pdu.Read(raw);
State = DicomAssociationState.Sta1_Idle;
if (AssociationAborted != null)
AssociationAborted(_assoc, pdu.Reason);
OnReceiveAbort(pdu.Source, pdu.Reason);
return true;
}
case 0xFF:
{
Platform.Log(LogLevel.Error, "Unexpected PDU type: 0xFF. Potential parsing error.");
return false;
//.........这里部分代码省略.........
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:101,代码来源:NetworkBase.cs
示例20: AuditLog
/// <summary>
/// Helper method for logging audit information.
/// </summary>
/// <param name="parms"></param>
/// <param name="outcome"></param>
/// <param name="msg">The query message to be audited</param>
private static void AuditLog(AssociationParameters parms, EventIdentificationContentsEventOutcomeIndicator outcome, DicomMessage msg)
{
try
{
var helper = new QueryAuditHelper(ServerPlatform.AuditSource,
outcome, parms, msg.AffectedSopClassUid, msg.DataSet);
ServerPlatform.LogAuditMessage(helper);
}
catch (Exception e)
{
Platform.Log(LogLevel.Warn, "Unexpected exception logging DICOM Query audit message: {0}", e.Message);
}
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:19,代码来源:QueryScpExtension.cs
注:本文中的ClearCanvas.Dicom.Network.AssociationParameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论