Exemplo n.º 1
0
 public void TestElevatorTemplates()
 {
     Console.WriteLine("====================================================");
     Console.WriteLine("   ELEVATORS");
     for (int indx = 33; indx < 35; ++indx)
     {
         AlrtTmplt.Header = MtrTmplt.GetAlertTemplateHeader()[indx];
         AlrtTmplt.Text   = MtrTmplt.GetAlertTemplateText()[indx];
         ParsedMessage pm = TmpltPrsr.ParseElevatorAlert(StationList, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
     }
 }
Exemplo n.º 2
0
 public void TestSystemTemplates()
 {
     Console.WriteLine("====================================================");
     Console.WriteLine("   SYSTEM");
     for (int indx = 35; indx < 41; ++indx)
     {
         AlrtTmplt.Header = MtrTmplt.GetAlertTemplateHeader()[indx];
         AlrtTmplt.Text   = MtrTmplt.GetAlertTemplateText()[indx];
         ParsedMessage pm = TmpltPrsr.ParseSystemAlert(AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
     }
 }
Exemplo n.º 3
0
 public void TestTrainAutoTemplates()
 {
     Console.WriteLine("====================================================");
     Console.WriteLine("   TRAIN AUTO ALERTS");
     for (int indx = 30; indx < 31; ++indx)
     {
         AlrtTmplt.Header = MtrTmplt.GetAlertTemplateHeader()[indx];
         AlrtTmplt.Text   = MtrTmplt.GetAlertTemplateText()[indx];
         DelayReason      = "signal problems";
         ParsedMessage pm = TmpltPrsr.ParseTrainAutoAlert(TaiList, DelayReason, 15, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
         Console.WriteLine("====================================================");
         Console.WriteLine("--- no delay reason ---");
         DelayReason = "[ none ]";
         pm          = TmpltPrsr.ParseTrainAutoAlert(TaiList, DelayReason, 15, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
     }
 }
Exemplo n.º 4
0
 public void TestLineTemplates()
 {
     Console.WriteLine("====================================================");
     Console.WriteLine("   LINES");
     for (int indx = 0; indx < 10; ++indx)
     {
         AlrtTmplt.Header = MtrTmplt.GetAlertTemplateHeader()[indx];
         AlrtTmplt.Text   = MtrTmplt.GetAlertTemplateText()[indx];
         DelayReason      = "signal problems";
         Console.WriteLine("====================================================");
         Console.WriteLine("--- No sublines ---");
         ParsedMessage pm = TmpltPrsr.ParseLineAlert(LaiList2, DelayReason, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
         Console.WriteLine("====================================================");
         Console.WriteLine("--- no delay reason ---");
         DelayReason = "[ none ]";
         pm          = TmpltPrsr.ParseLineAlert(LaiList2, DelayReason, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
         DelayReason = "signal problems";
         Console.WriteLine("====================================================");
         Console.WriteLine("--- Multiple sublines ---");
         pm = TmpltPrsr.ParseLineAlert(LaiList, DelayReason, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
         Console.WriteLine("====================================================");
         Console.WriteLine("--- no delay reason ---");
         DelayReason = "[ none ]";
         pm          = TmpltPrsr.ParseLineAlert(LaiList, DelayReason, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
         DelayReason = "signal problems";
         Console.WriteLine("====================================================");
         Console.WriteLine("--- Multiple lines and sublines ---");
         pm = TmpltPrsr.ParseLineAlert(LaiList3, DelayReason, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
         Console.WriteLine("====================================================");
         Console.WriteLine("--- no delay reason ---");
         DelayReason = "[ none ]";
         pm          = TmpltPrsr.ParseLineAlert(LaiList3, DelayReason, AlrtTmplt);
         Console.WriteLine("====================================================");
         Console.WriteLine(MtrTmplt.GetAlertTemplateName()[indx]);
         Console.WriteLine("--- header template ---");
         Console.WriteLine(AlrtTmplt.Header);
         Console.WriteLine("--- parsed header result ---");
         Console.WriteLine(pm.AlertSummary);
         Console.WriteLine("--- text template ---");
         Console.WriteLine(AlrtTmplt.Text);
         Console.WriteLine("--- parsed text result ---");
         Console.WriteLine(pm.AlertText);
     }
 }