Beispiel #1
0
        private void SaveEFilmInCommonSave(EFilmModel eFilmModel, string jobID, double progress)
        {
            //系列化DataHeader
            byte[] serializedInfo;
            if (eFilmModel.DataHeaderForSave != null)
            {
                eFilmModel.DataHeaderForSave.Serialize(out serializedInfo);
            }
            else
            {
                serializedInfo = new byte[0];
            }

            //设置commonsave参数,todo 主干PS接口有变更
            SaveFilmingCommandContext.Builder builder = SaveFilmingCommandContext.CreateBuilder();

            builder.SetCellIndex(0);
            builder.SetSaveImageType(SavingType.SecondaryCapture);
            builder.SetOperationType(SaveFilmingMode.Save);
            builder.SetStrategy(SaveFilmingStrategy.SaveImages);
            builder.SetKeepSameSeries(true);
            builder.SetSeriesUID(eFilmModel.EFilmSeriesUid);
            var rangeBuilder = new PrgressRange.Builder();

            rangeBuilder.JobID = jobID;
            rangeBuilder.SetMaxForCurrentSubJob(progress);
            builder.SetRange(rangeBuilder);
            ImageAuxiliary.Builder auxiliaryBuilder = ImageAuxiliary.CreateBuilder();
            //auxiliaryBuilder.ActivePS = string.Empty;
            //auxiliaryBuilder.BurnedPS = string.Empty;
            auxiliaryBuilder.PS              = string.Empty;
            auxiliaryBuilder.CellIndex       = -1;//区别于 SaveSeries
            auxiliaryBuilder.SaveAsDisplay   = true;
            auxiliaryBuilder.DataHeaderBytes = Google.ProtocolBuffers.ByteString.CopyFrom(serializedInfo);
            builder.AddImageAuxiliaries(auxiliaryBuilder);
            byte[] btInfo = builder.Build().ToByteArray();



            //SAVE_EFILM_COMMAND
            CommandContext cs = new CommandContext();

            cs.iCommandId       = 16000; //7088
            cs.sReceiver        = CommunicationNodeName.CreateCommunicationProxyName("FilmingService");
            cs.sSerializeObject = btInfo;
            //var result = Containee.Main.GetCommunicationProxy().SyncSendCommand(cs);
            int errorCode = Containee.Main.GetCommunicationProxy().AsyncSendCommand(cs);

            if (0 != errorCode)
            {
                throw new Exception("send filming job command failure, error code: " + errorCode);
            }

            builder.Clear();
            // if (eFilmModel.DataHeaderForSave != null) eFilmModel.DataHeaderForSave.Dispose();
        }
Beispiel #2
0
        private void SaveEFilmInCommonSave(string seriesInstanceUid)
        {
            //系列化DataHeader
            byte[] serializedInfo;
            _dicomDataHeader.Serialize(out serializedInfo);


            //设置commonsave参数,todo 主干PS接口有变更
            SaveFilmingCommandContext.Builder builder = SaveFilmingCommandContext.CreateBuilder();
            builder.SetCellIndex(0);
            builder.SetSaveImageType(SavingType.SecondaryCapture);
            builder.SetOperationType(SaveFilmingMode.Save);
            builder.SetStrategy(SaveFilmingStrategy.SaveImages);

            //builder.
            builder.SetKeepSameSeries(true);
            builder.SetSeriesUID(seriesInstanceUid);
            ImageAuxiliary.Builder auxiliaryBuilder = ImageAuxiliary.CreateBuilder();
            //auxiliaryBuilder.ActivePS = string.Empty;
            //auxiliaryBuilder.BurnedPS = string.Empty;
            auxiliaryBuilder.PS              = string.Empty;
            auxiliaryBuilder.CellIndex       = -1;//区别于 SaveSeries
            auxiliaryBuilder.SaveAsDisplay   = true;
            auxiliaryBuilder.DataHeaderBytes = Google.ProtocolBuffers.ByteString.CopyFrom(serializedInfo);
            builder.AddImageAuxiliaries(auxiliaryBuilder);
            byte[] btInfo = builder.Build().ToByteArray();



            //SAVE_EFILM_COMMAND
            CommandContext cs = new CommandContext();

            cs.iCommandId       = 16000; //7088
            cs.sReceiver        = CommunicationNodeName.CreateCommunicationProxyName("FilmingService");
            cs.sSerializeObject = btInfo;
            //var result = Containee.Main.GetCommunicationProxy().SyncSendCommand(cs);
            int errorCode = _proxy.AsyncSendCommand(cs);

            if (0 != errorCode)
            {
                throw new Exception("send filming job command failure, error code: " + errorCode);
            }
        }