54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace GenCycleVDP
|
|||
|
{
|
|||
|
internal class Program
|
|||
|
{
|
|||
|
private static bool isExiting = false;
|
|||
|
private static List<GenCycle> tasks = [];
|
|||
|
|
|||
|
static void Main(string[] args)
|
|||
|
{
|
|||
|
for (var i = 1; i <= 48; i++)
|
|||
|
{
|
|||
|
var a = new GenCycle(i);
|
|||
|
a.Start();
|
|||
|
tasks.Add(a);
|
|||
|
}
|
|||
|
|
|||
|
int count = 0;
|
|||
|
while (!isExiting)
|
|||
|
{
|
|||
|
if (count > 600)
|
|||
|
{
|
|||
|
for (var i = 0; i < tasks.Count; i++)
|
|||
|
{
|
|||
|
if (i % 10 == 0 && i != 0)
|
|||
|
Console.WriteLine();
|
|||
|
Console.Write(tasks[i].GetStatus() + "|");
|
|||
|
}
|
|||
|
Console.WriteLine();
|
|||
|
count = 0;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
count++;
|
|||
|
}
|
|||
|
Task.Delay(1000).Wait();
|
|||
|
}
|
|||
|
foreach(var furance in tasks)
|
|||
|
{
|
|||
|
furance.Stop();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private static void OnExit(object sender, ConsoleCancelEventArgs e)
|
|||
|
{
|
|||
|
isExiting = true;
|
|||
|
e.Cancel = true;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|