Написание программы моделирования работы елочной гирлянды, страница 2

               Form1->Lamp29->Brush->Color = clGreen;

               Form1->Lamp30->Brush->Color = clRed;

               Sleep(250);

               switch(param1) //Отключаем определенную лампочку гирлянды

               {

                     case 0: Form1->Lamp1->Brush->Color = clWhite;

                     case 1: Form1->Lamp2->Brush->Color = clWhite;

                     case 2: Form1->Lamp3->Brush->Color = clWhite;

                     case 3: Form1->Lamp10->Brush->Color = clWhite;

                     case 4: Form1->Lamp11->Brush->Color = clWhite;

                     case 5: Form1->Lamp12->Brush->Color = clWhite;

                     case 6: Form1->Lamp13->Brush->Color = clWhite;

                     case 7: Form1->Lamp14->Brush->Color = clWhite;

                     case 8: Form1->Lamp15->Brush->Color = clWhite;

                     case 9: Form1->Lamp16->Brush->Color = clWhite;

                     case 10: Form1->Lamp24->Brush->Color = clWhite;

                     case 11: Form1->Lamp25->Brush->Color = clWhite;

                     case 12: Form1->Lamp26->Brush->Color = clWhite;

                     case 13: Form1->Lamp27->Brush->Color = clWhite;

                     case 14: Form1->Lamp28->Brush->Color = clWhite;

                     case 15: Form1->Lamp29->Brush->Color = clWhite;

                     case 16: Form1->Lamp30->Brush->Color = clWhite;

               };

               Sleep(550);

               param1++;

               if(param1 == 16) param1 = 0;

             }

             break;

             case 2:

             {           //Режим мигания нескольких лампочек гирлянды

               Form1->Lamp1->Brush->Color = clRed;

               Form1->Lamp2->Brush->Color = clWhite;

               Form1->Lamp3->Brush->Color = clLime;

              Form1->Lamp10->Brush->Color = clNavy;

              Form1->Lamp11->Brush->Color = clWhite;

              Form1->Lamp12->Brush->Color = clLime;

              Form1->Lamp13->Brush->Color = clRed;

              Form1->Lamp14->Brush->Color = clWhite;

              Form1->Lamp15->Brush->Color = clLime;

              Form1->Lamp16->Brush->Color = clRed;

              Form1->Lamp24->Brush->Color = clWhite;

              Form1->Lamp25->Brush->Color = clNavy;

              Form1->Lamp26->Brush->Color = clLime;

              Form1->Lamp27->Brush->Color = clWhite;

              Form1->Lamp28->Brush->Color = clRed;

              Form1->Lamp29->Brush->Color = clGreen;

              Form1->Lamp30->Brush->Color = clWhite;

               Sleep(200);

              Form1->Lamp2->Brush->Color = clYellow;

              Form1->Lamp11->Brush->Color = clYellow;

              Form1->Lamp11->Brush->Color = clYellow;

              Form1->Lamp14->Brush->Color = clYellow;

              Form1->Lamp24->Brush->Color = clYellow;

              Form1->Lamp27->Brush->Color = clYellow;

              Form1->Lamp30->Brush->Color = clYellow;

               Sleep(650);

             }

             break;

        };

     }

  };

}

//---------------------------------------------------------------------------

DWORD WINAPI TForm1::Girlanda2ThreadFunc(LPVOID param)

{

  while(1)

  {

     if(stop2 == false)

     {

        switch(Form1->RG2->ItemIndex) //Определяем порядок работы гирлянды (режим)

        {

             case 0:

             {

              Form1->Lamp4->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp5->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp6->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp7->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp8->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp9->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp17->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp18->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp19->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp21->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp22->Brush->Color = clRed;

              Sleep(100);

              Form1->Lamp23->Brush->Color = clRed;

              Sleep(100);

                // "Отключаем 2-ю гирлянду" (Для эффекта "замедленного включения")

              Form1->Lamp4->Brush->Color = clWhite;

              Sleep(100);

              Form1->Lamp5->Brush->Color = clWhite;

              Sleep(100);