Examples of Logic


Examples of com.art.anette.client.controller.Logic

        // nun eingeloggt; starte Hauptfenster
        if (basicControl.isLoggedIn()) {
            try {
                final ProgressUtils.Monitor progress = ProgressUtils.createProgress(lang.getString("ProgressLogicDatabase"));
                final Logic logic = Logic.getInstance(config, basicControl.getLoggedInEmployee());
                NetworkControl.getInstance().setLoginData(basicControl.getLoginData(), logic.getDBControl());
                NetworkControl.getInstance().start();
                ClientConfiguration.getInstance().setProperty("db.dirty", "true");
                ClientConfiguration.getInstance().writeConfiguration();
                progress.finish();
                SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

Examples of com.art.anette.client.controller.Logic

        }

        // nun eingeloggt; starte Hauptfenster
        assert basicControl.isLoggedIn();

        final Logic logic;
        try {
            logic = Logic.getInstance(config, basicControl.getLoggedInEmployee());
        } catch (LogicInitFailedException e) {
            logger.severe("Can't create logic");
            return;
        }
        network.setLoginData(basicControl.getLoginData(), logic.getDBControl());
        network.start();
        ClientConfiguration.getInstance().setProperty("db.dirty", "true");
        ClientConfiguration.getInstance().writeConfiguration();

        if (sleepTime == 0) {
            doOneShot(logic);
        } else {
            int repeat = 0;
            while (true) {
                doOneShot(logic);
                Thread.sleep(1000 * sleepTime);
                repeat++;
                if (numRepeats > 0 && repeat >= numRepeats) {
                    logger.info("reached the number of repeats (" + numRepeats + "); exiting");
                    break;
                }
            }
        }
        logic.shutdown();
    }
View Full Code Here

Examples of com.pointcliki.dizgruntled.Logic

   
    fMap.dispatcher().addMinion("newlogic", new Minion<IEvent>() {
      @Override
      public long run(Dispatcher<IEvent> dispatcher, String type, IEvent event) {
        if (event instanceof NewLogicEvent) {
          Logic l = ((NewLogicEvent) event).logic();
          fLogicLayer.addChild(l);
          l.init(fMap);
        }
        return Minion.CONTINUE;
      }
    });
   
View Full Code Here

Examples of com.pointcliki.dizgruntled.Logic

         
          // For some reason, ambient files are sometimes incorrectly called "AREAXLOOP" rather than "AMBIENTXLOOP"
          if (GruntzGame.resourceManager().rez().file(aniRef, "ani") == null) aniRef = aniRef.replace("AREA", "AMBIENT");
         
          // Check that the string exists
          Logic log = factory.createFromWWD(logicRef, graphicRef, aniRef, Arrays.copyOfRange(s, dataOffset, dataOffset + 284));
          if (log != null) logics.add(log);
          else if (!logicRef.equals("GiantRock")) System.err.println("Failed to find controller for logic " + logicRef);
        }
      } catch (Exception e) {
        // Finish parsing errors if an exception occurs
View Full Code Here

Examples of com.pointcliki.dizgruntled.Logic

        if (traits(xy).contains("redPyramid")) {
          // Check whether a logic has been placed here
          Effect e = gm.getFirstEntityOfTypeAt(xy, Effect.class);
          if (e == null) {
            try {
              Logic l = new Effect();
              JSONObject json = logic.exportToJSON();
              json.put("xy", (x * 32) + " " + (y * 32));
              l.importFromJSON(json);
              placeLogic(l);
            } catch (Exception e2) {
              System.err.println("Error creating virtual red pyramid logic at " + xy);
              System.err.println(e2.getMessage());
            }
View Full Code Here

Examples of it.polito.appeal.traci.Logic

  public void testCompleteProgramDefinition() throws IOException {
    TrafficLight tl = repo.getByID("0");
    Program program = tl.getCompleteDefinitionQuery().get();
   
    assertEquals(1, program.getLogics().length);
    Logic logic = program.getLogics()[0];
   
    assertEquals("0", logic.getSubID());
    assertEquals(0, logic.getCurrentPhaseIndex());
   
    Phase[] phases = logic.getPhases();
    assertEquals(8, phases.length);
   
    for (int i=0; i<phases.length; i++) {
      Phase ph = phases[i];
      assertEquals(PHASES_DURATION[i] * 1000, ph.getDuration());
View Full Code Here

Examples of it.polito.appeal.traci.Logic

  public void testCompleteProgramDefinition() throws IOException {
    TrafficLight tl = repo.getByID("0");
    Program program = tl.queryReadCompleteDefinition().get();
   
    assertEquals(1, program.getLogics().length);
    Logic logic = program.getLogics()[0];
   
    assertEquals("0", logic.getSubID());
    assertEquals(0, logic.getCurrentPhaseIndex());
   
    Phase[] phases = logic.getPhases();
    assertEquals(8, phases.length);
   
    for (int i=0; i<phases.length; i++) {
      Phase ph = phases[i];
      assertEquals(PHASES_DURATION[i] * 1000, ph.getDuration());
View Full Code Here

Examples of it.polito.appeal.traci.Logic

 
  @Test
  public void testChangingCompleteProgramDefinition() throws IOException {
    TrafficLight tl = repo.getByID("0");
   
    final Logic expectedLogic = new Logic("0", 0, new Phase[] {
      new Phase(10000, new TLState("rrGGyyyyggrryryr")),
      new Phase(15000, new TLState("GGyyrrrrrrGGrGrG")),
      new Phase(55000, new TLState("yyrrGGGGGGyyGyGy"))
    });
    tl.queryChangeCompleteProgramDefinition().setValue(expectedLogic);
    tl.queryChangeCompleteProgramDefinition().run();
   
    Program newProgram = tl.queryReadCompleteDefinition().get();
   
    assertEquals(1, newProgram.getLogics().length);
    Logic actualLogic = newProgram.getLogics()[0];

    assertEquals(
        expectedLogic.getSubID(),
        actualLogic.getSubID());
    assertEquals(
        expectedLogic.getCurrentPhaseIndex(),
        actualLogic.getCurrentPhaseIndex());

    Phase[] actualPhases = actualLogic.getPhases();
    Phase[] expectedPhases = expectedLogic.getPhases();
    assertEquals(expectedPhases.length, actualPhases.length);

    for (int i = 0; i < actualPhases.length; i++) {
      Phase actualPhase = actualPhases[i];
View Full Code Here

Examples of org.vraptor.annotations.Logic

        Class<?> type = resource.getType();
        return type.isAnnotationPresent(Component.class);
    }

    public static String getLogicName(Method method) {
        Logic logic = method.getAnnotation(Logic.class);
        if (logic == null || logic.value().length == 0) {
            return method.getName();
        }
        return logic.value()[0];
    }
View Full Code Here

Examples of org.xtreemfs.babudb.replication.service.logic.Logic

        // initialize logic
        // ---------------------
        logics = new HashMap<LogicID, Logic>();
       
       
        Logic lg = new BasicLogic(this, pacemaker, slaveView, fileIO);
        logics.put(lg.getId(), lg);
       
        lg = new RequestLogic(this, pacemaker, slaveView, fileIO);
        logics.put(lg.getId(), lg);
       
        lg = new LoadLogic(this, pacemaker, slaveView, fileIO, maxChunkSize);
        logics.put(lg.getId(), lg);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.