Package fr.soleil.salsa.entity.impl

Examples of fr.soleil.salsa.entity.impl.HistoricLogLine


        public void run() {
            int[] selectedRows = historicLogTable.getSelectedRows();
            historicLogTableModel.clear();
            if (historicLogArray != null) {
                for (int index = 0; index < historicLogArray.size(); ++index) {
                    HistoricLogLine hll = historicLogArray.get(index);
                    addEvent(hll.getDate(), hll.getAction(), hll.getScan(), hll.getNexusFile(), hll
                            .getTrajectories());
                }
                for (int row : selectedRows) {
                    if (row < historicLogArray.size()) {
                        historicLogTable.getSelectionModel().addSelectionInterval(row, row);
View Full Code Here


        public void run() {
            int[] selectedRows = historicLogTable.getSelectedRows();
            historicLogTableModel.clear();
            if (historicLogArray != null) {
                for (int index = 0; index < historicLogArray.size(); ++index) {
                    HistoricLogLine hll = historicLogArray.get(index);
                    addEvent(hll.getScanId(), hll.getDate(), hll.getAction(), hll.getScan(),
                            hll.getNexusFile(), hll.getNxEntry(), hll.getTrajectories());
                }
                for (int row : selectedRows) {
                    if (row < historicLogArray.size()) {
                        historicLogTable.getSelectionModel().addSelectionInterval(row, row);
                    }
View Full Code Here

     *
     * @param nodeEventList, index, events, historicLogArray
     */
    public void createHistoricLogLine(NodeList nodeEventList, int index, ArrayList<Element> events,
            ArrayList<HistoricLogLine> historicLogArray) {
        HistoricLogLine historicLogLine = new HistoricLogLine();
        Element elementEvent = (Element) nodeEventList.item(index);
        String action = null;
        if (elementEvent.hasAttribute("action")) {
            action = elementEvent.getAttribute("action");
            events.add(elementEvent);
        }

        NodeList nodeActuatorList = elementEvent.getElementsByTagName("actuators");
        int nbrNodeActuator = nodeActuatorList.getLength();
        if ((action != null) && action.equalsIgnoreCase("start") && (nbrNodeActuator != 0)) {
            for (int id = 0; id < nbrNodeActuator; id++) {
                Element elementActuator = (Element) nodeActuatorList.item(id);
                NodeList nodeActuatorElementList = elementActuator.getElementsByTagName("actuator");
                int nbrnodeActuatorElement = nodeActuatorElementList.getLength();
                if (nbrnodeActuatorElement != 0) {
                    ArrayList<ITrajectory> trajectoriesList = new ArrayList<ITrajectory>();
                    Element element = null;
                    for (int i = 0; i < nbrnodeActuatorElement; i++) {
                        element = (Element) nodeActuatorElementList.item(i);
                        ITrajectory tmpTrajectory = copyToTrajectoryImpl(element);
                        if (tmpTrajectory != null) {
                            trajectoriesList.add(tmpTrajectory);
                        }

                    }
                    historicLogLine.setTrajectories(trajectoriesList);
                }
            }
        } else {
            ArrayList<ITrajectory> trajectoriesList = new ArrayList<ITrajectory>();
            historicLogLine.setTrajectories(trajectoriesList);
        }

        String date = elementEvent.getAttribute("date");
        String time = elementEvent.getAttribute("hour");

        String month = date.substring(0, 2);
        String day = date.substring(2, 4);
        String year = "20" + date.substring(4, 6);
        String hour = time.substring(0, 2);
        String minute = time.substring(3, 5);
        String second = time.substring(6, 8);
        String stringDate = day + month + year + hour + minute + second;
        Date dateEvent = null;
        try {
            dateEvent = stringToDate(stringDate, "ddMMyyyyHHmmss");
        } catch (Exception e) {
            String errorMessage = "Cannot convert date " + stringDate + " " + e.getMessage();
            LOGGER.warn(errorMessage);
            LOGGER.debug("Stack trace", e);
        }
        historicLogLine.setDate(dateEvent);
        historicLogLine.setScanId(elementEvent.getAttribute("scanId"));
        historicLogLine.setAction(elementEvent.getAttribute("action"));
        historicLogLine.setNexusFile(elementEvent.getAttribute("nexusFile"));
        historicLogLine.setNxEntry(elementEvent.getAttribute("nxEntryName"));
        historicLogLine.setScan(elementEvent.getAttribute("scan"));
        historicLogArray.add(historicLogLine);
    }
View Full Code Here

     *
     * @param nodeEventList, index, events, historicLogArray
     */
    public void createHistoricLogLine(NodeList nodeEventList, int index, ArrayList<Element> events,
            ArrayList<HistoricLogLine> historicLogArray) {
        HistoricLogLine historicLogLine = new HistoricLogLine();
        Element elementEvent = (Element) nodeEventList.item(index);
        String action = null;
        if (elementEvent.hasAttribute("action")) {
            action = elementEvent.getAttribute("action");
            events.add(elementEvent);
        }

        NodeList nodeActuatorList = elementEvent.getElementsByTagName("actuators");
        int nbrNodeActuator = nodeActuatorList.getLength();
        if (action != null && action.equalsIgnoreCase("start") && nbrNodeActuator != 0) {
            for (int id = 0; id < nbrNodeActuator; id++) {
                Element elementActuator = (Element) nodeActuatorList.item(id);
                NodeList nodeActuatorElementList = elementActuator.getElementsByTagName("actuator");
                int nbrnodeActuatorElement = nodeActuatorElementList.getLength();
                if (nbrnodeActuatorElement != 0) {
                    ArrayList<ITrajectory> trajectoriesList = new ArrayList<ITrajectory>();
                    Element element = null;
                    for (int i = 0; i < nbrnodeActuatorElement; i++) {
                        element = (Element) nodeActuatorElementList.item(i);
                        ITrajectory tmpTrajectory = copyToTrajectoryImpl(element);
                        if (tmpTrajectory != null) {
                            trajectoriesList.add(tmpTrajectory);
                        }

                    }
                    historicLogLine.setTrajectories(trajectoriesList);
                }
            }
        }
        else {
            ArrayList<ITrajectory> trajectoriesList = new ArrayList<ITrajectory>();
            historicLogLine.setTrajectories(trajectoriesList);
        }

        String date = elementEvent.getAttribute("date");
        String time = elementEvent.getAttribute("hour");

        String month = date.substring(0, 2);
        String day = date.substring(2, 4);
        String year = "20" + date.substring(4, 6);
        String hour = time.substring(0, 2);
        String minute = time.substring(3, 5);
        String second = time.substring(6, 8);
        String stringDate = day + month + year + hour + minute + second;
        Date dateEvent = null;
        try {
            dateEvent = stringToDate(stringDate, "ddMMyyyyHHmmss");
        }
        catch (Exception e) {
            e.printStackTrace();
        }
        historicLogLine.setDate(dateEvent);
        historicLogLine.setScanId(elementEvent.getAttribute("scanId"));
        historicLogLine.setAction(elementEvent.getAttribute("action"));
        historicLogLine.setNexusFile(elementEvent.getAttribute("nexusFile"));
        historicLogLine.setNxEntry(elementEvent.getAttribute("nxEntryName"));
        historicLogLine.setScan(elementEvent.getAttribute("scan"));
        historicLogArray.add(historicLogLine);
    }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.impl.HistoricLogLine

Copyright © 2018 www.massapicom. 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.