Changeset 1440
- Timestamp:
- 03/27/09 13:17:44 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Engine/HeuristicLab.Hive.Engine.csproj
r1432 r1440 31 31 <WarningLevel>4</WarningLevel> 32 32 </PropertyGroup> 33 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 34 <DebugSymbols>true</DebugSymbols> 35 <OutputPath>bin\x86\Debug\</OutputPath> 36 <DefineConstants>DEBUG;TRACE</DefineConstants> 37 <DebugType>full</DebugType> 38 <PlatformTarget>x86</PlatformTarget> 39 <ErrorReport>prompt</ErrorReport> 40 </PropertyGroup> 41 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 42 <OutputPath>bin\x86\Release\</OutputPath> 43 <DefineConstants>TRACE</DefineConstants> 44 <Optimize>true</Optimize> 45 <DebugType>pdbonly</DebugType> 46 <PlatformTarget>x86</PlatformTarget> 47 <ErrorReport>prompt</ErrorReport> 48 </PropertyGroup> 33 49 <ItemGroup> 34 50 <Reference Include="System" /> … … 37 53 </Reference> 38 54 <Reference Include="System.Drawing" /> 55 <Reference Include="System.ServiceModel"> 56 <RequiredTargetFramework>3.0</RequiredTargetFramework> 57 </Reference> 39 58 <Reference Include="System.Windows.Forms" /> 40 59 <Reference Include="System.Xml.Linq"> … … 48 67 </ItemGroup> 49 68 <ItemGroup> 69 <Compile Include="Job.cs" /> 50 70 <Compile Include="HeuristicLabHiveEnginePlugin.cs" /> 51 71 <Compile Include="HiveEngine.cs" /> 52 72 <Compile Include="HiveEngineEditor.cs"> 73 <SubType>UserControl</SubType> 53 74 </Compile> 54 75 <Compile Include="HiveEngineEditor.Designer.cs"> 55 76 <DependentUpon>HiveEngineEditor.cs</DependentUpon> 56 77 </Compile> 78 <Compile Include="Properties\AssemblyInfo.cs" /> 79 <Compile Include="ServiceLocator.cs" /> 57 80 </ItemGroup> 58 81 <ItemGroup> … … 60 83 <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project> 61 84 <Name>HeuristicLab.Core</Name> 85 </ProjectReference> 86 <ProjectReference Include="..\HeuristicLab.DataAccess\HeuristicLab.DataAccess.csproj"> 87 <Project>{9076697B-C151-46CD-95BC-1D059492B478}</Project> 88 <Name>HeuristicLab.DataAccess</Name> 89 </ProjectReference> 90 <ProjectReference Include="..\HeuristicLab.Hive.Contracts\HeuristicLab.Hive.Contracts.csproj"> 91 <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project> 92 <Name>HeuristicLab.Hive.Contracts</Name> 62 93 </ProjectReference> 63 94 <ProjectReference Include="..\HeuristicLab.Hive.JobBase\HeuristicLab.Hive.JobBase.csproj"> … … 68 99 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 69 100 <Name>HeuristicLab.PluginInfrastructure</Name> 101 </ProjectReference> 102 <ProjectReference Include="..\HeuristicLab.SequentialEngine\HeuristicLab.SequentialEngine.csproj"> 103 <Project>{B4BE8E53-BA06-4237-9A01-24255F880201}</Project> 104 <Name>HeuristicLab.SequentialEngine</Name> 70 105 </ProjectReference> 71 106 </ItemGroup> … … 86 121 </Target> 87 122 --> 123 <PropertyGroup> 124 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 125 set ProjectDir=$(ProjectDir) 126 set SolutionDir=$(SolutionDir) 127 set Outdir=$(Outdir) 128 129 call PreBuildEvent.cmd</PreBuildEvent> 130 </PropertyGroup> 88 131 </Project> -
trunk/sources/HeuristicLab.Hive.Engine/HiveEngine.cs
r1432 r1440 25 25 using HeuristicLab.Core; 26 26 using System.Threading; 27 using HeuristicLab.Hive.JobBase; 28 using HeuristicLab.Hive.Contracts.Interfaces; 27 29 28 30 namespace HeuristicLab.Hive.Engine { … … 31 33 /// in parallel. 32 34 /// </summary> 33 public class HiveEngine : EngineBase, IEditable { 34 private IOperator currentOperator; 35 public class HiveEngine : ItemBase, IEngine, IEditable { 36 private Job job; 37 public string HiveServerUrl { get; set; } 35 38 36 /// <summary> 37 /// Creates a new instance of <see cref="HiveEngineEditor"/>. 38 /// </summary> 39 /// <returns>The created view as <see cref="HiveEngineEditor"/>.</returns> 39 public HiveEngine() { 40 job = new Job(); 41 } 42 43 44 #region IEngine Members 45 46 public IOperatorGraph OperatorGraph { 47 get { return job.Engine.OperatorGraph; } 48 } 49 50 public IScope GlobalScope { 51 get { return job.Engine.GlobalScope; } 52 } 53 54 public TimeSpan ExecutionTime { 55 get { return job.Engine.ExecutionTime; } 56 } 57 58 public bool Running { 59 get { return job.Engine.Running; } 60 } 61 62 public bool Canceled { 63 get { return job.Engine.Canceled; } 64 } 65 66 public bool Terminated { 67 get { return job.Engine.Terminated; } 68 } 69 70 public void Execute() { 71 IExecutionEngineFacade executionEngineFacade = ServiceLocator.CreateExecutionEngineFacade(HiveServerUrl); 72 HeuristicLab.Hive.Contracts.BusinessObjects.Job jobObj = new HeuristicLab.Hive.Contracts.BusinessObjects.Job(); 73 jobObj.SerializedJob = PersistenceManager.SaveToGZip(job); 74 executionEngineFacade.AddJob(jobObj); 75 } 76 77 public void ExecuteStep() { 78 throw new NotSupportedException(); 79 } 80 81 public void ExecuteSteps(int steps) { 82 throw new NotSupportedException(); 83 } 84 85 public void Abort() { 86 throw new NotImplementedException(); 87 } 88 89 public void Reset() { 90 throw new NotImplementedException(); 91 } 92 93 public event EventHandler Initialized; 94 95 public event EventHandler<OperationEventArgs> OperationExecuted; 96 97 public event EventHandler<ExceptionEventArgs> ExceptionOccurred; 98 99 public event EventHandler ExecutionTimeChanged; 100 101 public event EventHandler Finished; 102 103 #endregion 104 105 public void RequestSnapshot() { 106 throw new NotImplementedException(); 107 } 108 40 109 public override IView CreateView() { 41 110 return new HiveEngineEditor(this); 42 111 } 43 112 44 /// <summary> 45 /// Creates a new instance of <see cref="HiveEngineEditor"/>. 46 /// </summary> 47 /// <returns>The created editor as <see cref="HiveEngineEditor"/>.</returns> 48 public virtual IEditor CreateEditor() { 113 #region IEditable Members 114 115 public IEditor CreateEditor() { 49 116 return new HiveEngineEditor(this); 50 117 } 51 52 /// <summary> 53 /// Aborts the current operator. 54 /// </summary> 55 /// <remarks>Calls <see cref="EngineBase.Abort"/> of base class <see cref="EngineBase"/> and 56 /// <see cref="IOperator.Abort"/> of the current <see cref="IOperator"/>.</remarks> 57 public override void Abort() { 58 base.Abort(); 59 if (currentOperator != null) 60 currentOperator.Abort(); 61 } 62 63 /// <summary> 64 /// Deals with the next operation, if it is an <see cref="AtomicOperation"/> it is executed, 65 /// if it is a <see cref="CompositeOperation"/> its single operations are pushed on the execution stack. 66 /// </summary> 67 /// <remarks>If an error occurs during the execution the operation is aborted and the operation 68 /// is pushed on the stack again.<br/> 69 /// If the execution was successful <see cref="EngineBase.OnOperationExecuted"/> is called.</remarks> 70 protected override void ProcessNextOperation() { 71 IOperation operation = myExecutionStack.Pop(); 72 if (operation is AtomicOperation) { 73 AtomicOperation atomicOperation = (AtomicOperation)operation; 74 IOperation next = null; 75 try { 76 currentOperator = atomicOperation.Operator; 77 next = atomicOperation.Operator.Execute(atomicOperation.Scope); 78 } 79 catch (Exception ex) { 80 // push operation on stack again 81 myExecutionStack.Push(atomicOperation); 82 Abort(); 83 ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex);}); 84 } 85 if (next != null) 86 myExecutionStack.Push(next); 87 OnOperationExecuted(atomicOperation); 88 if (atomicOperation.Operator.Breakpoint) Abort(); 89 } else if (operation is CompositeOperation) { 90 CompositeOperation compositeOperation = (CompositeOperation)operation; 91 for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--) 92 myExecutionStack.Push(compositeOperation.Operations[i]); 93 } 94 } 118 #endregion 95 119 } 96 120 } -
trunk/sources/HeuristicLab.Hive.Engine/HiveEngineEditor.cs
r1432 r1440 41 41 public HiveEngine HiveEngine { 42 42 get { return (HiveEngine)Engine; } 43 set { base.Engine = value; } 43 set { 44 base.Engine = value; 45 SetDataBinding(); 46 } 44 47 } 45 48 … … 59 62 HiveEngine = hiveEngine; 60 63 } 64 65 private void SetDataBinding() { 66 urlTextBox.DataBindings.Add("Text", HiveEngine, "HiveServerUrl"); 67 } 61 68 } 62 69 } -
trunk/sources/HeuristicLab.sln
r1432 r1440 1303 1303 {4D5A2A16-66C2-431D-9AA3-BD3041E64B84}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU 1304 1304 {4D5A2A16-66C2-431D-9AA3-BD3041E64B84}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU 1305 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|Any CPU.ActiveCfg = Debug| Any CPU1306 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|Any CPU.Build.0 = Debug| Any CPU1305 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|Any CPU.ActiveCfg = Debug|x86 1306 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|Any CPU.Build.0 = Debug|x86 1307 1307 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU 1308 1308 {C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Note: See TracChangeset
for help on using the changeset viewer.