Ejemplo n.º 1
0
        /// <summary>
        /// Parse commands
        /// </summary>
        protected override void conn_CommandReceived(DICOMConnection conn, PDATACommands command, DICOMData cmdDICOM, DICOMData dataDICOM)
        {
            switch (command)
            {
            case PDATACommands.CMOVERSP:
                logger.Log(LogLevel.Info, "Received C-MOVE-RSP");

                CommandStatus status    = (CommandStatus)(ushort)cmdDICOM[DICOMTags.Status].Data;
                ushort        remaining = (ushort)cmdDICOM[DICOMTags.NumberOfRemainingSubOps].Data;
                ushort        completed = (ushort)cmdDICOM[DICOMTags.NumberOfCompletedSubOps].Data;
                ushort        failed    = (ushort)cmdDICOM[DICOMTags.NumberOfFailedSubOps].Data;
                ushort        warning   = (ushort)cmdDICOM[DICOMTags.NumberOfWarningSubOps].Data;

                if (MoveUpdate != null)
                {
                    MoveUpdate(this, remaining, completed, failed, warning);
                }

                if (remaining == 0)
                {
                    conn.SendReleaseRQ();
                }

                break;

            default:
                logger.Log(LogLevel.Warning, "Unhandled P-DATA Command Type: " + command + "...");
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parse commands
        /// </summary>
        protected override void conn_CommandReceived(DICOMConnection conn, PDATACommands command, DICOMData cmdDICOM, DICOMData dataDICOM)
        {
            switch (command)
            {
            case PDATACommands.CFINDRSP:
                logger.Log(LogLevel.Info, "Received C-FIND-RSP");

                CommandStatus status = (CommandStatus)(ushort)cmdDICOM[DICOMTags.Status].Data;
                if (status == CommandStatus.Pending_AllOptionalKeysReturned || status == CommandStatus.Pending_SomeOptionalKeysNotReturned)
                {
                    findResponse.AddResponseRow(dataDICOM);
                }
                else if (status == CommandStatus.Success)
                {
                    if (FindResponse != null)
                    {
                        FindResponse(this, findResponse);
                    }

                    conn.SendReleaseRQ();
                }
                else
                {
                    logger.Log(LogLevel.Error, "Unhandled C-FIND-RSP Status Type: " + status + "...");
                }

                break;

            default:
                logger.Log(LogLevel.Warning, "Unhandled P-DATA Command Type: " + command + "...");
                break;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Parses commands.
        /// </summary>
        protected override void conn_CommandReceived(DICOMConnection conn, PDATACommands command, DICOMData cmdDICOM, DICOMData dataDICOM)
        {
            switch (command)
            {
            case PDATACommands.CECHORSP:
                logger.Log(LogLevel.Info, "Received C-ECHO-RSP");
                conn.SendReleaseRQ();
                break;

            default:
                logger.Log(LogLevel.Warning, "Unhandled P-DATA Command Type: " + command + "...");
                break;
            }
        }