Skip to content

Commit e578a1e

Browse files
committed
Initial commit
0 parents  commit e578a1e

12 files changed

+1372
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target/**

.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>yamcs-cfs</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>

.settings/org.eclipse.jdt.core.prefs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.5
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
13+
org.eclipse.jdt.core.compiler.source=1.5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false

.settings/org.eclipse.m2e.core.prefs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# yamcs-cfs

pom.xml

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<?xml version="1.0"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.odysseysr.proteus</groupId>
5+
<artifactId>yamcs-cfs</artifactId>
6+
<version>0.0.1</version>
7+
8+
<packaging>jar</packaging>
9+
<name>Telemetry and Command provider for Core Flight Software</name>
10+
11+
<dependencies>
12+
<dependency>
13+
<groupId>org.slf4j</groupId>
14+
<artifactId>slf4j-api</artifactId>
15+
<version>1.7.1</version>
16+
</dependency>
17+
18+
<dependency>
19+
<groupId>org.slf4j</groupId>
20+
<artifactId>slf4j-jdk14</artifactId>
21+
<version>1.7.1</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.yamcs</groupId>
26+
<artifactId>yamcs-api</artifactId>
27+
<version>0.29.3</version>
28+
</dependency>
29+
30+
<dependency>
31+
<groupId>org.yamcs</groupId>
32+
<artifactId>yamcs-core</artifactId>
33+
<version>0.29.3</version>
34+
</dependency>
35+
36+
<!-- TEST DEPENDENCIES -->
37+
38+
<dependency>
39+
<groupId>junit</groupId>
40+
<artifactId>junit</artifactId>
41+
<version>4.8.2</version>
42+
<scope>test</scope>
43+
</dependency>
44+
</dependencies>
45+
46+
<reporting>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.codehaus.mojo</groupId>
50+
<artifactId>findbugs-maven-plugin</artifactId>
51+
<version>2.3.3</version>
52+
<configuration>
53+
<threshold>Normal</threshold>
54+
<effort>Default</effort>
55+
</configuration>
56+
</plugin>
57+
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId>
58+
<configuration> <encoding>UTF-8</encoding> <configLocation>checkstyle.xml</configLocation>
59+
<enableRulesSummary>false</enableRulesSummary> </configuration> </plugin> -->
60+
<plugin>
61+
<groupId>org.codehaus.mojo</groupId>
62+
<artifactId>cobertura-maven-plugin</artifactId>
63+
<version>2.7</version>
64+
</plugin>
65+
</plugins>
66+
</reporting>
67+
68+
<repositories>
69+
<repository>
70+
<id>yamcs</id>
71+
<name>yamcs</name>
72+
<releases>
73+
<enabled>true</enabled>
74+
<checksumPolicy>ignore</checksumPolicy>
75+
</releases>
76+
<snapshots>
77+
<enabled>true</enabled>
78+
</snapshots>
79+
<url>file://${project.basedir}/../yamcs/lib</url>
80+
</repository>
81+
82+
<repository>
83+
<id>repository.jboss.org</id>
84+
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
85+
<snapshots>
86+
<enabled>false</enabled>
87+
</snapshots>
88+
</repository>
89+
<repository>
90+
<id>yamcs-mvn-repo-releases</id>
91+
<url>https://raw.github.com/yamcs/mvn-repo/master/releases/</url>
92+
<snapshots>
93+
<enabled>false</enabled>
94+
</snapshots>
95+
</repository>
96+
<repository>
97+
<id>yamcs-mvn-repo-snapshots</id>
98+
<url>https://raw.github.com/yamcs/mvn-repo/master/snapshots/</url>
99+
<snapshots>
100+
<enabled>true</enabled>
101+
</snapshots>
102+
</repository>
103+
</repositories>
104+
105+
<distributionManagement>
106+
<!-- use the following if you're not using a snapshot version. -->
107+
<repository>
108+
<id>github-releases</id>
109+
<name>GitHub Yamcs Repo releases</name>
110+
<url>file:///home/nm/git/yamcs-mvn-repo/releases</url>
111+
</repository>
112+
<!-- use the following if you ARE using a snapshot version. -->
113+
<snapshotRepository>
114+
<id>github-snapshot</id>
115+
<name>Github Yamcs repo snapshots</name>
116+
<url>file:///home/nm/git/yamcs-mvn-repo/snapshots</url>
117+
<uniqueVersion>false</uniqueVersion>
118+
</snapshotRepository>
119+
</distributionManagement>
120+
121+
<profiles>
122+
<profile>
123+
<id>jenkins</id>
124+
<activation>
125+
<property>
126+
<name>env.BUILD_NUMBER</name>
127+
</property>
128+
</activation>
129+
<build>
130+
<pluginManagement>
131+
<plugins>
132+
<plugin>
133+
<groupId>org.codehaus.mojo</groupId>
134+
<artifactId>cobertura-maven-plugin</artifactId>
135+
<version>2.7</version>
136+
<configuration>
137+
<formats>
138+
<format>xml</format>
139+
</formats>
140+
</configuration>
141+
<executions>
142+
<execution>
143+
<phase>package</phase>
144+
<goals>
145+
<goal>cobertura</goal>
146+
</goals>
147+
</execution>
148+
</executions>
149+
</plugin>
150+
</plugins>
151+
</pluginManagement>
152+
</build>
153+
</profile>
154+
</profiles>
155+
156+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package com.odysseysr.proteus.yamcs.tctm;
2+
3+
import java.nio.ByteBuffer;
4+
import java.util.HashMap;
5+
import java.util.Map;
6+
7+
/**
8+
* Fills in the time, seq and checksum
9+
* @author nm
10+
*
11+
*/
12+
public class CfsCcsdsSeqAndChecksumFiller {
13+
static Map<Integer,Integer> seqCounts=new HashMap<Integer,Integer>();
14+
15+
/**
16+
* generate a new ccsds primary header sequence count for the given apid
17+
* @param apid
18+
* @return
19+
*/
20+
private synchronized int getSeqCount(int apid) {
21+
int seqCount=0;
22+
if(seqCounts.containsKey(apid)) {
23+
seqCount=seqCounts.get(apid);
24+
}
25+
seqCount=(seqCount+1)%(1<<14);
26+
seqCounts.put(apid, seqCount);
27+
return seqCount;
28+
}
29+
30+
/**
31+
* generates a sequence count and fills it in plus the checksum and the generation time
32+
* returns the generated sequence count
33+
* @param bb
34+
* @param genTime
35+
*/
36+
public int fill(ByteBuffer bb, long genTime) {
37+
int apid=bb.getShort(0)&0x07FF;
38+
int seqCount=getSeqCount(apid);
39+
int seqFlags=bb.getShort(2)>>>14;
40+
bb.putShort(2,(short)((seqFlags<<14)|seqCount));
41+
42+
//GpsCcsdsTime gpsTime = TimeEncoding.toGpsTime(genTime);
43+
//bb.putInt(6, gpsTime.coarseTime);
44+
//bb.put(10, gpsTime.fineTime);
45+
46+
47+
//int checksum=0;
48+
//int l=bb.capacity();
49+
//for(int i=0;i<l-2;i+=2) {
50+
// checksum+=bb.getShort(i);
51+
//}
52+
//bb.putShort(l-2,(short)(checksum&0xFFFF));
53+
54+
return seqCount;
55+
}
56+
}

0 commit comments

Comments
 (0)