• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Model.ServerPartition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ClearCanvas.ImageServer.Model.ServerPartition的典型用法代码示例。如果您正苦于以下问题:C# ServerPartition类的具体用法?C# ServerPartition怎么用?C# ServerPartition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ServerPartition类属于ClearCanvas.ImageServer.Model命名空间,在下文中一共展示了ServerPartition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MoveSeries

        /// <summary>
        /// Inserts a move request to move one or more series in a study.
        /// </summary>
        /// <param name="context">The persistence context used for database connection.</param>
        /// <param name="partition">The <see cref="ServerPartition"/> where the study resides</param>
        /// <param name="studyInstanceUid">The Study Instance Uid of the study</param>
        /// <param name="deviceKey">The Key of the device to move the series to.</param> 
        /// <param name="seriesInstanceUids">The Series Instance Uid of the series to be move.</param>
        /// <param name="externalRequest">Optional <see cref="ExternalRequestQueue"/> entry that triggered this move</param>
        /// <returns>A MoveSeries <see cref="WorkQueue"/> entry inserted into the system.</returns>
        /// <exception cref="InvalidStudyStateOperationException"></exception>
        public static IList<WorkQueue> MoveSeries(IUpdateContext context, ServerPartition partition, string studyInstanceUid, ServerEntityKey deviceKey, List<string> seriesInstanceUids, ExternalRequestQueue externalRequest=null)
        {
            // Find all location of the study in the system and insert series delete request
			IList<StudyStorageLocation> storageLocations = StudyStorageLocation.FindStorageLocations(partition.Key, studyInstanceUid);
			IList<WorkQueue> entries = new List<WorkQueue>();

            foreach (StudyStorageLocation location in storageLocations)
            {
                try
                {
                    // insert a move series request
                    WorkQueue request = InsertMoveSeriesRequest(context, location, seriesInstanceUids, deviceKey, externalRequest);
                    Debug.Assert(request.WorkQueueTypeEnum.Equals(WorkQueueTypeEnum.WebMoveStudy));
                    entries.Add(request);
                }
                catch (Exception ex)
                {
                    Platform.Log(LogLevel.Error, ex, "Errors occurred when trying to insert move request");
                    if (!ServerHelper.UnlockStudy(location.Key))
                        throw new ApplicationException("Unable to unlock the study");
                }
            }

            return entries;
        }
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:36,代码来源:StudyEditorHelper.cs


示例2: LoadPartitionSopClasses

        private IEnumerable<PartitionSopClass> LoadPartitionSopClasses(ServerPartition partition)
        {
            IList<PartitionSopClass> list = null;

            if (Cache.IsSupported())
            {
                var cacheKey = "PartitionSopClasses-" + partition.Key;
                using (var cacheClient = Cache.CreateClient(_cacheId))
                {
                    list = cacheClient.Get(cacheKey, new CacheGetOptions("default")) as IList<PartitionSopClass>;
                    if (list == null)
                    {
                        Platform.Log(LogLevel.Debug, "Loading PartitionSopClass from database");
                        list = LoadPartitionSopClassesFromDatabase(partition);
                        cacheClient.Put(cacheKey, list, new CachePutOptions("default", TimeSpan.FromSeconds(30), false /*no sliding. Reload 60 seconds*/));
                    }
                }
            }
            else
            {
                list = LoadPartitionSopClassesFromDatabase(partition);
            }

            return list;
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:25,代码来源:PartitionSopClassConfiguration.cs


示例3: StartPartitionListener

	    private void StartPartitionListener(ServerPartition part)
	    {
			var parms = new DicomScpContext(part);

	        if (DicomSettings.Default.ListenIPV4)
	        {
	            var ipV4Scp = new DicomScp<DicomScpContext>(parms, AssociationVerifier.Verify,
	                                                        AssociationAuditLogger.InstancesTransferredAuditLogger)
	                {
	                    ListenPort = part.Port,
	                    AeTitle = part.AeTitle,
	                    ListenAddress = IPAddress.Any
	                };

	            StartScp(ipV4Scp, _listenerList);
	        }

	        if (DicomSettings.Default.ListenIPV6)
	        {
	            var ipV6Scp = new DicomScp<DicomScpContext>(parms, AssociationVerifier.Verify,
	                                                        AssociationAuditLogger.InstancesTransferredAuditLogger)
	                {
	                    ListenPort = part.Port,
	                    AeTitle = part.AeTitle,
	                    ListenAddress = IPAddress.IPv6Any
	                };
	            StartScp(ipV6Scp, _listenerList);
	        }
	    }
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:29,代码来源:DicomServerManager.cs


示例4: DeleteSeries

        /// <summary>
        /// Inserts delete request(s) to delete a series in a study.
        /// </summary>
        /// <param name="context">The persistence context used for database connection.</param>
        /// <param name="partition">The <see cref="ServerPartition"/> where the study resides</param>
        /// <param name="studyInstanceUid">The Study Instance Uid of the study</param>
        /// <param name="seriesInstanceUids">The Series Instance Uid of the series to be deleted.</param>
        /// <param name="reason">The reason for deleting the series.</param>
        /// <returns>A list of DeleteSeries <see cref="WorkQueue"/> entries inserted into the system.</returns>
        /// <exception cref="InvalidStudyStateOperationException"></exception>
        public static IList<WorkQueue> DeleteSeries(IUpdateContext context, ServerPartition partition, string studyInstanceUid, List<string> seriesInstanceUids, string reason)
        {
            // Find all location of the study in the system and insert series delete request
            IList<StudyStorageLocation> storageLocations = StudyStorageLocation.FindStorageLocations(partition.Key, studyInstanceUid);
            IList<WorkQueue> entries = new List<WorkQueue>();

            foreach (StudyStorageLocation location in storageLocations)
            {
                try
                {
                    string failureReason;
                    if (ServerHelper.LockStudy(location.Key, QueueStudyStateEnum.WebDeleteScheduled, out failureReason))
                    {
                        // insert a delete series request
                        WorkQueue request = InsertDeleteSeriesRequest(context, location, seriesInstanceUids, reason);
                        Debug.Assert(request.WorkQueueTypeEnum.Equals(WorkQueueTypeEnum.WebDeleteStudy));
                        entries.Add(request);
                    }
                    else
                    {
                        throw new ApplicationException(String.Format("Unable to lock storage location {0} for deletion : {1}", location.Key, failureReason));
                    }
                }
                catch(Exception ex)
                {
                    Platform.Log(LogLevel.Error, ex, "Errors occurred when trying to insert delete request");
                    if (!ServerHelper.UnlockStudy(location.Key))
                        throw new ApplicationException("Unable to unlock the study");
                }
            }

            return entries;
        }
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:43,代码来源:StudyEditorHelper.cs


示例5: DeleteStudy

        /// <summary>
        /// Inserts delete request(s) to delete a series in a study.
        /// </summary>
        /// <param name="context">The persistence context used for database connection.</param>
        /// <param name="partition">The <see cref="ServerPartition"/> where the study resides</param>
        /// <param name="studyInstanceUid">The Study Instance Uid of the study</param>
        /// <param name="reason">The reason for deleting the series.</param>
        /// <returns>A list of DeleteSeries <see cref="WorkQueue"/> entries inserted into the system.</returns>
        /// <exception cref="InvalidStudyStateOperationException"></exception>
        public static WorkQueue DeleteStudy(IUpdateContext context, ServerPartition partition, string studyInstanceUid,
                                             string reason)
        {
			StudyStorageLocation location = FindStudyStorageLocation(context, partition, studyInstanceUid);

            string failureReason;

            try
            {
                if (LockStudyForDeletion(location.Key, out failureReason))
                {
                    WorkQueue deleteRequest = InsertDeleteStudyRequest(context, location, reason);
                        if (deleteRequest == null)
                            throw new ApplicationException(
                                String.Format("Unable to insert a Delete Study request for study {0}",
                                              location.StudyInstanceUid));
                    

                    return deleteRequest;
                }
            }
            catch (Exception ex)
            {
                Platform.Log(LogLevel.Error, ex, "Errors occurred when trying to insert study delete request");

                if (!ReleaseDeletionLock(location.Key))
                    Platform.Log(LogLevel.Error, "Unable to unlock the study: " + location.StudyInstanceUid);

                throw;
            }

            throw new ApplicationException(
                String.Format("Unable to lock storage location {0} for deletion : {1}", location.Key, failureReason));
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:43,代码来源:StudyDeleteHelper.cs


示例6: StudyRulesEngine

		public StudyRulesEngine(ServerRulesEngine studyRulesEngine, StudyStorageLocation location, ServerPartition partition, StudyXml studyXml)
		{
			_studyRulesEngine = studyRulesEngine;
			_studyXml = studyXml;
			_location = location;
			_partition = partition ?? ServerPartition.Load(_location.ServerPartitionKey);
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:7,代码来源:StudyRulesEngine.cs


示例7: GetPartitionSopClass

        /// <summary>
        /// Returns the <see cref="PartitionSopClass"/> for the specified sop class and partition or NULL if the sop class UID is not set.
        /// </summary>
        /// <param name="partition"></param>
        /// <param name="sopClassUid"></param>
        /// <returns></returns>
        public PartitionSopClass GetPartitionSopClass(ServerPartition partition, string sopClassUid)
        {
            Platform.CheckForNullReference(partition, "partition");
            Platform.CheckForEmptyString(sopClassUid, "sopClassUid");

            var list = LoadPartitionSopClasses(partition);
            return list.SingleOrDefault(entry => entry.SopClassUid == sopClassUid);
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:14,代码来源:PartitionSopClassConfiguration.cs


示例8: SopInstanceImporterContext

 /// <summary>
 /// Creates an instance of <see cref="SopInstanceImporterContext"/> to be used
 /// by <see cref="SopInstanceImporter"/> 
 /// </summary>
 /// <param name="contextID">The ID assigned to the context. This will be used as the name of storage folder in case of duplicate.</param>
 /// <param name="sourceAE">Source AE title of the image(s) to be imported</param>
 /// <param name="partition">The <see cref="ServerPartition"/> which the image(s) will be imported to</param>
 public SopInstanceImporterContext(string contextID, string sourceAE, ServerPartition partition)
 {
     Platform.CheckForEmptyString(contextID, "contextID");
     Platform.CheckForNullReference(partition, "partition");
     _contextID = contextID;
     _sourceAE = sourceAE;
     _partition = partition;
 }
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:15,代码来源:SopInstanceImporter.cs


示例9: ServerActionContext

 public ServerActionContext(DicomMessageBase msg, ServerEntityKey filesystemKey,
                            ServerPartition partition, ServerEntityKey studyLocationKey)
 {
     Message = msg;
     ServerPartitionKey = partition.Key;
     StudyLocationKey = studyLocationKey;
     FilesystemKey = filesystemKey;
 	ServerPartition = partition;
 }
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:ServerActionContext.cs


示例10: ValidationStudyInfo

 public ValidationStudyInfo(Study theStudy, ServerPartition partition)
 {
     ServerAE = partition.AeTitle;
     PatientsName = theStudy.PatientsName;
     PatientsId = theStudy.PatientId;
     StudyInstaneUid = theStudy.StudyInstanceUid;
     AccessionNumber = theStudy.AccessionNumber;
     StudyDate = theStudy.StudyDate;
 }
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:ValidationStudyInfo.cs


示例11: UpdateInstanceCommand

		public UpdateInstanceCommand(ServerPartition partition,
								  StudyStorageLocation studyLocation,
								  DicomFile file)
			: base("Update existing SOP Instance")
		{
			_partition = partition;
			_studyLocation = studyLocation;
			_file = file;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:9,代码来源:UpdateInstanceCommand.cs


示例12: ImageServerDbGenerator

 public ImageServerDbGenerator(ServerPartition partition, DateTime startDate, int totalStudies, int studiesPerDay, int percentWeekend)
 {
     _startDate = startDate;
     _totalStudies = totalStudies;
     _studiesPerDay = studiesPerDay;
     _percentWeekend = percentWeekend;
     _partition = partition;
     _backroundTask = new BackgroundTask(Run, true);
 }
开发者ID:nhannd,项目名称:Xian,代码行数:9,代码来源:ImageServerDbGenerator.cs


示例13: StudyDeleteRecord

 public StudyDeleteRecord(ServerPartition partition, string studyInstanceUid, string accessionNumber, string patientId, string patientName)
     : base("StudyDeleteRecord")
 {
     this.ServerPartitionAE = partition.AeTitle;
     this.StudyInstanceUid = studyInstanceUid;
     this.Timestamp = Platform.Time;
     this.AccessionNumber = accessionNumber;
     this.PatientId = patientId;
     this.PatientsName = patientName;
 }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:10,代码来源:StudyDeleteRecord.cs


示例14: UpdatePartition

        /// <summary>
        /// Update the partition whose GUID and new information are specified in <paramref name="partition"/>.
        /// 
        /// </summary>
        /// <param name="partition"></param>
        /// <param name="groupsWithDataAccess"></param>
        /// <returns></returns>
        public bool UpdatePartition(ServerPartition partition, List<string> groupsWithDataAccess)
        {
            Platform.Log(LogLevel.Info, "Updating server partition: AETitle = {0}", partition.AeTitle);

            bool result = _serverAdapter.Update(partition, groupsWithDataAccess);

            if (result)
                Platform.Log(LogLevel.Info, "Server Partition updated : AETitle = {0}", partition.AeTitle);
            else
                Platform.Log(LogLevel.Info, "Failed to update Server Partition: AETitle = {0}", partition.AeTitle);

            return result;
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:20,代码来源:ServerPartitionConfigController.cs


示例15: AddPartition

        /// <summary>
        /// Add a partition in the database.
        /// </summary>
        /// <param name="partition"></param>
        /// <param name="groupsWithDataAccess"></param>
        public bool AddPartition(ServerPartition partition, List<string> groupsWithDataAccess)
        {
            Platform.Log(LogLevel.Info, "Adding new server partition : AETitle = {0}", partition.AeTitle);

            bool result = _serverAdapter.AddServerPartition(partition, groupsWithDataAccess);

            if (result)
                Platform.Log(LogLevel.Info, "Server Partition added : AETitle = {0}", partition.AeTitle);
            else
                Platform.Log(LogLevel.Info, "Failed to add Server Partition: AETitle = {0}", partition.AeTitle);

            return result;
        }
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:18,代码来源:ServerPartitionConfigController.cs


示例16: UpdateStudyCommand

		public UpdateStudyCommand(ServerPartition partition, 
		                          StudyStorageLocation studyLocation,
		                          IList<BaseImageLevelUpdateCommand> imageLevelCommands,
								  ServerRuleApplyTimeEnum applyTime) 
			: base("Update existing study")
		{
			_partition = partition;
			_oldStudyLocation = studyLocation;
			_commands = imageLevelCommands;
			_statistics = new UpdateStudyStatistics(_oldStudyLocation.StudyInstanceUid);
			// Load the engine for editing rules.
			_rulesEngine = new ServerRulesEngine(applyTime, _partition.Key);
			if (applyTime.Equals(ServerRuleApplyTimeEnum.SopProcessed))
				_rulesEngine.AddIncludeType(ServerRuleTypeEnum.AutoRoute);
			_rulesEngine.Load();
		}
开发者ID:nhannd,项目名称:Xian,代码行数:16,代码来源:UpdateStudyCommand.cs


示例17: StudyEditor

		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="thePartition"></param>
		/// <param name="location"></param>
		/// <param name="thePatient"></param>
		/// <param name="theStudy"></param>
		public StudyEditor(ServerPartition thePartition, StudyStorageLocation location, Patient thePatient, Study theStudy, WorkQueue workQueue)
		{
			FailureReason = string.Empty;
			Platform.CheckForNullReference(thePartition, "thePartition");
			Platform.CheckForNullReference(location, "location");
			Platform.CheckForNullReference(thePatient, "thePatient");
			Platform.CheckForNullReference(theStudy, "theStudy");

			ServerPartition = thePartition;
			StorageLocation = location;
			
            Patient = thePatient;
            Study = theStudy;
			_workQueue = workQueue;

            // Scrub for invalid characters that may cause a failure when the Xml is generated for the history
		    Patient.PatientId = XmlUtils.XmlCharacterScrub(Patient.PatientId);
            Patient.PatientsName = XmlUtils.XmlCharacterScrub(Patient.PatientsName);
            
            Study.StudyDescription = XmlUtils.XmlCharacterScrub(Study.StudyDescription);
            Study.ReferringPhysiciansName = XmlUtils.XmlCharacterScrub(Study.ReferringPhysiciansName);
            Study.PatientId = XmlUtils.XmlCharacterScrub(Study.PatientId);
            Study.PatientsName = XmlUtils.XmlCharacterScrub(Study.PatientsName);            
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:31,代码来源:StudyEditor.cs


示例18: GetServerPartition

		/// <summary>
		/// Get the server partition
		/// </summary>
		/// <param name="partitionFolderName"></param>
		/// <param name="partition"></param>
		/// <returns></returns>
		private bool GetServerPartition(string partitionFolderName, out ServerPartition partition)
		{
			foreach (ServerPartition part in _partitions)
			{
				if (part.PartitionFolder == partitionFolderName)
				{
					partition = part;
					return true;
				}
			}

			partition = null;
			return false;
		}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:20,代码来源:FilesystemRebuildXmlItemProcessor.cs


示例19: LookupDevice

    	/// <summary>
    	/// Lookup the device entity in the database corresponding to the remote AE of the association.
    	/// </summary>
    	/// <param name="partition">The partition to look up the devices</param>
    	/// <param name="association">The association</param>
    	/// <param name="isNew">Indicates whether the device returned is created by the call.</param>
    	/// <returns>The device record corresponding to the called AE of the association</returns>
		static public Device LookupDevice(ServerPartition partition, AssociationParameters association, out bool isNew)
    	{
    		isNew = false;

    		Device device = null;

    		using (
    			IUpdateContext updateContext =
    				PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush))
    		{
    			var queryDevice = updateContext.GetBroker<IDeviceEntityBroker>();

    			// Setup the select parameters.
    			var queryParameters = new DeviceSelectCriteria();
    			queryParameters.AeTitle.EqualTo(association.CallingAE);
    			queryParameters.ServerPartitionKey.EqualTo(partition.GetKey());
                var devices = queryDevice.Find(queryParameters);
                foreach (var d in devices)
                {                    
                    if (string.Compare(d.AeTitle,association.CallingAE,false,CultureInfo.InvariantCulture) == 0)
                    {
                        device = d;
                        break;
                    }
                }

    			if (device == null)
    			{
    				if (!partition.AcceptAnyDevice)
    				{
    					return null;
    				}

    				if (partition.AutoInsertDevice)
    				{
    					// Auto-insert a new entry in the table.
    				    var updateColumns = new DeviceUpdateColumns
    				                            {
    				                                AeTitle = association.CallingAE,
    				                                Enabled = true,
    				                                Description = String.Format("AE: {0}", association.CallingAE),
    				                                Dhcp = false,
    				                                IpAddress = association.RemoteEndPoint.Address.ToString(),
    				                                ServerPartitionKey = partition.GetKey(),
    				                                Port = partition.DefaultRemotePort,
    				                                AllowQuery = true,
    				                                AllowRetrieve = true,
    				                                AllowStorage = true,
    				                                ThrottleMaxConnections = ImageServerCommonConfiguration.Device.MaxConnections,
    				                                DeviceTypeEnum = DeviceTypeEnum.Workstation
    				                            };

    				    var insert = updateContext.GetBroker<IDeviceEntityBroker>();

    					device = insert.Insert(updateColumns);

    					updateContext.Commit();

    					isNew = true;
    				}
    			}

    			if (device != null)
    			{
    				// For DHCP devices, we always update the remote ip address, if its changed from what is in the DB.
    				if (device.Dhcp && !association.RemoteEndPoint.Address.ToString().Equals(device.IpAddress))
    				{
    				    var updateColumns = new DeviceUpdateColumns
    				                            {
    				                                IpAddress = association.RemoteEndPoint.Address.ToString(),
    				                                LastAccessedTime = Platform.Time
    				                            };

    				    var update = updateContext.GetBroker<IDeviceEntityBroker>();

    					if (!update.Update(device.GetKey(), updateColumns))
    						Platform.Log(LogLevel.Error,
    						             "Unable to update IP Address for DHCP device {0} on partition '{1}'",
    						             device.AeTitle, partition.Description);
    					else
    						updateContext.Commit();
    				}
    				else if (!isNew)
    				{
    				    var updateColumns = new DeviceUpdateColumns {LastAccessedTime = Platform.Time};

    				    var update = updateContext.GetBroker<IDeviceEntityBroker>();

    					if (!update.Update(device.GetKey(), updateColumns))
    						Platform.Log(LogLevel.Error,
    						             "Unable to update LastAccessedTime device {0} on partition '{1}'",
    						             device.AeTitle, partition.Description);
    					else
//.........这里部分代码省略.........
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:101,代码来源:DeviceManager.cs


示例20: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                if (ViewState["_EditMode"] != null)
                    _editMode = (bool) ViewState["_EditMode"];

                if (ViewState["_ServerPartition"] != null)
                    _partition = (ServerPartition) ViewState["_ServerPartition"];

                if (ViewState["_EdittedRule"] != null)
                {
                    var ruleKey = ViewState["_EdittedRule"] as ServerEntityKey;
                    _rule = ServerRule.Load(ruleKey);
                }
            }
        }
开发者ID:nhannd,项目名称:Xian,代码行数:17,代码来源:AddEditServerRuleDialog.ascx.cs



注:本文中的ClearCanvas.ImageServer.Model.ServerPartition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Model.Study类代码示例发布时间:2022-05-24
下一篇:
C# Enterprise.ServerEntityKey类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap