Commit dc5ec3a8 authored by Gilbert Kim's avatar Gilbert Kim

update git to use server

parent 4d5f5d5c
/*
var imported = document.createElement('script');
imported.type = "text/javascript"
imported.src = 'hostname.js';
document.head.appendChild(imported);
setTimeout(function () {
console.log(hostname)
}, 5000);
*/
function fillPanels() {
for (var i = 0; i < number_panels; i++) {
if (i == 0) {
......@@ -98,7 +108,7 @@ function makeGraph(i) {
try {
$.ajax({
url: "http://134.82.132.5:8888/query",
url: "http://"+hostname+":8888/query",
dataType: "json",
error: showError,
success: createGraph,
......
var imported = document.createElement('script');
imported.type = "text/javascript"
imported.src = 'hostname.js';
document.head.appendChild(imported);
setTimeout(function () {
console.log(hostname)
}, 5000);
function fillPanels() {
for (var i = 0; i < number_panels; i++) {
if (i == 0) {
......@@ -17,7 +25,7 @@ function fillPanels() {
}
$("#Body-"+i).append('</div>')
$("#Body-"+i).append('<div class="chart_container"><div style="float:right" id="legend"></div><div class="y_axis" id="y_axis-'+i+'"></div><div class="chart" id="chart-'+i+'"></div></div>')
$("#Body-"+i).append('<div class="chart_container"><div style="float:right;" id="legend"></div><div class="y_axis" id="y_axis-'+i+'"></div><div class="chart" id="chart-'+i+'"></div></div>')
makeGraph(i)
links.push("testCombinedData.html")
}
......@@ -98,7 +106,7 @@ function makeGraph(i) {
try {
$.ajax({
url: "http://134.82.132.5:8888/query",
url: "http://"+hostname+":8888/query",
dataType: "json",
error: showError,
success: createGraph,
......
/* get all information necessary from MySQL and openTSDB */
function getAllParameters() {
mysqllookup()
......@@ -11,7 +12,7 @@ function getAllParameters() {
function mysqllookup() {
try {
$.ajax({
url: "http://134.82.56.223:8888/mysqllookup",
url: "http://"+hostname+":8888/mysqllookup",
dataType: "json",
error: showError,
success: getMySQLParams,
......@@ -49,7 +50,7 @@ function opentsdblookup() {
lookup = { "metric": tag_metrics[i] }
try {
$.ajax({
url: "http://134.82.56.223:8888/opentsdblookup",
url: "http://"+hostname+":8888/opentsdblookup",
dataType: "json",
error: showError,
success: getOpenTSDBParams,
......
var imported = document.createElement('script');
imported.type ="text/javascript"
imported.src = 'hostname.js';
document.head.appendChild(imported);
setTimeout(function () {
console.log(hostname)
}, 5000);
/* get all information necessary from MySQL and openTSDB */
function getAllParameters() {
......@@ -11,7 +20,7 @@ function getAllParameters() {
function mysqllookup() {
try {
$.ajax({
url: "http://134.82.132.5:8888/mysqllookup",
url: "http://"+hostname+":8888/mysqllookup",
dataType: "json",
error: showError,
success: getMySQLParams,
......@@ -49,7 +58,7 @@ function opentsdblookup() {
lookup = { "metric": tag_metrics[i] }
try {
$.ajax({
url: "http://134.82.132.5:8888/opentsdblookup",
url: "http://"+hostname+":8888/opentsdblookup",
dataType: "json",
error: showError,
success: getOpenTSDBParams,
......
var hostname = "amm-csr2.bucknell.edu"
var hostname = "amm-csr1.bucknell.edu"
......@@ -26,6 +26,9 @@
<script src = "IWrote/getting_parameters.js"></script>
<script src = "IWrote/downsample.js"></script>
<script src = "IWrote/hostname.js"></script>
<body>
<div style="float:left;width:260px;padding-top:4px;margin-left:50px;">
......@@ -96,7 +99,7 @@
<script>
console.log("hostname: ", hostname)
/* add the downsample options; default is "1 day"
right now only number option is 1 */
......@@ -235,7 +238,7 @@
for (var z in parameter_names) {
cookie_param.push(parameter_names[z])
}
url += "parameters=" + cookie_param + ";"
url += "parameters=" + cookie_param + "&"
var cookie_axis = []
for (var z = 0; z < shown_parameters.length; z++) {
......@@ -243,18 +246,18 @@
var axis = $( "#Axis-"+param_id).val()
cookie_axis.push(axis)
}
url += "axes=" + cookie_axis + ";"
url += "axes=" + cookie_axis + "&"
url += "max1="+max1 + ";"
url += "max2="+max2 + ";"
url += "min1="+min1 + ";"
url += "min2="+min2 + ";"
url += "max1="+max1 + "&"
url += "max2="+max2 + "&"
url += "min1="+min1 + "&"
url += "min2="+min2 + "&"
url += "down_number="+down_number + ";"
url += "down_time="+down_time + ";"
url += "down_number="+down_number + "&"
url += "down_time="+down_time + "&"
url += "start-date="+ $("#start-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + ";"
url += "end-date="+ $("#end-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + ";"
url += "start-date="+ $("#start-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + "&"
url += "end-date="+ $("#end-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + "&"
url += "renderer="+renderer
......@@ -326,7 +329,7 @@
// query string
url_query = url_query.substring(1)
try {
var settings = url_query.split(";")
var settings = url_query.split("&")
for (var x = 0; x < settings.length; x++) {
var setting = settings[x]
console.log(setting)
......@@ -597,7 +600,7 @@ console.log("openTSDB: ", openTSDB)
try {
$.ajax({
url: "http://134.82.56.223:8888/opentsdbtocsv",
url: "http://"+hostname+":8888/opentsdbtocsv",
error: showError,
success: downloadData,
crossDomain: true,
......@@ -854,7 +857,7 @@ console.log("query: ", query)
try {
$.ajax({
url: "http://134.82.56.223:8888/query",
url: "http://"+hostname+":8888/query",
dataType: "json",
error: showError,
success: createGraph,
......
......@@ -26,6 +26,9 @@
<script src = "IWrote/getting_parameters.js"></script>
<script src = "IWrote/downsample.js"></script>
<script src = "IWrote/hostname.js"></script>
<body>
<div style="float:left;width:260px;padding-top:4px;margin-left:50px;">
......@@ -96,7 +99,7 @@
<script>
console.log("hostname: ", hostname)
/* add the downsample options; default is "1 day"
right now only number option is 1 */
......@@ -235,7 +238,7 @@
for (var z in parameter_names) {
cookie_param.push(parameter_names[z])
}
url += "parameters=" + cookie_param + ";"
url += "parameters=" + cookie_param + "&"
var cookie_axis = []
for (var z = 0; z < shown_parameters.length; z++) {
......@@ -243,18 +246,18 @@
var axis = $( "#Axis-"+param_id).val()
cookie_axis.push(axis)
}
url += "axes=" + cookie_axis + ";"
url += "axes=" + cookie_axis + "&"
url += "max1="+max1 + ";"
url += "max2="+max2 + ";"
url += "min1="+min1 + ";"
url += "min2="+min2 + ";"
url += "max1="+max1 + "&"
url += "max2="+max2 + "&"
url += "min1="+min1 + "&"
url += "min2="+min2 + "&"
url += "down_number="+down_number + ";"
url += "down_time="+down_time + ";"
url += "down_number="+down_number + "&"
url += "down_time="+down_time + "&"
url += "start-date="+ $("#start-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + ";"
url += "end-date="+ $("#end-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + ";"
url += "start-date="+ $("#start-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + "&"
url += "end-date="+ $("#end-date").datepicker({ dateFormat: 'dd-mm-yy' }).val() + "&"
url += "renderer="+renderer
......@@ -597,7 +600,7 @@ console.log("openTSDB: ", openTSDB)
try {
$.ajax({
url: "http://134.82.132.5:8888/opentsdbtocsv",
url: "http://"+hostname+":8888/opentsdbtocsv",
error: showError,
success: downloadData,
crossDomain: true,
......@@ -854,7 +857,7 @@ console.log("query: ", query)
try {
$.ajax({
url: "http://134.82.132.5:8888/query",
url: "http://"+hostname+":8888/query",
dataType: "json",
error: showError,
success: createGraph,
......
......@@ -29,7 +29,7 @@
<script src="Scripts/RangeSlider.js"> </script>
<script src="Scripts/RangeSliderPreview.js"> </script>
<script src="Scripts/bootstrap.min.js"></script>
<script src="IWrote/hostname.js"></script>
......@@ -106,7 +106,7 @@
try {
$.ajax({
url: "http://134.82.132.5:8888/query",
url: "http://"+hostname+":8888/query",
dataType: "json",
error: showError,
success: createGraph,
......
<!DOCTYPE html >
<html>
<head>
<!doctype>
<script src="RGraphLibraries/RGraph.common.core.js" ></script>
<script src="RGraphLibraries/RGraph.rose.js" ></script>
<script src="RGraphLibraries/RGraph.common.dynamic.js" ></script>
<script src="RGraphLibraries/RGraph.common.effects.js" ></script>
<script src="RGraphLibraries/RGraph.common.tooltips.js" ></script>
<script src="RGraphLibraries/RGraph.common.key.js" ></script>
<script src="RGraphLibraries/RGraph.drawing.rect.js" ></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="Content/rickshaw.min.css">
<link type="text/css" rel="stylesheet" href="Content/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="IWrote/combined_graph.css">
<link rel="stylesheet" href="Scripts/jquery-ui.css">
<link rel="stylesheet" href="Scripts/style.css">
......@@ -11,39 +22,66 @@
<script src="Scripts/jquery-1.9.0.min.js"></script>
<script src="Scripts/jquery-1.9.0.js"></script>
<script src="Scripts/jquery-ui.js"></script>
<script src = "Scripts/rickshaw.js"></script>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="Scripts/rickshaw.js"></script>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script src = "Scripts/Fixtures.Time.js"> </script>
<script src = "Scripts/RangeSlider.js"> </script>
<script src="Scripts/Fixtures.Time.js"> </script>
<script src="Scripts/RangeSlider.js"> </script>
<script src="Scripts/RangeSliderPreview.js"> </script>
<script src="Scripts/bootstrap.min.js"></script>
<script src="RGraphLibraries/RGraph.common.core.js" ></script>
<script src="RGraphLibraries/RGraph.rose.js" ></script>
<script src="RGraphLibraries/RGraph.common.dynamic.js" ></script>
<script src="RGraphLibraries/RGraph.common.effects.js" ></script>
<script src="RGraphLibraries/RGraph.common.tooltips.js" ></script>
<script src="RGraphLibraries/RGraph.common.key.js" ></script>
<script src="RGraphLibraries/RGraph.drawing.rect.js" ></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
<title>A basic rose chart</title>
<meta name="description" content="A basic Rose chart" />
</head>
<body>
<h1>A basic Rose chart</h1>
<body>
<canvas id="cvs" width="500" height="450">[No canvas support]</canvas>
<div style="float:left;width:260px;padding-top:4px;margin-left:50px;">
<div class="compare-label">Start Date:</div>
<input type="text" id="start-date" class="text ui-widget-content ui-corner-all compare-input">
<div class="compare-label">End Date:</div>
<input type="text" id="end-date" class="text ui-widget-content ui-corner-all compare-input">
</div>
</body>
<script>
/* default start and end dates */
var start = new Date(2014,6-1,20);
var end = new Date();
/* set start date on the calendar; if a date is chosen by user, then query data and update graph */
$( "#start-date" ).datepicker({ onSelect: function(dateText) {
start = new Date(dateText);
main()
}
});
$( "#start-date" ).datepicker("setDate", start);
/* set end date on the calendar; if a date is chosen by user, then query data and update graph */
$( "#end-date" ).datepicker({ onSelect: function(dateText) {
end = new Date(dateText);
main()
}
});
$( "#end-date" ).datepicker("setDate", end);
function main() {
var dict = {}
dict["sensor_name"] = "WindDir"
......@@ -60,14 +98,15 @@
var queryData =
{
"start": (new Date(2014,7-1,8)).getTime(),
"end": (new Date()).getTime(),
"start": start.getTime(),
"end": end.getTime(),
"db" : "OpenTSDB",
"queries": [command, command2]
}
try {
$.ajax({
url: "http://brki167-lnx-5:8888/rickshaw",
url: "http://134.82.132.5:8888/query",
dataType: "json",
error: showError,
success: createGraph,
......@@ -96,12 +135,12 @@
var speedDistr = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]];
for (var i = 0; i < data[0]["Table.sensor_name:WindDir.sensor_processing:Smp.sensor_units:degrees"].length; i++) {
var index = Math.floor(data[0]["Table.sensor_name:WindDir.sensor_processing:Smp.sensor_units:degrees"][i]["y"]/23)
for (var i = 0; i < data[0][0]["Table.sensor_name:WindDir.sensor_processing:Smp.sensor_units:degrees"].length; i++) {
var index = Math.floor(data[0][0]["Table.sensor_name:WindDir.sensor_processing:Smp.sensor_units:degrees"][i]["y"]/23)
showData[index] += 1
var speed = data[1]["Table.sensor_name:WindSpeed.sensor_processing:Smp.sensor_units:meters/second"][i]["y"]
var speed = data[1][0]["Table.sensor_name:WindSpeed.sensor_processing:Smp.sensor_units:meters/second"][i]["y"]
if (speed < 0.5) {
speedDistr[index][0] += 1;
......@@ -118,7 +157,7 @@
for (var i = 0; i < showData.length; i++) {
percentages[i] = showData[i]*100/data[0]["Table.sensor_name:WindDir.sensor_processing:Smp.sensor_units:degrees"].length
percentages[i] = showData[i]*100/data[0][0]["Table.sensor_name:WindDir.sensor_processing:Smp.sensor_units:degrees"].length
speedDistr[i][0] = speedDistr[i][0]/(showData[i])*(percentages[i])
speedDistr[i][1] = speedDistr[i][1]/(showData[i])*(percentages[i])
......@@ -128,6 +167,11 @@
}
console.log(percentages)
$("#cvs").remove()
$(document.body).append('<canvas id="cvs" width="500" height="450">[No canvas support]</canvas>')
var rose = new RGraph.Rose('cvs', speedDistr)
//.set('background.grid.spokes.overhang', 0); // 0 is the default
.set('title', "Wind Dir and Wind Speed")
......@@ -168,5 +212,3 @@ console.log(percentages)
</script>
</body>
</html>
......@@ -43,6 +43,8 @@ def post_is_in_db_with_old_timestamp(title):
def main():
while (True):
#
# get the feed data from the url
#
......
This diff is collapsed.
......@@ -77,7 +77,7 @@ class DataLogger:
end_record_numbers = [int(x) for x in start_record_numbers]
print 'datalogger_size: ', datalogger_size
#print 'datalogger_size: ', datalogger_size
......@@ -89,7 +89,7 @@ class DataLogger:
if (len(data[0]) == 0):
# rarely happends
# dont know the cause
print 'got here for some reason'
#print 'got here for some reason'
break
most_recent_record_number = data[0][0]['RecFrag'][0]['RecNbr']
......@@ -110,7 +110,7 @@ class DataLogger:
# line 1527 in pakbus.py
# got here because there is no data
j -= 1 # dont add so dont count
print 'got here instead'
#print 'got here instead'
break
time_stamp = data[0][0]['RecFrag'][0]['TimeOfRec'][0] + 631166400
......@@ -125,7 +125,7 @@ class DataLogger:
long(sensors[sensor][0])
data_to_add_to_database += [(time_stamp, sensors[sensor][0], self.list_of_tables[i].dic_of_sensorTags[sensor].tag)]
except:
print 'uh oh; there is a problem if this is printed; a data point was NaN or invalid'
print 'a data point was NaN or invalid'
# exclude data point
# data_to_add_to_database += [(time_stamp, -1, self.list_of_tables[i].dic_of_sensorTags[sensor].tag)]
......@@ -135,18 +135,18 @@ class DataLogger:
if (record_number > most_recent_record_number):
up_to_date = True
print 'got here'
#print 'got here'
break
else:
up_to_date = False
print len(data_to_add_to_database)
print time.time()-start_time
start_time = time.time()
#print len(data_to_add_to_database)
#print time.time()-start_time
#start_time = time.time()
#print data_to_add_to_database
#return
if (len(data_to_add_to_database) > 0):
print client.multiplePut(data_to_add_to_database) + ' records added: ' + str(j+1)
print time.time()-start_time
#print time.time()-start_time
end_record_numbers[i] = record_number
......@@ -164,61 +164,3 @@ class DataLogger:
return up_to_date
class DataLogger:
class LinkState:
"from pg 1-3 of BMP5 Transparent Commands rev: 9/08"
OFF_LINE = 8
RING = 9
READY = 10
FINISHED = 11
PAUSE = 12
def __init__(self, host, remote_pakbus_address,
local_pakbus_address = 4085, timeout = 6):
"""Connect to a remote datalogger
@param host/port to connect to:
eg: 60e90457.eairlink.com:6785,
@param remote_pakbus_address: the address/node id to connect to
@param local_pakbus_address: this stations node id/pakbus address [0...4095], Loggernet uses 4095
"""
self.local_address = local_pakbus_address
self.link_state = DataLogger.LinkState.OFF_LINE
self.remote_address = remote_pakbus_address
host,port = host.split(":")
self.link = pakbus.open_socket(host,int(port))
self.timeout = timeout
def ring(self):
pakbus.send(self.link,
pakbus.Link_hdr(
self.remote_address, self.local_address))
pkt = pakbus.recv(self.link)
print "ring got:", pakbus.decode_pkt(pkt)
def hello(self):
pakbus.send(self.link,
pakbus.pkt_hello_cmd(
self.remote_address,
self.local_address,
)[0])
pkt = pakbus.recv(self.link)
print "hello got:", pakbus.decode_pkt(pkt)
def close(self):
self.send(
pakbus.pkt_byte_cmd(self.remote_address, self.local_address))
self.link.close()
self.link_state = DataLogger.LinkState.OFF_LINE
def __del__(self):
if self.link_state > DataLogger.LinkState.OFF_LINE:
self.close()
No preview for this file type
......@@ -7,6 +7,8 @@ import json
import requests
import sys
import time
#import logging
#logging.basicConfig(filename="PyPakLogging.log", level=logging.DEBUG)
......@@ -56,6 +58,7 @@ class DataLogger:
def collectData(self, addition_size, num_dataloggers):
''' Collect data from datalogger up to "addition_size" number of records '''
up_to_date = False
datalogger_size = len(self.list_of_tables)
start_record_numbers = [0]*datalogger_size
......@@ -74,13 +77,19 @@ class DataLogger:
end_record_numbers = [int(x) for x in start_record_numbers]
#print 'datalogger_size: ', datalogger_size
for i in range(datalogger_size):
data = pakbus.collect_data(self.socket, self.pakbus_id, self.my_node_id, self.tabledef, self.list_of_tables[i].name, CollectMode = 0x05, P1 = 1)
start_time = time.time()
if (len(data[0]) == 0):
# rarely happends
# dont know the cause
#print 'got here for some reason'
break
most_recent_record_number = data[0][0]['RecFrag'][0]['RecNbr']
......@@ -99,7 +108,9 @@ class DataLogger:
# only happens for CR800, as if fails connections sometimes
# never happens for CR1000
# line 1527 in pakbus.py
# got here because there is no data
j -= 1 # dont add so dont count
#print 'got here instead'
break
time_stamp = data[0][0]['RecFrag'][0]['TimeOfRec'][0] + 631166400
......@@ -114,7 +125,9 @@ class DataLogger:
long(sensors[sensor][0])
data_to_add_to_database += [(time_stamp, sensors[sensor][0], self.list_of_tables[i].dic_of_sensorTags[sensor].tag)]
except:
data_to_add_to_database += [(time_stamp, -1, self.list_of_tables[i].dic_of_sensorTags[sensor].tag)]
print 'a data point was NaN or invalid'
# exclude data point
# data_to_add_to_database += [(time_stamp, -1, self.list_of_tables[i].dic_of_sensorTags[sensor].tag)]
data_to_add_to_database += [(time_stamp, record_number, self.list_of_tables[i].record_tag)]
......@@ -122,13 +135,18 @@ class DataLogger:
if (record_number > most_recent_record_number):
up_to_date = True
#print 'got here'
break
else:
up_to_date = False
#print len(data_to_add_to_database)
#print time.time()-start_time
#start_time = time.time()
#print data_to_add_to_database
#return
if (len(data_to_add_to_database) > 0):
print client.multiplePut(data_to_add_to_database) + ' records added: ' + str(j+1)
#print time.time()-start_time
end_record_numbers[i] = record_number
......@@ -145,3 +163,62 @@ class DataLogger:
f.write(all_end_records)
return up_to_date
class DataLogger:
class LinkState:
"from pg 1-3 of BMP5 Transparent Commands rev: 9/08"
OFF_LINE = 8
RING = 9
READY = 10
FINISHED = 11
PAUSE = 12
def __init__(self, host, remote_pakbus_address,
local_pakbus_address = 4085, timeout = 6):
"""Connect to a remote datalogger
@param host/port to connect to:
eg: 60e90457.eairlink.com:6785,
@param remote_pakbus_address: the address/node id to connect to
@param local_pakbus_address: this stations node id/pakbus address [0...4095], Loggernet uses 4095
"""
self.local_address = local_pakbus_address
self.link_state = DataLogger.LinkState.OFF_LINE
self.remote_address = remote_pakbus_address
host,port = host.split(":")
self.link = pakbus.open_socket(host,int(port))
self.timeout = timeout
def ring(self):
pakbus.send(self.link,
pakbus.Link_hdr(
self.remote_address, self.local_address))
pkt = pakbus.recv(self.link)
print "ring got:", pakbus.decode_pkt(pkt)
def hello(self):
pakbus.send(self.link,
pakbus.pkt_hello_cmd(
self.remote_address,
self.local_address,
)[0])
pkt = pakbus.recv(self.link)
print "hello got:", pakbus.decode_pkt(pkt)
def close(self):
self.send(
pakbus.pkt_byte_cmd(self.remote_address, self.local_address))
self.link.close()
self.link_state = DataLogger.LinkState.OFF_LINE
def __del__(self):
if self.link_state > DataLogger.LinkState.OFF_LINE:
self.close()
236824
68650
68647
400000
50000
50000
168161
67
64
300000
50000
50000
......@@ -64,6 +64,8 @@ def main():
datalogger_list = []
for i in range(len(pakbus_ids)):
print metric_ids[i]
tmp = [DataLogger(i, socket, my_node_id, metric_ids[i], int(pakbus_ids[i], base = 0))]
print len(tmp)
datalogger_list += [DataLogger(i, socket, my_node_id, metric_ids[i], int(pakbus_ids[i], base = 0))]
#logging.info("Finished making datalogger instances. Now collecting data...")
......
......@@ -14,7 +14,6 @@ def main():
#logging.basicConfig(filename="PyPakLogging.log", level=logging.DEBUG)
#logging.info("Reading config file...")
# Parse command line arguments
parser = optparse.OptionParser()
parser.add_option('-c', '--config',
......@@ -23,7 +22,6 @@ def main():
default = 'campbell.conf')
(options, args) = parser.parse_args()
# Read configuration file
cf = ConfigParser.SafeConfigParser()
print 'configuration read from %s' % cf.read(options.config)
......@@ -66,6 +64,8 @@ def main():
datalogger_list = []
for i in range(len(pakbus_ids)):