- Timestamp:
- 06/08/18 15:34:12 (6 years ago)
- Location:
- branches/2839_HiveProjectManagement
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.Designer.cs
r14185 r15956 48 48 this.chbade = new System.Windows.Forms.CheckBox(); 49 49 this.dtpEnd = new System.Windows.Forms.DateTimePicker(); 50 this.dtpToTime = new System.Windows.Forms.DateTimePicker();51 50 this.label5 = new System.Windows.Forms.Label(); 52 51 this.dtpStart = new System.Windows.Forms.DateTimePicker(); 53 this.dtpFromTime = new System.Windows.Forms.DateTimePicker();54 52 this.label6 = new System.Windows.Forms.Label(); 55 53 this.btSaveRecurrence = new System.Windows.Forms.Button(); … … 74 72 this.gbAppointment.Controls.Add(this.chbade); 75 73 this.gbAppointment.Controls.Add(this.dtpEnd); 76 this.gbAppointment.Controls.Add(this.dtpToTime);77 74 this.gbAppointment.Controls.Add(this.label5); 78 75 this.gbAppointment.Controls.Add(this.dtpStart); 79 this.gbAppointment.Controls.Add(this.dtpFromTime);80 76 this.gbAppointment.Controls.Add(this.label6); 81 77 this.gbAppointment.Location = new System.Drawing.Point(2, 2); … … 98 94 // dtpEnd 99 95 // 100 this.dtpEnd.Format = System.Windows.Forms.DateTimePickerFormat.Short; 96 this.dtpEnd.Format = System.Windows.Forms.DateTimePickerFormat.Custom; 97 this.dtpEnd.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss"; 101 98 this.dtpEnd.Location = new System.Drawing.Point(113, 56); 102 99 this.dtpEnd.Name = "dtpEnd"; 103 this.dtpEnd.Size = new System.Drawing.Size( 91, 20);100 this.dtpEnd.Size = new System.Drawing.Size(175, 20); 104 101 this.dtpEnd.TabIndex = 29; 105 //106 // dtpToTime107 //108 this.dtpToTime.CustomFormat = "HH:mm";109 this.dtpToTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;110 this.dtpToTime.Location = new System.Drawing.Point(226, 56);111 this.dtpToTime.Name = "dtpToTime";112 this.dtpToTime.ShowUpDown = true;113 this.dtpToTime.Size = new System.Drawing.Size(73, 20);114 this.dtpToTime.TabIndex = 38;115 102 // 116 103 // label5 … … 126 113 // 127 114 this.dtpStart.Format = System.Windows.Forms.DateTimePickerFormat.Custom; 115 this.dtpStart.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss"; 128 116 this.dtpStart.Location = new System.Drawing.Point(113, 19); 129 117 this.dtpStart.Name = "dtpStart"; 130 this.dtpStart.Size = new System.Drawing.Size( 89, 20);118 this.dtpStart.Size = new System.Drawing.Size(175, 20); 131 119 this.dtpStart.TabIndex = 28; 132 //133 // dtpFromTime134 //135 this.dtpFromTime.CustomFormat = "HH:mm";136 this.dtpFromTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;137 this.dtpFromTime.Location = new System.Drawing.Point(226, 19);138 this.dtpFromTime.Name = "dtpFromTime";139 this.dtpFromTime.ShowUpDown = true;140 this.dtpFromTime.Size = new System.Drawing.Size(73, 20);141 this.dtpFromTime.TabIndex = 30;142 120 // 143 121 // label6 … … 307 285 private System.Windows.Forms.Button btSaveRecurrence; 308 286 private System.Windows.Forms.Button btCancelRecurrence; 309 private System.Windows.Forms.DateTimePicker dtpFromTime;310 private System.Windows.Forms.DateTimePicker dtpToTime;311 287 private System.Windows.Forms.CheckBox chbade; 312 288 private System.Windows.Forms.GroupBox gbWeekly; -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Recurrence.cs
r14185 r15956 46 46 //check if valid 47 47 if (InputIsValid()) { 48 dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);49 dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);48 dateFrom = DateTime.Parse(dtpStart.Text); 49 dateTo = DateTime.Parse(dtpEnd.Text); 50 50 51 51 RecurrentEvent recurrentEvent = new RecurrentEvent() { … … 89 89 DateTime dateFrom, dateTo; 90 90 91 dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);92 dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);91 dateFrom = DateTime.Parse(dtpStart.Text); 92 dateTo = DateTime.Parse(dtpEnd.Text); 93 93 94 94 if (chbade.Checked && dateFrom < dateTo) { -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.Designer.cs
r14185 r15956 48 48 Calendar.DrawTool drawTool1 = new Calendar.DrawTool(); 49 49 this.dvOnline = new Calendar.DayView(); 50 this.txttimeTo = new System.Windows.Forms.DateTimePicker();51 this.txttimeFrom = new System.Windows.Forms.DateTimePicker();52 50 this.dtpTo = new System.Windows.Forms.DateTimePicker(); 53 51 this.groupBox1 = new System.Windows.Forms.GroupBox(); … … 94 92 this.dvOnline.OnSelectionChanged += new System.EventHandler<System.EventArgs>(this.dvOnline_OnSelectionChanged); 95 93 // 96 // txttimeTo97 //98 this.txttimeTo.CustomFormat = "HH:mm";99 this.txttimeTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;100 this.txttimeTo.Location = new System.Drawing.Point(164, 45);101 this.txttimeTo.Name = "txttimeTo";102 this.txttimeTo.ShowUpDown = true;103 this.txttimeTo.Size = new System.Drawing.Size(73, 20);104 this.txttimeTo.TabIndex = 40;105 //106 // txttimeFrom107 //108 this.txttimeFrom.CustomFormat = "HH:mm";109 this.txttimeFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;110 this.txttimeFrom.Location = new System.Drawing.Point(164, 12);111 this.txttimeFrom.Name = "txttimeFrom";112 this.txttimeFrom.ShowUpDown = true;113 this.txttimeFrom.Size = new System.Drawing.Size(73, 20);114 this.txttimeFrom.TabIndex = 39;115 //116 94 // dtpTo 117 95 // 118 96 this.dtpTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom; 97 this.dtpTo.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss"; 119 98 this.dtpTo.Location = new System.Drawing.Point(72, 45); 120 99 this.dtpTo.Name = "dtpTo"; 121 this.dtpTo.Size = new System.Drawing.Size( 89, 20);100 this.dtpTo.Size = new System.Drawing.Size(175, 20); 122 101 this.dtpTo.TabIndex = 33; 123 102 // … … 125 104 // 126 105 this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 127 this.groupBox1.Controls.Add(this.txttimeTo);128 this.groupBox1.Controls.Add(this.txttimeFrom);129 106 this.groupBox1.Controls.Add(this.dtpTo); 130 107 this.groupBox1.Controls.Add(this.dtpFrom); … … 144 121 // 145 122 this.dtpFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom; 123 this.dtpFrom.CustomFormat = "ddd, dd.MM.yyyy, HH:mm:ss"; 146 124 this.dtpFrom.Location = new System.Drawing.Point(72, 12); 147 125 this.dtpFrom.Name = "dtpFrom"; 148 this.dtpFrom.Size = new System.Drawing.Size( 89, 20);126 this.dtpFrom.Size = new System.Drawing.Size(175, 20); 149 127 this.dtpFrom.TabIndex = 32; 150 128 // … … 157 135 this.chbade.TabIndex = 31; 158 136 this.chbade.Text = "All Day Event"; 137 this.chbade.CheckedChanged += new System.EventHandler(this.chbade_CheckedChanged); 159 138 this.chbade.UseVisualStyleBackColor = true; 160 this.chbade.CheckedChanged += new System.EventHandler(this.chbade_CheckedChanged);161 139 // 162 140 // btnRecurrence … … 273 251 #endregion 274 252 275 private System.Windows.Forms.DateTimePicker txttimeTo;276 253 private Calendar.DayView dvOnline; 277 private System.Windows.Forms.DateTimePicker txttimeFrom;278 254 private System.Windows.Forms.DateTimePicker dtpTo; 279 255 private System.Windows.Forms.GroupBox groupBox1; -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs
r15813 r15956 92 92 93 93 if (!string.IsNullOrEmpty(dtpFrom.Text) && !string.IsNullOrEmpty(dtpTo.Text)) { 94 if ( chbade.Checked) {94 if (DateTime.TryParse(dtpFrom.Text, out from) && DateTime.TryParse(dtpTo.Text, out to) && from <= to) { 95 95 //whole day appointment, only dates are visible 96 if (DateTime.TryParse(dtpFrom.Text, out from) && DateTime.TryParse(dtpTo.Text, out to) && from <= to) 97 offlineTimes.Add(CreateDowntime(from, to.AddDays(1), true, dtType)); 98 else 99 MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 100 } else if (!string.IsNullOrEmpty(txttimeFrom.Text) && !string.IsNullOrEmpty(txttimeTo.Text)) { 101 //Timeframe appointment 102 if (DateTime.TryParse(dtpFrom.Text + " " + txttimeFrom.Text, out from) && DateTime.TryParse(dtpTo.Text + " " + txttimeTo.Text, out to) && from < to) { 96 if (chbade.Checked) { 97 offlineTimes.Add(CreateDowntime(new DateTime(from.Year, from.Month, from.Day), (new DateTime(to.Year, to.Month, to.Day)).AddDays(1), true, dtType)); 98 } else { 99 //Timeframe appointment 103 100 if (from.Date == to.Date) 104 101 offlineTimes.Add(CreateDowntime(from, to, false, dtType)); … … 111 108 offlineTimes.Add(CreateDowntime(from, new DateTime(from.Year, from.Month, from.Day, to.Hour, to.Minute, 0, 0), false, dtType)); 112 109 } 113 } else 114 MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 115 } 110 } 111 112 } else { 113 MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 114 } 115 116 116 117 dvOnline.Invalidate(); 117 118 return true; … … 156 157 157 158 private void ChangeRecurrenceDowntime(Guid recurringId) { 158 int hourfrom = int.Parse(txttimeFrom.Text.Substring(0, txttimeFrom.Text.IndexOf(':'))); 159 int hourTo = int.Parse(txttimeTo.Text.Substring(0, txttimeTo.Text.IndexOf(':'))); 160 List<HiveDowntime> recurringDowntimes = offlineTimes.Where(appointment => ((HiveDowntime)appointment).RecurringId == recurringId).ToList(); 161 recurringDowntimes.ForEach(appointment => appointment.StartDate = new DateTime(appointment.StartDate.Year, appointment.StartDate.Month, appointment.StartDate.Day, hourfrom, 0, 0)); 162 recurringDowntimes.ForEach(appointment => appointment.EndDate = new DateTime(appointment.EndDate.Year, appointment.EndDate.Month, appointment.EndDate.Day, hourTo, 0, 0)); 159 DateTime from, to; 160 if (DateTime.TryParse(dtpFrom.Text, out from) && DateTime.TryParse(dtpTo.Text, out to) && from <= to) { 161 List<HiveDowntime> recurringDowntimes = offlineTimes.Where(appointment => ((HiveDowntime)appointment).RecurringId == recurringId).ToList(); 162 recurringDowntimes.ForEach(appointment => appointment.StartDate = new DateTime(appointment.StartDate.Year, appointment.StartDate.Month, appointment.StartDate.Day, from.Hour, 0, 0)); 163 recurringDowntimes.ForEach(appointment => appointment.EndDate = new DateTime(appointment.EndDate.Year, appointment.EndDate.Month, appointment.EndDate.Day, to.Hour, 0, 0)); 164 } else { 165 MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 166 } 163 167 } 164 168 … … 249 253 250 254 private void chbade_CheckedChanged(object sender, EventArgs e) { 251 txttimeFrom.Visible = !chbade.Checked; 252 txttimeTo.Visible = !chbade.Checked; 255 if(chbade.Checked) { 256 dtpFrom.Value = new DateTime(dtpFrom.Value.Year, dtpFrom.Value.Month, dtpFrom.Value.Day); 257 dtpTo.Value = new DateTime(dtpTo.Value.Year, dtpTo.Value.Month, dtpTo.Value.Day); 258 } 253 259 } 254 260 255 261 private void dvOnline_OnSelectionChanged(object sender, EventArgs e) { 256 262 if (dvOnline.Selection == SelectionType.DateRange) { 257 dtpFrom.Text = dvOnline.SelectionStart.ToShortDateString(); 258 dtpTo.Text = dvOnline.SelectionEnd.Date.ToShortDateString(); 259 txttimeFrom.Text = dvOnline.SelectionStart.ToShortTimeString(); 260 txttimeTo.Text = dvOnline.SelectionEnd.ToShortTimeString(); 263 dtpFrom.Value = dvOnline.SelectionStart; 264 dtpTo.Value = dvOnline.SelectionEnd.Date; 261 265 btCreate.Text = "Create Downtime"; 262 266 } 263 267 264 268 if (dvOnline.Selection == SelectionType.Appointment) { 265 dtpFrom.Text = dvOnline.SelectedAppointment.StartDate.ToShortDateString(); 266 dtpTo.Text = dvOnline.SelectedAppointment.EndDate.ToShortDateString(); 267 txttimeFrom.Text = dvOnline.SelectedAppointment.StartDate.ToShortTimeString(); 268 txttimeTo.Text = dvOnline.SelectedAppointment.EndDate.ToShortTimeString(); 269 dtpFrom.Value = dvOnline.SelectedAppointment.StartDate; 270 dtpTo.Value = dvOnline.SelectedAppointment.EndDate; 269 271 270 272 if (dvOnline.SelectedAppointment.Recurring) -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.Designer.cs
r15920 r15956 248 248 protected HeuristicLab.Clients.Hive.Views.TreeView.NoDoubleClickTreeView resourcesTreeView; 249 249 private System.Windows.Forms.GroupBox summaryGroupBox; 250 pr ivateSystem.Windows.Forms.Label coresLabel;251 pr ivateSystem.Windows.Forms.Label memorySummaryLabel;252 pr ivateSystem.Windows.Forms.Label memoryLabel;253 pr ivateSystem.Windows.Forms.Label coresSummaryLabel;250 protected System.Windows.Forms.Label coresLabel; 251 protected System.Windows.Forms.Label memorySummaryLabel; 252 protected System.Windows.Forms.Label memoryLabel; 253 protected System.Windows.Forms.Label coresSummaryLabel; 254 254 } 255 255 } -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r15922 r15956 148 148 } 149 149 150 public int AssignedCores { 151 get { 152 HashSet<Slave> newAssignedSlaves = new HashSet<Slave>(newAssignedResources.OfType<Slave>()); 153 foreach(var slaveGroup in newAssignedResources.OfType<SlaveGroup>()) { 154 foreach(var slave in HiveClient.Instance.GetAvailableResourceDescendants(slaveGroup.Id).OfType<Slave>()) { 155 newAssignedSlaves.Add(slave); 156 } 157 } 158 return newAssignedSlaves.Sum(x => x.Cores.GetValueOrDefault()); 159 } 160 } 161 150 162 public IEnumerable<Resource> AssignedResources { 151 163 get { return newAssignedResources; } … … 425 437 } 426 438 } 427 } else { // existent, unchanged jobs get all assigned resources439 } else if(selectedProject.Id == projectId) { // existent, unchanged jobs get all assigned resources 428 440 // update assigned resources 429 441 var assignedJobResources = GetAssignedResourcesForJob(JobId); -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.Designer.cs
r15953 r15956 50 50 this.refreshButton = new System.Windows.Forms.Button(); 51 51 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 52 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 52 53 this.hiveResourceSelector = new HeuristicLab.Clients.Hive.JobManager.Views.HiveProjectSelector(); 54 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 53 55 this.SuspendLayout(); 54 56 // … … 64 66 this.okButton.Text = "&OK"; 65 67 this.okButton.UseVisualStyleBackColor = true; 68 this.errorProvider.SetIconAlignment(this.okButton, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 69 this.errorProvider.SetIconPadding(this.okButton, 2); 66 70 // 67 71 // cancelButton … … 87 91 this.refreshButton.UseVisualStyleBackColor = true; 88 92 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 93 // 94 // errorProvider 95 // 96 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 97 this.errorProvider.ContainerControl = this; 89 98 // 90 99 // hiveResourceSelector … … 127 136 this.Text = "Select Project"; 128 137 this.Load += new System.EventHandler(this.HiveResourceSelectorDialog_Load); 138 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 129 139 this.ResumeLayout(false); 130 140 … … 137 147 protected System.Windows.Forms.Button refreshButton; 138 148 protected System.Windows.Forms.ToolTip toolTip; 149 protected System.Windows.Forms.ErrorProvider errorProvider; 139 150 protected HiveProjectSelector hiveResourceSelector; 140 151 } -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs
r15933 r15956 134 134 135 135 private void hiveResourceSelector_SelectedProjectChanged(object sender, EventArgs e) { 136 okButton.Enabled = hiveResourceSelector.SelectedProject != null ;136 okButton.Enabled = hiveResourceSelector.SelectedProject != null && hiveResourceSelector.AssignedResources.Any(); 137 137 } 138 138 139 139 private void hiveResourceSelector_SelectedResourcesChanged(object sender, EventArgs e) { 140 140 okButton.Enabled = hiveResourceSelector.AssignedResources.Any(); 141 142 if(!hiveResourceSelector.AssignedResources.Any()) { 143 errorProvider.SetError(okButton, "Note: currently no resources are assigned"); 144 } else if(hiveResourceSelector.AssignedCores == 0) { 145 errorProvider.SetError(okButton, "Note: currently no resources with cores are assigned"); 146 } else { 147 errorProvider.SetError(okButton, string.Empty); 148 } 141 149 } 142 150
Note: See TracChangeset
for help on using the changeset viewer.