Compare commits

...
3 Commits
8 changed files with 72 additions and 38 deletions
+1 -1
View File
@@ -1 +1 @@
1.0.44
1.0.47
+1 -1
View File
@@ -9,7 +9,7 @@ namespace JiraTimeBot.Configuration
{
public class Settings
{
public int MinuterPerWorkDay = 8 * 60;
public int MinuterPerWorkDay { get; set; }
public int RountToMinutes { get; set; }
public string JiraUrl = "https://myteam.aeroclub.ru";
+4
View File
@@ -49,6 +49,10 @@ namespace JiraTimeBot
{
return;
}
if (cancellationToken.IsCancellationRequested)
{
return;
}
_log.Warn($"{realDate:dd.MM.yyyy} вы не сделали ничего полезного =) Использую предыдущий день.");
daysDiff--;
+3 -3
View File
@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.44")]
[assembly: AssemblyFileVersion("1.0.44")]
[assembly: AssemblyInformationalVersion("1.0.44")]
[assembly: AssemblyVersion("1.0.47")]
[assembly: AssemblyFileVersion("1.0.47")]
[assembly: AssemblyInformationalVersion("1.0.47")]
@@ -22,6 +22,7 @@ namespace JiraTimeBot.TaskTime
{
int minutesPerWorkDay = settings.MinuterPerWorkDay;
int remainMinutes = settings.MinuterPerWorkDay;
int workHours = (settings.MinuterPerWorkDay / 60);
int totalCommitsCount = commits.Count;
if (!commits.Any())
@@ -30,7 +31,7 @@ namespace JiraTimeBot.TaskTime
}
//если кол-во коммитов более чем кол-во интервалов - то уменьшим интервал вдвое.
while (totalCommitsCount > (8 * (60.0 / settings.RountToMinutes)))
while (totalCommitsCount > (workHours * (60.0 / settings.RountToMinutes)))
{
settings.RountToMinutes = (int)RoundTo((decimal)(settings.RountToMinutes / 2.0), 5);
_log.Info($"Слишком много задач - уменьшаю интервал до {settings.RountToMinutes}.");
+1
View File
@@ -172,6 +172,7 @@ namespace JiraTimeBot.UI
if (txtDummyMode.Checked)
{
_log.Info("Выключаем режим Тестового прогона");
txtDummyMode.Checked = false;
}
using (var tokenSource = GetTokenSource())
+26 -4
View File
@@ -49,6 +49,8 @@
this.label8 = new System.Windows.Forms.Label();
this.txtTimeControlTask = new System.Windows.Forms.TextBox();
this.chkAutostart = new System.Windows.Forms.CheckBox();
this.lblWorkDay = new System.Windows.Forms.Label();
this.txtWorkDayDuration = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label5
@@ -153,7 +155,7 @@
// chkAddComments
//
this.chkAddComments.AutoSize = true;
this.chkAddComments.Location = new System.Drawing.Point(65, 277);
this.chkAddComments.Location = new System.Drawing.Point(65, 308);
this.chkAddComments.Name = "chkAddComments";
this.chkAddComments.Size = new System.Drawing.Size(133, 17);
this.chkAddComments.TabIndex = 31;
@@ -162,7 +164,7 @@
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(86, 300);
this.btnSave.Location = new System.Drawing.Point(86, 331);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 32;
@@ -227,18 +229,36 @@
// chkAutostart
//
this.chkAutostart.AutoSize = true;
this.chkAutostart.Location = new System.Drawing.Point(65, 254);
this.chkAutostart.Location = new System.Drawing.Point(65, 285);
this.chkAutostart.Name = "chkAutostart";
this.chkAutostart.Size = new System.Drawing.Size(96, 17);
this.chkAutostart.TabIndex = 40;
this.chkAutostart.Text = "Автозагрузка";
this.chkAutostart.UseVisualStyleBackColor = true;
//
// lblWorkDay
//
this.lblWorkDay.AutoSize = true;
this.lblWorkDay.Location = new System.Drawing.Point(15, 258);
this.lblWorkDay.Name = "lblWorkDay";
this.lblWorkDay.Size = new System.Drawing.Size(117, 13);
this.lblWorkDay.TabIndex = 42;
this.lblWorkDay.Text = "Минут в рабочем дне:";
//
// txtWorkDayDuration
//
this.txtWorkDayDuration.Location = new System.Drawing.Point(133, 254);
this.txtWorkDayDuration.Name = "txtWorkDayDuration";
this.txtWorkDayDuration.Size = new System.Drawing.Size(99, 20);
this.txtWorkDayDuration.TabIndex = 41;
//
// frmSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(243, 334);
this.ClientSize = new System.Drawing.Size(243, 362);
this.Controls.Add(this.lblWorkDay);
this.Controls.Add(this.txtWorkDayDuration);
this.Controls.Add(this.chkAutostart);
this.Controls.Add(this.label8);
this.Controls.Add(this.txtTimeControlTask);
@@ -294,5 +314,7 @@
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox txtTimeControlTask;
private System.Windows.Forms.CheckBox chkAutostart;
private System.Windows.Forms.Label lblWorkDay;
private System.Windows.Forms.TextBox txtWorkDayDuration;
}
}
+6
View File
@@ -38,6 +38,7 @@ namespace JiraTimeBot.UI
cboWorkType.SelectedIndex = (int) settings.WorkType;
txtTimeControlTask.Text = settings.TimeControlTask;
txtJQL.Text = settings.JiraQuery;
txtWorkDayDuration.Text = settings.MinuterPerWorkDay.ToString();
cboWorkType_SelectedIndexChanged(null, null);
}
@@ -48,6 +49,10 @@ namespace JiraTimeBot.UI
{
roundTo = 15;
}
if (!int.TryParse(txtWorkDayDuration.Text, out var minuterPerWorkDay))
{
minuterPerWorkDay = 8 * 60;
}
var settings = new Settings
{
@@ -61,6 +66,7 @@ namespace JiraTimeBot.UI
WorkType = (WorkType) cboWorkType.SelectedIndex,
JiraQuery = txtJQL.Text,
TimeControlTask = txtTimeControlTask.Text,
MinuterPerWorkDay = minuterPerWorkDay
};
//LockUnlock(false);