本文整理汇总了C#中ClearCanvas.Dicom.Network.AssociationParameters类的典型用法代码示例。如果您正苦于以下问题:C# AssociationParameters类的具体用法?C# AssociationParameters怎么用?C# AssociationParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssociationParameters类属于ClearCanvas.Dicom.Network命名空间,在下文中一共展示了AssociationParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
}
示例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;
}
示例4: DicomClient
private DicomClient(AssociationParameters assoc, IDicomClientHandler handler)
{
_remoteEndPoint = assoc.RemoteEndPoint;
_socket = null;
_network = null;
_closedEvent = null;
_timeout = 10;
_handler = handler;
_assoc = assoc;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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));
}
}
示例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();
}
示例12: AAssociateAC
public AAssociateAC(AssociationParameters assoc)
{
_assoc = assoc;
}
示例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();
}
示例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++;
}
示例15: scu_NetworkError
private void scu_NetworkError(object sender, AssociationParameters e)
{
MessageBox.Show("A network error has occurred");
}