Commit bf349740 authored by dagal's avatar dagal
Browse files

More helpful logging

parent 5e9370eb
......@@ -149,11 +149,11 @@ uint64_t CTR_xy_area(void *ctr, uint32_t *s1, uint32_t n_s1, uint32_t *s2, uint3
uint64_t result = 0;
for (uint32_t i = 0; i < n_s1; i++) {
query->values[1] = s1[i];
for (uint32_t j = 0; j < n_s2; j++) {
query->values[3] = s2[j];
for (uint32_t j = 0; j < n_s2; j++) {
query->values[3] = s2[j];
for (uint32_t i = 0; i < n_s1; i++) {
query->values[1] = s1[i];
result += get_from_x_to_y(ctr, query);
}
}
......
......@@ -143,16 +143,8 @@ func GetXYArea(c *gin.Context) {
"message": "incomplete query",
})
} else {
fromTime := uint32(0)
toTime := uint32(0)
//if data.Time != nil {
fromTime = data.Time.From
toTime = data.Time.To
//}
println(fromTime)
println(toTime)
fromTime := data.Time.From
toTime := data.Time.To
xy := CTRXYArea(data.StartStops, data.EndStops, fromTime, toTime)
c.JSON(200, gin.H{
......
......@@ -4,7 +4,10 @@ package main
// #cgo LDFLAGS: -Lctr -lwcsa -lsais -lcds -lrt -lzstd
// #include "cgo.hxx"
import "C"
import "unsafe"
import (
"log"
"unsafe"
)
var ctr unsafe.Pointer
......@@ -55,5 +58,6 @@ func CTRXY(x uint32, y uint32, fromTime uint32, toTime uint32) uint64 {
}
func CTRXYArea(x []uint32, y []uint32, fromTime uint32, toTime uint32) uint64 {
log.Printf("Querying %d x %d area", len(x), len(y))
return uint64(C.CTR_xy_area(ctr, (*C.uint)(&x[0]), C.uint(len(x)), (*C.uint)(&y[0]), C.uint(len(y)), C.uint(fromTime), C.uint(toTime)))
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment