Exemplo n.º 1
0
 void selection_FixtureSelectionChanged(ElectroxProgramInfo programInfo)
 {
     Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => updateFixtureSelection(programInfo)));
 }
Exemplo n.º 2
0
 void updateFixtureSelection(ElectroxProgramInfo program)
 {
     selectedModelLabel.Content = program.FriendlyName;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Based on the fixture information try to send the command to the Electrox Machine to select the program that matches the fixture on place
 /// </summary>
 private void SendSelectionCommand()
 {
     if (fixture != NO_FIXTURE)
     {
         ElectroxProgramInfo program = ElectroxProgramManagment.GetInstance().GetProgramInfoFromId(fixture);
         if (program != null)
         {
             bool found = false;
             foreach (LaserProgram laserProg in laser.Programs)
             {
                 if (program.Name == laserProg.Name)
                 {
                     found = true;
                 }
             }
             if (found)
             {
                 if (partPresent)
                 {
                     laser.SelectProgram(program.Name);
                     if (FixtureSelectionChanged != null)
                     {
                         FixtureSelectionChanged(program);
                     }
                 }
                 else
                 {
                     laser.Lock(true);
                     if (NoPartFound != null)
                     {
                         NoPartFound();
                     }
                 }
             }
             else
             {
                 laser.Lock(true);
                 if (NoProgramFound != null)
                 {
                     NoProgramFound();
                 }
             }
         }
         else
         {
             laser.Lock(true);
             if (InvalidFixture != null)
             {
                 InvalidFixture();
             }
         }
     }
     else
     {
         laser.Lock(true);
         if (NoFixtureFound != null)
         {
             NoFixtureFound();
         }
     }
 }