Ejemplo n.º 1
0
  /** * Scheduler ** */
  protected boolean pickAndExecuteAnAction() {

    if (badRequests.size() > 0) {
      processNonNorms();
      return true;
    }
    if (requests.size() > 0) {
      verifyParts();
      return true;
    }
    return false;
  }
Ejemplo n.º 2
0
 /* (GUI NN Panel) Drives the Parts Missing Non-Normative */
 public void msgPartsMissing(int num) // nest num
     {
   print("Received part missing non-normative");
   FactoryState.out.println("Received part missing non-normative");
   badRequests.add(new BadRequest(num, BadRequestState.partsMissing));
   stateChanged();
 }
Ejemplo n.º 3
0
  private void verifyParts() {

    CheckRequest c = requests.remove(0);
    print("Taking picture of " + c.nest.getName());
    FactoryState.out.println("Taking picture of " + c.nest.getName());

    c.nest.guiNest().camera.DoTakePicture(c.nest);
    try {
      verify.acquire();
    } catch (Exception ex) {
    }

    if (c.state == RequestState.good) {
      c.nest.msgPartsAreGood(c.parts);
    } else if (c.state == RequestState.partsBad) {
      c.nest.msgPartsAreBad();
    } else if (c.state == RequestState.partsUnstable) {
      c.nest.msgPartsAreUnstable();
    } else if (c.state == RequestState.partsMissing) {
      print("Parts missing from " + c.nest.getName());
      FactoryState.out.println("Parts missing from " + c.nest.getName());
    } else if (c.state == RequestState.photobombing) {
      c.nest.msgPartsArePhotobombing();
    } else if (c.state == RequestState.cameraError) {
      c.nest.msgPartsAreCameraError();
    }

    stateChanged();
  }
Ejemplo n.º 4
0
  public void processNonNorms() {

    BadRequest n = badRequests.remove(0);
    int num = n.num;

    print("Taking picture of " + factoryState.nestList.get(num).getName());
    FactoryState.out.println("Taking picture of " + factoryState.nestList.get(num).getName());

    factoryState.nestList.get(num).guiNest().camera.DoTakePicture(factoryState.nestList.get(num));
    try {
      verify.acquire();
    } catch (Exception ex) {
    }

    if (n.state == BadRequestState.partsMissing) {
      print("Parts missing from " + factoryState.nestList.get(num).getName());
      FactoryState.out.println("Parts missing from " + factoryState.nestList.get(num).getName());
      factoryState.nestList.get(num).msgPartsMissing();
    }

    stateChanged();
  }
Ejemplo n.º 5
0
 /*  (Nest) Requests to verify parts and take picture when we have unstable parts */
 public void msgVerifyPartsUnstable(List<Part> visionParts, NestAgent nest) {
   requests.add(new CheckRequest(visionParts, nest, RequestState.partsUnstable));
   stateChanged();
 }
Ejemplo n.º 6
0
 /*  (Nest) Requests to verify parts and take picture when there's a camera error */
 public void msgVerifyPartsCameraError(List<Part> visionParts, NestAgent nest) {
   requests.add(new CheckRequest(visionParts, nest, RequestState.cameraError));
   stateChanged();
 }
Ejemplo n.º 7
0
 /*  (Nest) Requests to verify parts and take picture when partrobot is photobombing */
 public void msgVerifyPartsPhotobombing(List<Part> visionParts, NestAgent nest) {
   requests.add(new CheckRequest(visionParts, nest, RequestState.photobombing));
   stateChanged();
 }