Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • Eilerts_branch
  • Karins_branch
  • Mads_branch
4 results

Target

Select target project
No results found
Select Git revision
  • master
  • Eilerts_branch
  • Karins_branch
  • Mads_branch
4 results
Show changes

Commits on Source 15

43 files
+ 345
105
Compare changes
  • Side-by-side
  • Inline

Files

Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/target" />
    </content>
    <orderEntry type="inheritedJdk" />
@@ -55,5 +56,15 @@
    <orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
    <orderEntry type="library" name="Maven: joda-time:joda-time:2.10.14" level="project" />
    <orderEntry type="library" name="Maven: org.jblas:jblas:1.2.4" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.9.0-M1" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.9.0-M1" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.9.0-M1" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.2" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.9.0-M1" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.9.0-M1" level="project" />
    <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.9.0-M1" level="project" />
  </component>
</module>
 No newline at end of file
+28 −0
Original line number Diff line number Diff line
@@ -46,6 +46,34 @@
            <version>1.2.4</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.openjfx/javafx -->

        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx</artifactId>
            <version>11</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>RELEASE</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>RELEASE</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>RELEASE</version>
            <scope>test</scope>
        </dependency>


    </dependencies>

    <properties>
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import static com.application.DB.Constants.*;
import static com.application.DB.Settings.*;
import static com.application.GUI.PopUpWindows.LoginPopup.getPasswordTextField;

public class Account_handler {
public class AccountHandler {

    public static void getAccountInformation(String username, String password) throws Exception {

@@ -63,13 +63,16 @@ public class Account_handler {
                "FROM " + PROJECT_ID + "." + LOCATION_ID + "." + USERS_TABLE_NAME + " " +
                "WHERE Username = " + '"' + username + '"';


        System.out.println(sqlStatement);

        // Retrieves the results from the queryjob
        return HelpingFunctions.createQueryJob(sqlStatement);
    }

    public static void addUser(String firstName, String lastName, String phoneNo, String username, String password, boolean isAdmin) throws Exception {
    public static boolean addUser(String firstName, String lastName, String phoneNo, String username, String password, boolean isAdmin) throws Exception {

        if(getAccount(username).getTotalRows() == 0) {
            // Sqlstatement
            final String sqlStatement =
                    "INSERT INTO " + PROJECT_ID + "." + LOCATION_ID + "." + USERS_TABLE_NAME + "(First_name, Last_name, Phone_no, Username, Password, Admin) " +
@@ -78,6 +81,10 @@ public class Account_handler {
            System.out.println(sqlStatement);

            HelpingFunctions.createQueryJob(sqlStatement);
            return true;
        } else {
            return false;
        }
    }

    public static boolean deleteUser(String username) throws Exception {
Original line number Diff line number Diff line
@@ -41,9 +41,7 @@ public class Constants {
    private static String userName;
    private static String phoneNo;

    public static String getUserName() {
        return userName;
    }
    public static String getUserName() { return userName;}

    public static void setUserName(String userName) {
        Constants.userName = userName;
Original line number Diff line number Diff line
package com.application.DB;

import com.application.GUI.PopUpWindows.NotificationPopUp;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.bigquery.*;
import io.opencensus.internal.StringUtils;

import java.io.File;
import java.io.FileInputStream;
@@ -12,8 +14,10 @@ import java.util.Map;
import java.util.TimeZone;

import static com.application.DB.Constants.KEY_FILE_NAME;
import static com.application.DB.Constants.MAX_USER_INPUT_CHARACTERS;
import static com.application.DB.Settings.*;


public class HelpingFunctions {


@@ -173,4 +177,22 @@ public class HelpingFunctions {
    public static void setLoadedData(boolean loadedData) {
        Constants.LOADED_DATA = loadedData;
    }


public static boolean isValidInput (String input){
    if(input.length() > Constants.MAX_USER_INPUT_CHARACTERS) {
        NotificationPopUp.displayNotificationWindow("A maximum of "+MAX_USER_INPUT_CHARACTERS+" characters is allowed!");
        return true;
    }
    else if(input.toLowerCase().contains("union")){
        NotificationPopUp.displayNotificationWindow("Keyword: 'UNION' is not allowed");
        return true;
    }
    else return false;
}





}
Original line number Diff line number Diff line
@@ -20,16 +20,14 @@ public final class Settings {
    public static int NUMBER_OF_SECONDS_LIVE_DATA = 60;

    // Confidence interval
    public static final double CONFIDENCE_INTERVAL = 0.80;


    public static final double CONFIDENCE_INTERVAL = 0.95;

    // Current sawmill settings;
    public static final String PROJECT_ID = "sf-drying-optimization";
    public static final int LOCATION_ID = 124;
    public static final String MAN_MOISTURE_TABLE = "int_dk_manMoisture";
    public static final String KWH_TABLE_NAME = "int_sd_winccsensordata";
    public static final String USERS_TABLE_NAME = "users";
    public static String USERS_TABLE_NAME = "users";
    public static final String KWH_NAME_PARAMETER = "VariantValue";
    public static final String KWH_TIMESTAMP_NAME_PARAMETER  = "Timestamp";
    public static final String KWH_VALUE_ID_NAME_PARAMETER  = "ValueID";
Original line number Diff line number Diff line
@@ -318,6 +318,7 @@ public class LineChartFunctionality {
            }
        }

        getRegressionSeriesConfidenceInterval().getData().clear();
        Map<Integer, ArrayList<Double>> confidenceIntervalShadow = statistics(multiMap,true);
        for ( Map.Entry<Integer, ArrayList<Double>> entry : confidenceIntervalShadow.entrySet()) {
            for (int i = 0; i < entry.getValue().size(); i++) {
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ public class CreateSideBar {
        RingProgressIndicator ringProgressIndicator = new RingProgressIndicator();
        ringProgressIndicator.setRingWidth(100);
        ringProgressIndicator.makeIndeterminate();
        ringProgressIndicator.setId("progressBar");

        class WorkerThread extends Thread{
            RingProgressIndicator rpi;