You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code is used to fetch data from a radio scanner about noise levels, the data comes in 8bit integers over a tcp stream in small bits as the scanner moves across the radio spectrum.
I start with a DataSet of all zeros so that the proper frequency range is displayed from the start.
The first scan loop works as expected, but when the scanning loop repeats I begin to see strange results.
The function that is responsible for parsing and inserting data into the graph.
BlockGraph is a custom class which contains information about frequency boundaries and a ChartDataEntry set
func parseAndAppend(graphToUpdate graph: BlockGraph ,rawData: ScanPacket){
print("adding Data at (rawData.offset)")
let lowerBlockBound = graph.block.bounds.0 - 10
let offset = Int(rawData.offset)
for i in 0..<rawData.bytes.count{
let freq = lowerBlockBound + (offset + i)
let byteToGraph = rawData.bytes[i]
let dataPoint = ChartDataEntry(x: Double(freq), y: Double(byteToGraph))
if offset > graph.graphData.count{
graph.graphData.append(dataPoint)
}else{
graph.graphData.insert(dataPoint, at: (offset+i))
}
}
please ask on stack overflow. It seems your issue while scanning. Please also search old issues about dynamic update especially those tagged with GoodExample
My code is used to fetch data from a radio scanner about noise levels, the data comes in 8bit integers over a tcp stream in small bits as the scanner moves across the radio spectrum.
I start with a DataSet of all zeros so that the proper frequency range is displayed from the start.
The first scan loop works as expected, but when the scanning loop repeats I begin to see strange results.
The function that is responsible for parsing and inserting data into the graph.
BlockGraph is a custom class which contains information about frequency boundaries and a ChartDataEntry set
Charts Environment
**Charts version/Branch/Commit Number: 3.1.0
**Xcode version: 9.2
**Swift version: 4.0
**Platform(s) running Charts: ios11
**macOS version running Xcode: 10.13
The text was updated successfully, but these errors were encountered: