Skip to content

Commit

Permalink
Fixed bugs: 6,7,8,9
Browse files Browse the repository at this point in the history
  • Loading branch information
yazan committed Aug 11, 2016
1 parent 378bd1b commit 024ed6f
Show file tree
Hide file tree
Showing 21 changed files with 1,688 additions and 1,121 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<groupId>edu.iris.dmc</groupId>
<artifactId>stationXml-Validator</artifactId>
<packaging>pom</packaging>
<version>1.5.0-SNAPSHOT</version>
<name>FDSN StationXML Validation</name>
<version>1.5.1</version>
<name>FDSN StationXML Validator</name>



Expand Down
1,076 changes: 30 additions & 1,046 deletions validation-client/logs/station_validator.log

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions validation-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>edu.iris.dmc</groupId>
<artifactId>station-xml-validation</artifactId>
<version>1.5.0-SNAPSHOT</version>
<artifactId>stationXml-Validator</artifactId>
<version>1.5.1</version>
</parent>
<artifactId>validation-client</artifactId>
<name>validation-client</name>
<version>1.0.2-SNAPSHOT</version>
<version>1.0.3</version>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>
<properties>
Expand All @@ -33,12 +33,12 @@
<dependency>
<groupId>edu.iris.dmc</groupId>
<artifactId>validation-service</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>edu.iris.dmc</groupId>
<artifactId>validation-model</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
19 changes: 9 additions & 10 deletions validation-client/src/main/java/edu/iris/dmc/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import java.io.PrintStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
Expand All @@ -36,6 +36,7 @@
import edu.iris.dmc.printer.PrintHandler;
import edu.iris.dmc.service.Errors;
import edu.iris.dmc.validation.rule.Rule;
import edu.iris.dmc.validation.rule.UnitTable;
import edu.iris.dms.table.Column;
import edu.iris.dms.table.Table;
import edu.iris.dms.table.view.ALIGN;
Expand Down Expand Up @@ -272,19 +273,17 @@ private void printRules() {
}

private void printUnits() {
Table table = new Table("IRIS: Validation units");
table.setBorder(1);
Column id = new Column("unit", 100);
table.addAll(id);

Set<String> units = controller.getUnits();
UnitTable table = controller.getUnits();
Collections.sort(table.getUnits());
System.out.println("UNIT TABLE, verified:"+table.getTag());
System.out.println("-------------------------------------");
int row = 0;
for (String unit : units) {
table.add(row, 0, unit, ALIGN.LEFT);
for (String unit : table.getUnits()) {
System.out.println(unit);
row++;
}
Renderer<Table> renderer = new ConsoleTableRenderer(System.out);
renderer.render(table);

}

private static String getVersion() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import edu.iris.dmc.service.Errors;
import edu.iris.dmc.service.ValidatorService;
import edu.iris.dmc.validation.rule.Rule;
import edu.iris.dmc.validation.rule.UnitTable;

@Controller
public class ValidStationController {
Expand All @@ -43,7 +44,7 @@ public List<Rule> getRules() {
return validatorService.getRules();
}

public Set<String> getUnits() {
public UnitTable getUnits() {
return validatorService.getUnits();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ private void printMessage(String file, int id, String network, Date nStart, Date
Date sEnd, String location, String channel, Date cStart, Date cEnd, String message) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.println("before: "+message);
String line = "";
if (this.summary) {
line = buildMessage(file, id, network, (station != null) ? station : "", (location != null) ? location : "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
public class ApplicationTest {

public static void main(String[] args) throws Exception {
args = new String[] {"/Users/Suleiman/PROJECTS/StationXML-Validation/validation-client/src/test/resources/IIKDAK10VHZ_nullLOCCODE.xml"};
//args = new String[] {"/StationXML-Validator/validation-client/src/test/resources/XX-TEST-FalseFailure-Rule413.xml.txt"};
//args = new String[] {"/Users/Suleiman/stations/archive/", "--summary", "-o=/Users/Suleiman/outs.txt"};
//args = new String[] {"--print-rules"};
args = new String[] {"--print-units"};
Application.main(args);
}
}
72 changes: 72 additions & 0 deletions validation-client/src/test/resources/CI_ADL.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" ?>
<fsx:FDSNStationXML schemaVersion="2.0" sis:schemaLocation="http://anss-sis.scsn.org/xml/ext-stationxml/2.0 http://anss-sis.scsn.org/xml/ext-stationxml/2.0/sis_extension.xsd" xmlns:fsx="http://www.fdsn.org/xml/station/1" xmlns:sis="http://anss-sis.scsn.org/xml/ext-stationxml/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<fsx:Source>ANSS Station Information System</fsx:Source>
<fsx:Sender>ANSS Station Information System</fsx:Sender>
<fsx:Created>2015-10-22T01:56:39.176236Z</fsx:Created>
<fsx:Network code="CI">
<fsx:Description>Southern California Seismic Network</fsx:Description>
<fsx:TotalNumberStations>725</fsx:TotalNumberStations>
<fsx:SelectedNumberStations>1</fsx:SelectedNumberStations>
<fsx:Station code="ADL" startDate="1975-02-11T00:00:00Z" endDate="1997-02-14T00:00:00Z">
<fsx:Latitude>34.555810</fsx:Latitude>
<fsx:Longitude>-117.418040</fsx:Longitude>
<fsx:Elevation>868.0</fsx:Elevation>
<fsx:Site>
<fsx:Name>Adelanto</fsx:Name>
<fsx:Town>Adelanto</fsx:Town>
<fsx:Region>CA</fsx:Region>
<fsx:Country>USA</fsx:Country>
</fsx:Site>
<fsx:Operator>
<fsx:Agency>SCSN-CA</fsx:Agency>
</fsx:Operator>
<fsx:CreationDate>1975-02-11T00:00:00Z</fsx:CreationDate>
<fsx:TotalNumberChannels>1</fsx:TotalNumberChannels>
<fsx:SelectedNumberChannels>1</fsx:SelectedNumberChannels>
<fsx:Channel code="EHZ" startDate="1975-02-11T00:00:00Z" endDate="1997-02-14T00:00:00Z" locationCode="">
<fsx:Comment>
<fsx:Value>Historical epoch</fsx:Value>
<fsx:BeginEffectiveTime>1975-02-11T00:00:00Z</fsx:BeginEffectiveTime>
<fsx:EndEffectiveTime>1997-02-14T00:00:00Z</fsx:EndEffectiveTime>
<fsx:Author>
<fsx:Name>sis2.0_migration-SCSN LEGACY DB-SIS</fsx:Name>
</fsx:Author>
</fsx:Comment>
<fsx:Latitude>34.555810</fsx:Latitude>
<fsx:Longitude>-117.418040</fsx:Longitude>
<fsx:Elevation>868.0</fsx:Elevation>
<fsx:Depth>0.0</fsx:Depth>
<fsx:Azimuth>0.0</fsx:Azimuth>
<fsx:Dip>-90.0</fsx:Dip>
<fsx:Type>GEOPHYSICAL</fsx:Type>
<fsx:SampleRate>9.990000000000E+02</fsx:SampleRate>
<fsx:StorageFormat>Steim-1 Integer Compression Format</fsx:StorageFormat>
<fsx:CalibrationUnits>
<fsx:Name>A</fsx:Name>
<fsx:Description>Electric Current in Amperes</fsx:Description>
</fsx:CalibrationUnits>
<fsx:Sensor>
<fsx:Type>UNKNOWN:UNKNOWN_VEL:ADL_EHZ</fsx:Type>
<fsx:Manufacturer>UNKNOWN</fsx:Manufacturer>
<fsx:Model>UNKNOWN_VEL</fsx:Model>
<fsx:SerialNumber>ADL_EHZ</fsx:SerialNumber>
<fsx:CalibrationDate>1975-02-11T00:00:00Z</fsx:CalibrationDate>
</fsx:Sensor>
<fsx:Response>
<fsx:InstrumentSensitivity>
<fsx:Value>1.000000000000E+00</fsx:Value>
<fsx:Frequency>1.000000000000E+00</fsx:Frequency>
<fsx:InputUnits>
<fsx:Name>m/s</fsx:Name>
<fsx:Description>Velocity in meters per second</fsx:Description>
</fsx:InputUnits>
<fsx:OutputUnits>
<fsx:Name>V</fsx:Name>
<fsx:Description>Voltage in Volts</fsx:Description>
</fsx:OutputUnits>
</fsx:InstrumentSensitivity>
</fsx:Response>
</fsx:Channel>
</fsx:Station>
</fsx:Network>
</fsx:FDSNStationXML>
Loading

0 comments on commit 024ed6f

Please sign in to comment.