Batch_Historical_Group_Report and refactor the code

This commit is contained in:
Laurențiu Constantin 2024-06-05 14:00:51 +03:00
parent 9084fa4381
commit 69f34e84ba
40 changed files with 4523 additions and 3631 deletions

View File

@ -402,6 +402,34 @@ namespace AppServer
}
private string get_radio_type()
{
string radio_type = string.Empty;
// if radio_type isn't saved in db => check folder's name
System.IO.DirectoryInfo myDirectory = new DirectoryInfo(Environment.CurrentDirectory);
// get parent directory
string parentDirectory = myDirectory.Parent.FullName;
DirectoryInfo dInfo = new DirectoryInfo(parentDirectory);
DirectoryInfo[] subdirs = dInfo.GetDirectories();
foreach (DirectoryInfo folder in subdirs)
{
if (folder.Name == "Gateway") { radio_type = ((int)RADIOTYPE.MOTO).ToString(); break; }
else if (folder.Name == "Hytera") { radio_type = ((int)RADIOTYPE.HYT).ToString(); break; }
else if (folder.Name == "Momentum") { radio_type = ((int)RADIOTYPE.HARRIS).ToString(); break; }
else if (folder.Name == "Astro") { radio_type = ((int)RADIOTYPE.ATLAS).ToString(); break; }
else if (folder.Name == "Tetra") { radio_type = ((int)RADIOTYPE.TETRA).ToString(); break; }
else if (folder.Name == "Connect Plus") { radio_type = ((int)RADIOTYPE.CONECTPLUS).ToString(); break; }
else if (folder.Name == "Repeater_Gateway") { radio_type = ((int)RADIOTYPE.REPEATER_TRBO).ToString(); break; }
else if (folder.Name == "SMC_Gateway") { radio_type = ((int)RADIOTYPE.MOTO).ToString(); break; }
else if (folder.Name == "Simoco") { radio_type = ((int)RADIOTYPE.SIMOCO).ToString(); break; }
else if (folder.Name == "Sepura3T_SDR") { radio_type = ((int)RADIOTYPE.LISF).ToString(); break; }
}
return radio_type;
}
/// <summary>
/// Update the UI licenses circular controllers. This will read the dongle licenses
/// and the ones from the DB and the display them in the UI.
@ -409,40 +437,26 @@ namespace AppServer
private void UpdateLicensesUI()
{
Version v = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
String[] appname = this.Text.Split(' ');
String[] appname = this.Text.Split(" ".ToCharArray());
this.Text = appname[0] + " " + v.ToString();
lbVersion.Text = "Version " + v.ToString();
//check radio type from database to set job ticketing to visible
if (Program.cfg == null)
return;
radioTypeManager = new DBRadioTypeManager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
dbSettings = new DBsettingsManager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
string radio_type = radioTypeManager.getRadioType();
if(radio_type == "")
{
// if radio_type isn't saved in db => check folder's name
System.IO.DirectoryInfo myDirectory = new DirectoryInfo(Environment.CurrentDirectory);
// get parent directory
string parentDirectory = myDirectory.Parent.FullName;
DirectoryInfo dInfo = new DirectoryInfo(parentDirectory);
DirectoryInfo[] subdirs = dInfo.GetDirectories();
foreach(DirectoryInfo folder in subdirs)
{
if (folder.Name == "Gateway") { radio_type = ((int)RADIOTYPE.MOTO).ToString(); break; }
else if (folder.Name == "Hytera") { radio_type = ((int)RADIOTYPE.HYT).ToString(); break; }
else if (folder.Name == "Momentum") { radio_type = ((int)RADIOTYPE.HARRIS).ToString(); break; }
else if (folder.Name == "Astro") { radio_type = ((int)RADIOTYPE.ATLAS).ToString(); break; }
else if (folder.Name == "Tetra") { radio_type = ((int)RADIOTYPE.TETRA).ToString(); break; }
else if (folder.Name == "Connect Plus") { radio_type = ((int)RADIOTYPE.CONECTPLUS).ToString(); break; }
else if (folder.Name == "Repeater_Gateway") { radio_type = ((int)RADIOTYPE.REPEATER_TRBO).ToString(); break; }
else if (folder.Name == "SMC_Gateway") { radio_type = ((int)RADIOTYPE.MOTO).ToString(); break; }
else if (folder.Name == "Simoco") { radio_type = ((int)RADIOTYPE.SIMOCO).ToString(); break; }
else if (folder.Name == "Sepura3T_SDR") { radio_type = ((int)RADIOTYPE.LISF).ToString(); break; }
}
radio_type = get_radio_type();
//save radiotype in db
radioTypeManager.setRadioType(radio_type);
}
if (radio_type != "")
RadioType = (RADIOTYPE)Enum.Parse(typeof(RADIOTYPE), radio_type);
@ -451,31 +465,18 @@ namespace AppServer
= (RadioType == RADIOTYPE.MOTO || RadioType == RADIOTYPE.REPEATER_TRBO || RadioType == RADIOTYPE.HYT || RadioType == RADIOTYPE.HARRIS);
circularSDM.Visible = pbSDM.Visible = labelSDM.Visible = lbLicSDM.Visible = (RadioType == RADIOTYPE.SIMOCO);
circularSDM.Visible = pbSDM.Visible = labelSDM.Visible = lbLicSDM.Visible = (RadioType == RADIOTYPE.SIMOCO);
// change logo icon depending on the system type
if (RadioType == RADIOTYPE.SIMOCO)
{
pbLogo.Image = AppServer.Properties.Resources.simoco;
}
else
{
pbLogo.Image = AppServer.Properties.Resources.safemobile;
}
pbLogo.Image = (RadioType == RADIOTYPE.SIMOCO) ? AppServer.Properties.Resources.simoco :
AppServer.Properties.Resources.safemobile;
if (error)
{
if (regLib.demoMode)
{
if (regLib.remainingTime() == 1)
{
lbRegistrationStatus.Text = "Demo invalidated, please contact " + Program.COMPANY;
lbRegistrationStatus.ForeColor = Color.DarkRed;
}
else
{
lbRegistrationStatus.Text = "Demo registration expired";
lbRegistrationStatus.ForeColor = Color.DarkRed;
}
lbRegistrationStatus.Text = (regLib.remainingTime() == 1) ? "Demo invalidated, please contact " + Program.COMPANY : "Demo registration expired"; ;
lbRegistrationStatus.ForeColor = Color.DarkRed;
}
}
else
@ -486,9 +487,11 @@ namespace AppServer
lbRegistrationStatus.Text = "trial ends in " + (regLib.remainingTime() / 86400).ToString() + " days ";
lbRegistrationStatus.ForeColor = Color.Yellow;
}
regManager = new DBregistrationManager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
vehManager = new DBvehiclesManager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
dbsub = new DBsubsOperationManager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
uint gpsCount = regManager.getGPSCount();
uint smsCount = regManager.getSMSCount();
uint reportsCount = regManager.getReportsCount();
@ -644,6 +647,7 @@ namespace AppServer
regManager.resetSafeDispatchRegistrations();
lbRegistrationRemaining.Text = "Database licenses reset";
}
if(gatewaysCount > regLib.gatewayCount())
regManager.removeAllGatewayRegistrations();
@ -997,6 +1001,7 @@ namespace AppServer
try
{
DB.InitConnection();
DB.CloseConnection();
}
catch (Exception ex)
{
@ -1196,15 +1201,19 @@ namespace AppServer
private void BroadcastWebSocketStatusOnMessageBus(object source, ElapsedEventArgs e)
{
string message; //$"#0.0#{failoverStatusToMessBuss}#{configHelper.PCIp}#{msg}#{master}#";
//string message; //$"#0.0#{failoverStatusToMessBuss}#{configHelper.PCIp}#{msg}#{master}#";
string status = WebsocketThread.Instance.getClient().IsRunning ? "online" : "offline";
string status = "offline";
IWebsocketClient iWebsocketClient = WebsocketThread.Instance.getClient();
if( iWebsocketClient != null)
status = iWebsocketClient.IsRunning ? "online" : "offline";
message = $"#0.0#{Utils.enumConvertToString(MessageBusCmds.WebsocketStatusToMsgBus)}#{status}#";
string message = $"#0.0#{Utils.enumConvertToString(MessageBusCmds.WebsocketStatusToMsgBus)}#{status}#";
byte[] dataToSend = Utils.Convert_text_For_multicast(message);
udp.Send(dataToSend, dataToSend.Length);
if(dataToSend != null && dataToSend.Length > 0)
udp.Send(dataToSend, dataToSend.Length);
}

View File

@ -1721,6 +1721,7 @@ namespace AppServer
UserList.Add(obj.Id, obj.UserName);
}
// gateways
GatewayListTMP = dbgate.getAllGateways();
GatewayList.Clear();
foreach (Gateway obj in GatewayListTMP)
@ -1732,6 +1733,7 @@ namespace AppServer
GatewayList.Add(obj.Id, (obj.Peer_id > 0));
}
// vehicles
VehicleListTMP = dbveh.getAllVehicles();
VehicleList.Clear();
foreach (Vehicles obj in VehicleListTMP)
@ -2003,20 +2005,22 @@ namespace AppServer
{
Vehicle_Data vehicle_Data = (Vehicle_Data)VehListTMP[obj];
// populate Zone list
ArrayList tmparr = new ArrayList();
foreach (ZoneClass obj2 in ZoneListTMP)
{
ZoneClass tmp = new ZoneClass(obj2, obj2.id, obj2.arrSc_id);
tmparr.Add(tmp);
tmparr.Add(new ZoneClass(obj2, obj2.id, obj2.arrSc_id));
}
vehicle_Data.zonelist = tmparr;
// populate Landmark list
ArrayList tmparr2 = new ArrayList();
foreach (LandMark obj2 in LandListTMP)
{
LandMark tmp = new LandMark(obj2.name, obj2.lat, obj2.lng, obj2.land_id, obj2.useridx, obj2.callout, obj2.calloutSeverity);
tmparr2.Add(tmp);
tmparr2.Add(new LandMark(obj2.name, obj2.lat, obj2.lng, obj2.land_id, obj2.useridx, obj2.callout, obj2.calloutSeverity));
}
vehicle_Data.landlist = tmparr2;
}
@ -2038,11 +2042,9 @@ namespace AppServer
MainForm.VehList.Clear();
// move from TMP used List
foreach (ZoneClass obj in ZoneListTMP)
ZoneList.Add(obj);
ZoneList.AddRange(ZoneListTMP);
LandList.AddRange(LandListTMP);
foreach (LandMark obj in LandListTMP)
LandList.Add(obj);
foreach (String obj in VehListTMP.Keys)
{
@ -2110,8 +2112,8 @@ namespace AppServer
{
try
{
DB = new DBmanager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
DB.InitConnection();
//DB = new DBmanager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
//DB.InitConnection();
//load vehs for stolen test
dbvehs = new DBvehiclesManager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);
dbsubsoperManage = new DBsubsOperationManager(Program.cfg.DB_IP, Program.cfg.DB_schema, Program.cfg.DB_user, Program.cfg.DB_passwd, Program.cfg.DB_port);

View File

@ -247,18 +247,11 @@ namespace RegLibDLL
return true;
#else
int ret = SDX_Find();
if (ret > 1)
{
if (ret >= 1)
return true;
}
else if (ret == 1)
{
return true;
}
else
{
return false;
}
return false;
#endif
}
@ -269,9 +262,8 @@ namespace RegLibDLL
#else
int ret = SDX_Open(1, uid, ref hid);
if (ret < 0)
{
return false;
}
handle = ret;
return true;
#endif
@ -282,9 +274,8 @@ namespace RegLibDLL
Byte[] retbuff = new byte[512];
int ret = SDX_Read(handle, blockNumber, retbuff);
if (ret < 0)
{
return "";
}
String sReturn = System.Text.ASCIIEncoding.ASCII.GetString(retbuff);
return sReturn;
}
@ -293,9 +284,8 @@ namespace RegLibDLL
{
int ret = SDX_Write(handle, blockIndex, dataToWrite);
if (ret < 0)
{
return -1;
}
return 0;
}
private String DecryptString(string Message, string Passphrase)
@ -356,13 +346,11 @@ namespace RegLibDLL
return true;
#else
if (existsDongle)
{
return true;
}
else
{
return false;
}
return false;
#endif
}
@ -376,13 +364,10 @@ namespace RegLibDLL
return true;
#else
if (validDongle)
{
return true;
}
else
{
return false;
}
return false;
#endif
}
@ -397,10 +382,8 @@ namespace RegLibDLL
Int32 length = Convert.ToInt32(decodedMessage.Substring(10, 3));
return decodedMessage.Substring(13, length);
}
else
{
return null;
}
return null;
}
/// <summary>
@ -414,10 +397,8 @@ namespace RegLibDLL
Int32 length = Convert.ToInt32(decodedMessage.Substring(35, 3));
return decodedMessage.Substring(38, length);
}
else
{
return null;
}
return null;
}
/// <summary>
@ -431,10 +412,8 @@ namespace RegLibDLL
Int32 length = Convert.ToInt32(decodedMessage.Substring(85, 3));
return decodedMessage.Substring(88, length);
}
else
{
return null;
}
return null;
}
/// <summary>
@ -448,10 +427,9 @@ namespace RegLibDLL
Int32 length = Convert.ToInt32(decodedMessage.Substring(195, 3));
return decodedMessage.Substring(198, length);
}
else
{
return null;
}
return null;
}
/// <summary>
@ -464,17 +442,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[zonesIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -488,17 +462,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[gpsIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -512,17 +482,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[smsIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -536,17 +502,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[jobTicketingIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -560,17 +522,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[recordingsIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -581,17 +539,13 @@ namespace RegLibDLL
public int voiceCount()
{
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[voiceIndex]);
}
else
{
return 0;
}
return 0;
}
/// <summary>
@ -601,17 +555,14 @@ namespace RegLibDLL
public int audibleAlertsCount()
{
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[audibleAlertsIndex]);
}
else
{
return 0;
}
return 0;
}
/// <summary>
@ -621,17 +572,14 @@ namespace RegLibDLL
public int dbAccessCount()
{
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[dbAccessIndex]);
}
else
{
return 0;
}
return 0;
}
/// <summary>
@ -644,17 +592,14 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[emailGatewayIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -668,13 +613,13 @@ namespace RegLibDLL
return 45;
#else
if (demoMode)
{
return 12; //10
}
if (oldDongle)
{
return 12; //10
}
int numberOfUnits = 0;
if (validDongle)
{
@ -687,10 +632,9 @@ namespace RegLibDLL
}
else return numberOfUnits;
}
else
{
return 0;
}
return 0;
#endif
}
@ -704,17 +648,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[reportsIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -728,17 +668,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[telemetryIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -752,17 +688,13 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[mapType1Index]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -776,17 +708,14 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[mapType2Index]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -800,17 +729,15 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[mapType3Index]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -824,17 +751,15 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[mapType4Index]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -848,17 +773,14 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
if (validDongle)
{
return ((int)decodedMessage[safeDispatchIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -872,24 +794,14 @@ namespace RegLibDLL
return true;
#else
if (demoMode)
{
return true;
}
if (validDongle)
{
if (decodedMessage[342].CompareTo('y') == 0)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
return (decodedMessage[342].CompareTo('y') == 0);
return false;
#endif
}
@ -903,9 +815,7 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
/*if (enabledGateway())
{
oldDongle = true;
@ -913,13 +823,11 @@ namespace RegLibDLL
}
oldDongle = false;*/
if (validDongle)
{
return ((int)decodedMessage[gatewayIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -933,9 +841,7 @@ namespace RegLibDLL
return 2;
#else
if (demoMode)
{
return 1;
}
/*if (enabledGateway())
{
oldDongle = true;
@ -943,13 +849,10 @@ namespace RegLibDLL
}
oldDongle = false;*/
if (validDongle)
{
return ((int)decodedMessage[SDMobileIndex]);
}
else
{
return 0;
}
return 0;
#endif
}
@ -963,26 +866,18 @@ namespace RegLibDLL
return true;
#else
if (demoMode)
{
return true;
}
if (validDongle)
{
Int32 length = Convert.ToInt32(decodedMessage.Substring(320, 3));
String HID_READ = decodedMessage.Substring(323, length);
if (HID_READ.CompareTo(hid.ToString()) == 0)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
return (HID_READ.CompareTo(hid.ToString()) == 0);
}
return false;
#endif
}

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.0.0.10885")]
[assembly: AssemblyFileVersion("8.0.0.10885")]
[assembly: AssemblyVersion("8.1.0.10898")]
[assembly: AssemblyFileVersion("8.1.0.10898")]

View File

@ -180,9 +180,10 @@ namespace ReportsLibrary
tmpData = new EndOfDayData();
RowNumber++;
tmpData.Trip = Convert.ToString(RowNumber);
//tmpData.StartTime = (new ConvertDT().GetDTLocalFromSeconds(obj3.stop)).ToString();
if (StaticMembers.is24hours) tmpData.StartTime = ((obj3.stop).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy HH:mm:ss");
else tmpData.StartTime = ((obj3.stop).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy hh:mm:ss tt");
string dateTimeFormat = StaticMembers.is24hours ? "MM/dd/yyyy HH:mm:ss" : "MM/dd/yyyy hh:mm:ss tt";
tmpData.StartTime = ((obj3.stop).GetDTLocalFromSeconds()).ToString(dateTimeFormat);
timeforStartCalc = obj3.stop;
if (!StaticMembers.LATLNGforDinamicReports)
@ -213,10 +214,10 @@ namespace ReportsLibrary
tmpData = new EndOfDayData();
RowNumber++;
tmpData.Trip = Convert.ToString(RowNumber);
//tmpData.StartTime = (new ConvertDT().GetDTLocalFromSeconds(lastStopTimeStop)).ToString();
if (StaticMembers.is24hours) tmpData.StartTime = ((lastStopTimeStop).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy HH:mm:ss");
else tmpData.StartTime = ((lastStopTimeStop).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy hh:mm:ss tt");
string dateTimeFormat = StaticMembers.is24hours ? "MM/dd/yyyy HH:mm:ss" : "MM/dd/yyyy hh:mm:ss tt";
tmpData.StartTime = ((lastStopTimeStop).GetDTLocalFromSeconds()).ToString(dateTimeFormat);
timeforStartCalc = lastStopTimeStop;
tmpData.StartAddress = lastStopNameStop;
@ -226,26 +227,35 @@ namespace ReportsLibrary
{
totaltime += (obj3.start - timeforStartCalc);
tmpData.StopTime = ((obj3.start).GetDTLocalFromSeconds()).ToString();
if (!StaticMembers.LATLNGforDinamicReports)
{
if ((StaticMembers.MapType == MapTYPE.Google) || (StaticMembers.MapType == MapTYPE.ArcGis))
tmpData.StopAddress = StaticMembers.IdReportHS[obj3.name].ToString();
}
else tmpData.StopAddress = "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString();
else
tmpData.StopAddress = "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString();
difidx = (Double)DriveList[count3];
total += difidx;
if (StaticMembers.isInMile) tmpData.Distance = (Math.Round(((difidx * 0.621371192) * 1000)) / 1000).ToString();
else tmpData.Distance = difidx.ToString();
if (tmpData != null) Ret.Add(tmpData);
if (StaticMembers.isInMile)
tmpData.Distance = (Math.Round(((difidx * 0.621371192) * 1000)) / 1000).ToString();
else
tmpData.Distance = difidx.ToString();
if (tmpData != null)
Ret.Add(tmpData);
}
lastStopIsStop = true;
lastStopTimeStop = obj3.stop;
if (!StaticMembers.LATLNGforDinamicReports)
{
if ((StaticMembers.MapType == MapTYPE.Google) || (StaticMembers.MapType == MapTYPE.ArcGis))
lastStopNameStop = StaticMembers.IdReportHS[obj3.name].ToString();
}
else lastStopNameStop = "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString();
else
lastStopNameStop = "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString();
}
catch (Exception ex)
{
@ -264,8 +274,12 @@ namespace ReportsLibrary
tmpData.StartAddress = String.Format("{0:00}", (int)(totaltime / 3600)) + ":" + String.Format("{0:00}", ((int)(((int)(totaltime % 3600)) / 60))) + ":" + String.Format("{0:00}", ((int)(totaltime % 60)));
tmpData.StopTime = "";
tmpData.StopAddress = "Total distance:";
if (StaticMembers.isInMile) tmpData.Distance = (Math.Round(((total * 0.621371192) * 1000)) / 1000).ToString();
else tmpData.Distance = total.ToString();
if (StaticMembers.isInMile)
tmpData.Distance = (Math.Round(((total * 0.621371192) * 1000)) / 1000).ToString();
else
tmpData.Distance = total.ToString();
Ret.Add(tmpData);
}
@ -289,149 +303,181 @@ namespace ReportsLibrary
[DataObjectMethod(DataObjectMethodType.Select)]
public List<StopData> GetALL()
{
if (!StaticMembers.IsHistroyNotStop) // aici prelucrez date cand e raport de stop sau IDLE
if (StaticMembers.IsHistroyNotStop)
return StaticMembers.HistDataReport;
//if (!StaticMembers.IsHistroyNotStop) // aici prelucrez date cand e raport de stop sau IDLE
CalcStops calcStop = new CalcStops(true);//mapControl
calcStop.get_position(StaticMembers.PositionList);
try
{
if (!StaticMembers.IsIdle)
{
calcStop.calculate_zone();
calcStop.calc_zone_with_delta2();
calcStop.create_stop_list();
}
else
{
calcStop.create_stop_list_EON(StaticMembers.IDLETime);
}
}
catch (Exception ex)
{
SM.Debug("Database connection failed:" + ex.ToString());
}
if (StaticMembers.StartStop)
{
calcStop.StartStopCalc();
calcStop.StartStopCalcPosition();
}
ArrayList numbers = new ArrayList();
ReverseGeocoding volltmpGo = new ReverseGeocoding(ReverseGeoOSM);
//calcul addressa Google
if (!StaticMembers.LATLNGforDinamicReports)
{
CalcStops calcStop = new CalcStops(true);//mapControl
calcStop.get_position(StaticMembers.PositionList);
try
{
if (!StaticMembers.IsIdle)
if ((StaticMembers.MapType == MapTYPE.ArcGis) || (StaticMembers.MapType == MapTYPE.Google))
{
calcStop.calculate_zone();
calcStop.calc_zone_with_delta2();
calcStop.create_stop_list();
}
else
{
calcStop.create_stop_list_EON(StaticMembers.IDLETime);
foreach (Stops obj3 in calcStop.StopsList)
{
StaticMembers.AddrGISQueue.Enqueue(new AddrAndID(Convert.ToInt32(obj3.name), obj3.lat, obj3.lng));
if (StaticMembers.ShowCoordinates)
StaticMembers.IdReportHS.Add(obj3.name, "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString());
else
StaticMembers.IdReportHS.Add(obj3.name, obj3.address != "" ? obj3.address : volltmpGo.getAddressLATLNG(obj3.lat, obj3.lng));
}
if (!StaticMembers.ShowCoordinates)
{
bool retrynew = true;
int cntmax = 0;
foreach (String obj in StaticMembers.IdReportHS.Keys)
numbers.Add(obj);
while (retrynew)
{
cntmax++;
retrynew = false;
foreach (String obj in numbers)
{
if ((String)StaticMembers.IdReportHS[obj] == "no address")
{
SM.Debug("Sta 180 msec");
Thread.Sleep(180);
retrynew = true;
}
}
if (cntmax > 10)
retrynew = false;
}
}
}
}
catch (Exception ex)
{
SM.Debug("Database connection failed:" + ex.ToString());
SM.Debug("Erorr on compute adress for report:" + ex.ToString());
}
}
if (StaticMembers.StartStop)
{
calcStop.StartStopCalc();
calcStop.StartStopCalcPosition();
}
ArrayList numbers = new ArrayList();
ReverseGeocoding volltmpGo = new ReverseGeocoding(ReverseGeoOSM);
//calcul addressa Google
if (!StaticMembers.LATLNGforDinamicReports)
int countStops = -1;
long stoptime, starttime;
StopData tmpData = null;
Int32 RowNumber = 0;
var list = new List<StopData>();
foreach (Stops obj3 in calcStop.StopsList)
{
countStops++;
if (obj3.type == car_state_e.CAR_STOP)
{
// Populate StopData object
tmpData = new StopData();
try
{
if ((StaticMembers.MapType == MapTYPE.ArcGis) || (StaticMembers.MapType == MapTYPE.Google))
{
foreach (Stops obj3 in calcStop.StopsList)
{
StaticMembers.AddrGISQueue.Enqueue(new AddrAndID(Convert.ToInt32(obj3.name), obj3.lat, obj3.lng));
if (StaticMembers.ShowCoordinates)
StaticMembers.IdReportHS.Add(obj3.name, "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString());
else
StaticMembers.IdReportHS.Add(obj3.name, obj3.address != "" ? obj3.address : volltmpGo.getAddressLATLNG(obj3.lat, obj3.lng));
}
if (!StaticMembers.ShowCoordinates)
{
bool retrynew = true;
int cntmax = 0;
foreach (String obj in StaticMembers.IdReportHS.Keys)
numbers.Add(obj);
RowNumber++;
while (retrynew)
{
cntmax++;
retrynew = false;
foreach (String obj in numbers)
{
if ((String)StaticMembers.IdReportHS[obj] == "no address")
{
SM.Debug("Sta 180 msec");
Thread.Sleep(180);
retrynew = true;
}
}
if (cntmax > 10) retrynew = false;
}
}
tmpData.Data = ((obj3.start).GetDTLocalFromSeconds()).Date.ToShortDateString();
tmpData.Time = ((Int32)obj3.start).TimeOfDayHHMMLocal(!StaticMembers.is24hours);
// get location
if (!StaticMembers.LATLNGforDinamicReports)
{
if ((StaticMembers.MapType == MapTYPE.Google) || (StaticMembers.MapType == MapTYPE.ArcGis))
tmpData.Location = StaticMembers.IdReportHS[obj3.name].ToString();
}
else
tmpData.Location = "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString();
// calculate duration
stoptime = obj3.stop;
starttime = obj3.start;
if (countStops < (calcStop.StopsList.Count - 1))
{
if (((Stops)(calcStop.StopsList[countStops + 1])).type == car_state_e.CAR_START)
stoptime = ((Stops)(calcStop.StopsList[countStops + 1])).stop;
}
tmpData.Duration = FormatDuration(starttime, stoptime);
}
catch (Exception ex)
{
SM.Debug("Erorr on compute adress for report:" + ex.ToString());
SM.Debug("EX:" + ex.ToString());
}
// add to list
list.Add(tmpData);
}
int countStops = -1;
long stoptime, starttime;
StopData tmpData = null;
Int32 RowNumber = 0;
var Ret = new List<StopData>();
Int64 diffTime;
foreach (Stops obj3 in calcStop.StopsList)
{
countStops++;
if (obj3.type == car_state_e.CAR_STOP)
{
tmpData = new StopData();
try
{
RowNumber++;
tmpData.Data = ((obj3.start).GetDTLocalFromSeconds()).Date.ToShortDateString();
tmpData.Time = ((Int32)obj3.start).TimeOfDayHHMMLocal(!StaticMembers.is24hours);
if (!StaticMembers.LATLNGforDinamicReports)
{
if ((StaticMembers.MapType == MapTYPE.Google) || (StaticMembers.MapType == MapTYPE.ArcGis))
tmpData.Location = StaticMembers.IdReportHS[obj3.name].ToString();
}
else tmpData.Location = "LAT:" + Math.Round(obj3.lat, 5).ToString() + " , LNG:" + Math.Round(obj3.lng, 5).ToString();
stoptime = obj3.stop;
starttime = obj3.start;
if (countStops < (calcStop.StopsList.Count - 1))
{
if (((Stops)(calcStop.StopsList[countStops + 1])).type == car_state_e.CAR_START)
stoptime = ((Stops)(calcStop.StopsList[countStops + 1])).stop;
}
diffTime = stoptime - starttime;
Int32 Hour = (Int32)(diffTime / 3600);
Int32 Minute = (Int32)((diffTime - Hour * 3600) / 60);
String toReturn = "";
if (Hour >= 10)
toReturn = toReturn + Hour.ToString() + ":";
else
toReturn = toReturn + "0" + Hour.ToString() + ":";
if (Minute >= 10)
toReturn = toReturn + Minute.ToString();
else
toReturn = toReturn + "0" + Minute.ToString();
tmpData.Duration = toReturn;
}
catch (Exception ex)
{
SM.Debug("EX:" + ex.ToString());
}
Ret.Add(tmpData);
}
}
//de la google address
if ((StaticMembers.MapType == MapTYPE.Google) || (StaticMembers.MapType == MapTYPE.ArcGis))
{
foreach (String obj in numbers)
StaticMembers.IdReportHS.Remove(obj);
numbers.Clear();
}
return Ret;
}
else // aici prelucrez date cand e raport de history
//de la google address
if ((StaticMembers.MapType == MapTYPE.Google) || (StaticMembers.MapType == MapTYPE.ArcGis))
{
return StaticMembers.HistDataReport;
foreach (String obj in numbers)
StaticMembers.IdReportHS.Remove(obj);
numbers.Clear();
}
return list;
}
private string FormatDuration(long starttime, long stoptime)
{
Int64 diffTime = stoptime - starttime;
Int32 Hour = (Int32)(diffTime / 3600);
Int32 Minute = (Int32)((diffTime - Hour * 3600) / 60);
return Hour.ToString("D2") + ":" + Minute.ToString("D2");
}
}
[DataObject]
public class BatchHistoryDataObj
{
[DataObjectMethod(DataObjectMethodType.Select)]
public List<BatchHistoryData> GetALL()
{
return StaticMembers.BatchHistoryReport;
}
}
[DataObject]
@ -440,9 +486,7 @@ namespace ReportsLibrary
[DataObjectMethod(DataObjectMethodType.Select)]
public List<FleetData> GetALL()
{
Double distance = .001f;
Double AllDistance = .001f;
var Ret = new List<FleetData>();
var fleetDataList = new List<FleetData>();
if (!StaticMembers.IsSMSLocationNotFleet)
{
@ -468,91 +512,112 @@ namespace ReportsLibrary
calcStop.StartStopCalcPosition();
}
//distance
AllDistance = 0;
Boolean first = true;
distance = 0;
Int32 timeStart = 0, timeStop = 0, oldStop = 0;
if (calcStop.StopsList.Count > 1)
{
Stops prevObj = null;
foreach (Stops obj in calcStop.StopsList)
{
if (prevObj != null)
{
if (!((prevObj.type == car_state_e.CAR_STOP) && (obj.type == car_state_e.CAR_START)))
{
AllDistance += distance;
if (first)
{
timeStart = prevObj.stop;
first = false;
}
else timeStart = oldStop;
timeStop = obj.start;
oldStop = obj.stop;
AllDistance += calcStop.calcDistance(timeStart, timeStop);
//DriveList.Add(distance);
}
else { first = true; }
}
prevObj = obj;
}
}
int startnr = 0;
Stops prevStopObj = null;
foreach (Stops obj in calcStop.StopsList)
{
if (obj.type == car_state_e.CAR_START)
startnr++;
if (prevStopObj != null)
if ((prevStopObj.type == car_state_e.CAR_STOP) && (obj.type == car_state_e.CAR_STOP))
startnr++;
prevStopObj = obj;
}
// populate FleetData
FleetData tmpData = new FleetData();
tmpData.Name = veh.Name;
if (StaticMembers.isInMile) tmpData.Distance = (Math.Round(((AllDistance * 0.621371192) * 1000)) / 1000).ToString();
else tmpData.Distance = AllDistance.ToString();
if ((calcStop.StopsList.Count == 0) || (calcStop.StopsList.Count == 1)) tmpData.Trips = "0";
else tmpData.Trips = startnr.ToString();
tmpData.Distance = calculatetDistance(calcStop);
tmpData.Trips = "0";
if (calcStop.StopsList.Count > 1)
tmpData.Trips = calculateTrips(calcStop);
tmpData.Start = "";
tmpData.Stop = "";
if ((calcStop.StopsList.Count != 0) && (calcStop.StopsList.Count != 1))
{
if (StaticMembers.is24hours)
{
tmpData.Start = ((((Stops)(calcStop.StopsList[0])).stop).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy HH:mm:ss");
tmpData.Stop = ((((Stops)(calcStop.StopsList[calcStop.StopsList.Count - 1])).start).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy HH:mm:ss");
}
else
{
tmpData.Start = ((((Stops)(calcStop.StopsList[0])).stop).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy hh:mm:ss tt");
tmpData.Stop = ((((Stops)(calcStop.StopsList[calcStop.StopsList.Count - 1])).start).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy hh:mm:ss tt");
}
string formatDate = StaticMembers.is24hours ? "MM/dd/yyyy HH:mm:ss" : "MM/dd/yyyy HH:mm:ss tt";
tmpData.Start = ((((Stops)(calcStop.StopsList[0])).stop).GetDTLocalFromSeconds()).ToString(formatDate);
tmpData.Stop = ((((Stops)(calcStop.StopsList[calcStop.StopsList.Count - 1])).start).GetDTLocalFromSeconds()).ToString(formatDate);
}
Ret.Add(tmpData);
// add to list
fleetDataList.Add(tmpData);
}
}
else
{
foreach (SMS_Location sms_obj in StaticMembers.SMSLocList)
{
FleetData tmpData = new FleetData();
tmpData.Name = sms_obj.Name;
tmpData.Start = sms_obj.Data;
tmpData.Stop = sms_obj.Address;
tmpData.Trips = sms_obj.Time;
tmpData.Distance = sms_obj.Text_mess;
Ret.Add(tmpData);
fleetDataList.Add( new FleetData()
{
Name = sms_obj.Name,
Start = sms_obj.Data,
Stop = sms_obj.Address,
Trips = sms_obj.Time,
Distance = sms_obj.Text_mess
});
}
}
return Ret;
return fleetDataList;
}
private string calculateTrips(CalcStops calcStop)
{
int startnr = 0;
Stops prevStopObj = null;
foreach (Stops obj in calcStop.StopsList)
{
if (obj.type == car_state_e.CAR_START)
startnr++;
if (prevStopObj != null)
if ((prevStopObj.type == car_state_e.CAR_STOP) && (obj.type == car_state_e.CAR_STOP))
startnr++;
prevStopObj = obj;
}
return startnr.ToString();
}
private string calculatetDistance(CalcStops calcStop)
{
Double AllDistance = 0;
Boolean first = true;
Double distance = 0;
Int32 timeStart = 0, timeStop = 0, oldStop = 0;
if (calcStop.StopsList.Count > 1)
{
Stops prevObj = null;
foreach (Stops obj in calcStop.StopsList)
{
if (prevObj != null)
{
if (!((prevObj.type == car_state_e.CAR_STOP) && (obj.type == car_state_e.CAR_START)))
{
AllDistance += distance;
if (first)
{
timeStart = prevObj.stop;
first = false;
}
else
timeStart = oldStop;
timeStop = obj.start;
oldStop = obj.stop;
AllDistance += calcStop.calcDistance(timeStart, timeStop);
//DriveList.Add(distance);
}
else { first = true; }
}
prevObj = obj;
}
}
if (StaticMembers.isInMile)
return (Math.Round(((AllDistance * 0.621371192) * 1000)) / 1000).ToString();
return AllDistance.ToString();
}
}
@ -569,9 +634,8 @@ namespace ReportsLibrary
if (StaticMembers.ReportType == rep_type.SPEED)
{
int[,] array2D = new int[,] { { 20, 50 }, { 50, 70 }, { 70, 90 }, { 90, 400 } };
var list = new List<string>();
foreach (SpeedData sd in StaticMembers.SpeedingList)
list.Add(sd.Speed);
var list = StaticMembers.SpeedingList.Select(x => x.Speed);
for (int i = 0; i < array2D.GetLength(0); i++)
{
var result = list.Select(int.Parse).Count(r => r >= array2D[i, 0] && r < array2D[i, 1]);
@ -582,6 +646,7 @@ namespace ReportsLibrary
}
}
}
if (StaticMembers.ReportType == rep_type.JOB_TICKETING)
{
var query = StaticMembers.SpeedingList.GroupBy(n => n.Time,
@ -596,6 +661,7 @@ namespace ReportsLibrary
}
}
}
return ChartDataList;
}
@ -617,12 +683,12 @@ namespace ReportsLibrary
ChartDataList.Add(cd);
}
}
if (StaticMembers.ReportType == rep_type.HIST)
{
int[,] array2D = new int[,] { { 0, 40 }, { 40, 70 }, { 70, 90 }, { 90, 400 } };
var list = new List<string>();
foreach (StopData sd in StaticMembers.HistDataReport)
list.Add(sd.Duration);
var list = StaticMembers.HistDataReport.Select(x => x.Duration);
for (int i = 0; i < array2D.GetLength(0); i++)
{
var result = list.Select(int.Parse).Count(r => r >= array2D[i, 0] && r < array2D[i, 1]);

View File

@ -77,6 +77,12 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reports\BatchHistoryReport.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Reports\BatchHistoryReport.Designer.cs">
<DependentUpon>BatchHistoryReport.cs</DependentUpon>
</Compile>
<Compile Include="Reports\CalcStops.cs" />
<Compile Include="Reports\ClassForReports.cs" />
<Compile Include="Reports\EndOfDay.cs">
@ -1144,6 +1150,9 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Reports\BatchHistoryReport.resx">
<DependentUpon>BatchHistoryReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Reports\EndOfDay.resx">
<DependentUpon>EndOfDay.cs</DependentUpon>
<SubType>Designer</SubType>
@ -1170,6 +1179,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="ClassDiagram1.cd" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

View File

@ -28,7 +28,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = "select count(value) from \"userSettings\" where key=\'radiotype\'";
string command = "SELECT COUNT(value) FROM \"userSettings\" WHERE key=\'radiotype\'";
object result = null;
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
@ -82,13 +82,7 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
resp = reader.GetValue(0).ToString();
}
}
resp = cmd.ExecuteScalar().ToString();
}
}
}

View File

@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Npgsql;
@ -18,9 +19,9 @@ namespace SafeMobileLib
public List<StopData> get_ALLAlarm(String glwhere, Boolean is24hours, Boolean isInMile, Boolean DayFirst, Hashtable VehIDHash, Hashtable ZoneIDHash, Hashtable LandIDHash, Hashtable vehicleHT, string milesh, string kmh)
{
int sc_id = 0, timeGMT = 0, zone_id = 0, speed = 0, telemetry_id = 0, action = 0, type = 0;
String tmpglwhere = glwhere;
String TimeVal = "";
List<StopData> HistDataReport = new List<StopData>();
try
@ -39,21 +40,25 @@ namespace SafeMobileLib
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
TimeVal = dr.GetInt32(1).GetRegionalFormat(is24hours, DayFirst);
var tmp = new StopData
{
Location = TimeVal,
Duration = "",
Time = "Emergency",
Data = (VehIDHash[dr.GetInt32(0)] != null) ? (String)VehIDHash[dr.GetInt32(0)] : "",
timeGMT = dr.GetInt32(1)
};
sc_id = Convert.ToInt32(dr["sc_id"]);
if (tmp.Data != "")
HistDataReport.Add(tmp);
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
timeGMT = Convert.ToInt32(dr["timeGMT"]);
HistDataReport.Add(new StopData
{
Location = timeGMT.GetRegionalFormat(is24hours, DayFirst),
Duration = "",
Time = "Emergency",
Data = (String)VehIDHash[sc_id],
timeGMT = timeGMT
});
}
}
}
}
@ -68,32 +73,41 @@ namespace SafeMobileLib
{
while (dr.Read())
{
string descStr = ((uint)dr.GetInt32(2) == 1) ? "OUT " : "IN ";
sc_id = Convert.ToInt32(dr["sc_id"]);
if (dr.GetInt32(4) == 1)
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
if (ZoneIDHash[dr.GetInt32(1)] != null)
descStr = descStr + ((ZoneClass)ZoneIDHash[dr.GetInt32(1)]).Name;
timeGMT = Convert.ToInt32(dr["timeGMT"]);
zone_id = Convert.ToInt32(dr["zone_id"]);
action = Convert.ToInt32(dr["action"]);
type = Convert.ToInt32(dr["type"]);
string descStr = ((uint)action == 1) ? "OUT " : "IN ";
if (type == 1)
{
if (ZoneIDHash[zone_id] != null)
descStr = descStr + ((ZoneClass)ZoneIDHash[zone_id]).Name;
}
else
{
if (LandIDHash[zone_id] != null)
descStr = descStr + ((String)LandIDHash[zone_id]);
}
HistDataReport.Add(new StopData
{
Location = timeGMT.GetRegionalFormat(is24hours, DayFirst),
Duration = descStr,
Time = "Geo-Fence",
Data = (String)VehIDHash[sc_id],
timeGMT = timeGMT
});
}
else
{
if (LandIDHash[dr.GetInt32(1)] != null)
descStr = descStr + ((String)LandIDHash[dr.GetInt32(1)]);
}
TimeVal = dr.GetInt32(3).GetRegionalFormat(is24hours, DayFirst);
var tmp = new StopData
{
Location = TimeVal,
Duration = descStr,
Time = "Geo-Fence",
Data = (VehIDHash[dr.GetInt32(0)] != null) ? (String)VehIDHash[dr.GetInt32(0)] : "",
timeGMT = dr.GetInt32(3)
};
if (tmp.Data != "")
HistDataReport.Add(tmp);
}
}
}
@ -106,17 +120,24 @@ namespace SafeMobileLib
{
while (dr.Read())
{
TimeVal = dr.GetInt32(0).GetRegionalFormat(is24hours, DayFirst);
var tmp = new StopData
sc_id = Convert.ToInt32(dr["sc_id"]);
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
Location = TimeVal,
Duration = (isInMile) ? ((int)(dr.GetInt32(2) * 0.621371192)).ToString() + " " + milesh : dr.GetInt32(2).ToString() + " " + kmh,
Time = "Speeding",
Data = (VehIDHash[dr.GetInt32(1)] != null) ? (String)VehIDHash[dr.GetInt32(1)] : "",
timeGMT = dr.GetInt32(0)
};
if (tmp.Data != "")
HistDataReport.Add(tmp);
timeGMT = Convert.ToInt32(dr["timeGMT"]);
speed = Convert.ToInt32(dr["speed"]);
HistDataReport.Add(new StopData
{
Location = timeGMT.GetRegionalFormat(is24hours, DayFirst),
Duration = (isInMile) ? ((int)(speed * 0.621371192)).ToString() + " " + milesh : speed.ToString() + " " + kmh,
Time = "Speeding",
Data = (String)VehIDHash[sc_id],
timeGMT = timeGMT
});
}
}
}
}
@ -130,29 +151,31 @@ namespace SafeMobileLib
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
String actionName = "";
if (VehIDHash[dr.GetInt32(0)] != null)
sc_id = Convert.ToInt32(dr["sc_id"]);
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
foreach (TelemetryObj obj in ((VehicleForReports)vehicleHT[(String)VehIDHash[dr.GetInt32(0)]]).telemList)
if (obj.Id == dr.GetInt32(2)) { actionName = obj.Name; break; }
telemetry_id = Convert.ToInt32(dr["telemetry_id"]);
timeGMT = Convert.ToInt32(dr["timeGMT"]);
// get action name
var list = ((VehicleForReports)vehicleHT[(String)VehIDHash[sc_id]]).telemList;
string actionName = list.Where(x => x.Id == telemetry_id).Select(x => x.Name).FirstOrDefault();
HistDataReport.Add(new StopData
{
Location = timeGMT.GetRegionalFormat(is24hours, DayFirst),
Duration = actionName,
Time = "Telemetry",
Data = (String)VehIDHash[sc_id],
timeGMT = timeGMT
});
}
TimeVal = dr.GetInt32(1).GetRegionalFormat(is24hours, DayFirst);
var tmp = new StopData
{
Location = TimeVal,
Duration = actionName,
Time = "Telemetry",
Data = (VehIDHash[dr.GetInt32(0)] != null) ? (String)VehIDHash[dr.GetInt32(0)] : "",
timeGMT = dr.GetInt32(1)
};
if (tmp.Data != "")
HistDataReport.Add(tmp);
}
}
}
@ -176,6 +199,7 @@ namespace SafeMobileLib
{
List<SpeedData> SpeedingList = new List<SpeedData>();
Int32 count50000 = 0;
Int32 sc_id = 0;
try
{
@ -195,23 +219,27 @@ namespace SafeMobileLib
{
count50000++;
var tmp = new SpeedData
sc_id = Convert.ToInt32(dr["sc_id"]);
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
Name = (VehIDHash[dr.GetInt32(1)] != null) ? (String)VehIDHash[dr.GetInt32(1)] : "",
Speed = (isInMile) ? ((int)(dr.GetInt32(2) * 0.621371192)).ToString() : dr.GetInt32(2).ToString(),
Time = dr.GetInt32(0).TimeOfDayHHMMLocal(!is24hours),
Data = dr.GetInt32(0).GetDTLocalFromSeconds().Date.ToShortDateString(),
Address = dr.GetString(3),
sc_id = dr.GetInt32(1),
timeGMT = dr.GetInt32(0),
lat = (dr.IsDBNull(4) ? 0 : dr.GetDouble(4)),
lng = (dr.IsDBNull(5) ? 0 : dr.GetDouble(5))
};
SpeedingList.Add(new SpeedData
{
Name = (String)VehIDHash[sc_id],
Speed = (isInMile) ? ((int)(dr.GetInt32(2) * 0.621371192)).ToString() : dr.GetInt32(2).ToString(),
Time = dr.GetInt32(0).TimeOfDayHHMMLocal(!is24hours),
Data = dr.GetInt32(0).GetDTLocalFromSeconds().Date.ToShortDateString(),
Address = dr.GetString(3),
sc_id = sc_id,
timeGMT = dr.GetInt32(0),
lat = (dr.IsDBNull(4) ? 0 : dr.GetDouble(4)),
lng = (dr.IsDBNull(5) ? 0 : dr.GetDouble(5))
});
if (tmp.Name != "")
SpeedingList.Add(tmp);
if (count50000 > 50000) break;
if (count50000 > 50000)
break;
}
}
}
}
@ -231,11 +259,13 @@ namespace SafeMobileLib
List<LandData> LandList = new List<LandData>();
String newglwhere = glwhere;
String ToAdd = " type=2 ";
if (typ == rep_type.GEOFENC) ToAdd = " type=1 ";
if (newglwhere.Length > 1)
newglwhere = newglwhere + " and " + ToAdd;
else newglwhere = " where " + ToAdd;
else
newglwhere = " where " + ToAdd;
try
{
@ -249,34 +279,41 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
int sc_id = 0, zone_id = 0;
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
LandData tmp = new LandData();
if (VehIDHash[dr.GetInt32(0)] != null)
tmp.Name = (String)VehIDHash[dr.GetInt32(0)];
else tmp.Name = "";
sc_id = Convert.ToInt32(dr["sc_id"]);
zone_id = Convert.ToInt32(dr["zone_id"]);
tmp.LandType = ((uint)dr.GetInt32(2) == 1) ? "OUT" : "IN";
tmp.Time = dr.GetInt32(3).GetRegionalFormat(is24hours, DayFirst);
tmp.LandName = dr.GetInt32(0).TimeOfDayHHMMLocal();
if (typ == rep_type.GEOFENC)
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
if (ZoneIDHash[dr.GetInt32(1)] != null)
tmp.LandName = ((ZoneClass)ZoneIDHash[dr.GetInt32(1)]).Name;
}
else
{
SM.Debug("LandID" + dr.GetInt32(1));
if (LandIDHash[dr.GetInt32(1)] != null)
tmp.LandName = (String)LandIDHash[dr.GetInt32(1)];
}
if (tmp.Name != "")
LandData tmp = new LandData();
tmp.Name = (String)VehIDHash[sc_id];
tmp.LandType = Convert.ToInt32(dr["action"]) == 1 ? "OUT" : "IN";
tmp.Time = Convert.ToInt32(dr["timeGMT"]).GetRegionalFormat(is24hours, DayFirst);
tmp.LandName = sc_id.TimeOfDayHHMMLocal();
if (typ == rep_type.GEOFENC)
{
if (ZoneIDHash[zone_id] != null)
tmp.LandName = ((ZoneClass)ZoneIDHash[zone_id]).Name;
}
else
{
if (LandIDHash[zone_id] != null)
tmp.LandName = (String)LandIDHash[zone_id];
}
LandList.Add(tmp);
}
}
}
}
@ -293,8 +330,9 @@ namespace SafeMobileLib
public List<ONOFFData> get_log_view_all(String glwhere, Boolean is24hours, Boolean DayFirst, Hashtable VehIMEIHash)
{
String tmpname = "";
String TimeVal = "";
string Stat = "";
string imei = "";
int timeGMT = 0;
List<ONOFFData> ONOFFList = new List<ONOFFData>();
try
@ -312,35 +350,31 @@ namespace SafeMobileLib
NpgsqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
if (VehIMEIHash[dr.GetString(0)] != null) tmpname = (VehIMEIHash[dr.GetString(0)] as String);
else tmpname = "";
imei = dr["imei"].ToString();
timeGMT = Convert.ToInt32(dr["timeGMT"]);
tmpname = "";
if (VehIMEIHash[imei] != null)
tmpname = (VehIMEIHash[imei] as String);
if (tmpname != "")
{
TimeVal = dr.GetInt32(1).GetRegionalFormat(is24hours, DayFirst);
switch (dr.GetInt32(2))
{
case 0:
Stat = "OFF";
break;
case 1:
Stat = "ON";
break;
case 9:
Stat = "MADE OFF";
break;
case 10:
Stat = "MADE ON";
break;
case 0: Stat = "OFF"; break;
case 1: Stat = "ON"; break;
case 9: Stat = "MADE OFF"; break;
case 10: Stat = "MADE ON"; break;
}
var tmp = new ONOFFData
{
Name = tmpname,
Time = TimeVal,
Status = Stat
};
ONOFFList.Add(tmp);
ONOFFList.Add( new ONOFFData
{
Name = tmpname,
Time = timeGMT.GetRegionalFormat(is24hours, DayFirst),
Status = Stat
});
}
}
}
@ -357,6 +391,8 @@ namespace SafeMobileLib
public List<ONOFFData> get_EMERG(String glwhere, Boolean is24hours, Hashtable VehIDHash)
{
List<ONOFFData> ONOFFList = new List<ONOFFData>();
int timeGMT = 0, sc_id = 0;
try
{
using (NpgsqlConnection connection = new NpgsqlConnection())
@ -370,21 +406,30 @@ namespace SafeMobileLib
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
string formatDateTime = is24hours ? "MM/dd/yyyy HH:mm:ss" : "MM/dd/yyyy hh:mm:ss tt";
while (dr.Read())
{
var tmp = new ONOFFData
{
Name = (VehIDHash[dr.GetInt32(1)] != null) ? (String)VehIDHash[dr.GetInt32(1)] : "",
Time = (is24hours) ? (dr.GetInt32(0).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy HH:mm:ss") : (dr.GetInt32(0).GetDTLocalFromSeconds()).ToString("MM/dd/yyyy hh:mm:ss tt"),
Status = dr.GetString(2),
sc_id = dr.GetInt32(1),
lat = dr.GetDouble(3),
lng = dr.GetDouble(4),
timeGMT = dr.GetInt32(0)
};
sc_id = Convert.ToInt32(dr["sc_id"]);
if (tmp.Name != "")
ONOFFList.Add(tmp);
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
timeGMT = Convert.ToInt32(dr["timegmt"]);
ONOFFList.Add( new ONOFFData
{
Name = (String)VehIDHash[sc_id],
Time = timeGMT.GetDTLocalFromSeconds().ToString(formatDateTime),
Status = dr["address"].ToString(),
sc_id = sc_id,
lat = Convert.ToDouble(dr["lat"]),
lng = Convert.ToDouble(dr["lng"]),
timeGMT = timeGMT
});
}
}
}
}
@ -398,6 +443,179 @@ namespace SafeMobileLib
return ONOFFList;
}
private BatchHistoryData GetData(NpgsqlDataReader dr, bool isInMile, bool is24hours, bool getAddress = false)
{
int timegmt = 0;
double lat = 0, lng = 0;
BatchHistoryData batchHistObj = null;
try
{
lat = Convert.ToDouble(dr["lat"]);
lng = Convert.ToDouble(dr["lng"]);
timegmt = Convert.ToInt32(dr["timegmt"]);
batchHistObj = new BatchHistoryData
{
Department = dr["department"].ToString(),
Unit = dr["unit"].ToString(),
Location = ((getAddress && dr["address"] != DBNull.Value) ? dr["address"].ToString() : "LAT:" + Math.Round(lat, 5).ToString() + " , LNG:" + Math.Round(lat, 5).ToString()),
Speed = (isInMile) ? ((int)(Convert.ToInt32(dr["speed"]) * 0.621371192)).ToString() : Convert.ToInt32(dr["speed"]).ToString(),
Lat = lat,
Lng = lng,
Address = dr["address"].ToString(),
Time = timegmt.TimeOfDayHHMMSSLocal(!is24hours),
Date = timegmt.GetDTLocalFromSeconds().Date.ToShortDateString()
};
}
catch (Exception ex)
{
Console.WriteLine(ex.Message, ConsoleColor.Red);
}
return batchHistObj;
}
private string FormatCommandBatchHistory(string sc_ids, int startdate, int enddate, bool isInMile, bool is24hours, int limit = Int32.MaxValue, bool getAddress = false, bool getOnlyValidPositions = false)
{
string address = "";
string join_getiing_address = "";
string onlyValidPositions = "";
if (getAddress)
{
address = ",a.address";
join_getiing_address = "LEFT JOIN address a ON a.lat = ROUND(z.lat::numeric, 4) AND a.lng = ROUND(z.lng::numeric, 4) ";
}
if (getOnlyValidPositions)
{
onlyValidPositions = " AND m.lat <> 0.0 AND m.lng <> 0.0 ";
}
string command = $" SELECT x.grp_name as department, x.veh_name as unit, z.lat, z.lng, z.timegmt, z.speed {address} " +
" FROM " +
" (SELECT m.sc_id, m.timegmt, m.lat, m.lng, m.speed " +
" FROM messages m " +
$" WHERE m.timegmt BETWEEN {startdate} AND {enddate} " +
$" {onlyValidPositions}" +
$" AND m.sc_id IN ({sc_ids}) { (limit != Int32.MaxValue ? $"LIMIT {limit}" : "")} " +
" )z " +
" INNER JOIN " +
" ( " +
" SELECT sh.sc_id, v.name as veh_name, g.name as grp_name " +
$" FROM (SELECT * FROM subscriber_history WHERE sc_id IN ({sc_ids})) sh " +
" INNER JOIN vehicle v ON v.id = sh.veh_id " +
" INNER JOIN vehicle_group vg ON sh.sc_id = vg.sc_id " +
" INNER JOIN groups g ON vg.grp_ip = g.id " +
" ) x ON z.sc_id = x.sc_id " +
$"{join_getiing_address}" +
" ORDER BY x.grp_name, x.veh_name, z.timegmt ";
return command;
}
public List<BatchHistoryData> getBatchHistory(string sc_ids, int startdate, int enddate , bool isInMile, bool is24hours, int limit = Int32.MaxValue, bool getAddress = false, bool getOnlyValidPositions = false)
{
var list = new List<BatchHistoryData>();
using (NpgsqlConnection connection = new NpgsqlConnection())
{
connection.ConnectionString = getConnectionString();
connection.Open();
string command = FormatCommandBatchHistory(sc_ids, startdate, enddate, isInMile, is24hours, limit, getAddress, getOnlyValidPositions);
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
cmd.CommandTimeout = 1200;
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
BatchHistoryData data = GetData(dr, isInMile, is24hours, getAddress);
list.Add(data);
}
}
}
}
return list;
}
public void saveBatchHistoryToCsv(string filePath, List<string> excludeColumns, string sc_ids, int startdate, int enddate, bool isInMile, bool is24hours, int limit = Int32.MaxValue, bool getAddress = false, bool getOnlyValidPositions = false)
{
using (NpgsqlConnection connection = new NpgsqlConnection())
{
connection.ConnectionString = getConnectionString();
connection.Open();
string command = FormatCommandBatchHistory(sc_ids, startdate, enddate, isInMile, is24hours, limit, getAddress, getOnlyValidPositions);
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
cmd.CommandTimeout = 1200;
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
// Being a huge report we get record by record and save them into file (without keep them).
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(filePath, false))
{
//================
// write header
//================
Utils.HeaderToCsv<BatchHistoryData>(sw, excludeColumns);
while (dr.Read())
{
//================
// write rows
//================
BatchHistoryData data = GetData(dr, isInMile, is24hours, getAddress);
Utils.RowToCsv<BatchHistoryData>(sw, data, excludeColumns);
}
}
}
}
}
}
public List<StopData> get_History(String glwhere, Boolean compAddress, Boolean forceLATLNG, Boolean is24hours, Boolean isInMile, ref int cntaddr, ref Queue AddrGISQueue, ref Hashtable IdReportHS)
{
List<StopData> HistDataReport = new List<StopData>();
@ -406,25 +624,33 @@ namespace SafeMobileLib
{
using (NpgsqlConnection connection = new NpgsqlConnection())
{
connection.ConnectionString = getConnectionString();
connection.Open();
string command = "SELECT timeGMT,address,speed,lat,lng,scevtime, sc_id, W.name, W.driver_id FROM messages " +
$" INNER JOIN vehicle W on sc_id = W.id {glwhere} ORDER BY timeGMT DESC";
$" INNER JOIN vehicle W on sc_id = W.id {glwhere} ORDER BY timeGMT DESC";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
cmd.CommandTimeout = 1200;
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
double lat = Convert.ToDouble(dr["lat"]);
double lng = Convert.ToDouble(dr["lng"]);
String Address = "";
latlng = "LAT:" + Math.Round(dr.GetDouble(3), 5).ToString() + " , LNG:" + Math.Round(dr.GetDouble(4), 5).ToString();
latlng = "LAT:" + Math.Round(lat, 5).ToString() + " , LNG:" + Math.Round(lat, 5).ToString();
if (!forceLATLNG)
{
if (!dr.IsDBNull(1)) Address = dr.GetString(1);
if ((dr.GetDouble(3) == 0) || (dr.GetDouble(4) == 0)) Address = "NO GPS FIX";
if (!dr.IsDBNull(1))
Address = dr["address"].ToString();
if ((lat == 0.0) || (lng == 0.0))
Address = "NO GPS FIX";
else if ((Address == "") || (Address == " "))
{
@ -432,24 +658,26 @@ namespace SafeMobileLib
{
cntaddr++;
IdReportHS[cntaddr.ToString()] = string.Format("no address ({0})", latlng);
AddrGISQueue.Enqueue(new AddrAndID(cntaddr, dr.GetDouble(3), dr.GetDouble(4)));
AddrGISQueue.Enqueue(new AddrAndID(cntaddr, lat, lng));
Address = cntaddr.ToString();
}
else Address = latlng;
}
}
else Address = "LAT:" + Math.Round(dr.GetDouble(3), 5).ToString() + " , LNG:" + Math.Round(dr.GetDouble(4), 5).ToString();
var tmp = new StopData
{
Location = Address,
Duration = (isInMile) ? ((int)(dr.GetInt32(2) * 0.621371192)).ToString() : dr.GetInt32(2).ToString(),
Time = dr.GetInt32(0).TimeOfDayHHMMSSLocal(!is24hours),
Data = (dr.GetInt32(0).GetDTLocalFromSeconds()).Date.ToShortDateString(),
unit_sc_id = dr.GetInt32(6),
unit_name = dr.GetString(7),
unique_id = dr.GetDouble(5)
};
HistDataReport.Add(tmp);
else
Address = latlng;
HistDataReport.Add(new StopData
{
Location = Address,
Duration = (isInMile) ? ((int)(Convert.ToInt32(dr["speed"]) * 0.621371192)).ToString() : Convert.ToInt32(dr["speed"]).ToString(),
Time = Convert.ToInt32(dr["timeGMT"]).TimeOfDayHHMMSSLocal(!is24hours),
Data = (Convert.ToInt32(dr["timeGMT"]).GetDTLocalFromSeconds()).Date.ToShortDateString(),
unit_sc_id = Convert.ToInt32(dr["sc_id"]),
unit_name = dr["name"].ToString(),
unique_id = Convert.ToDouble(dr["scevtime"])
});
}
}
}
@ -464,6 +692,7 @@ namespace SafeMobileLib
return HistDataReport;
}
public List<SpeedData> get_TelemHist_alarm_event(String glwhere, Hashtable VehIDHash, Hashtable vehicleHT)
{
List<SpeedData> SpeedingList = new List<SpeedData>();
@ -481,33 +710,38 @@ namespace SafeMobileLib
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
int timeGMT = 0, sc_id = 0, telemetry_id = 0;
while (dr.Read())
{
String actionName = "";
if (VehIDHash[dr.GetInt32(1)] != null)
{
foreach (TelemetryObj obj in ((VehicleForReports)vehicleHT[(String)VehIDHash[dr.GetInt32(1)]]).telemList)
if (obj.Id == dr.GetInt32(2))
{
actionName = obj.Name;
break;
}
}
var tmp = new SpeedData
{
Name = (VehIDHash[dr.GetInt32(1)] != null) ? (String)VehIDHash[dr.GetInt32(1)] : "",
Speed = actionName,
Time = dr.GetInt32(0).TimeOfDayHHMMSSLocal(false),
Data = (dr.GetInt32(0).GetDTLocalFromSeconds()).Date.ToShortDateString(),
Address = dr.GetString(3),
sc_id = dr.GetInt32(1),
timeGMT = dr.GetInt32(0),
lat = dr.GetDouble(4),
lng = dr.GetDouble(5)
};
if (tmp.Name != "")
SpeedingList.Add(tmp);
sc_id = Convert.ToInt32(dr["sc_id"]);
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
timeGMT = Convert.ToInt32(dr["timegmt"]);
telemetry_id = Convert.ToInt32(dr["telemetry_id"]);
// get action name
var list = ((VehicleForReports)vehicleHT[(String)VehIDHash[sc_id]]).telemList;
string actionName = list.Where(x => x.Id == telemetry_id).Select(x => x.Name).FirstOrDefault();
SpeedingList.Add(new SpeedData
{
Name = (String)VehIDHash[sc_id],
Speed = actionName,
Time = timeGMT.TimeOfDayHHMMSSLocal(false),
Data = (timeGMT.GetDTLocalFromSeconds()).Date.ToShortDateString(),
Address = dr["address"].ToString(),
sc_id = sc_id,
timeGMT = timeGMT,
lat = Convert.ToDouble(dr["lat"]),
lng = Convert.ToDouble(dr["lng"])
});
}
}
}
}
@ -539,22 +773,32 @@ namespace SafeMobileLib
{
using (NpgsqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
int sc_id = 0, timeGMT = 0;
while (dr.Read())
{
var tmp = new SMS_Location
sc_id = Convert.ToInt32(dr["sc_id_sour"]);
if (VehIDHash.ContainsKey(sc_id) && (String)VehIDHash[sc_id] != "")
{
Name = (VehIDHash[dr.GetInt32(1)] != null) ? (String)VehIDHash[dr.GetInt32(1)] : "",
Text_mess = dr.GetString(2),
Time = dr.GetInt32(0).TimeOfDayHHMMLocal(!is24hours),
Data = (dr.GetInt32(0).GetDTLocalFromSeconds()).Date.ToShortDateString(),
Address = dr.GetString(3),
sc_id = dr.GetInt32(1),
timeGMT = dr.GetInt32(0),
lat = dr.GetDouble(4),
lng = dr.GetDouble(5)
};
if (tmp.Name != "")
SMSLocList.Add(tmp);
timeGMT = Convert.ToInt32(dr["timeGMT"]);
SMSLocList.Add(new SMS_Location
{
Name = (String)VehIDHash[sc_id],
Text_mess = dr["mess"].ToString(),
Time = timeGMT.TimeOfDayHHMMLocal(!is24hours),
Data = (timeGMT.GetDTLocalFromSeconds()).Date.ToShortDateString(),
Address = dr["address"].ToString(),
sc_id = sc_id,
timeGMT = timeGMT,
lat = Convert.ToDouble(dr["lat"]),
lng = Convert.ToDouble(dr["lng"])
});
}
}
}
}
@ -603,12 +847,13 @@ namespace SafeMobileLib
{
var tmp = new SpeedData
{
Name = dr.GetString(0),
Speed = dr.GetInt32(1).ToString(),
Time = dr.GetString(2),
Data = (dr.GetValue(3).ToString() == "") ? "" : dr.GetInt32(3).GetDTLocalFromSeconds().Date.ToShortDateString(),
Address = (dr.GetValue(4).ToString() == "") ? "" : dr.GetInt32(4).GetDTLocalFromSeconds().Date.ToShortDateString(),
Name = dr["name"].ToString(),
Speed = dr["ticket_id"].ToString(),
Time = dr["status"].ToString(),
Data = (dr["start_time"].ToString() == "") ? "" : Convert.ToInt32(dr["start_time"]).GetDTLocalFromSeconds().Date.ToShortDateString(),
Address = (dr["end_time"].ToString() == "") ? "" : Convert.ToInt32(dr["end_time"]).GetDTLocalFromSeconds().Date.ToShortDateString(),
};
if (tmp.Name != "")
SpeedingList.Add(tmp);
}
@ -650,18 +895,19 @@ namespace SafeMobileLib
while (dr.Read())
{
int seconds = 0;
string value = dr.GetString(1);
string value = dr["value"].ToString();
Int32.TryParse(value, out seconds);
DateTime DT = DateTime.Today.AddSeconds(seconds);
var tmp = new UserReportTime
{
UserID = dr.GetInt32(0),
UserName = dr.GetString(2),
HH = DT.Hour,
MM = DT.Minute,
ReportExecuted = false
};
UserReportTimeList.Add(tmp);
UserReportTimeList.Add(new UserReportTime
{
UserID = Convert.ToInt32(dr["user_id"]),
UserName = dr["login"].ToString(),
HH = DT.Hour,
MM = DT.Minute,
ReportExecuted = false
});
}
}
}
@ -700,10 +946,15 @@ namespace SafeMobileLib
{
while (dr.Read())
{
string address = dr.IsDBNull(1) ? "" : dr.GetString(1);
if ((dr.GetDouble(2) != 0) && (dr.GetDouble(3) != 0))
ret.Add(new PositionData(dr.GetDouble(2), dr.GetDouble(3), address, dr.GetInt32(0), car_state_e.CAR_RUNNING, dr.GetInt32(5)));
double lat = Convert.ToDouble(dr["lat"]);
double lng = Convert.ToDouble(dr["lng"]);
string address = dr.IsDBNull(1) ? "" : dr["address"].ToString();
int speed = Convert.ToInt32(dr["speed"]);
int timeGMT = Convert.ToInt32(dr["timeGMT"]);
if (lat != 0 && lng != 0)
ret.Add(new PositionData(lat, lng, address, timeGMT, car_state_e.CAR_RUNNING, speed));
}
}
}

View File

@ -35,14 +35,8 @@ namespace SafeMobileLib
string command = "SELECT value FROM sequences where name = 'jobticketing'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader Reader = cmd.ExecuteReader())
{
while (Reader.Read())
{
ticket_id = Convert.ToInt32(Reader.GetValue(0).ToString());
}
}
ticket_id = Convert.ToInt32(cmd.ExecuteScalar());
}
if (ticket_id == -1)
@ -100,26 +94,13 @@ namespace SafeMobileLib
string command = $"SELECT sc_id FROM subscriber WHERE imei='{imei}'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
command = "SELECT status_id from jobticketstatusesset where is_first_state = 1";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
job_status = dr.GetInt32(0);
}
}
job_status = Convert.ToInt32(cmd.ExecuteScalar());
}
@ -210,7 +191,7 @@ namespace SafeMobileLib
public sqlResponse insert_ticket_response(String imei, string mess)
{
sqlResponse resp = sqlResponse.SQLerror;
InitConnection();
//InitConnection();
Int32 status_id = 0;
Int32 sc_id = 0;
@ -226,15 +207,9 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
using (NpgsqlCommand cmd = new NpgsqlCommand($"SELECT sc_id from subscriber where imei='{imei}'", connection))
using (NpgsqlCommand cmd = new NpgsqlCommand($"SELECT sc_id from subscriber where imei='{imei}' LIMIT 1", connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
@ -1049,7 +1024,7 @@ namespace SafeMobileLib
public TicketResponse deleteTicketingStatus(string ticketStatus)
{
//TODO before delete ticket status check job ticketing transactions
InitConnection();
//InitConnection();
TicketResponse resp;
Int32 status_id = -1;
@ -1066,14 +1041,9 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader Reader = cmd.ExecuteReader())
{
while (Reader.Read())
{
status_id = Reader.GetInt32(0);
}
}
status_id = Convert.ToInt32(cmd.ExecuteScalar());
}
if (status_id > -1)
{
command = "SELECT COUNT(job_status) FROM jobtickets WHERE job_status =\'" + status_id + "\'";
@ -1176,13 +1146,7 @@ namespace SafeMobileLib
string command = "SELECT status_id FROM jobticketstatusesset WHERE status=\'" + ticketStatus + "\'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader Reader = cmd.ExecuteReader())
{
while (Reader.Read())
{
status_id = Convert.ToInt32(Reader.GetValue(0).ToString());
}
}
status_id = Convert.ToInt32(cmd.ExecuteScalar());
}
}
}

View File

@ -33,14 +33,7 @@ namespace SafeMobileLib
string command = "SELECT sc_id from subscriber where imei='" + radioID.ToString() + "'";
using (cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
dr.Close();
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
command = " SELECT id, emergency, landmark, \"zone\" ,loneworker,speed,email,empopup,emsound,geopopup,geosound,speedpopup,speedsound,telempopup,telemsound FROM subscriber_alarm " +
@ -53,7 +46,6 @@ namespace SafeMobileLib
{
alarmRet = new Alarm(Reader.GetInt32(0), sc_id, Reader.GetString(1), Reader.GetString(2), Reader.GetString(3), Reader.GetString(4), Reader.GetString(5), Reader.GetString(6), Reader.GetBoolean(7), Reader.GetBoolean(8), Reader.GetBoolean(9), Reader.GetBoolean(10), Reader.GetBoolean(11), Reader.GetBoolean(12), Reader.GetBoolean(13), Reader.GetBoolean(14));
}
Reader.Close();
}
}
}
@ -81,24 +73,18 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = "SELECT imei,status FROM lastpos";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
using (NpgsqlCommand cmd = new NpgsqlCommand("SELECT imei,status FROM lastpos", connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
try
{
ret.Add(reader.GetString(0), reader.GetInt32(1));
}
catch (Exception ex)
{
Console.WriteLine("Error on add to hash SystemPosition:" + ex.ToString());
}
string imei = (reader["imei"] != DBNull.Value) ? reader["imei"].ToString() : "";
if (imei != "" && ret.ContainsKey(imei))
ret.Add(imei, reader.GetInt32(1));
}
reader.Close();
}
}
}
@ -137,7 +123,6 @@ namespace SafeMobileLib
{
alarmRet = new Alarm(Reader.GetInt32(0), sc_id, Reader.GetString(1), Reader.GetString(2), Reader.GetString(3), Reader.GetString(4), Reader.GetString(5), Reader.GetString(6), Reader.GetBoolean(7), Reader.GetBoolean(8), Reader.GetBoolean(9), Reader.GetBoolean(10), Reader.GetBoolean(11), Reader.GetBoolean(12), Reader.GetBoolean(13), Reader.GetBoolean(14));
}
Reader.Close();
}
}
}
@ -208,17 +193,10 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"SELECT sc_id from subscriber where imei='{radioID}'";
string command = $"SELECT sc_id FROM subscriber where imei='{radioID}' LIMIT 1";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
sc_id = reader.GetInt32(0);
}
reader.Close();
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
@ -258,17 +236,10 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"SELECT sc_id from subscriber where imei='{radioID}'";
string command = $"SELECT sc_id from subscriber where imei='{radioID}' LIMIT 1";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
sc_id = reader.GetInt32(0);
}
reader.Close();
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
int i = 0;
@ -310,56 +281,30 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"SELECT sc_id from subscriber where imei='{radioID}'";
string command = $"SELECT sc_id FROM subscriber WHERE imei='{radioID}' LIMIT 1";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
sc_id = reader.GetInt32(0);
}
reader.Close();
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
command = "SELECT idx from place where name='Landmark1'";
command = "SELECT idx FROM place WHERE name='Landmark1'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
idxL1 = reader.GetInt32(0);
}
reader.Close();
}
idxL1 = Convert.ToInt32(cmd.ExecuteScalar());
}
command = "SELECT idx from place where name='Landmark2'";
command = "SELECT idx FROM place WHERE name='Landmark2'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
idxL2 = reader.GetInt32(0);
}
reader.Close();
}
idxL2 = Convert.ToInt32(cmd.ExecuteScalar());
}
command = "SELECT idx from zonename where name='testZone1'";
command = "SELECT idx FROM zonename WHERE name='testZone1'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
idxGeo = reader.GetInt32(0);
}
reader.Close();
}
idxGeo = Convert.ToInt32(cmd.ExecuteScalar());
}
// get ID for landmark1,2 and zone1
@ -534,18 +479,11 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"SELECT sc_id FROM subscriber WHERE imei='{radioID}'";
string command = $"SELECT sc_id FROM subscriber WHERE imei='{radioID}' LIMIT 1";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
sc_id = reader.GetInt32(0);
}
reader.Close();
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
command = $"DELETE FROM \"subscriber_alarm\" WHERE sc_id = {sc_id} ";
@ -621,17 +559,10 @@ namespace SafeMobileLib
connection.Open();
//get sc_id from imei/radioID
string command = $"SELECT sc_id FROM subscriber WHERE imei='{radioID}'";
string command = $"SELECT sc_id FROM subscriber WHERE imei='{radioID}' LIMIT 1";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
p_sc_id = reader.GetInt32(0);
}
reader.Close();
}
p_sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
string emergTime = DateTime.Now.ToUniversalTime().DateTo70Format() + "";
@ -682,14 +613,7 @@ namespace SafeMobileLib
string command = $"SELECT sc_id FROM subscriber WHERE imei='{radioID}'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, conn))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
p_sc_id = dr.GetInt32(0);
}
dr.Close();
}
p_sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
command = "INSERT INTO speedalarm (sc_id,timeGMT,speed,preview,address,lat,lng) " +
@ -712,7 +636,7 @@ namespace SafeMobileLib
{
Utils.WriteLine(o.ToString(), ConsoleColor.Red);
}
conn.Close();
}
}
catch (Exception ex)
@ -753,7 +677,7 @@ namespace SafeMobileLib
}
resp = sqlResponse.done;
conn.Close();
}
}
catch (Exception ex)
@ -784,7 +708,7 @@ namespace SafeMobileLib
}
String idx = string.Empty;
query = "SELECT max(idx) from zonename";
query = "SELECT MAX(idx) FROM zonename";
using (NpgsqlCommand cmd = new NpgsqlCommand(query, connection))
{
idx = ((Int32)cmd.ExecuteScalar()).ToString();
@ -833,17 +757,10 @@ namespace SafeMobileLib
connection.Open();
string command = $"select sc_id from subscriber where imei='{imei}'";
string command = $"SELECT sc_id FROM subscriber where imei='{imei}' LIMIT 1";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
dr.Close();
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
@ -1006,7 +923,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = "SELECT name,lat,lng,idx, useridx, callout, callout_severity from PLACE ORDER BY name";
string command = "SELECT name,lat,lng,idx, useridx, callout, callout_severity FROM place ORDER BY name";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
@ -1047,7 +964,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"SELECT count(sc_id) FROM emergalarm WHERE preview = 0 and sc_id = {sc_id} ";
string command = $"SELECT COUNT(sc_id) FROM emergalarm WHERE preview = 0 and sc_id = {sc_id} ";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{

View File

@ -143,25 +143,7 @@ namespace SafeMobileLib
}
public void InitConnectionHistoryReport()
{
cn = new NpgsqlConnection();
cn.ConnectionString = getConnectionString();
try
{
if (cn != null && cn.State == System.Data.ConnectionState.Closed)
cn.Open();
}
catch (Exception o)
{
if (cn != null)
{
cn.Close();
}
throw new ArgumentException(o.Message.ToString());
}
}
public void CloseConnection()
{

View File

@ -92,30 +92,10 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
String query = "UPDATE registration SET has_gps = false WHERE true";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
query = "UPDATE registration SET has_sms = false WHERE true";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
query = "UPDATE registration SET has_ticketing = false WHERE true";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
query = "UPDATE registration SET has_reports = false WHERE true";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
query = "UPDATE registration SET has_voice = false WHERE true";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
query = "UPDATE registration SET has_recordings = false WHERE true";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
query = "UPDATE registration SET has_zones = false WHERE true";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
query = "UPDATE registration SET has_telemetry = false WHERE true";
String query = "UPDATE registration SET has_gps = false, has_sms = false, has_ticketing = false, has_reports = false, has_voice = false, has_recordings = false, has_zones = false, has_telemetry = false ";
cmd = new NpgsqlCommand(query, connection);
cmd.ExecuteNonQuery();
}
}
catch (Exception e)
@ -197,25 +177,25 @@ namespace SafeMobileLib
public uint getReportsCount()
{
string command = "SELECT count (has_reports) FROM registration WHERE has_reports=true";
string command = "SELECT count (has_reports) FROM registration WHERE has_reports = true";
return (uint)GetInt32Result(command);
}
public uint getVoiceCount()
{
string command = "SELECT COUNT (has_voice) FROM registration WHERE has_voice=true";
string command = "SELECT COUNT (has_voice) FROM registration WHERE has_voice = true";
return (uint)GetInt32Result(command);
}
public uint getZonesCount()
{
string command = "SELECT COUNT (has_zones) FROM registration WHERE has_zones=true";
string command = "SELECT COUNT (has_zones) FROM registration WHERE has_zones = true";
return (uint)GetInt32Result(command);
}
public uint getTelemetryCount()
{
string command = "SELECT COUNT (has_telemetry) FROM registration WHERE has_telemetry=true";
string command = "SELECT COUNT (has_telemetry) FROM registration WHERE has_telemetry = true";
return (uint)GetInt32Result(command);
}
@ -268,19 +248,19 @@ namespace SafeMobileLib
while (reader.Read())
{
SDRegistration reg = new SDRegistration();
reg.ip = reader.GetValue(0).ToString();
reg.gps = (Boolean)reader.GetValue(1);
reg.sms = (Boolean)reader.GetValue(2);
reg.ticketing = (Boolean)reader.GetValue(3);
reg.reports = (Boolean)reader.GetValue(4);
reg.voice = (Boolean)reader.GetValue(5);
reg.recordings = (Boolean)reader.GetValue(6);
reg.zones = (Boolean)reader.GetValue(7);
reg.telemetry = (Boolean)reader.GetValue(8);
Int16 mType = Int16.Parse(reader.GetValue(9).ToString());
reg.map_type = mType;
reg.ip = reader["ip"].ToString();
reg.gps = Convert.ToBoolean(reader["has_gps"]);
reg.sms = Convert.ToBoolean(reader["has_sms"]);
reg.ticketing = Convert.ToBoolean(reader["has_ticketing"]);
reg.reports = Convert.ToBoolean(reader["has_reports"]);
reg.voice = Convert.ToBoolean(reader["has_voice"]);
reg.recordings = Convert.ToBoolean(reader["has_recordings"]);
reg.zones = Convert.ToBoolean(reader["has_zones"]);
reg.telemetry = Convert.ToBoolean(reader["has_telemetry"]);
reg.map_type = Convert.ToInt16(reader["map_type"]);
reg.MapTypeS = "None";
switch (mType)
switch (reg.map_type)
{
case 1:
reg.MapTypeS = "Google";
@ -295,6 +275,7 @@ namespace SafeMobileLib
reg.MapTypeS = "ArcGIS";
break;
}
safeDispatches.Add(reg);
}
}

View File

@ -206,7 +206,9 @@ namespace SafeMobileLib
{
string key = Reader.GetValue(0).ToString();
string value = Reader.GetValue(1).ToString();
resp.Add(key, value);
if (!resp.ContainsKey(key))
resp.Add(key, value);
}
}
}

View File

@ -32,13 +32,7 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
sc_id = reader.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
@ -74,16 +68,10 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = "SELECT sc_id from subscriber where imei='" + imei + "'";
string command = $"SELECT sc_id from subscriber where imei='{imei}'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
command = "INSERT INTO sms (timeGMT,sc_id_sour,sc_id_dest,mess,status, email, seq_id) " +
@ -135,13 +123,7 @@ namespace SafeMobileLib
string command = $"SELECT sc_id from subscriber where imei = '{imei}'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
@ -468,14 +450,7 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
status = reader.GetInt32(0);
}
}
status = Convert.ToInt32(cmd.ExecuteScalar());
}
return (status == 2);

View File

@ -54,7 +54,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
command = String.Format("UPDATE lastpos SET status ={0} where imei='{1}'", status, p_IMEI);
command = String.Format("UPDATE lastpos SET status = {0} where imei = '{1}'", status, p_IMEI);
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
cmd.ExecuteNonQuery();
@ -239,13 +239,7 @@ namespace SafeMobileLib
//get sc_id from imei/radioID
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
}
@ -260,14 +254,8 @@ namespace SafeMobileLib
string command = $"SELECT status from subscriber_stun where sc_id={sc_id}";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
respStatus = dr.GetInt32(0);
}
}
respStatus = Convert.ToInt32(cmd.ExecuteScalar());
}
}
@ -321,17 +309,11 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"SELECT sc_id from subscriber where imei='{radioID}'";
string command = $"SELECT sc_id from subscriber where imei = '{radioID}'";
//get sc_id from imei/radioID
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader dr = cmd.ExecuteReader())
{
while (dr.Read())
{
sc_id = dr.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}

View File

@ -550,13 +550,7 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand("SELECT sc_id FROM subscriber where imei='" + radioID + "'", connection))
{
using (NpgsqlDataReader Reader = cmd.ExecuteReader())
{
while (Reader.Read())
{
sc_id = Reader.GetInt32(0);
}
}
sc_id = Convert.ToInt32(cmd.ExecuteScalar());
}
}
}

View File

@ -140,7 +140,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
using (NpgsqlCommand cmd = new NpgsqlCommand("SELECT COUNT(*) FROM zonename WHERE useridx=" + userID, connection))
using (NpgsqlCommand cmd = new NpgsqlCommand($"SELECT COUNT(*) FROM zonename WHERE useridx = {userID}", connection))
{
resp = Convert.ToInt32((object)cmd.ExecuteScalar());
}
@ -167,7 +167,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
using (NpgsqlCommand cmd = new NpgsqlCommand("SELECT COUNT(*) FROM place WHERE useridx=" + userID, connection))
using (NpgsqlCommand cmd = new NpgsqlCommand($"SELECT COUNT(*) FROM place WHERE useridx = {userID}", connection))
{
resp = Convert.ToInt32((object)cmd.ExecuteScalar());
}
@ -195,12 +195,12 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
using (NpgsqlCommand cmd = new NpgsqlCommand($"UPDATE zonename SET useridx={newUserID} WHERE useridx=" + userID, connection))
using (NpgsqlCommand cmd = new NpgsqlCommand($"UPDATE zonename SET useridx = {newUserID} WHERE useridx = {userID}", connection))
{
cmd.ExecuteNonQuery();
}
using (NpgsqlCommand cmd = new NpgsqlCommand($"UPDATE place SET useridx={newUserID} WHERE useridx=" + userID, connection))
using (NpgsqlCommand cmd = new NpgsqlCommand($"UPDATE place SET useridx = {newUserID} WHERE useridx = {userID}", connection))
{
cmd.ExecuteNonQuery();
}
@ -284,8 +284,8 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = "SELECT firstName, lastName, login, password, userId, user_type, backup_user_id " +
" FROM users where userid <> 0 ORDER by login";
string command = " SELECT firstName, lastName, login, password, userId, user_type, backup_user_id " +
" FROM users where userid <> 0 ORDER BY login";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader Reader = cmd.ExecuteReader())
@ -309,6 +309,7 @@ namespace SafeMobileLib
{
uType = USERTYPE.LiteDispatcher;
}
User usr = new User()
{
UType = uType,
@ -319,6 +320,7 @@ namespace SafeMobileLib
Id = Convert.ToInt32(Reader.GetValue(4)),
BackupUserId = Convert.ToInt32(Reader.GetValue(6))
};
userList.Add(usr);
}
}
@ -351,7 +353,7 @@ namespace SafeMobileLib
connection.Open();
string command = "SELECT u.userid, us.value FROM users u join \"userSettings\" us on us.user_id = u.userid " +
" WHERE key = 'startUnits'";
" WHERE key = 'startUnits'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
@ -390,7 +392,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = "SELECT login FROM users where userid <> 0 ORDER by user_type";
string command = "SELECT login FROM users where userid <> 0 ORDER by user_type";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
@ -477,7 +479,7 @@ namespace SafeMobileLib
connection.Open();
string command = $"SELECT firstName, lastName, login, password, userId, user_type"
+ $" FROM users u where user_type != 1 and login = '{userName}' and password='{password}'";
+ $" FROM users u where user_type != 1 and login = '{userName}' and password='{password}'";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
@ -619,13 +621,7 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand($"SELECT userid FROM users WHERE \"login\"='{userLoginName}'", connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
userid = reader.GetInt32(0);
}
}
userid = Convert.ToInt32(cmd.ExecuteScalar());
}
}
@ -655,13 +651,7 @@ namespace SafeMobileLib
using (NpgsqlCommand cmd = new NpgsqlCommand("SELECT \"password\" FROM users WHERE \"login\"='administrator'", connection))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
pass = reader.GetString(0);
}
}
pass = cmd.ExecuteScalar().ToString();
}
}
}
@ -756,7 +746,7 @@ namespace SafeMobileLib
connection.Open();
Int32 temp = 0;
using (NpgsqlCommand cmd = new NpgsqlCommand($"SELECT ison FROM users WHERE userid={UserIdx}", connection))
using (NpgsqlCommand cmd = new NpgsqlCommand($"SELECT ison FROM users WHERE userid = {UserIdx}", connection))
{
temp = Convert.ToInt32((object)cmd.ExecuteScalar());
}
@ -783,8 +773,8 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"update users set ison={(state == true ? 1 : 0)} " +
" where userid=(select id from sip_manager where sip_id = {sipID} and type = 0) ";
string command = $"UPDATE users SET ison={(state == true ? 1 : 0)} " +
" WHERE userid = (SELECT id FROM sip_manager WHERE sip_id = {sipID} AND type = 0) ";
NpgsqlCommand cmd = new NpgsqlCommand(command, connection);
{
cmd.ExecuteNonQuery();
@ -809,7 +799,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
NpgsqlCommand cmd = new NpgsqlCommand($"update users set ison={(state == true ? 1 : 0)} where userid={UserIdx}", connection);
NpgsqlCommand cmd = new NpgsqlCommand($"UPDATE users SET ison = {(state == true ? 1 : 0)} WHERE userid={UserIdx}", connection);
cmd.ExecuteNonQuery();
}
}

View File

@ -1201,17 +1201,8 @@ namespace SafeMobileLib
{
ArrayList toreturn = new ArrayList();
StringBuilder buffer = new StringBuilder(4096);
string buffer = string.Join(",", hash.Keys);
foreach (Int32 obj in hash.Keys)
{
buffer.AppendFormat("'{0}',", obj);
}
if (buffer.Length > 0)
buffer = buffer.Replace(",", "", buffer.Length - 1, 1);
try
{
@ -1221,7 +1212,7 @@ namespace SafeMobileLib
connection.ConnectionString = getConnectionString();
connection.Open();
string command = $"SELECT sc_id FROM subscriber WHERE imei in ( {buffer.ToString() } )";
string command = $"SELECT sc_id FROM subscriber WHERE imei in ( {buffer} )";
using (NpgsqlCommand cmd = new NpgsqlCommand(command, connection))
{
@ -2139,7 +2130,8 @@ namespace SafeMobileLib
int gateway_id = Convert.ToInt32(reader["gateway_id"]);
int radio_gw_id = Convert.ToInt32(reader["radio_gw_id"]);
ret.Add(sc_id, new UnitSysPosition(gateway_id, radio_gw_id));
if(!ret.ContainsKey(sc_id))
ret.Add(sc_id, new UnitSysPosition(gateway_id, radio_gw_id));
}
reader.Close();
@ -2330,6 +2322,7 @@ namespace SafeMobileLib
cmd.ExecuteNonQuery();
result = totalUnits;
}
cmd = new NpgsqlCommand("SELECT COUNT(id) FROM vehicle v WHERE is_deleted = FALSE", connection);
int.TryParse(cmd.ExecuteScalar().ToString(), out totaldbunits);

View File

@ -8,6 +8,14 @@ using System.Text;
namespace SafeMobileLib
{
public interface ILocationAddress
{
Double Lat { get; set; }
Double Lng { get; set; }
String Address { get; set; }
}
public enum MapTYPE
{
Google = 1,
@ -53,7 +61,8 @@ namespace SafeMobileLib
HIST,
ALLALARM,
SMS_LOCATION,
JOB_TICKETING
JOB_TICKETING,
BATCH_HIST
};
public enum car_state_e
@ -64,7 +73,7 @@ namespace SafeMobileLib
CAR_HW
};
public class PositionData
public class PositionData : ILocationAddress
{
public Int32 ReportingInterval { get; set; }
public Double Lat { get; set; }
@ -150,7 +159,20 @@ namespace SafeMobileLib
public String Stop { get; set; }
}
public class ChartData
public class BatchHistoryData : ILocationAddress
{
public String Department { get; set; }
public String Unit { get; set; }
public String Date { get; set; }
public String Time { get; set; }
public String Location { get; set; }
public String Address { get; set; }
public Double Lat { get; set; }
public Double Lng { get; set; }
public String Speed { get; set; }
}
public class ChartData
{
public String Type { get; set; }
public int Value { get; set; }

View File

@ -27,6 +27,7 @@ namespace SafeMobileLib
public static List<SpeedData> SpeedingList;
public static List<LandData> LandList;
public static List<StopData> HistDataReport;
public static List<BatchHistoryData> BatchHistoryReport;
public static List<User> UsersList;
public static List<SMS_Location> SMSLocList;
public static Boolean IsIdle = false;

View File

@ -18,6 +18,9 @@ using System.Net.Sockets;
using System.Management.Automation.Runspaces;
using System.Collections.ObjectModel;
using System.Management.Automation;
using System.Data;
using System.ComponentModel;
using System.IO;
namespace SafeMobileLib
{
@ -1250,6 +1253,129 @@ namespace SafeMobileLib
string Text = Convert.ToInt32(e).ToString();
return Text;
}
public static DataTable ToEmptyDataTable<T>()
{
DataTable table = new DataTable();
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(T));
for (int i = 0; i < props.Count; i++)
{
PropertyDescriptor prop = props[i];
table.Columns.Add(prop.Name, prop.PropertyType);
}
return table;
}
public static void HeaderToCsv<T>(StreamWriter sw, List<string> excludeColumns)
{
char separator = ',';
char replacer = ';';
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(T));
for (int i = 0; i < props.Count; i++)
{
if (excludeColumns.Contains(props[i].Name))
continue;
PropertyDescriptor prop = props[i];
sw.Write(prop.Name.Replace(separator, replacer));
if (i < props.Count - 1)
sw.Write(separator);
}
sw.Write(Environment.NewLine);
}
public static void RowToCsv<T>(StreamWriter sw, T obj, List<string> excludeColumns)
{
char separator = ',';
char replacer = ';';
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(T));
for (int i = 0; i < props.Count; i++)
{
if (excludeColumns.Contains(props[i].Name))
continue;
String value = props[i].GetValue(obj).ToString();
sw.Write(value.Replace(separator, replacer));
if (i < props.Count - 1)
sw.Write(separator);
}
sw.Write(Environment.NewLine);
}
public static void DataTable_HeaderToCsvFile(System.IO.StreamWriter sw, DataTable dt)
{
char separator = ',';
char replacer = ';';
int columnCount = dt.Columns.Count;
for (int i = 0; i < columnCount; i++)
{
sw.Write(dt.Columns[i].ToString().Replace(separator, replacer));
if (i < columnCount - 1)
sw.Write(separator);
}
sw.Write(Environment.NewLine);
}
public static void DataTable_RowToCsvFile(System.IO.StreamWriter sw, DataRow dr)
{
char separator = ',';
char replacer = ';';
int columnCount = dr.Table.Columns.Count;
for (int i = 0; i < columnCount; i++)
{
if (!Convert.IsDBNull(dr[i]))
sw.Write(dr[i].ToString().Replace(separator, replacer));
if (i < columnCount - 1)
sw.Write(separator);
}
sw.Write(Environment.NewLine);
}
public static void DataTableToCsvFile(DataTable dataTable, string filePath, bool includeHeaders = true)
{
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(filePath, false))
{
//================
// write header
//================
if (includeHeaders)
{
DataTable_HeaderToCsvFile(sw, dataTable);
}
//================
// write rows
//================
foreach (DataRow dr in dataTable.Rows)
{
DataTable_RowToCsvFile(sw, dr);
}
}
}
}
public class Hyt_cmdMsg

View File

@ -126,7 +126,8 @@ namespace Safedispatch_4_0
REPORTS,
SYSTEM,
HELP,
RADIO
RADIO,
BATCH_HIST
};
//public enum StartItems
@ -209,6 +210,7 @@ namespace Safedispatch_4_0
public static readonly Tabs SYSTEM = new Tabs(9, "SYSTEM");
public static readonly Tabs ALERTS = new Tabs(10, "ALERTS");
public static readonly Tabs RADIO = new Tabs(11, "RADIO");
public static readonly Tabs BATCH_HISTORY = new Tabs(12, "BATCH HISTORY");
private Tabs(int value, String name)
{
@ -1027,6 +1029,7 @@ namespace Safedispatch_4_0
{
public ToolWindow toolwind;
public HistoryTab histtab = null;
public HistTabWind(ToolWindow _toolwind, HistoryTab _livetab)
{
@ -1036,6 +1039,7 @@ namespace Safedispatch_4_0
}
public class Commands
{
public Commands(Int32 _type, String _imei, Int32 _time, Double _lat, Double _lng, Int32 _speed, Int32 _di, Double _alt)

View File

@ -438,6 +438,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Batch History Report.
/// </summary>
internal static string BatchHistoryRep {
get {
return ResourceManager.GetString("BatchHistoryRep", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Border color.
/// </summary>
@ -501,6 +510,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Generate Report In Csv.
/// </summary>
internal static string btShowReportInCsv {
get {
return ResourceManager.GetString("btShowReportInCsv", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Busy.
/// </summary>
@ -1014,6 +1032,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Date.
/// </summary>
internal static string Date {
get {
return ResourceManager.GetString("Date", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Stop Date.
/// </summary>
@ -1113,6 +1140,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Department.
/// </summary>
internal static string Department {
get {
return ResourceManager.GetString("Department", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Details.
/// </summary>
@ -3012,6 +3048,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to In Progress.
/// </summary>
internal static string InProgress {
get {
return ResourceManager.GetString("InProgress", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to InterConnected Subscribers.
/// </summary>
@ -5124,6 +5169,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Batch History Report.
/// </summary>
internal static string r_BatchHistoryReport {
get {
return ResourceManager.GetString("r_BatchHistoryReport", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Emergency Alarm Report.
/// </summary>
@ -6681,6 +6735,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Speed.
/// </summary>
internal static string Speed {
get {
return ResourceManager.GetString("Speed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Speed Alarm Report.
/// </summary>
@ -7024,6 +7087,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Batch history.
/// </summary>
internal static string tabBatchHist {
get {
return ResourceManager.GetString("tabBatchHist", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Geo-Fences.
/// </summary>
@ -7429,6 +7501,15 @@ namespace Dispatcher.Language {
}
}
/// <summary>
/// Looks up a localized string similar to Time.
/// </summary>
internal static string Time {
get {
return ResourceManager.GetString("Time", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Time filter.
/// </summary>

View File

@ -2995,4 +2995,31 @@ Does not apply to the below send message and email options.</value>
<value>Successfully SDR service test</value>
<comment>Failover service</comment>
</data>
<data name="tabBatchHist" xml:space="preserve">
<value>Batch history</value>
</data>
<data name="r_BatchHistoryReport" xml:space="preserve">
<value>Batch History Report</value>
</data>
<data name="BatchHistoryRep" xml:space="preserve">
<value>Batch History Report</value>
</data>
<data name="Date" xml:space="preserve">
<value>Date</value>
</data>
<data name="Department" xml:space="preserve">
<value>Department</value>
</data>
<data name="Speed" xml:space="preserve">
<value>Speed</value>
</data>
<data name="Time" xml:space="preserve">
<value>Time</value>
</data>
<data name="btShowReportInCsv" xml:space="preserve">
<value>Generate Report In Csv</value>
</data>
<data name="InProgress" xml:space="preserve">
<value>In Progress</value>
</data>
</root>

View File

@ -441,13 +441,17 @@ namespace Safedispatch_4_0
client = new TcpClient();
IPEndPoint serverEndPoint = new IPEndPoint(IPAddress.Parse(MainForm2.cfg.APPLICATION_SERVER_IP), MainForm2.cfg.RegsPort);
client.Connect(serverEndPoint);
YourIPaddress = (client.Client.LocalEndPoint.ToString().Split(':'))[0];
YourIPaddress = (client.Client.LocalEndPoint.ToString().Split(":".ToCharArray()))[0];
IPaddress = MainForm2.cfg.LocalIP.Length > 3 ? MainForm2.cfg.LocalIP : YourIPaddress;
NetworkStream clientStream = client.GetStream();
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
UTF8Encoding encoding = new UTF8Encoding();
byte[] buffer = encoding.GetBytes("100");
clientStream.Write(buffer, 0, buffer.Length);
SM.Debug("Sent registration request to server, waiting...");
byte[] message = new byte[256];
clientStream.ReadTimeout = 7000;
int result = clientStream.Read(message, 0, message.Length);
@ -457,9 +461,11 @@ namespace Safedispatch_4_0
{
client.Close();
Thread.Sleep(100);
client = new TcpClient();
client.Connect(serverEndPoint);
buffer = encoding.GetBytes("1000#" + MainForm2.uniqueID + "#");
NetworkStream clientStream2 = client.GetStream();
clientStream2.Write(buffer, 0, buffer.Length);
byte[] message2 = new byte[256];

View File

@ -187,7 +187,7 @@ namespace Safedispatch_4_0
//
// radDock1
//
this.radDock1.ActiveWindow = this.tabSystem;
this.radDock1.ActiveWindow = this.tabGeo;
this.radDock1.BackColor = System.Drawing.Color.Transparent;
this.radDock1.CausesValidation = false;
this.radDock1.Controls.Add(this.documentContainer1);
@ -521,7 +521,7 @@ namespace Safedispatch_4_0
this.rcbDropDropDownUnitEvent.Location = new System.Drawing.Point(13, 157);
this.rcbDropDropDownUnitEvent.Name = "rcbDropDropDownUnitEvent";
this.rcbDropDropDownUnitEvent.NullText = "Display all";
this.rcbDropDropDownUnitEvent.Size = new System.Drawing.Size(260, 20);
this.rcbDropDropDownUnitEvent.Size = new System.Drawing.Size(260, 21);
this.rcbDropDropDownUnitEvent.TabIndex = 66;
this.rcbDropDropDownUnitEvent.ThemeName = "Office2013Light";
this.rcbDropDropDownUnitEvent.ItemCheckedChanged += new Telerik.WinControls.UI.RadCheckedListDataItemEventHandler(this.rcbDropDropDownUnitEvent_ItemCheckedChanged);
@ -545,7 +545,7 @@ namespace Safedispatch_4_0
this.rdpEndTime.MaxDate = new System.DateTime(2030, 12, 31, 0, 0, 0, 0);
this.rdpEndTime.Name = "rdpEndTime";
this.rdpEndTime.NullText = "Display all";
this.rdpEndTime.Size = new System.Drawing.Size(232, 20);
this.rdpEndTime.Size = new System.Drawing.Size(232, 21);
this.rdpEndTime.TabIndex = 65;
this.rdpEndTime.TabStop = false;
this.rdpEndTime.ThemeName = "Office2013Light";
@ -561,7 +561,7 @@ namespace Safedispatch_4_0
this.rdpStartTime.MinDate = new System.DateTime(2015, 1, 1, 0, 0, 0, 0);
this.rdpStartTime.Name = "rdpStartTime";
this.rdpStartTime.NullText = "Display all";
this.rdpStartTime.Size = new System.Drawing.Size(233, 20);
this.rdpStartTime.Size = new System.Drawing.Size(233, 21);
this.rdpStartTime.TabIndex = 64;
this.rdpStartTime.TabStop = false;
this.rdpStartTime.Text = "Thu, 01/01/2015, 00:00";
@ -604,7 +604,7 @@ namespace Safedispatch_4_0
this.rcbDropDownEventType.Location = new System.Drawing.Point(13, 15);
this.rcbDropDownEventType.Name = "rcbDropDownEventType";
this.rcbDropDownEventType.NullText = "Display all";
this.rcbDropDownEventType.Size = new System.Drawing.Size(260, 20);
this.rcbDropDownEventType.Size = new System.Drawing.Size(260, 21);
this.rcbDropDownEventType.TabIndex = 60;
this.rcbDropDownEventType.ThemeName = "Office2013Light";
this.rcbDropDownEventType.ItemCheckedChanged += new Telerik.WinControls.UI.RadCheckedListDataItemEventHandler(this.rcbDropDownEventType_ItemCheckedChanged);
@ -752,7 +752,7 @@ namespace Safedispatch_4_0
this.pbFilterDirection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pbFilterDirection.Cursor = System.Windows.Forms.Cursors.Hand;
this.pbFilterDirection.Image = global::Dispatcher.Properties.Resources.s_filter_direction_grey;
this.pbFilterDirection.Location = new System.Drawing.Point(565, -1);
this.pbFilterDirection.Location = new System.Drawing.Point(557, -1);
this.pbFilterDirection.Name = "pbFilterDirection";
this.pbFilterDirection.Size = new System.Drawing.Size(24, 24);
this.pbFilterDirection.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -768,7 +768,7 @@ namespace Safedispatch_4_0
this.pbFilterType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pbFilterType.Cursor = System.Windows.Forms.Cursors.Hand;
this.pbFilterType.Image = global::Dispatcher.Properties.Resources.s_filter_type_grey;
this.pbFilterType.Location = new System.Drawing.Point(595, -1);
this.pbFilterType.Location = new System.Drawing.Point(587, -1);
this.pbFilterType.Name = "pbFilterType";
this.pbFilterType.Size = new System.Drawing.Size(24, 24);
this.pbFilterType.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -784,7 +784,7 @@ namespace Safedispatch_4_0
this.pbFilterUnit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pbFilterUnit.Cursor = System.Windows.Forms.Cursors.Hand;
this.pbFilterUnit.Image = global::Dispatcher.Properties.Resources.s_filter_user_grey;
this.pbFilterUnit.Location = new System.Drawing.Point(624, -1);
this.pbFilterUnit.Location = new System.Drawing.Point(616, -1);
this.pbFilterUnit.Name = "pbFilterUnit";
this.pbFilterUnit.Size = new System.Drawing.Size(24, 24);
this.pbFilterUnit.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -1023,7 +1023,7 @@ namespace Safedispatch_4_0
//
//
this.documentTabStrip1.RootElement.MinSize = new System.Drawing.Size(0, 0);
this.documentTabStrip1.SelectedIndex = 9;
this.documentTabStrip1.SelectedIndex = 1;
this.documentTabStrip1.Size = new System.Drawing.Size(1017, 581);
this.documentTabStrip1.TabIndex = 0;
this.documentTabStrip1.TabStop = false;
@ -1057,10 +1057,10 @@ namespace Safedispatch_4_0
//
this.tabGeo.Caption = null;
this.tabGeo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.tabGeo.Location = new System.Drawing.Point(5, 33);
this.tabGeo.Location = new System.Drawing.Point(5, 32);
this.tabGeo.Name = "tabGeo";
this.tabGeo.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.tabGeo.Size = new System.Drawing.Size(1007, 543);
this.tabGeo.Size = new System.Drawing.Size(1007, 544);
this.tabGeo.Tag = "GEOFENCE";
this.tabGeo.Text = "Geo-Fences and Landmarks";
this.tabGeo.ToolTipText = "Geofence";
@ -1071,14 +1071,15 @@ namespace Safedispatch_4_0
//
this.tabHistory.Caption = null;
this.tabHistory.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.tabHistory.Location = new System.Drawing.Point(5, 33);
this.tabHistory.Location = new System.Drawing.Point(5, 32);
this.tabHistory.Name = "tabHistory";
this.tabHistory.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.tabHistory.Size = new System.Drawing.Size(1007, 543);
this.tabHistory.Size = new System.Drawing.Size(1007, 544);
this.tabHistory.Tag = "HISTORY";
this.tabHistory.Text = "History";
this.tabHistory.Enter += new System.EventHandler(this.tabHistory_Enter);
this.tabHistory.Leave += new System.EventHandler(this.tabHistory_Leave);
//
// tabSMS
//
@ -1100,10 +1101,10 @@ namespace Safedispatch_4_0
//
this.tabTicketing.Caption = null;
this.tabTicketing.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.tabTicketing.Location = new System.Drawing.Point(5, 33);
this.tabTicketing.Location = new System.Drawing.Point(5, 32);
this.tabTicketing.Name = "tabTicketing";
this.tabTicketing.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.TabbedDocument;
this.tabTicketing.Size = new System.Drawing.Size(1007, 543);
this.tabTicketing.Size = new System.Drawing.Size(1007, 544);
this.tabTicketing.Tag = "TICKETING";
this.tabTicketing.Text = "Job Ticketing";
this.tabTicketing.Enter += new System.EventHandler(this.tabTicketing_Enter);
@ -1114,10 +1115,10 @@ namespace Safedispatch_4_0
this.tabReport.Caption = null;
this.tabReport.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold);
this.tabReport.ForeColor = System.Drawing.Color.Black;
this.tabReport.Location = new System.Drawing.Point(5, 33);
this.tabReport.Location = new System.Drawing.Point(5, 32);
this.tabReport.Name = "tabReport";
this.tabReport.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.tabReport.Size = new System.Drawing.Size(1007, 543);
this.tabReport.Size = new System.Drawing.Size(1007, 544);
this.tabReport.Tag = "REPORTS";
this.tabReport.Text = "Reports";
this.tabReport.Enter += new System.EventHandler(this.tabReport_Enter);
@ -1139,11 +1140,11 @@ namespace Safedispatch_4_0
//
this.tabNewRadio.Caption = null;
this.tabNewRadio.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.tabNewRadio.Location = new System.Drawing.Point(5, 33);
this.tabNewRadio.Location = new System.Drawing.Point(5, 32);
this.tabNewRadio.Margin = new System.Windows.Forms.Padding(0);
this.tabNewRadio.Name = "tabNewRadio";
this.tabNewRadio.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Floating;
this.tabNewRadio.Size = new System.Drawing.Size(1007, 543);
this.tabNewRadio.Size = new System.Drawing.Size(1007, 544);
this.tabNewRadio.Tag = "RADIO";
this.tabNewRadio.Text = "Radio";
this.tabNewRadio.Enter += new System.EventHandler(this.tabNewRadio_Enter);

File diff suppressed because it is too large Load Diff

View File

@ -11,13 +11,17 @@ namespace Dispatcher
public class ReverseGeocodingModule
{
public static String osnServer = "192.168.65.130";
public static List<String> CalculateAddressForPositions(List<PositionData> positions)
public static List<String> CalculateAddressForPositions<T>(List<T> positions)
{
List<String> results = new List<string>();
foreach(PositionData pos in positions)
foreach(ILocationAddress pos in positions)
{
if (pos.Lat == 0.0 && pos.Lng == 0.0)
continue;
String address = GetAddressFromOSM(pos.Lat, pos.Lng);
if (address == null)
address = GetAddressFromGoogle(pos.Lat, pos.Lng);
@ -39,8 +43,11 @@ namespace Dispatcher
await Task.Factory.StartNew(() =>
{
foreach (PositionData pos in positions)
foreach (ILocationAddress pos in positions)
{
if (pos.Lat == 0.0 && pos.Lng == 0.0)
continue;
String address = GetAddressFromOSM(pos.Lat, pos.Lng);
if (address == null)
address = GetAddressFromGoogle(pos.Lat, pos.Lng);

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
[Server]
IP = 127.0.0.1
IP = 10.120.1.149
;localIP=
[Google]

View File

@ -16,6 +16,7 @@ using SafeMobileLib;
using System.IO;
using Dispatcher.maptab.UIClasses;
using Dispatcher.maptab;
using System.Linq;
namespace Safedispatch_4_0
{
@ -64,20 +65,13 @@ namespace Safedispatch_4_0
//rdpEndTime.Culture = MainForm2.culture;
//rdpStartTime.Culture = MainForm2.culture;
string startTimeCustomFormat = MainForm2.DayFirst ? "dd/MM/yyyy hh:mm tt" : "MM/dd/yyyy hh:mm tt";
if (MainForm2.is24hours)
{
if (MainForm2.DayFirst)
rdpStartTime.CustomFormat = "dd/MM/yyyy HH:mm";
else
rdpStartTime.CustomFormat = "MM/dd/yyyy HH:mm";
}
else
{
if (MainForm2.DayFirst)
rdpStartTime.CustomFormat = "dd/MM/yyyy hh:mm tt";
else
rdpStartTime.CustomFormat = "MM/dd/yyyy hh:mm tt";
}
startTimeCustomFormat = MainForm2.DayFirst ? "dd/MM/yyyy HH:mm" : "MM/dd/yyyy HH:mm";
rdpStartTime.CustomFormat = startTimeCustomFormat;
// copy format to the end date picker
rdpEndTime.CustomFormat = rdpStartTime.CustomFormat;
@ -241,20 +235,12 @@ namespace Safedispatch_4_0
// rcbComputeAddress.Checked = true;
//else rcbComputeAddress.Checked = false;
string startTimeCustomFormat = MainForm2.DayFirst ? "dd/MM/yyyy hh:mm tt" : "MM/dd/yyyy hh:mm tt";
if (MainForm2.is24hours)
{
if (MainForm2.DayFirst)
rdpStartTime.CustomFormat = "dd/MM/yyyy HH:mm";
else
rdpStartTime.CustomFormat = "MM/dd/yyyy HH:mm";
}
else
{
if (MainForm2.DayFirst)
rdpStartTime.CustomFormat = "dd/MM/yyyy hh:mm tt";
else
rdpStartTime.CustomFormat = "MM/dd/yyyy hh:mm tt";
}
startTimeCustomFormat = MainForm2.DayFirst ? "dd/MM/yyyy HH:mm" : "MM/dd/yyyy HH:mm";
rdpStartTime.CustomFormat = startTimeCustomFormat;
rdpEndTime.CustomFormat = rdpStartTime.CustomFormat;
// set history time format
HistoryGridCellElement.timeFormat = rdpStartTime.CustomFormat;
@ -433,12 +419,12 @@ namespace Safedispatch_4_0
for (int i = 0; i < e.MenuItems.Count; i++)
{
RadMenuItemBase menuItem = e.MenuItems[i];
if (menuItem.Name == "CloseWindow" ||
menuItem.Name == "CloseAllButThis" ||
menuItem.Name == "CloseAll" ||
menuItem.Name == "Floating" ||
menuItem.Name == "Docked" ||
menuItem.Name == "Hidden" ||
if (menuItem.Name.Equals("CloseWindow") ||
menuItem.Name.Equals("CloseAllButThis") ||
menuItem.Name.Equals("CloseAll") ||
menuItem.Name.Equals("Floating") ||
menuItem.Name.Equals("Docked") ||
menuItem.Name.Equals("Hidden") ||
menuItem is RadMenuSeparatorItem)
{
menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
@ -1207,52 +1193,23 @@ namespace Safedispatch_4_0
FirstGoogle = true;
SMposition tmpos = (SMposition)Point_for_play[0];
if (MainForm2.isInMile) volSpeedString = Convert.ToString((int)Math.Round(tmpos.m_speed * 0.621371192));
else volSpeedString = Convert.ToString((int)(tmpos.m_speed));
worker.ReportProgress(3);
vehSelect = tmpos.m_vehName
+ "_" + tmpos.m_posID;
updatecomand = FormatUpdateCommand(tmpos, FirstGoogle);
if (FirstGoogle)
{
updatecomand = "setDataset,heading_positions," + MainForm2.FixDoubleLAT(tmpos.m_lat.ToString())
+ "," + MainForm2.FixDoubleLNG(tmpos.m_lng.ToString())
+ "," + (tmpos.m_time).ConvertGMTToLocal().GetDTFromSeconds().ToString("yyyy-MM-dd HH:mm:ss")
+ "," + tmpos.m_vehName + "_" + tmpos.m_posID
+ "," + volSpeedString + (MainForm2.isInMile ? "mph" : "kph")
+ "," + tmpos.m_alt
+ "," + MainForm2.FixComma(tmpos.m_address) + ","
+ "history/" + GetSymbName(busSymb.GetSymbolFromOrientation(tmpos.m_heading)) + ","
+ "false" + "," + "false" + "," + "false";
latitude = tmpos.m_lat;
longitude = tmpos.m_lng;
latitude = tmpos.m_lat;
longitude = tmpos.m_lng;
if (FirstGoogle)
{
Thread.Sleep(2000);
FirstGoogle = false;
worker.ReportProgress(1,tmpos.m_evnt_id);
Thread.Sleep(2000);
}
else
{
updatecomand = "updateDataset,heading_positions,"
+ MainForm2.FixDoubleLAT(tmpos.m_lat.ToString())
+ "," + MainForm2.FixDoubleLNG(tmpos.m_lng.ToString())
+ "," + (tmpos.m_time).ConvertGMTToLocal().GetDTFromSeconds().ToString("yyyy-MM-dd HH:mm:ss")
+ "," + tmpos.m_vehName + "_" + tmpos.m_posID
+ "," + volSpeedString + (MainForm2.isInMile ? "mph" : "kph")
+ "," + tmpos.m_alt
+ "," + MainForm2.FixComma(tmpos.m_address) + ","
+ "history/" + GetSymbName(busSymb.GetSymbolFromOrientation(tmpos.m_heading)) + ","
+ "false" + "," + "false" + "," + "false";
}
latitude = tmpos.m_lat;
longitude = tmpos.m_lng;
worker.ReportProgress(1,tmpos.m_evnt_id);
}
worker.ReportProgress(1, tmpos.m_evnt_id);
Index_to_play++;
}// end if prev state is STOP
try
@ -1260,37 +1217,27 @@ namespace Safedispatch_4_0
while ((Index_to_play < Point_for_play.Count) && (ePlayStatus == PS.PLAY))
{
tempPos = ((SMposition)Point_for_play[Index_to_play]);
if (MainForm2.isInMile) volSpeedString = Convert.ToString((int)Math.Round(tempPos.m_speed * 0.621371192));
else volSpeedString = Convert.ToString((int)(tempPos.m_speed));
// convert to km
volSpeedString = ConvertToKm(tempPos);
Index_to_play++;
if (ePlayStatus == PS.PLAY)
{
vehSelect = tempPos.m_vehName + "_" + tempPos.m_posID;
if (FirstGoogle)
{
updatecomand = "setDataset,heading_positions";
FirstGoogle = false;
}
else updatecomand = "updateDataset,heading_positions";
//updatecomand = updatecomand + "," + MainForm2.FixDoubleLAT(tempPos.m_lat.ToString()) + "," + MainForm2.FixDoubleLNG(tempPos.m_lng.ToString()) + "," + vehSelect + "," + note + "," + GetSymbName(busSymb.GetSymbolFromOrientation(tempPos.m_heading));
updatecomand = FormatUpdateCommand(tempPos, FirstGoogle);
FirstGoogle = false;
latitude = tempPos.m_lat;
longitude = tempPos.m_lng;
updatecomand = updatecomand + "," + MainForm2.FixDoubleLAT(tempPos.m_lat.ToString())
+ "," + MainForm2.FixDoubleLNG(tempPos.m_lng.ToString())
+ "," + (tempPos.m_time).ConvertGMTToLocal().GetDTFromSeconds().ToString("yyyy-MM-dd HH:mm:ss")
+ "," + tempPos.m_vehName + "_" + tempPos.m_posID
+ "," + volSpeedString + (MainForm2.isInMile ? "mph" : "kph")
+ "," + tempPos.m_alt
+ "," + MainForm2.FixComma(tempPos.m_address) + ","
+ "history/" + GetSymbName(busSymb.GetSymbolFromOrientation(tempPos.m_heading)) + ","
+ "false" + "," + "false" + "," + "false";
worker.ReportProgress(1,tempPos.m_evnt_id);
}
else
break;
break;
Thread.Sleep(10);
if ((parent.isCanceled[tabName] != null && (bool)parent.isCanceled[tabName])
@ -1375,25 +1322,13 @@ namespace Safedispatch_4_0
}
tempPos = (SMposition)Point_for_play[Index_to_play];
if (MainForm2.isInMile) volSpeedString = Convert.ToString((int)Math.Round(tempPos.m_speed * 0.621371192));
else volSpeedString = Convert.ToString((int)(tempPos.m_speed));
vehSelect = tempPos.m_vehName + "_" + tempPos.m_posID.ToString();
if (onthelimit)
worker.ReportProgress(2, tempPos.m_evnt_id);
else
{
//String note = createnote(tempPos);
//updatecomand = "updateDataset,heading_positions," + MainForm2.FixDoubleLAT(tempPos.m_lat.ToString()) + "," + MainForm2.FixDoubleLNG(tempPos.m_lng.ToString()) + "," + vehSelect + "," + note + "," + GetSymbName(busSymb.GetSymbolFromOrientation(tempPos.m_heading));
updatecomand = "updateDataset,heading_positions," + MainForm2.FixDoubleLAT(tempPos.m_lat.ToString())
+ "," + MainForm2.FixDoubleLNG(tempPos.m_lng.ToString())
+ "," + (tempPos.m_time).ConvertGMTToLocal().GetDTFromSeconds().ToString("yyyy-MM-dd HH:mm:ss")
+ "," + tempPos.m_vehName + "_" + tempPos.m_posID
+ "," + volSpeedString + (MainForm2.isInMile ? "mph" : "kph")
+ "," + tempPos.m_alt
+ "," + MainForm2.FixComma(tempPos.m_address) + ","
+ "history/" + GetSymbName(busSymb.GetSymbolFromOrientation(tempPos.m_heading)) + ","
+ "false" + "," + "false" + "," + "false";
updatecomand = FormatUpdateCommand(tempPos, false);
worker.ReportProgress(1, tempPos.m_evnt_id);
}
}
@ -1415,6 +1350,41 @@ namespace Safedispatch_4_0
return 0;
}
private string FormatUpdateCommand(SMposition tempPos, bool firstGoogle)
{
// Convert To Km
string volSpeedString = ConvertToKm(tempPos);
string vehSelect = $"{tempPos.m_vehName}_{tempPos.m_posID}";
string command = firstGoogle ? "setDataset" : "updateDataset";
string updateComand = $"{command},heading_positions"
+ "," + MainForm2.FixDoubleLAT(tempPos.m_lat.ToString())
+ "," + MainForm2.FixDoubleLNG(tempPos.m_lng.ToString())
+ "," + (tempPos.m_time).ConvertGMTToLocal().GetDTFromSeconds().ToString("yyyy-MM-dd HH:mm:ss")
+ "," + tempPos.m_vehName + "_" + tempPos.m_posID
+ "," + volSpeedString + (MainForm2.isInMile ? "mph" : "kph")
+ "," + tempPos.m_alt
+ "," + MainForm2.FixComma(tempPos.m_address) + ","
+ "history/" + GetSymbName(busSymb.GetSymbolFromOrientation(tempPos.m_heading)) + ","
+ "false" + "," + "false" + "," + "false";
return updateComand;
}
private string ConvertToKm(SMposition obj)
{
if (MainForm2.isInMile)
return Convert.ToString((int)Math.Round(obj.m_speed * 0.621371192));
return Convert.ToString((int)(obj.m_speed));
}
// Mihai
private bool changeTrackbarValueFromCode = false;
/// <summary>
@ -1468,12 +1438,14 @@ namespace Safedispatch_4_0
{
hitLimit = false;
string proc1 = MainForm2.returnLNGString("Update"),
proc2 = MainForm2.returnLNGString("Retriev"),
proc3 = MainForm2.returnLNGString("Computing"),
proc4 = MainForm2.returnLNGString("DelOld");
proc2 = MainForm2.returnLNGString("Retriev"),
proc3 = MainForm2.returnLNGString("Computing"),
proc4 = MainForm2.returnLNGString("DelOld");
txProgStatus.Invoke(new UpdateStatusBarCallBack(this.UpdateStatusBar),proc4);
Thread.Sleep(5000);
Pushpinx pp1 = null;
Locationx[] posTemp = null;
Shapex shp = null;
@ -1483,6 +1455,7 @@ namespace Safedispatch_4_0
String SpeedData = "mile";
String AddressData = "";
IdReportHS.Clear();
if (closeTabThread)
{
e.Cancel = true;
@ -1570,6 +1543,7 @@ namespace Safedispatch_4_0
List_of_Name_for_History.Add(unit.Text);
int contRoute = -1;
Int32 number = 0;
ArrayList POSList = new ArrayList();
SM.Debug("value for name:" + unit.Text);
if (DataPos[unit.Text] != null)
@ -1628,6 +1602,7 @@ namespace Safedispatch_4_0
//note
if (MainForm2.isInMile) SpeedData = " ;" + MainForm2.langSpeed + " " + Convert.ToString((int)Math.Round(obj3.m_speed * 0.621371192)) + MainForm2.milesh;
else SpeedData = " ;" + MainForm2.langSpeed + " " + Convert.ToString(obj3.m_speed) + MainForm2.kmh;
if ((obj3.m_address != "") && (obj3.m_address != " "))
{
try
@ -1641,6 +1616,7 @@ namespace Safedispatch_4_0
}
}
else AddressData = "";
pp1.Note = MainForm2.langTime + " " + obj3.m_time.DateTimeOfDayHHMMLocal() + SpeedData + AddressData;
pp1.BalloonState = GeoBalloonStatex.geoDisplayNone;
if (closeTabThread)
@ -1648,11 +1624,13 @@ namespace Safedispatch_4_0
e.Cancel = true;
return 1;
}
// pp1.MoveTo(vehiclesDataSet2);
progStep++;
if (minTime > obj3.m_time)
minTime = obj3.m_time;
if (maxTime < obj3.m_time)
maxTime = obj3.m_time;
}
@ -1668,6 +1646,7 @@ namespace Safedispatch_4_0
latlnt.Add(pos[k].Latitude);
latlnt.Add(pos[k].Longitude);
}
if (posTemp.Length > 1)
{
if (closeTabThread) return 1;
@ -1744,14 +1723,19 @@ namespace Safedispatch_4_0
foreach (SMposition obj in selectedPositions)
{
contx++;
if (MainForm2.isInMile) volSpeedString = Convert.ToString((int)Math.Round(obj.m_speed * 0.621371192));
else volSpeedString = Convert.ToString((int)(obj.m_speed));
// convert to km
volSpeedString = ConvertToKm(obj);
volAddress = obj.m_address;
if ((volAddress == "") || (volAddress == " ")) volAddress = "LAT:" + Math.Round(obj.m_lat, 5).ToString() + " , LNG:" + Math.Round(obj.m_lng, 5).ToString();
if ((volAddress == "") || (volAddress == " "))
volAddress = "LAT:" + Math.Round(obj.m_lat, 5).ToString() + " , LNG:" + Math.Round(obj.m_lng, 5).ToString();
ListforGrid.Add(new DataforGRID(contx.ToString(), obj.m_vehName, (obj.m_time).ConvertGMTToLocal().GetDTFromSeconds(), volAddress, volSpeedString, "", "",
Math.Round(obj.m_lat, 5).ToString(), Math.Round(obj.m_lng, 5).ToString(), Math.Round(obj.m_alt, 5).ToString(),obj.m_heading));
obj.m_evnt_id = contx;
SliderPosition.Add(SliderCount);
SliderPosition.Add(SliderCount);
if ((obj.m_lat != 0) && (obj.m_lng != 0))
{
Point_for_play.Add(obj);
@ -1797,8 +1781,8 @@ namespace Safedispatch_4_0
{
if (docLoad)
{
mapGoogles.ExecuteScript("window.GWTcallback('" + obj + "');");
mapGoogles.ExecuteScript("window.GWTcallback('removelabels," + ((String [])obj.Split(','))[4] + "');");
ExecuteScript(obj);
ExecuteScript($"removelabels,{((String [])obj.Split(",".ToCharArray()))[4]}");
}
}
//end history
@ -1818,9 +1802,10 @@ namespace Safedispatch_4_0
+ DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ",,,,,,false,false,false";
mapGoogles.ExecuteScript("window.GWTcallback('" + corner + "');");
mapGoogles.ExecuteScript("window.GWTcallback('" + "putOnMap,once,corner_positions" + "');");
mapGoogles.ExecuteScript("window.GWTcallback('" + "removelabels,corner_positions" + "');");
ExecuteScript(corner);
ExecuteScript("putOnMap,once,corner_positions");
ExecuteScript("removelabels,corner_positions");
/* SM.Debug("Face ZOOM pe un dataset");
if (vehiclesDataSet2.RecordCount > 0)
vehiclesDataSet2.ZoomTo();*/
@ -1882,7 +1867,9 @@ namespace Safedispatch_4_0
}
if (MainForm2.Connfailed)
{
if ((MainForm2.radioType == RADIOTYPE.HARRIS)||(MainForm2.radioType == RADIOTYPE.ATLAS)) ((RadLabel)RadMessageBox.Instance.Controls[1]).LabelElement.ForeColor = MainForm2.HarTextColor;
if ((MainForm2.radioType == RADIOTYPE.HARRIS)||(MainForm2.radioType == RADIOTYPE.ATLAS))
((RadLabel)RadMessageBox.Instance.Controls[1]).LabelElement.ForeColor = MainForm2.HarTextColor;
RadMessageBox.Show(MainForm2.returnLNGString("database"), MainForm2.returnLNGString("war"), MessageBoxButtons.OK, RadMessageIcon.Exclamation);
MainForm2.Connfailed = false;
}
@ -1892,6 +1879,8 @@ namespace Safedispatch_4_0
{
backgroundWorker1.RunWorkerAsync();
VisualSettings.loadUserVisualSettings(this.Name, this.toolWindow4, MainForm2.HashVal);
// convert in km
if (MainForm2.isInMile)
{
rseSpeedLower.Value = (int)Math.Round(Convert.ToInt32(rseSpeedLower.Value) * 0.621371192);
@ -1922,7 +1911,7 @@ namespace Safedispatch_4_0
try
{
if (e.ProgressPercentage == 3)
mapGoogles.ExecuteScript("window.GWTcallback('" + "removeDataset,heading_positions" + "');");
ExecuteScript("removeDataset,heading_positions");
else
{
Int32 index = (Int32)e.UserState;
@ -1936,18 +1925,21 @@ namespace Safedispatch_4_0
}
if (e.ProgressPercentage == 1)
{
//Utils.WriteLine("Yellow: " + updatecomand, ConsoleColor.Yellow);
mapGoogles.ExecuteScript("window.GWTcallback('" + updatecomand + "');");
ExecuteScript(updatecomand);
if (updatecomand.StartsWith("setDataset,heading_positions"))
{
if (rcbShowLabels.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
mapGoogles.ExecuteScript("window.GWTcallback('" + "putlabels,heading_positions" + "');");
else mapControl.mapGoogles.ExecuteScript("window.GWTcallback('" + "removelabels,heading_positions" + "');");
ExecuteScript("putlabels,heading_positions");
else
mapControl.mapGoogles.ExecuteScript("window.GWTcallback('" + "removelabels,heading_positions" + "');");
}
mapGoogles.ExecuteScript("window.GWTcallback('" + "putOnMap,none,heading_positions" + "');");
ExecuteScript("putOnMap,none,heading_positions");
}
mapGoogles.ExecuteScript("window.GWTcallback('" + "openInfo," + vehSelect + "');");
mapGoogles?.ExecuteScript($"window.GWTcallback('centerzoom,{latitude},{longitude},-1');");
ExecuteScript($"openInfo,{vehSelect}");
ExecuteScript($"centerzoom,{latitude},{longitude},-1");
}
}
catch (Exception ex)
@ -1958,7 +1950,10 @@ namespace Safedispatch_4_0
}
private void ExecuteScript(string command)
{
mapGoogles?.ExecuteScript($"window.GWTcallback('{command}');");
}
@ -2087,7 +2082,9 @@ namespace Safedispatch_4_0
{
if (FirstGoogle)
{
mapGoogles.ExecuteScript("window.GWTcallback('removeDataset,heading_positions');");
ExecuteScript("removeDataset,heading_positions");
updatecomand = "setDataset,heading_positions,";
FirstGoogle = false;
@ -2106,11 +2103,15 @@ namespace Safedispatch_4_0
Utils.WriteLine(updatecomand,ConsoleColor.Blue);
if (docLoad)
{
mapGoogles.ExecuteScript("window.GWTcallback('" + updatecomand + "');");
ExecuteScript(updatecomand);
if (PutonMap)
mapGoogles.ExecuteScript("window.GWTcallback('" + "putOnMap,none,heading_positions" + "');");
mapGoogles.ExecuteScript("window.GWTcallback('" + "openInfo," + gridData.VehName + "_" + gridData.Id + "');");
mapGoogles?.ExecuteScript($"window.GWTcallback('centerzoom,{gridData.Lat},{gridData.Lng},-1');");
ExecuteScript("putOnMap,none,heading_positions");
ExecuteScript($"openInfo,{gridData.VehName}_{gridData.Id}");
ExecuteScript($"centerzoom,{gridData.Lat},{gridData.Lng},-1");
}
}
@ -2125,7 +2126,7 @@ namespace Safedispatch_4_0
{
if (docLoad)
{
mapGoogles.ExecuteScript("window.GWTcallback('" + "openInfo," + pp.Name + "');");
ExecuteScript($"openInfo,{pp.Name}");
}
}
@ -2163,6 +2164,7 @@ namespace Safedispatch_4_0
{
tmpAddrAndID.LNG = Math.Round(tmpAddrAndID.LNG, 4);
tmpAddrAndID.LAT = Math.Round(tmpAddrAndID.LAT, 4);
valHash = tmpAddrAndID.LNG + tmpAddrAndID.LAT * 0.000001;
if (MainForm2.AddrHass[valHash] != null)
{
@ -2184,6 +2186,7 @@ namespace Safedispatch_4_0
{
Utils.WriteLine(ex.ToString(), ConsoleColor.Red);
}
if (!findaddress)
{
tmpAddrAndID.Address = volltmpGo2.getAddressLATLNG(tmpAddrAndID.LAT, tmpAddrAndID.LNG);
@ -2211,41 +2214,43 @@ namespace Safedispatch_4_0
IdReportHS[tmpAddrAndID.ID.ToString()] = tmpAddrAndID.Address;
if (inwhile)
HistroyProgBar.Invoke(new UpdateProgressBarCallBack(this.UpdateProgressBar), -1);
SM.Debug("Baga google in hash ID:" + tmpAddrAndID.ID.ToString() + "Addr:" + tmpAddrAndID.Address);
}
else
{
//dau in open street maps si apoi ies prin prin cene
Thread.Sleep(1100);
tmpAddrAndID.Address = volltmpGo2.getAddressLATLNG2(tmpAddrAndID.LAT, tmpAddrAndID.LNG);
if ((tmpAddrAndID.Address != "") && (tmpAddrAndID.Address != " "))
{
if (!findaddress)
{
try
{
if (tmpAddrAndID.Address != "N/A")
{
valHash = tmpAddrAndID.LNG + tmpAddrAndID.LAT * 0.000001;
MainForm2.AddrHass.Add(valHash, tmpAddrAndID.Address);
AddrtmpX = smdbObj.get_address(tmpAddrAndID.LAT, tmpAddrAndID.LNG); //just for avoid Error from Event Viewer
if (AddrtmpX == "") smdbObj.Insert_Address(tmpAddrAndID.Address, tmpAddrAndID.LAT, tmpAddrAndID.LNG);
}
}
catch (Exception ex)
{
SM.Debug("Error: " + ex.ToString());
}
}
IdReportHS[tmpAddrAndID.ID.ToString()] = tmpAddrAndID.Address;
if (inwhile) HistroyProgBar.Invoke(new UpdateProgressBarCallBack(this.UpdateProgressBar), -1);
SM.Debug("Baga open street maps in hash ID:"+tmpAddrAndID.ID.ToString() + "Addr:" + tmpAddrAndID.Address);
}
else
{
SM.Debug("Iese prin Cene cu nimic");
}
}
//else
//{
// //dau in open street maps si apoi ies prin prin cene
// Thread.Sleep(1100);
// tmpAddrAndID.Address = volltmpGo2.getAddressLATLNG2(tmpAddrAndID.LAT, tmpAddrAndID.LNG);
// if ((tmpAddrAndID.Address != "") && (tmpAddrAndID.Address != " "))
// {
// if (!findaddress)
// {
// try
// {
// if (tmpAddrAndID.Address != "N/A")
// {
// valHash = tmpAddrAndID.LNG + tmpAddrAndID.LAT * 0.000001;
// MainForm2.AddrHass.Add(valHash, tmpAddrAndID.Address);
// AddrtmpX = smdbObj.get_address(tmpAddrAndID.LAT, tmpAddrAndID.LNG); //just for avoid Error from Event Viewer
// if (AddrtmpX == "") smdbObj.Insert_Address(tmpAddrAndID.Address, tmpAddrAndID.LAT, tmpAddrAndID.LNG);
// }
// }
// catch (Exception ex)
// {
// SM.Debug("Error: " + ex.ToString());
// }
// }
// IdReportHS[tmpAddrAndID.ID.ToString()] = tmpAddrAndID.Address;
// if (inwhile) HistroyProgBar.Invoke(new UpdateProgressBarCallBack(this.UpdateProgressBar), -1);
// SM.Debug("Baga open street maps in hash ID:"+tmpAddrAndID.ID.ToString() + "Addr:" + tmpAddrAndID.Address);
// }
// else
// {
// SM.Debug("Iese prin Cene cu nimic");
// }
//}
}
}
catch (Exception ex)
@ -2332,10 +2337,10 @@ namespace Safedispatch_4_0
{
try
{
int cont = 0;
if (docLoad)
{
mapGoogles.ExecuteScript("window.GWTcallback('" + "deletePolygon,ALL');");
ExecuteScript("deletePolygon,ALL");
nrNavigatecnt++;
}
@ -2387,7 +2392,8 @@ namespace Safedispatch_4_0
{
if (docLoad)
{
mapGoogles.ExecuteScript("window.GWTcallback('" + "deletePolygon,ALL');");
ExecuteScript("deletePolygon,ALL");
nrNavigatecnt++;
}
}
@ -2473,6 +2479,7 @@ namespace Safedispatch_4_0
/// </summary>
private void speedLimit_CheckStateChanged(object sender, EventArgs e)
{
if ((RadCheckBox)sender == rcbSpeedLower)
rseSpeedLower.Enabled = ((RadCheckBox)sender).Checked;
else if ((RadCheckBox)sender == rcbSpeedUpper)
@ -2700,26 +2707,22 @@ namespace Safedispatch_4_0
private void timeTrackBar_ValueChanged(object sender, EventArgs e)
{
Utils.WriteLine(timeTrackBar.Value.ToString(), ConsoleColor.Yellow);
if (changeTrackbarValueFromCode)
{
changeTrackbarValueFromCode = false;
return;
}
try
{
SMposition tmpos = (SMposition)Point_for_play[(Int32)timeTrackBar.Value];
if (MainForm2.isInMile) volSpeedString = Convert.ToString((int)Math.Round(tmpos.m_speed * 0.621371192));
else volSpeedString = Convert.ToString((int)(tmpos.m_speed));
Index_to_play = (Int32)timeTrackBar.Value;
vehSelect = tmpos.m_vehName + "_" + tmpos.m_posID;
if (FirstGoogle)
{
mapGoogles.ExecuteScript("window.GWTcallback('removeDataset,heading_positions');");
updatecomand = "setDataset,heading_positions";
Index_to_play = (Int32)timeTrackBar.Value;
updatecomand = FormatUpdateCommand(tmpos, FirstGoogle);
if (FirstGoogle)
FirstGoogle = false;
}
else updatecomand = "updateDataset,heading_positions";
Int32 index = tmpos.m_evnt_id;
if ((index >= 0) && (index < gridHistoryPoints.RowCount))
@ -2728,21 +2731,15 @@ namespace Safedispatch_4_0
gridHistoryPoints.Rows[index].IsSelected = true;
gridHistoryPoints.Rows[index].IsCurrent = true;
}
updatecomand = updatecomand + ","
+ MainForm2.FixDoubleLAT(tmpos.m_lat.ToString()) + ","
+ MainForm2.FixDoubleLNG(tmpos.m_lng.ToString()) + ","
+ (tmpos.m_time).ConvertGMTToLocal().GetDTFromSeconds().ToString("yyyy-MM-dd HH:mm:ss") + ","
+ vehSelect + ","
+ volSpeedString + (MainForm2.isInMile ? "mph" : "kph") + "," +
+ tmpos.m_alt + ","
+ MainForm2.FixComma(tmpos.m_address) + ","
+ "history/" + GetSymbName(busSymb.GetSymbolFromOrientation(tmpos.m_heading)) + ","
+ "false" + "," + "false" + "," + "false";
//Utils.WriteLine("Green: "+updatecomand,ConsoleColor.Green);
mapGoogles.ExecuteScript("window.GWTcallback('" + updatecomand + "');");
mapGoogles.ExecuteScript("window.GWTcallback('" + "putOnMap,none,heading_positions" + "');");
mapGoogles.ExecuteScript("window.GWTcallback('" + "openInfo," + vehSelect + "');");
mapGoogles?.ExecuteScript($"window.GWTcallback('centerzoom,{tmpos.m_lat},{tmpos.m_lng},-1');");
updatecomand = FormatUpdateCommand(tmpos, FirstGoogle);
ExecuteScript(updatecomand);
ExecuteScript("putOnMap,none,heading_positions");
ExecuteScript($"openInfo,{vehSelect}");
ExecuteScript($"centerzoom,{tmpos.m_lat},{tmpos.m_lng},-1");
}
catch (Exception ex)
{
@ -2760,7 +2757,7 @@ namespace Safedispatch_4_0
// remove old dataset points
if (docLoad)
{
mapGoogles.ExecuteScript("window.GWTcallback('" + "reset" + "');");
ExecuteScript("reset");
}
MaxLAT = -90;
@ -2770,11 +2767,10 @@ namespace Safedispatch_4_0
Index_to_play = 0;
FirstGoogle = true;
selectedPositions.Clear();
if (gridHistoryPoints.Rows.Count > 0)
{
gridHistoryPoints.Rows.Clear();
}
if (gridHistoryPoints.Rows.Count > 0)
gridHistoryPoints.Rows.Clear();
gridHistoryPoints.DataSource = null;
@ -2782,6 +2778,8 @@ namespace Safedispatch_4_0
foreach (RadTreeNode node in treeViewUnits.Nodes)
node.Checked = false;
// clear speed values
rseSpeedLower.Value = 0;
rseSpeedUpper.Value = 0;
@ -2826,9 +2824,13 @@ namespace Safedispatch_4_0
try
{
if (rcbShowLabels.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
mapGoogles.ExecuteScript("window.GWTcallback('" + "putlabels,heading_positions"+ "');");
else mapGoogles.ExecuteScript("window.GWTcallback('" + "removelabels,heading_positions" + "');");
ExecuteScript("putlabels, heading_positions");
else
ExecuteScript("removelabels, heading_positions");
Thread.Sleep(1);
checkbox_UpdateHT(sender, args);
}
catch (Exception ex)
@ -2848,6 +2850,7 @@ namespace Safedispatch_4_0
if (rcbShowGeofence.Checked)
ForceShowZone();
else ForceHideZone();
checkbox_UpdateHT(sender, args);
}
catch (Exception ex)
@ -2862,10 +2865,8 @@ namespace Safedispatch_4_0
/// </summary>
private void rbtAnimation_EnabledChanged(object sender, EventArgs e)
{
if(((RadButton)sender).Enabled)
((RadButton)sender).ButtonElement.ButtonFillElement.BackColor = MainForm2.ButtonColor;
else
((RadButton)sender).ButtonElement.ButtonFillElement.BackColor = MainForm2.ButtonColorDisabled;
Color bkColor = ((RadButton)sender).Enabled ? MainForm2.ButtonColor : MainForm2.ButtonColorDisabled;
((RadButton)sender).ButtonElement.ButtonFillElement.BackColor = bkColor;
}
@ -2954,17 +2955,27 @@ namespace Safedispatch_4_0
{
if (isLoaded)
{
int value = Convert.ToInt32(((RadSpinEditor)sender).Value);
if (((RadSpinEditor)sender).Name == "rseSpeedLower" || ((RadSpinEditor)sender).Name == "rseSpeedUpper")
RadSpinEditor spinEditor = sender as RadSpinEditor;
int value = Convert.ToInt32(spinEditor.Value);
if (spinEditor.Name.Equals("rseSpeedLower") || spinEditor.Name.Equals("rseSpeedUpper"))
{
if (MainForm2.isInMile) value = (int)(value * 1.60934);
}
VisualSettings.InsertUpdateHTforVisualItems(this.Name, ((RadSpinEditor)sender).Name, value.ToString());
if (((RadSpinEditor)sender).Name == "rsePositionDisplay")
VisualSettings.InsertUpdateHTforVisualItems("hisPlayTime", value.ToString());
if (((RadSpinEditor)sender).Name == "rseSkipSeconds")
VisualSettings.InsertUpdateHTforVisualItems("hisPauseTime", value.ToString());
VisualSettings.InsertUpdateHTforVisualItems(this.Name, spinEditor.Name, value.ToString());
string spinEditorName = string.Empty;
if (spinEditor.Name.Equals("rsePositionDisplay"))
spinEditorName = "hisPlayTime";
else if (spinEditor.Name.Equals("rseSkipSeconds"))
spinEditorName = "hisPauseTime";
if(!string.IsNullOrEmpty(spinEditorName))
VisualSettings.InsertUpdateHTforVisualItems(spinEditorName, value.ToString());
}
}
/// <summary>

View File

@ -41,7 +41,7 @@ namespace Safedispatch_4_0
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition6 = new Telerik.WinControls.UI.TableViewDefinition();
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HistoryTab));
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.textBox3 = new Telerik.WinControls.UI.RadTextBox();
@ -60,24 +60,6 @@ namespace Safedispatch_4_0
this.GoogleClick = new System.Windows.Forms.Timer(this.components);
this.StartBasicHistory = new System.Windows.Forms.Timer(this.components);
this.radDock1 = new Telerik.WinControls.UI.Docking.RadDock();
this.windowHistoryResult = new Telerik.WinControls.UI.Docking.ToolWindow();
this.panelAnimationButtons = new Telerik.WinControls.UI.RadPanel();
this.rbPrev = new Telerik.WinControls.UI.RadButton();
this.rbNext = new Telerik.WinControls.UI.RadButton();
this.rbStop = new Telerik.WinControls.UI.RadButton();
this.rbPause = new Telerik.WinControls.UI.RadButton();
this.rbPlay = new Telerik.WinControls.UI.RadButton();
this.gridHistoryPoints = new Telerik.WinControls.UI.RadGridView();
this.timeTrackBar = new Telerik.WinControls.UI.RadTrackBar();
this.rsePositionDisplay = new Telerik.WinControls.UI.RadSpinEditor();
this.rseSkipSeconds = new Telerik.WinControls.UI.RadSpinEditor();
this.radLabel10 = new Telerik.WinControls.UI.RadLabel();
this.labelSlideshow = new Telerik.WinControls.UI.RadLabel();
this.rcbShowLabels = new Telerik.WinControls.UI.RadCheckBox();
this.rcbShowGeofence = new Telerik.WinControls.UI.RadCheckBox();
this.rlPositionDisplayMs = new Telerik.WinControls.UI.RadLabel();
this.rlAnimation = new Telerik.WinControls.UI.RadLabel();
this.toolTabStripTabs = new Telerik.WinControls.UI.Docking.ToolTabStrip();
this.toolWindow4 = new Telerik.WinControls.UI.Docking.ToolWindow();
this.pbFilter = new System.Windows.Forms.PictureBox();
this.rbResetHistory = new Telerik.WinControls.UI.RadButton();
@ -97,6 +79,24 @@ namespace Safedispatch_4_0
this.treeViewUnits = new Telerik.WinControls.UI.RadTreeView();
this.rlHistoryForSelectedUnits = new Telerik.WinControls.UI.RadLabel();
this.labelUnits = new Telerik.WinControls.UI.RadLabel();
this.toolTabStripTabs = new Telerik.WinControls.UI.Docking.ToolTabStrip();
this.windowHistoryResult = new Telerik.WinControls.UI.Docking.ToolWindow();
this.panelAnimationButtons = new Telerik.WinControls.UI.RadPanel();
this.rbPrev = new Telerik.WinControls.UI.RadButton();
this.rbNext = new Telerik.WinControls.UI.RadButton();
this.rbStop = new Telerik.WinControls.UI.RadButton();
this.rbPause = new Telerik.WinControls.UI.RadButton();
this.rbPlay = new Telerik.WinControls.UI.RadButton();
this.gridHistoryPoints = new Telerik.WinControls.UI.RadGridView();
this.timeTrackBar = new Telerik.WinControls.UI.RadTrackBar();
this.rsePositionDisplay = new Telerik.WinControls.UI.RadSpinEditor();
this.rseSkipSeconds = new Telerik.WinControls.UI.RadSpinEditor();
this.radLabel10 = new Telerik.WinControls.UI.RadLabel();
this.labelSlideshow = new Telerik.WinControls.UI.RadLabel();
this.rcbShowLabels = new Telerik.WinControls.UI.RadCheckBox();
this.rcbShowGeofence = new Telerik.WinControls.UI.RadCheckBox();
this.rlPositionDisplayMs = new Telerik.WinControls.UI.RadLabel();
this.rlAnimation = new Telerik.WinControls.UI.RadLabel();
this.documentContainer1 = new Telerik.WinControls.UI.Docking.DocumentContainer();
this.documentTabStrip1 = new Telerik.WinControls.UI.Docking.DocumentTabStrip();
this.documentWindow1 = new Telerik.WinControls.UI.Docking.DocumentWindow();
@ -126,27 +126,6 @@ namespace Safedispatch_4_0
((System.ComponentModel.ISupportInitialize)(this.skinButton4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radDock1)).BeginInit();
this.radDock1.SuspendLayout();
this.windowHistoryResult.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.panelAnimationButtons)).BeginInit();
this.panelAnimationButtons.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.rbPrev)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbNext)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbStop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbPause)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbPlay)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints.MasterTemplate)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.timeTrackBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rsePositionDisplay)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rseSkipSeconds)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radLabel10)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.labelSlideshow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowLabels)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowGeofence)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rlPositionDisplayMs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rlAnimation)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.toolTabStripTabs)).BeginInit();
this.toolTabStripTabs.SuspendLayout();
this.toolWindow4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbFilter)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbResetHistory)).BeginInit();
@ -166,6 +145,27 @@ namespace Safedispatch_4_0
((System.ComponentModel.ISupportInitialize)(this.treeViewUnits)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rlHistoryForSelectedUnits)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.labelUnits)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.toolTabStripTabs)).BeginInit();
this.toolTabStripTabs.SuspendLayout();
this.windowHistoryResult.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.panelAnimationButtons)).BeginInit();
this.panelAnimationButtons.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.rbPrev)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbNext)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbStop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbPause)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbPlay)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints.MasterTemplate)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.timeTrackBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rsePositionDisplay)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rseSkipSeconds)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radLabel10)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.labelSlideshow)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowLabels)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowGeofence)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rlPositionDisplayMs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rlAnimation)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.documentContainer1)).BeginInit();
this.documentContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.documentTabStrip1)).BeginInit();
@ -311,7 +311,6 @@ namespace Safedispatch_4_0
this.radDock1.Location = new System.Drawing.Point(0, 0);
this.radDock1.MainDocumentContainer = this.documentContainer1;
this.radDock1.Name = "radDock1";
this.radDock1.Padding = new System.Windows.Forms.Padding(0);
//
//
//
@ -326,6 +325,381 @@ namespace Safedispatch_4_0
this.radDock1.ActiveWindowChanging += new Telerik.WinControls.UI.Docking.DockWindowCancelEventHandler(this.radDock1_ActiveWindowChanging);
this.radDock1.ActiveWindowChanged += new Telerik.WinControls.UI.Docking.DockWindowEventHandler(this.radDock1_ActiveWindowChanged);
//
// toolWindow4
//
this.toolWindow4.BackColor = System.Drawing.Color.WhiteSmoke;
this.toolWindow4.Caption = null;
this.toolWindow4.Controls.Add(this.pbFilter);
this.toolWindow4.Controls.Add(this.rbResetHistory);
this.toolWindow4.Controls.Add(this.rbSearchHistory);
this.toolWindow4.Controls.Add(this.rcbComputeAddress);
this.toolWindow4.Controls.Add(this.rcbSpeedUpper);
this.toolWindow4.Controls.Add(this.rseSpeedUpper);
this.toolWindow4.Controls.Add(this.pb24H);
this.toolWindow4.Controls.Add(this.rcbSpeedLower);
this.toolWindow4.Controls.Add(this.rtbFilterUnits);
this.toolWindow4.Controls.Add(this.rseSpeedLower);
this.toolWindow4.Controls.Add(this.rdpEndTime);
this.toolWindow4.Controls.Add(this.rdpStartTime);
this.toolWindow4.Controls.Add(this.rcb24H);
this.toolWindow4.Controls.Add(this.rlUntil);
this.toolWindow4.Controls.Add(this.radLabel6);
this.toolWindow4.Controls.Add(this.treeViewUnits);
this.toolWindow4.Controls.Add(this.rlHistoryForSelectedUnits);
this.toolWindow4.Controls.Add(this.labelUnits);
this.toolWindow4.DocumentButtons = Telerik.WinControls.UI.Docking.DocumentStripButtons.None;
this.toolWindow4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.toolWindow4.Location = new System.Drawing.Point(1, 29);
this.toolWindow4.Name = "toolWindow4";
this.toolWindow4.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.toolWindow4.Size = new System.Drawing.Size(294, 762);
this.toolWindow4.Text = "History search parameters";
this.toolWindow4.ToolCaptionButtons = Telerik.WinControls.UI.Docking.ToolStripCaptionButtons.None;
//
// pbFilter
//
this.pbFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pbFilter.BackColor = System.Drawing.Color.White;
this.pbFilter.Image = global::Dispatcher.Properties.Resources.i_search;
this.pbFilter.Location = new System.Drawing.Point(259, 468);
this.pbFilter.Name = "pbFilter";
this.pbFilter.Size = new System.Drawing.Size(21, 21);
this.pbFilter.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbFilter.TabIndex = 68;
this.pbFilter.TabStop = false;
this.pbFilter.Tag = "unselected";
this.pbFilter.MouseEnter += new System.EventHandler(this.pbFilter_MouseEnter);
this.pbFilter.MouseLeave += new System.EventHandler(this.pbFilter_MouseLeave);
//
// rbResetHistory
//
this.rbResetHistory.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rbResetHistory.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.rbResetHistory.Cursor = System.Windows.Forms.Cursors.Hand;
this.rbResetHistory.Font = new System.Drawing.Font("Segoe UI", 10F);
this.rbResetHistory.Location = new System.Drawing.Point(18, 716);
this.rbResetHistory.Name = "rbResetHistory";
this.rbResetHistory.Size = new System.Drawing.Size(91, 34);
this.rbResetHistory.TabIndex = 76;
this.rbResetHistory.Text = "Reset";
this.rbResetHistory.ThemeName = "TelerikMetroBlue";
this.rbResetHistory.Click += new System.EventHandler(this.rbResetHistory_Click);
((Telerik.WinControls.UI.RadButtonElement)(this.rbResetHistory.GetChildAt(0))).Text = "Reset";
((Telerik.WinControls.Primitives.FillPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Font = new System.Drawing.Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold);
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
((Telerik.WinControls.Primitives.FocusPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(3))).BackColor = System.Drawing.Color.DeepSkyBlue;
//
// rbSearchHistory
//
this.rbSearchHistory.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rbSearchHistory.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.rbSearchHistory.Cursor = System.Windows.Forms.Cursors.Hand;
this.rbSearchHistory.Font = new System.Drawing.Font("Segoe UI", 10F);
this.rbSearchHistory.Location = new System.Drawing.Point(147, 716);
this.rbSearchHistory.Name = "rbSearchHistory";
this.rbSearchHistory.Size = new System.Drawing.Size(136, 34);
this.rbSearchHistory.TabIndex = 75;
this.rbSearchHistory.Text = "Search History";
this.rbSearchHistory.ThemeName = "TelerikMetroBlue";
this.rbSearchHistory.Click += new System.EventHandler(this.btDisplayHeadingHisotry_Click);
((Telerik.WinControls.UI.RadButtonElement)(this.rbSearchHistory.GetChildAt(0))).Text = "Search History";
((Telerik.WinControls.Primitives.FillPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
((Telerik.WinControls.Primitives.FocusPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(3))).BackColor = System.Drawing.Color.DeepSkyBlue;
//
// rcbComputeAddress
//
this.rcbComputeAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcbComputeAddress.BackColor = System.Drawing.Color.Transparent;
this.rcbComputeAddress.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcbComputeAddress.Location = new System.Drawing.Point(20, 679);
this.rcbComputeAddress.Name = "rcbComputeAddress";
//
//
//
this.rcbComputeAddress.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcbComputeAddress.Size = new System.Drawing.Size(119, 19);
this.rcbComputeAddress.TabIndex = 74;
this.rcbComputeAddress.Text = "Compute address";
this.rcbComputeAddress.ThemeName = "TelerikMetroBlue";
this.rcbComputeAddress.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.checkbox_UpdateHT);
//
// rcbSpeedUpper
//
this.rcbSpeedUpper.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcbSpeedUpper.BackColor = System.Drawing.Color.Transparent;
this.rcbSpeedUpper.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcbSpeedUpper.Location = new System.Drawing.Point(95, 643);
this.rcbSpeedUpper.Name = "rcbSpeedUpper";
//
//
//
this.rcbSpeedUpper.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcbSpeedUpper.Size = new System.Drawing.Size(160, 19);
this.rcbSpeedUpper.TabIndex = 73;
this.rcbSpeedUpper.Text = "Upper speed limit [km/h]";
this.rcbSpeedUpper.ThemeName = "TelerikMetroBlue";
this.rcbSpeedUpper.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.checkbox_UpdateHT);
this.rcbSpeedUpper.CheckStateChanged += new System.EventHandler(this.speedLimit_CheckStateChanged);
//
// rseSpeedUpper
//
this.rseSpeedUpper.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rseSpeedUpper.Enabled = false;
this.rseSpeedUpper.Location = new System.Drawing.Point(19, 640);
this.rseSpeedUpper.Maximum = new decimal(new int[] {
350,
0,
0,
0});
this.rseSpeedUpper.Name = "rseSpeedUpper";
this.rseSpeedUpper.Size = new System.Drawing.Size(72, 21);
this.rseSpeedUpper.TabIndex = 72;
this.rseSpeedUpper.TabStop = false;
this.rseSpeedUpper.TextAlignment = System.Windows.Forms.HorizontalAlignment.Right;
this.rseSpeedUpper.ThemeName = "Office2013Light";
this.rseSpeedUpper.Value = new decimal(new int[] {
50,
0,
0,
0});
this.rseSpeedUpper.ValueChanged += new System.EventHandler(this.rse_ValueChanged);
//
// pb24H
//
this.pb24H.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pb24H.BackColor = System.Drawing.Color.Transparent;
this.pb24H.Cursor = System.Windows.Forms.Cursors.Hand;
this.pb24H.Image = global::Dispatcher.Properties.Resources.h_24h;
this.pb24H.Location = new System.Drawing.Point(247, 548);
this.pb24H.Name = "pb24H";
this.pb24H.Size = new System.Drawing.Size(36, 36);
this.pb24H.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pb24H.TabIndex = 71;
this.pb24H.TabStop = false;
this.pb24H.Tag = "selected";
this.pb24H.Click += new System.EventHandler(this.pb24H_Click);
this.pb24H.MouseEnter += new System.EventHandler(this.pb24H_MouseEnter);
this.pb24H.MouseLeave += new System.EventHandler(this.pb24H_MouseLeave);
//
// rcbSpeedLower
//
this.rcbSpeedLower.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcbSpeedLower.BackColor = System.Drawing.Color.Transparent;
this.rcbSpeedLower.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcbSpeedLower.Location = new System.Drawing.Point(95, 618);
this.rcbSpeedLower.Name = "rcbSpeedLower";
//
//
//
this.rcbSpeedLower.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcbSpeedLower.Size = new System.Drawing.Size(159, 19);
this.rcbSpeedLower.TabIndex = 70;
this.rcbSpeedLower.Text = "Lower speed limit [km/h]";
this.rcbSpeedLower.ThemeName = "TelerikMetroBlue";
this.rcbSpeedLower.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.checkbox_UpdateHT);
this.rcbSpeedLower.CheckStateChanged += new System.EventHandler(this.speedLimit_CheckStateChanged);
//
// rtbFilterUnits
//
this.rtbFilterUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rtbFilterUnits.Font = new System.Drawing.Font("Segoe UI", 10F);
this.rtbFilterUnits.Location = new System.Drawing.Point(16, 467);
this.rtbFilterUnits.MaxLength = 140;
this.rtbFilterUnits.Name = "rtbFilterUnits";
this.rtbFilterUnits.NullText = "Type to search unit";
this.rtbFilterUnits.Size = new System.Drawing.Size(262, 23);
this.rtbFilterUnits.TabIndex = 58;
this.rtbFilterUnits.ThemeName = "Office2013Dark";
this.rtbFilterUnits.TextChanged += new System.EventHandler(this.rtbFilterUnits_TextChanged);
//
// rseSpeedLower
//
this.rseSpeedLower.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rseSpeedLower.Enabled = false;
this.rseSpeedLower.Location = new System.Drawing.Point(19, 615);
this.rseSpeedLower.Maximum = new decimal(new int[] {
350,
0,
0,
0});
this.rseSpeedLower.Name = "rseSpeedLower";
this.rseSpeedLower.Size = new System.Drawing.Size(72, 21);
this.rseSpeedLower.TabIndex = 69;
this.rseSpeedLower.TabStop = false;
this.rseSpeedLower.TextAlignment = System.Windows.Forms.HorizontalAlignment.Right;
this.rseSpeedLower.ThemeName = "Office2013Light";
this.rseSpeedLower.ValueChanged += new System.EventHandler(this.rse_ValueChanged);
//
// rdpEndTime
//
this.rdpEndTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rdpEndTime.CustomFormat = "MM/dd/yyyy, HH:mm";
this.rdpEndTime.Enabled = false;
this.rdpEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.rdpEndTime.Location = new System.Drawing.Point(18, 567);
this.rdpEndTime.MaxDate = new System.DateTime(2030, 12, 31, 0, 0, 0, 0);
this.rdpEndTime.MinDate = new System.DateTime(2010, 1, 1, 0, 0, 0, 0);
this.rdpEndTime.Name = "rdpEndTime";
this.rdpEndTime.Size = new System.Drawing.Size(225, 21);
this.rdpEndTime.TabIndex = 64;
this.rdpEndTime.TabStop = false;
this.rdpEndTime.Text = "01/01/2010, 00:00";
this.rdpEndTime.ThemeName = "Office2013Light";
this.rdpEndTime.Value = new System.DateTime(2010, 1, 1, 0, 0, 0, 0);
//
// rdpStartTime
//
this.rdpStartTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rdpStartTime.CustomFormat = "MM/dd/yyyy, HH:mm";
this.rdpStartTime.Enabled = false;
this.rdpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.rdpStartTime.Location = new System.Drawing.Point(18, 542);
this.rdpStartTime.MaxDate = new System.DateTime(2030, 12, 31, 0, 0, 0, 0);
this.rdpStartTime.MinDate = new System.DateTime(2010, 1, 1, 0, 0, 0, 0);
this.rdpStartTime.Name = "rdpStartTime";
this.rdpStartTime.NullText = "Display all";
this.rdpStartTime.Size = new System.Drawing.Size(225, 21);
this.rdpStartTime.TabIndex = 63;
this.rdpStartTime.TabStop = false;
this.rdpStartTime.Text = "01/01/2015, 00:00";
this.rdpStartTime.ThemeName = "Office2013Light";
this.rdpStartTime.Value = new System.DateTime(2015, 1, 1, 0, 0, 0, 0);
//
// rcb24H
//
this.rcb24H.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcb24H.AutoSize = false;
this.rcb24H.BackColor = System.Drawing.Color.Transparent;
this.rcb24H.CheckState = System.Windows.Forms.CheckState.Checked;
this.rcb24H.Enabled = false;
this.rcb24H.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcb24H.Location = new System.Drawing.Point(253, 550);
this.rcb24H.Name = "rcb24H";
//
//
//
this.rcb24H.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcb24H.Size = new System.Drawing.Size(25, 37);
this.rcb24H.TabIndex = 67;
this.rcb24H.Text = "24";
this.rcb24H.TextWrap = true;
this.rcb24H.ThemeName = "TelerikMetroBlue";
this.rcb24H.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
//
// rlUntil
//
this.rlUntil.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rlUntil.AutoSize = false;
this.rlUntil.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.rlUntil.ForeColor = System.Drawing.Color.DarkGray;
this.rlUntil.Location = new System.Drawing.Point(134, 587);
this.rlUntil.Name = "rlUntil";
this.rlUntil.Size = new System.Drawing.Size(109, 19);
this.rlUntil.TabIndex = 66;
this.rlUntil.Text = "History until";
this.rlUntil.TextAlignment = System.Drawing.ContentAlignment.TopRight;
//
// radLabel6
//
this.radLabel6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.radLabel6.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.radLabel6.ForeColor = System.Drawing.Color.DarkGray;
this.radLabel6.Location = new System.Drawing.Point(16, 525);
this.radLabel6.Name = "radLabel6";
this.radLabel6.Size = new System.Drawing.Size(81, 19);
this.radLabel6.TabIndex = 65;
this.radLabel6.Text = "History from";
//
// treeViewUnits
//
this.treeViewUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.treeViewUnits.CheckBoxes = true;
this.treeViewUnits.Location = new System.Drawing.Point(16, 25);
this.treeViewUnits.Name = "treeViewUnits";
this.treeViewUnits.Size = new System.Drawing.Size(265, 443);
this.treeViewUnits.SortOrder = System.Windows.Forms.SortOrder.Ascending;
this.treeViewUnits.SpacingBetweenNodes = -1;
this.treeViewUnits.TabIndex = 60;
this.treeViewUnits.Text = "radTreeView1";
this.treeViewUnits.ThemeName = "TelerikMetroBlue";
this.treeViewUnits.TriStateMode = true;
this.treeViewUnits.NodeFormatting += new Telerik.WinControls.UI.TreeNodeFormattingEventHandler(this.treeViewUnits_NodeFormatting);
this.treeViewUnits.CreateNodeElement += new Telerik.WinControls.UI.CreateTreeNodeElementEventHandler(this.treeViewUnits_CreateNodeElement);
//
// rlHistoryForSelectedUnits
//
this.rlHistoryForSelectedUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rlHistoryForSelectedUnits.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.rlHistoryForSelectedUnits.ForeColor = System.Drawing.Color.DarkGray;
this.rlHistoryForSelectedUnits.Location = new System.Drawing.Point(16, 490);
this.rlHistoryForSelectedUnits.Name = "rlHistoryForSelectedUnits";
this.rlHistoryForSelectedUnits.Size = new System.Drawing.Size(152, 19);
this.rlHistoryForSelectedUnits.TabIndex = 61;
this.rlHistoryForSelectedUnits.Text = "History for selected units";
//
// labelUnits
//
this.labelUnits.BackColor = System.Drawing.Color.WhiteSmoke;
this.labelUnits.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
this.labelUnits.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.labelUnits.Location = new System.Drawing.Point(16, 5);
this.labelUnits.Name = "labelUnits";
this.labelUnits.Size = new System.Drawing.Size(40, 21);
this.labelUnits.TabIndex = 77;
this.labelUnits.Text = "Units";
//
// toolTabStripTabs
//
this.toolTabStripTabs.CanUpdateChildIndex = true;
this.toolTabStripTabs.CaptionVisible = false;
this.toolTabStripTabs.Controls.Add(this.toolWindow4);
this.toolTabStripTabs.Controls.Add(this.windowHistoryResult);
this.toolTabStripTabs.Location = new System.Drawing.Point(5, 5);
this.toolTabStripTabs.Name = "toolTabStripTabs";
//
//
//
this.toolTabStripTabs.RootElement.MinSize = new System.Drawing.Size(25, 25);
this.toolTabStripTabs.SelectedIndex = 0;
this.toolTabStripTabs.Size = new System.Drawing.Size(296, 793);
this.toolTabStripTabs.SizeInfo.AbsoluteSize = new System.Drawing.Size(296, 200);
this.toolTabStripTabs.SizeInfo.SplitterCorrection = new System.Drawing.Size(110, 0);
this.toolTabStripTabs.TabIndex = 4;
this.toolTabStripTabs.TabStop = false;
this.toolTabStripTabs.TabStripAlignment = Telerik.WinControls.UI.TabStripAlignment.Top;
this.toolTabStripTabs.ThemeName = "TelerikMetroBlue";
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).Width = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).LeftWidth = 12F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).TopWidth = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).RightWidth = 12F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).BottomWidth = 0F;
((Telerik.WinControls.UI.Docking.ToolWindowCaptionElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.UI.Docking.ToolWindowCaptionElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(0))).Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(0).GetChildAt(1))).SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).ItemContentOrientation = Telerik.WinControls.UI.PageViewContentOrientation.Horizontal;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderLeftWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderTopWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderRightWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderBottomWidth = 0F;
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).BorderWidth = 0F;
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).BorderBottomWidth = 3F;
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).BorderBottomColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).Margin = new System.Windows.Forms.Padding(0);
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderLeftWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderTopWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderRightWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderBottomWidth = 0F;
((Telerik.WinControls.UI.StripViewButtonsPanel)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(1))).BorderBottomWidth = 2F;
//
// windowHistoryResult
//
this.windowHistoryResult.BackColor = System.Drawing.Color.WhiteSmoke;
@ -499,7 +873,7 @@ namespace Safedispatch_4_0
this.gridHistoryPoints.MasterTemplate.EnableGrouping = false;
this.gridHistoryPoints.MasterTemplate.ShowColumnHeaders = false;
this.gridHistoryPoints.MasterTemplate.ShowRowHeaderColumn = false;
this.gridHistoryPoints.MasterTemplate.ViewDefinition = tableViewDefinition6;
this.gridHistoryPoints.MasterTemplate.ViewDefinition = tableViewDefinition1;
this.gridHistoryPoints.Name = "gridHistoryPoints";
this.gridHistoryPoints.ShowGroupPanel = false;
this.gridHistoryPoints.Size = new System.Drawing.Size(273, 489);
@ -664,381 +1038,6 @@ namespace Safedispatch_4_0
this.rlAnimation.TabIndex = 85;
this.rlAnimation.Text = "Animation active for less than 100 positions";
//
// toolTabStripTabs
//
this.toolTabStripTabs.CanUpdateChildIndex = true;
this.toolTabStripTabs.CaptionVisible = false;
this.toolTabStripTabs.Controls.Add(this.toolWindow4);
this.toolTabStripTabs.Controls.Add(this.windowHistoryResult);
this.toolTabStripTabs.Location = new System.Drawing.Point(0, 0);
this.toolTabStripTabs.Name = "toolTabStripTabs";
//
//
//
this.toolTabStripTabs.RootElement.MinSize = new System.Drawing.Size(25, 25);
this.toolTabStripTabs.SelectedIndex = 0;
this.toolTabStripTabs.Size = new System.Drawing.Size(296, 803);
this.toolTabStripTabs.SizeInfo.AbsoluteSize = new System.Drawing.Size(296, 200);
this.toolTabStripTabs.SizeInfo.SplitterCorrection = new System.Drawing.Size(110, 0);
this.toolTabStripTabs.TabIndex = 4;
this.toolTabStripTabs.TabStop = false;
this.toolTabStripTabs.TabStripAlignment = Telerik.WinControls.UI.TabStripAlignment.Top;
this.toolTabStripTabs.ThemeName = "TelerikMetroBlue";
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).Width = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).LeftWidth = 12F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).TopWidth = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).RightWidth = 12F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(1))).BottomWidth = 0F;
((Telerik.WinControls.UI.Docking.ToolWindowCaptionElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.UI.Docking.ToolWindowCaptionElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(0))).Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(0).GetChildAt(1))).SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).ItemContentOrientation = Telerik.WinControls.UI.PageViewContentOrientation.Horizontal;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderLeftWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderTopWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderRightWidth = 0F;
((Telerik.WinControls.UI.RadPageViewTabStripElement)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1))).BorderBottomWidth = 0F;
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).BorderWidth = 0F;
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).BorderBottomWidth = 3F;
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).BorderBottomColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.UI.StripViewItemContainer)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0))).Margin = new System.Windows.Forms.Padding(0);
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderLeftWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderTopWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderRightWidth = 0F;
((Telerik.WinControls.UI.StripViewItemLayout)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(0))).BorderBottomWidth = 0F;
((Telerik.WinControls.UI.StripViewButtonsPanel)(this.toolTabStripTabs.GetChildAt(0).GetChildAt(2).GetChildAt(1).GetChildAt(0).GetChildAt(1))).BorderBottomWidth = 2F;
//
// toolWindow4
//
this.toolWindow4.BackColor = System.Drawing.Color.WhiteSmoke;
this.toolWindow4.Caption = null;
this.toolWindow4.Controls.Add(this.pbFilter);
this.toolWindow4.Controls.Add(this.rbResetHistory);
this.toolWindow4.Controls.Add(this.rbSearchHistory);
this.toolWindow4.Controls.Add(this.rcbComputeAddress);
this.toolWindow4.Controls.Add(this.rcbSpeedUpper);
this.toolWindow4.Controls.Add(this.rseSpeedUpper);
this.toolWindow4.Controls.Add(this.pb24H);
this.toolWindow4.Controls.Add(this.rcbSpeedLower);
this.toolWindow4.Controls.Add(this.rtbFilterUnits);
this.toolWindow4.Controls.Add(this.rseSpeedLower);
this.toolWindow4.Controls.Add(this.rdpEndTime);
this.toolWindow4.Controls.Add(this.rdpStartTime);
this.toolWindow4.Controls.Add(this.rcb24H);
this.toolWindow4.Controls.Add(this.rlUntil);
this.toolWindow4.Controls.Add(this.radLabel6);
this.toolWindow4.Controls.Add(this.treeViewUnits);
this.toolWindow4.Controls.Add(this.rlHistoryForSelectedUnits);
this.toolWindow4.Controls.Add(this.labelUnits);
this.toolWindow4.DocumentButtons = Telerik.WinControls.UI.Docking.DocumentStripButtons.None;
this.toolWindow4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.toolWindow4.Location = new System.Drawing.Point(1, 29);
this.toolWindow4.Name = "toolWindow4";
this.toolWindow4.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.toolWindow4.Size = new System.Drawing.Size(294, 772);
this.toolWindow4.Text = "History search parameters";
this.toolWindow4.ToolCaptionButtons = Telerik.WinControls.UI.Docking.ToolStripCaptionButtons.None;
//
// pbFilter
//
this.pbFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pbFilter.BackColor = System.Drawing.Color.White;
this.pbFilter.Image = global::Dispatcher.Properties.Resources.i_search;
this.pbFilter.Location = new System.Drawing.Point(259, 478);
this.pbFilter.Name = "pbFilter";
this.pbFilter.Size = new System.Drawing.Size(21, 21);
this.pbFilter.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbFilter.TabIndex = 68;
this.pbFilter.TabStop = false;
this.pbFilter.Tag = "unselected";
this.pbFilter.MouseEnter += new System.EventHandler(this.pbFilter_MouseEnter);
this.pbFilter.MouseLeave += new System.EventHandler(this.pbFilter_MouseLeave);
//
// rbResetHistory
//
this.rbResetHistory.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rbResetHistory.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.rbResetHistory.Cursor = System.Windows.Forms.Cursors.Hand;
this.rbResetHistory.Font = new System.Drawing.Font("Segoe UI", 10F);
this.rbResetHistory.Location = new System.Drawing.Point(18, 726);
this.rbResetHistory.Name = "rbResetHistory";
this.rbResetHistory.Size = new System.Drawing.Size(91, 34);
this.rbResetHistory.TabIndex = 76;
this.rbResetHistory.Text = "Reset";
this.rbResetHistory.ThemeName = "TelerikMetroBlue";
this.rbResetHistory.Click += new System.EventHandler(this.rbResetHistory_Click);
((Telerik.WinControls.UI.RadButtonElement)(this.rbResetHistory.GetChildAt(0))).Text = "Reset";
((Telerik.WinControls.Primitives.FillPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Font = new System.Drawing.Font("Segoe UI", 8F, System.Drawing.FontStyle.Bold);
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
((Telerik.WinControls.Primitives.FocusPrimitive)(this.rbResetHistory.GetChildAt(0).GetChildAt(3))).BackColor = System.Drawing.Color.DeepSkyBlue;
//
// rbSearchHistory
//
this.rbSearchHistory.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rbSearchHistory.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.rbSearchHistory.Cursor = System.Windows.Forms.Cursors.Hand;
this.rbSearchHistory.Font = new System.Drawing.Font("Segoe UI", 10F);
this.rbSearchHistory.Location = new System.Drawing.Point(147, 726);
this.rbSearchHistory.Name = "rbSearchHistory";
this.rbSearchHistory.Size = new System.Drawing.Size(136, 34);
this.rbSearchHistory.TabIndex = 75;
this.rbSearchHistory.Text = "Search History";
this.rbSearchHistory.ThemeName = "TelerikMetroBlue";
this.rbSearchHistory.Click += new System.EventHandler(this.btDisplayHeadingHisotry_Click);
((Telerik.WinControls.UI.RadButtonElement)(this.rbSearchHistory.GetChildAt(0))).Text = "Search History";
((Telerik.WinControls.Primitives.FillPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
((Telerik.WinControls.Primitives.TextPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
((Telerik.WinControls.Primitives.FocusPrimitive)(this.rbSearchHistory.GetChildAt(0).GetChildAt(3))).BackColor = System.Drawing.Color.DeepSkyBlue;
//
// rcbComputeAddress
//
this.rcbComputeAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcbComputeAddress.BackColor = System.Drawing.Color.Transparent;
this.rcbComputeAddress.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcbComputeAddress.Location = new System.Drawing.Point(20, 689);
this.rcbComputeAddress.Name = "rcbComputeAddress";
//
//
//
this.rcbComputeAddress.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcbComputeAddress.Size = new System.Drawing.Size(119, 19);
this.rcbComputeAddress.TabIndex = 74;
this.rcbComputeAddress.Text = "Compute address";
this.rcbComputeAddress.ThemeName = "TelerikMetroBlue";
this.rcbComputeAddress.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.checkbox_UpdateHT);
//
// rcbSpeedUpper
//
this.rcbSpeedUpper.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcbSpeedUpper.BackColor = System.Drawing.Color.Transparent;
this.rcbSpeedUpper.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcbSpeedUpper.Location = new System.Drawing.Point(95, 653);
this.rcbSpeedUpper.Name = "rcbSpeedUpper";
//
//
//
this.rcbSpeedUpper.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcbSpeedUpper.Size = new System.Drawing.Size(160, 19);
this.rcbSpeedUpper.TabIndex = 73;
this.rcbSpeedUpper.Text = "Upper speed limit [km/h]";
this.rcbSpeedUpper.ThemeName = "TelerikMetroBlue";
this.rcbSpeedUpper.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.checkbox_UpdateHT);
this.rcbSpeedUpper.CheckStateChanged += new System.EventHandler(this.speedLimit_CheckStateChanged);
//
// rseSpeedUpper
//
this.rseSpeedUpper.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rseSpeedUpper.Enabled = false;
this.rseSpeedUpper.Location = new System.Drawing.Point(19, 650);
this.rseSpeedUpper.Maximum = new decimal(new int[] {
350,
0,
0,
0});
this.rseSpeedUpper.Name = "rseSpeedUpper";
this.rseSpeedUpper.Size = new System.Drawing.Size(72, 21);
this.rseSpeedUpper.TabIndex = 72;
this.rseSpeedUpper.TabStop = false;
this.rseSpeedUpper.TextAlignment = System.Windows.Forms.HorizontalAlignment.Right;
this.rseSpeedUpper.ThemeName = "Office2013Light";
this.rseSpeedUpper.Value = new decimal(new int[] {
50,
0,
0,
0});
this.rseSpeedUpper.ValueChanged += new System.EventHandler(this.rse_ValueChanged);
//
// pb24H
//
this.pb24H.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pb24H.BackColor = System.Drawing.Color.Transparent;
this.pb24H.Cursor = System.Windows.Forms.Cursors.Hand;
this.pb24H.Image = global::Dispatcher.Properties.Resources.h_24h;
this.pb24H.Location = new System.Drawing.Point(247, 558);
this.pb24H.Name = "pb24H";
this.pb24H.Size = new System.Drawing.Size(36, 36);
this.pb24H.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pb24H.TabIndex = 71;
this.pb24H.TabStop = false;
this.pb24H.Tag = "selected";
this.pb24H.Click += new System.EventHandler(this.pb24H_Click);
this.pb24H.MouseEnter += new System.EventHandler(this.pb24H_MouseEnter);
this.pb24H.MouseLeave += new System.EventHandler(this.pb24H_MouseLeave);
//
// rcbSpeedLower
//
this.rcbSpeedLower.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcbSpeedLower.BackColor = System.Drawing.Color.Transparent;
this.rcbSpeedLower.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcbSpeedLower.Location = new System.Drawing.Point(95, 628);
this.rcbSpeedLower.Name = "rcbSpeedLower";
//
//
//
this.rcbSpeedLower.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcbSpeedLower.Size = new System.Drawing.Size(159, 19);
this.rcbSpeedLower.TabIndex = 70;
this.rcbSpeedLower.Text = "Lower speed limit [km/h]";
this.rcbSpeedLower.ThemeName = "TelerikMetroBlue";
this.rcbSpeedLower.ToggleStateChanged += new Telerik.WinControls.UI.StateChangedEventHandler(this.checkbox_UpdateHT);
this.rcbSpeedLower.CheckStateChanged += new System.EventHandler(this.speedLimit_CheckStateChanged);
//
// rtbFilterUnits
//
this.rtbFilterUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rtbFilterUnits.Font = new System.Drawing.Font("Segoe UI", 10F);
this.rtbFilterUnits.Location = new System.Drawing.Point(16, 477);
this.rtbFilterUnits.MaxLength = 140;
this.rtbFilterUnits.Name = "rtbFilterUnits";
this.rtbFilterUnits.NullText = "Type to search unit";
this.rtbFilterUnits.Size = new System.Drawing.Size(262, 23);
this.rtbFilterUnits.TabIndex = 58;
this.rtbFilterUnits.ThemeName = "Office2013Dark";
this.rtbFilterUnits.TextChanged += new System.EventHandler(this.rtbFilterUnits_TextChanged);
//
// rseSpeedLower
//
this.rseSpeedLower.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rseSpeedLower.Enabled = false;
this.rseSpeedLower.Location = new System.Drawing.Point(19, 625);
this.rseSpeedLower.Maximum = new decimal(new int[] {
350,
0,
0,
0});
this.rseSpeedLower.Name = "rseSpeedLower";
this.rseSpeedLower.Size = new System.Drawing.Size(72, 21);
this.rseSpeedLower.TabIndex = 69;
this.rseSpeedLower.TabStop = false;
this.rseSpeedLower.TextAlignment = System.Windows.Forms.HorizontalAlignment.Right;
this.rseSpeedLower.ThemeName = "Office2013Light";
this.rseSpeedLower.ValueChanged += new System.EventHandler(this.rse_ValueChanged);
//
// rdpEndTime
//
this.rdpEndTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rdpEndTime.CustomFormat = "MM/dd/yyyy, HH:mm";
this.rdpEndTime.Enabled = false;
this.rdpEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.rdpEndTime.Location = new System.Drawing.Point(18, 577);
this.rdpEndTime.MaxDate = new System.DateTime(2030, 12, 31, 0, 0, 0, 0);
this.rdpEndTime.MinDate = new System.DateTime(2010, 1, 1, 0, 0, 0, 0);
this.rdpEndTime.Name = "rdpEndTime";
this.rdpEndTime.Size = new System.Drawing.Size(225, 21);
this.rdpEndTime.TabIndex = 64;
this.rdpEndTime.TabStop = false;
this.rdpEndTime.Text = "01/01/2010, 00:00";
this.rdpEndTime.ThemeName = "Office2013Light";
this.rdpEndTime.Value = new System.DateTime(2010, 1, 1, 0, 0, 0, 0);
//
// rdpStartTime
//
this.rdpStartTime.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rdpStartTime.CustomFormat = "MM/dd/yyyy, HH:mm";
this.rdpStartTime.Enabled = false;
this.rdpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.rdpStartTime.Location = new System.Drawing.Point(18, 552);
this.rdpStartTime.MaxDate = new System.DateTime(2030, 12, 31, 0, 0, 0, 0);
this.rdpStartTime.MinDate = new System.DateTime(2010, 1, 1, 0, 0, 0, 0);
this.rdpStartTime.Name = "rdpStartTime";
this.rdpStartTime.NullText = "Display all";
this.rdpStartTime.Size = new System.Drawing.Size(225, 21);
this.rdpStartTime.TabIndex = 63;
this.rdpStartTime.TabStop = false;
this.rdpStartTime.Text = "01/01/2015, 00:00";
this.rdpStartTime.ThemeName = "Office2013Light";
this.rdpStartTime.Value = new System.DateTime(2015, 1, 1, 0, 0, 0, 0);
//
// rcb24H
//
this.rcb24H.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rcb24H.AutoSize = false;
this.rcb24H.BackColor = System.Drawing.Color.Transparent;
this.rcb24H.CheckState = System.Windows.Forms.CheckState.Checked;
this.rcb24H.Enabled = false;
this.rcb24H.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(5)))), ((int)(((byte)(5)))));
this.rcb24H.Location = new System.Drawing.Point(253, 560);
this.rcb24H.Name = "rcb24H";
//
//
//
this.rcb24H.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
this.rcb24H.Size = new System.Drawing.Size(25, 37);
this.rcb24H.TabIndex = 67;
this.rcb24H.Text = "24";
this.rcb24H.TextWrap = true;
this.rcb24H.ThemeName = "TelerikMetroBlue";
this.rcb24H.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
//
// rlUntil
//
this.rlUntil.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rlUntil.AutoSize = false;
this.rlUntil.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.rlUntil.ForeColor = System.Drawing.Color.DarkGray;
this.rlUntil.Location = new System.Drawing.Point(134, 597);
this.rlUntil.Name = "rlUntil";
this.rlUntil.Size = new System.Drawing.Size(109, 19);
this.rlUntil.TabIndex = 66;
this.rlUntil.Text = "History until";
this.rlUntil.TextAlignment = System.Drawing.ContentAlignment.TopRight;
//
// radLabel6
//
this.radLabel6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.radLabel6.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.radLabel6.ForeColor = System.Drawing.Color.DarkGray;
this.radLabel6.Location = new System.Drawing.Point(16, 535);
this.radLabel6.Name = "radLabel6";
this.radLabel6.Size = new System.Drawing.Size(81, 19);
this.radLabel6.TabIndex = 65;
this.radLabel6.Text = "History from";
//
// treeViewUnits
//
this.treeViewUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.treeViewUnits.CheckBoxes = true;
this.treeViewUnits.Location = new System.Drawing.Point(16, 25);
this.treeViewUnits.Name = "treeViewUnits";
this.treeViewUnits.Size = new System.Drawing.Size(265, 453);
this.treeViewUnits.SortOrder = System.Windows.Forms.SortOrder.Ascending;
this.treeViewUnits.SpacingBetweenNodes = -1;
this.treeViewUnits.TabIndex = 60;
this.treeViewUnits.Text = "radTreeView1";
this.treeViewUnits.ThemeName = "TelerikMetroBlue";
this.treeViewUnits.TriStateMode = true;
this.treeViewUnits.NodeFormatting += new Telerik.WinControls.UI.TreeNodeFormattingEventHandler(this.treeViewUnits_NodeFormatting);
this.treeViewUnits.CreateNodeElement += new Telerik.WinControls.UI.CreateTreeNodeElementEventHandler(this.treeViewUnits_CreateNodeElement);
//
// rlHistoryForSelectedUnits
//
this.rlHistoryForSelectedUnits.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.rlHistoryForSelectedUnits.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.rlHistoryForSelectedUnits.ForeColor = System.Drawing.Color.DarkGray;
this.rlHistoryForSelectedUnits.Location = new System.Drawing.Point(16, 500);
this.rlHistoryForSelectedUnits.Name = "rlHistoryForSelectedUnits";
this.rlHistoryForSelectedUnits.Size = new System.Drawing.Size(152, 19);
this.rlHistoryForSelectedUnits.TabIndex = 61;
this.rlHistoryForSelectedUnits.Text = "History for selected units";
//
// labelUnits
//
this.labelUnits.BackColor = System.Drawing.Color.WhiteSmoke;
this.labelUnits.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
this.labelUnits.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.labelUnits.Location = new System.Drawing.Point(16, 5);
this.labelUnits.Name = "labelUnits";
this.labelUnits.Size = new System.Drawing.Size(40, 21);
this.labelUnits.TabIndex = 77;
this.labelUnits.Text = "Units";
//
// documentContainer1
//
this.documentContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(254)))));
@ -1075,7 +1074,7 @@ namespace Safedispatch_4_0
//
this.documentTabStrip1.RootElement.MinSize = new System.Drawing.Size(25, 25);
this.documentTabStrip1.SelectedIndex = 1;
this.documentTabStrip1.Size = new System.Drawing.Size(854, 803);
this.documentTabStrip1.Size = new System.Drawing.Size(844, 793);
this.documentTabStrip1.TabIndex = 0;
this.documentTabStrip1.TabStop = false;
this.documentTabStrip1.TabStripVisible = false;
@ -1125,7 +1124,7 @@ namespace Safedispatch_4_0
this.toolWindow2.Margin = new System.Windows.Forms.Padding(0);
this.toolWindow2.Name = "toolWindow2";
this.toolWindow2.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.toolWindow2.Size = new System.Drawing.Size(854, 803);
this.toolWindow2.Size = new System.Drawing.Size(844, 793);
this.toolWindow2.Text = "toolWindow2";
this.toolWindow2.Resize += new System.EventHandler(this.toolWindow2_Resize);
//
@ -1184,7 +1183,7 @@ namespace Safedispatch_4_0
this.HistMapPanel.Location = new System.Drawing.Point(0, 0);
this.HistMapPanel.Margin = new System.Windows.Forms.Padding(0);
this.HistMapPanel.Name = "HistMapPanel";
this.HistMapPanel.Size = new System.Drawing.Size(854, 803);
this.HistMapPanel.Size = new System.Drawing.Size(844, 793);
this.HistMapPanel.TabIndex = 0;
this.HistMapPanel.ThemeName = "TelerikMetroBlue";
((Telerik.WinControls.UI.RadPanelElement)(this.HistMapPanel.GetChildAt(0))).Text = "";
@ -1268,28 +1267,6 @@ namespace Safedispatch_4_0
((System.ComponentModel.ISupportInitialize)(this.skinButton4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.radDock1)).EndInit();
this.radDock1.ResumeLayout(false);
this.windowHistoryResult.ResumeLayout(false);
this.windowHistoryResult.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.panelAnimationButtons)).EndInit();
this.panelAnimationButtons.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.rbPrev)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbNext)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbStop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbPause)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbPlay)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints.MasterTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.timeTrackBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rsePositionDisplay)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rseSkipSeconds)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.radLabel10)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.labelSlideshow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowLabels)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowGeofence)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rlPositionDisplayMs)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rlAnimation)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.toolTabStripTabs)).EndInit();
this.toolTabStripTabs.ResumeLayout(false);
this.toolWindow4.ResumeLayout(false);
this.toolWindow4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pbFilter)).EndInit();
@ -1310,6 +1287,28 @@ namespace Safedispatch_4_0
((System.ComponentModel.ISupportInitialize)(this.treeViewUnits)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rlHistoryForSelectedUnits)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.labelUnits)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.toolTabStripTabs)).EndInit();
this.toolTabStripTabs.ResumeLayout(false);
this.windowHistoryResult.ResumeLayout(false);
this.windowHistoryResult.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.panelAnimationButtons)).EndInit();
this.panelAnimationButtons.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.rbPrev)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbNext)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbStop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbPause)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbPlay)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints.MasterTemplate)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.gridHistoryPoints)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.timeTrackBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rsePositionDisplay)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rseSkipSeconds)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.radLabel10)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.labelSlideshow)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowLabels)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rcbShowGeofence)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rlPositionDisplayMs)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rlAnimation)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.documentContainer1)).EndInit();
this.documentContainer1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.documentTabStrip1)).EndInit();

View File

@ -149,7 +149,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABI
HQAAAk1TRnQBSQFMAgEBBgEAAWgBCAFoAQgBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
HQAAAk1TRnQBSQFMAgEBBgEAAXABCAFwAQgBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABIAMAAQEBAAEgBgABICIAAywBQwNQAZ4BYAJbAdYCXAFVAeoCYAFZAesBXwJcAdsDVAGuAzQBVCAA
AyYBOANPAZcDXAHPA1cB6ANVAeoDWgHTA1EBoAMsAUSYAAMIAQsDUAGdAZACAAH/AY4CAAH/AZACAAH/
AZECAAH/AZECAAH/AZACAAH/AY4CAAH/AY4CAAH/A1gBuQMUARsQAAMMARADTgGVAysB/AMAAf8DAAH/

View File

@ -29,22 +29,23 @@
private void InitializeComponent()
{
this.radDock1 = new Telerik.WinControls.UI.Docking.RadDock();
this.repGeofenc = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repSMSLocation = new Telerik.WinControls.UI.Docking.ToolWindow();
this.documentContainer1 = new Telerik.WinControls.UI.Docking.DocumentContainer();
this.documentTabStrip1 = new Telerik.WinControls.UI.Docking.DocumentTabStrip();
this.repSpeed = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repGeofenc = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repLand = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repONOFF = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repEmerg = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repALL = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repHist = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repBatchHist = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repEndDay = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repIdle = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repStop = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repFleet = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repTelem = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repTelemEvn = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repSMSLocation = new Telerik.WinControls.UI.Docking.ToolWindow();
this.repTicketing = new Telerik.WinControls.UI.Docking.ToolWindow();
this.radThemeManager1 = new Telerik.WinControls.RadThemeManager();
((System.ComponentModel.ISupportInitialize)(this.radDock1)).BeginInit();
@ -57,7 +58,7 @@
//
// radDock1
//
this.radDock1.ActiveWindow = this.repONOFF;
this.radDock1.ActiveWindow = this.repBatchHist;
this.radDock1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(254)))));
this.radDock1.CausesValidation = false;
this.radDock1.Controls.Add(this.documentContainer1);
@ -79,22 +80,23 @@
this.radDock1.ThemeName = "TelerikMetroBlue";
this.radDock1.ActiveWindowChanging += new Telerik.WinControls.UI.Docking.DockWindowCancelEventHandler(this.radDock1_ActiveWindowChanging);
this.radDock1.ActiveWindowChanged += new Telerik.WinControls.UI.Docking.DockWindowEventHandler(this.radDock1_ActiveWindowChanged);
((Telerik.WinControls.UI.SplitPanelElement)(this.radDock1.GetChildAt(0))).Padding = new System.Windows.Forms.Padding(5);
((Telerik.WinControls.Primitives.BorderPrimitive)(this.radDock1.GetChildAt(0).GetChildAt(1))).Width = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.radDock1.GetChildAt(0).GetChildAt(1))).LeftWidth = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.radDock1.GetChildAt(0).GetChildAt(1))).TopWidth = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.radDock1.GetChildAt(0).GetChildAt(1))).RightWidth = 0F;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.radDock1.GetChildAt(0).GetChildAt(1))).BottomWidth = 0F;
//
// repGeofenc
// repSMSLocation
//
this.repGeofenc.Caption = null;
this.repGeofenc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repGeofenc.Location = new System.Drawing.Point(4, 32);
this.repGeofenc.Name = "repGeofenc";
this.repGeofenc.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repGeofenc.Size = new System.Drawing.Size(1454, 502);
this.repGeofenc.Text = "Geofencing Retroactive";
this.repGeofenc.Enter += new System.EventHandler(this.repGeofenc_Enter);
this.repSMSLocation.Caption = null;
this.repSMSLocation.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repSMSLocation.Location = new System.Drawing.Point(4, 32);
this.repSMSLocation.Name = "repSMSLocation";
this.repSMSLocation.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repSMSLocation.Size = new System.Drawing.Size(1454, 502);
this.repSMSLocation.Text = "Text message location";
this.repSMSLocation.Enter += new System.EventHandler(this.repSMSLocation_Enter);
//
// documentContainer1
//
@ -114,13 +116,14 @@
//
this.documentTabStrip1.CanUpdateChildIndex = true;
this.documentTabStrip1.CausesValidation = false;
this.documentTabStrip1.Controls.Add(this.repHist);
this.documentTabStrip1.Controls.Add(this.repSpeed);
this.documentTabStrip1.Controls.Add(this.repGeofenc);
this.documentTabStrip1.Controls.Add(this.repLand);
this.documentTabStrip1.Controls.Add(this.repONOFF);
this.documentTabStrip1.Controls.Add(this.repEmerg);
this.documentTabStrip1.Controls.Add(this.repALL);
this.documentTabStrip1.Controls.Add(this.repHist);
this.documentTabStrip1.Controls.Add(this.repBatchHist);
this.documentTabStrip1.Controls.Add(this.repEndDay);
this.documentTabStrip1.Controls.Add(this.repIdle);
this.documentTabStrip1.Controls.Add(this.repStop);
@ -135,7 +138,7 @@
//
//
this.documentTabStrip1.RootElement.MinSize = new System.Drawing.Size(25, 25);
this.documentTabStrip1.SelectedIndex = 3;
this.documentTabStrip1.SelectedIndex = 7;
this.documentTabStrip1.Size = new System.Drawing.Size(1462, 538);
this.documentTabStrip1.TabIndex = 0;
this.documentTabStrip1.TabStop = false;
@ -165,6 +168,17 @@
this.repSpeed.ToolCaptionButtons = Telerik.WinControls.UI.Docking.ToolStripCaptionButtons.None;
this.repSpeed.Enter += new System.EventHandler(this.repSpeed_Enter);
//
// repGeofenc
//
this.repGeofenc.Caption = null;
this.repGeofenc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repGeofenc.Location = new System.Drawing.Point(4, 32);
this.repGeofenc.Name = "repGeofenc";
this.repGeofenc.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repGeofenc.Size = new System.Drawing.Size(1454, 502);
this.repGeofenc.Text = "Geofencing Retroactive";
this.repGeofenc.Enter += new System.EventHandler(this.repGeofenc_Enter);
//
// repLand
//
this.repLand.Caption = null;
@ -180,10 +194,10 @@
//
this.repONOFF.Caption = null;
this.repONOFF.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repONOFF.Location = new System.Drawing.Point(4, 32);
this.repONOFF.Location = new System.Drawing.Point(5, 28);
this.repONOFF.Name = "repONOFF";
this.repONOFF.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repONOFF.Size = new System.Drawing.Size(1454, 502);
this.repONOFF.Size = new System.Drawing.Size(1442, 495);
this.repONOFF.Text = "Mototrbo ON / OFF";
this.repONOFF.Enter += new System.EventHandler(this.repONOFF_Enter);
//
@ -213,13 +227,24 @@
//
this.repHist.Caption = null;
this.repHist.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repHist.Location = new System.Drawing.Point(6, 28);
this.repHist.Location = new System.Drawing.Point(4, 32);
this.repHist.Name = "repHist";
this.repHist.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repHist.Size = new System.Drawing.Size(1015, 446);
this.repHist.Size = new System.Drawing.Size(1454, 502);
this.repHist.Text = "History";
this.repHist.Enter += new System.EventHandler(this.repHist_Enter);
//
// repBatchHist
//
this.repBatchHist.Caption = null;
this.repBatchHist.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repBatchHist.Location = new System.Drawing.Point(4, 32);
this.repBatchHist.Name = "repBatchHist";
this.repBatchHist.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repBatchHist.Size = new System.Drawing.Size(1454, 502);
this.repBatchHist.Text = "Batch History";
this.repBatchHist.Enter += new System.EventHandler(this.repBatchHist_Enter);
//
// repEndDay
//
this.repEndDay.Caption = null;
@ -286,25 +311,14 @@
this.repTelemEvn.Text = "Telemetry Event";
this.repTelemEvn.Enter += new System.EventHandler(this.repTelemEvn_Enter);
//
// repSMSLocation
//
this.repSMSLocation.Caption = null;
this.repSMSLocation.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repSMSLocation.Location = new System.Drawing.Point(4, 32);
this.repSMSLocation.Name = "repSMSLocation";
this.repSMSLocation.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repSMSLocation.Size = new System.Drawing.Size(1454, 502);
this.repSMSLocation.Text = "Text message location";
this.repSMSLocation.Enter += new System.EventHandler(this.repSMSLocation_Enter);
//
// repTicketing
//
this.repTicketing.Caption = null;
this.repTicketing.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.repTicketing.Location = new System.Drawing.Point(6, 29);
this.repTicketing.Location = new System.Drawing.Point(4, 32);
this.repTicketing.Name = "repTicketing";
this.repTicketing.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked;
this.repTicketing.Size = new System.Drawing.Size(1440, 493);
this.repTicketing.Size = new System.Drawing.Size(1454, 502);
this.repTicketing.Text = "Job Ticketing";
this.repTicketing.Enter += new System.EventHandler(this.repTicketing_Enter);
//
@ -328,6 +342,7 @@
private Telerik.WinControls.UI.Docking.DocumentContainer documentContainer1;
private Telerik.WinControls.UI.Docking.ToolWindow repHist;
private Telerik.WinControls.UI.Docking.ToolWindow repBatchHist;
private Telerik.WinControls.UI.Docking.DocumentTabStrip documentTabStrip1;
private Telerik.WinControls.UI.Docking.ToolWindow repONOFF;
private Telerik.WinControls.UI.Docking.ToolWindow repGeofenc;

View File

@ -25,6 +25,7 @@ namespace Safedispatch_4_0
repEmerg.Text = MainForm2.returnLNGString("emergAlarm");
repFleet.Text = MainForm2.returnLNGString("FleetReport");
repHist.Text = MainForm2.returnLNGString("tabHist");
repBatchHist.Text = MainForm2.returnLNGString("tabBatchHist");
switch (MainForm2.radioType)
{
@ -73,8 +74,6 @@ namespace Safedispatch_4_0
InitializeComponent();
setLanguage();
repHash.Clear();
if ((MainForm2.radioType == RADIOTYPE.MOTO) || (MainForm2.radioType == RADIOTYPE.HYT)
@ -84,10 +83,13 @@ namespace Safedispatch_4_0
repHash.Add(repTelem.Name, false);
repHash.Add(repTelemEvn.Name, false);
}
if (MainForm2.radioType != RADIOTYPE.SIMOCO && MainForm2.radioType != RADIOTYPE.EXCERA)
repHash.Add(repONOFF.Name, false);
if (MainForm2.radioType != RADIOTYPE.CONECTPLUS)
repHash.Add(repEmerg.Name, false);
if (MainForm2.SMSDecide)
repHash.Add(repSMSLocation.Name, false);
@ -95,6 +97,7 @@ namespace Safedispatch_4_0
repHash.Add(repFleet.Name, false);
repHash.Add(repGeofenc.Name, false);
repHash.Add(repHist.Name, false);
repHash.Add(repBatchHist.Name, false);
repHash.Add(repIdle.Name, false);
//repHash.Add(repONOFF.Name, false);
repHash.Add(repSpeed.Name, false);
@ -102,6 +105,7 @@ namespace Safedispatch_4_0
repHash.Add(repALL.Name, false);
documentTabStrip1.SelectedIndex = 0;
OnEnterValid = true;
//on ENter don' work here
CheckTabs(rep_type.SPEED, repSpeed);
@ -113,22 +117,10 @@ namespace Safedispatch_4_0
menuService.AllowDocumentContextMenu = false;
menuService.AllowToolContextMenu = false;
repALL.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repEmerg.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repEndDay.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repFleet.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repGeofenc.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repHist.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repIdle.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repONOFF.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repSpeed.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repStop.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repTelem.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repTelemEvn.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repSMSLocation.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repTicketing.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repLand.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
RemoveCloseButtons();
MainForm2.RestartMEM += 40000000;
try
{
switch (MainForm2.radioType)
@ -205,7 +197,10 @@ namespace Safedispatch_4_0
{
SM.Debug("Error remove reports constructor" + ex.ToString());
}
if (!MainForm2.SMSDecide) documentTabStrip1.Controls.Remove(repSMSLocation);
if (!MainForm2.SMSDecide)
documentTabStrip1.Controls.Remove(repSMSLocation);
if(MainForm2.radioType == RADIOTYPE.LINX)
@ -218,6 +213,26 @@ namespace Safedispatch_4_0
}
}
private void RemoveCloseButtons()
{
repALL.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repEmerg.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repEndDay.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repFleet.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repGeofenc.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repHist.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repBatchHist.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repIdle.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repONOFF.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repSpeed.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repStop.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repTelem.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repTelemEvn.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repSMSLocation.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repTicketing.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
repLand.DocumentButtons &= ~Telerik.WinControls.UI.Docking.DocumentStripButtons.Close;
}
private void menuService_ContextMenuDisplaying(object sender, ContextMenuDisplayingEventArgs e)
{
if (e.MenuType == ContextMenuType.DockWindow &&
@ -226,10 +241,10 @@ namespace Safedispatch_4_0
for (int i = 0; i < e.MenuItems.Count; i++)
{
RadMenuItemBase menuItem = e.MenuItems[i];
if (menuItem.Name == "CloseWindow" ||
menuItem.Name == "CloseAllButThis" ||
menuItem.Name == "CloseAll" ||
menuItem.Name == "Hidden" ||
if (menuItem.Name.Equals("CloseWindow") ||
menuItem.Name.Equals("CloseAllButThis") ||
menuItem.Name.Equals("CloseAll") ||
menuItem.Name.Equals("Hidden") ||
menuItem is RadMenuSeparatorItem)
{
menuItem.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
@ -243,35 +258,27 @@ namespace Safedispatch_4_0
if (OnEnterValid)
{
if (repHash[tool.Name] != null)
{
if (((Boolean)repHash[tool.Name]) == false)
{
repHash[tool.Name] = true;
AddReportWindow(type, tool);
// add geofences to the combobox
if (type == rep_type.GEOFENC)
OnFocusControl.Refresh_GeoName();
else if (type == rep_type.LAND)
OnFocusControl.Refresh_LandName();
}
else
{
OnFocusControl = (ReportsControl)tool.Controls[0];
// refresh geofecens from the combobox
if (type == rep_type.GEOFENC)
OnFocusControl.Refresh_GeoName();
else if (type == rep_type.LAND)
OnFocusControl.Refresh_LandName();
}
}
else
{
repHash.Add(tool.Name, true);
AddReportWindow(type, tool);
// add geofences to the combobox
if (type == rep_type.GEOFENC)
OnFocusControl.Refresh_GeoName();
else if (type == rep_type.LAND)
OnFocusControl.Refresh_LandName();
}
if (type == rep_type.GEOFENC)
OnFocusControl.Refresh_GeoName();
else if (type == rep_type.LAND)
OnFocusControl.Refresh_LandName();
}
}
@ -310,6 +317,11 @@ namespace Safedispatch_4_0
CheckTabs(rep_type.HIST, (ToolWindow)sender);
}
private void repBatchHist_Enter(object sender, EventArgs e)
{
CheckTabs(rep_type.BATCH_HIST, (ToolWindow)sender);
}
private void repIdle_Enter(object sender, EventArgs e)
{
CheckTabs(rep_type.IDLE, (ToolWindow)sender);
@ -391,5 +403,7 @@ namespace Safedispatch_4_0
e.DockWindow.TabStripItem.BackColor = MainForm2.TabSelectedColor;
}
#endregion
}
}

View File

@ -31,6 +31,9 @@
this.components = new System.ComponentModel.Container();
this.radDock1 = new Telerik.WinControls.UI.Docking.RadDock();
this.documentWindow1 = new Telerik.WinControls.UI.Docking.DocumentWindow();
this.btPrintReportInCsv = new Telerik.WinControls.UI.RadButton();
this.btPrintReport = new Telerik.WinControls.UI.RadButton();
this.radTreeUnits = new Telerik.WinControls.UI.RadTreeView();
this.pbReportDaily = new System.Windows.Forms.PictureBox();
this.ckReportDaily = new Telerik.WinControls.UI.RadCheckBox();
this.pbStatus = new System.Windows.Forms.PictureBox();
@ -48,7 +51,6 @@
this.rProgressBar = new Telerik.WinControls.UI.RadProgressBar();
this.rlComputing = new Telerik.WinControls.UI.RadLabel();
this.ckComputeAddress = new Telerik.WinControls.UI.RadCheckBox();
this.btPrintReport = new Telerik.WinControls.UI.RadButton();
this.rdtUntil = new Telerik.WinControls.UI.RadDateTimePicker();
this.ckDataFilter = new Telerik.WinControls.UI.RadCheckBox();
this.ckSelectALL = new Telerik.WinControls.UI.RadCheckBox();
@ -99,9 +101,13 @@
this.GisAddressWorker = new System.ComponentModel.BackgroundWorker();
this.toolTipHelp = new System.Windows.Forms.ToolTip(this.components);
this.office2013LightTheme1 = new Telerik.WinControls.Themes.Office2013LightTheme();
this.ckKeepValidPositions = new Telerik.WinControls.UI.RadCheckBox();
((System.ComponentModel.ISupportInitialize)(this.radDock1)).BeginInit();
this.radDock1.SuspendLayout();
this.documentWindow1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.btPrintReportInCsv)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.btPrintReport)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radTreeUnits)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbReportDaily)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ckReportDaily)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbStatus)).BeginInit();
@ -121,7 +127,6 @@
this.rProgressBar.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.rlComputing)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ckComputeAddress)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.btPrintReport)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rdtUntil)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ckDataFilter)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ckSelectALL)).BeginInit();
@ -173,6 +178,7 @@
((System.ComponentModel.ISupportInitialize)(this.panelNoReport)).BeginInit();
this.panelNoReport.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbReportType)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ckKeepValidPositions)).BeginInit();
this.SuspendLayout();
//
// radDock1
@ -207,13 +213,16 @@
// documentWindow1
//
this.documentWindow1.BackColor = System.Drawing.Color.WhiteSmoke;
this.documentWindow1.Controls.Add(this.ckKeepValidPositions);
this.documentWindow1.Controls.Add(this.btPrintReportInCsv);
this.documentWindow1.Controls.Add(this.btPrintReport);
this.documentWindow1.Controls.Add(this.radTreeUnits);
this.documentWindow1.Controls.Add(this.pbReportDaily);
this.documentWindow1.Controls.Add(this.ckReportDaily);
this.documentWindow1.Controls.Add(this.pbStatus);
this.documentWindow1.Controls.Add(this.rgbReport);
this.documentWindow1.Controls.Add(this.rProgressBar);
this.documentWindow1.Controls.Add(this.ckComputeAddress);
this.documentWindow1.Controls.Add(this.btPrintReport);
this.documentWindow1.Controls.Add(this.rdtUntil);
this.documentWindow1.Controls.Add(this.ckDataFilter);
this.documentWindow1.Controls.Add(this.ckSelectALL);
@ -239,6 +248,60 @@
this.documentWindow1.Size = new System.Drawing.Size(287, 725);
this.documentWindow1.Text = "documentWindow1";
//
// btPrintReportInCsv
//
this.btPrintReportInCsv.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.btPrintReportInCsv.CausesValidation = false;
this.btPrintReportInCsv.Cursor = System.Windows.Forms.Cursors.Hand;
this.btPrintReportInCsv.Font = new System.Drawing.Font("Segoe UI", 10F);
this.btPrintReportInCsv.Location = new System.Drawing.Point(14, 671);
this.btPrintReportInCsv.Name = "btPrintReportInCsv";
this.btPrintReportInCsv.Size = new System.Drawing.Size(257, 34);
this.btPrintReportInCsv.TabIndex = 92;
this.btPrintReportInCsv.Text = "Generate Report in CSV";
this.btPrintReportInCsv.ThemeName = "TelerikMetroBlue";
this.btPrintReportInCsv.Click += new System.EventHandler(this.btPrintReportInCsv_Click);
((Telerik.WinControls.UI.RadButtonElement)(this.btPrintReportInCsv.GetChildAt(0))).Text = "Generate Report in CSV";
((Telerik.WinControls.Primitives.FillPrimitive)(this.btPrintReportInCsv.GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReportInCsv.GetChildAt(0).GetChildAt(1).GetChildAt(1))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReportInCsv.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReportInCsv.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
((Telerik.WinControls.Primitives.FocusPrimitive)(this.btPrintReportInCsv.GetChildAt(0).GetChildAt(3))).BackColor = System.Drawing.Color.DeepSkyBlue;
//
// btPrintReport
//
this.btPrintReport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.btPrintReport.CausesValidation = false;
this.btPrintReport.Cursor = System.Windows.Forms.Cursors.Hand;
this.btPrintReport.Font = new System.Drawing.Font("Segoe UI", 10F);
this.btPrintReport.Location = new System.Drawing.Point(15, 631);
this.btPrintReport.Name = "btPrintReport";
this.btPrintReport.Size = new System.Drawing.Size(257, 34);
this.btPrintReport.TabIndex = 91;
this.btPrintReport.Text = "Generate Report";
this.btPrintReport.ThemeName = "TelerikMetroBlue";
this.btPrintReport.Click += new System.EventHandler(this.btPrintReport_Click);
((Telerik.WinControls.UI.RadButtonElement)(this.btPrintReport.GetChildAt(0))).Text = "Generate Report";
((Telerik.WinControls.Primitives.FillPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(1).GetChildAt(1))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
((Telerik.WinControls.Primitives.FocusPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(3))).BackColor = System.Drawing.Color.DeepSkyBlue;
//
// radTreeUnits
//
this.radTreeUnits.CheckBoxes = true;
this.radTreeUnits.Location = new System.Drawing.Point(16, 483);
this.radTreeUnits.Name = "radTreeUnits";
this.radTreeUnits.Size = new System.Drawing.Size(257, 142);
this.radTreeUnits.SortOrder = System.Windows.Forms.SortOrder.Ascending;
this.radTreeUnits.SpacingBetweenNodes = -1;
this.radTreeUnits.TabIndex = 130;
this.radTreeUnits.Text = "radTreeView1";
this.radTreeUnits.ThemeName = "TelerikMetroBlue";
this.radTreeUnits.TriStateMode = true;
this.radTreeUnits.Visible = false;
//
// pbReportDaily
//
this.pbReportDaily.BackColor = System.Drawing.Color.Transparent;
@ -529,28 +592,6 @@
this.ckComputeAddress.Text = "Compute address";
this.ckComputeAddress.ThemeName = "TelerikMetroBlue";
//
// btPrintReport
//
this.btPrintReport.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.btPrintReport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
this.btPrintReport.CausesValidation = false;
this.btPrintReport.Cursor = System.Windows.Forms.Cursors.Hand;
this.btPrintReport.Font = new System.Drawing.Font("Segoe UI", 10F);
this.btPrintReport.Location = new System.Drawing.Point(16, 480);
this.btPrintReport.Name = "btPrintReport";
this.btPrintReport.Size = new System.Drawing.Size(257, 34);
this.btPrintReport.TabIndex = 91;
this.btPrintReport.Text = "Generate Report";
this.btPrintReport.ThemeName = "TelerikMetroBlue";
this.btPrintReport.Click += new System.EventHandler(this.btPrintReport_Click);
((Telerik.WinControls.UI.RadButtonElement)(this.btPrintReport.GetChildAt(0))).Text = "Generate Report";
((Telerik.WinControls.Primitives.FillPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(0))).BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(1).GetChildAt(1))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold);
((Telerik.WinControls.Primitives.TextPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(1).GetChildAt(1))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
((Telerik.WinControls.Primitives.FocusPrimitive)(this.btPrintReport.GetChildAt(0).GetChildAt(3))).BackColor = System.Drawing.Color.DeepSkyBlue;
//
// rdtUntil
//
this.rdtUntil.CustomFormat = "MM/dd/yyyy, HH:mm";
@ -1214,6 +1255,17 @@
this.GisAddressWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.GisAddressWorker_DoWork);
this.GisAddressWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.GisAddressWorker_RunWorkerCompleted);
//
// ckKeepValidPositions
//
this.ckKeepValidPositions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
this.ckKeepValidPositions.Location = new System.Drawing.Point(17, 356);
this.ckKeepValidPositions.Name = "ckKeepValidPositions";
this.ckKeepValidPositions.Size = new System.Drawing.Size(144, 18);
this.ckKeepValidPositions.TabIndex = 131;
this.ckKeepValidPositions.Text = "Keep only valid positions";
this.ckKeepValidPositions.ThemeName = "TelerikMetroBlue";
this.ckKeepValidPositions.Visible = false;
//
// ReportsControl
//
this.Controls.Add(this.radDock1);
@ -1224,6 +1276,9 @@
this.radDock1.ResumeLayout(false);
this.documentWindow1.ResumeLayout(false);
this.documentWindow1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.btPrintReportInCsv)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.btPrintReport)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.radTreeUnits)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbReportDaily)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ckReportDaily)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbStatus)).EndInit();
@ -1244,7 +1299,6 @@
this.rProgressBar.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.rlComputing)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ckComputeAddress)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.btPrintReport)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rdtUntil)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ckDataFilter)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ckSelectALL)).EndInit();
@ -1301,6 +1355,7 @@
((System.ComponentModel.ISupportInitialize)(this.panelNoReport)).EndInit();
this.panelNoReport.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pbReportType)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.ckKeepValidPositions)).EndInit();
this.ResumeLayout(false);
}
@ -1377,5 +1432,8 @@
private Telerik.WinControls.UI.RadButton btSaveEmail;
private Telerik.WinControls.Themes.Office2013LightTheme office2013LightTheme1;
private Telerik.WinControls.UI.RadLabel rlIdle;
private Telerik.WinControls.UI.RadTreeView radTreeUnits;
public Telerik.WinControls.UI.RadButton btPrintReportInCsv;
private Telerik.WinControls.UI.RadCheckBox ckKeepValidPositions;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -726,20 +726,28 @@ namespace SubscriberAndUserManager
string data = System.Text.Encoding.ASCII.GetString(rawData, 0, actualLen);
//SM.Debug("RX: " + data.Trim());
string[] tempArr = data.Split('#');
string[] tempArr = data.Split("#".ToCharArray());
if (tempArr.Length == 0)
{
SM.Debug("incorect message=" + data);
return false;
}
int messLen = Convert.ToInt32(tempArr[1]);
int messLen = 0;
if( tempArr[1] != "")
messLen = Convert.ToInt32(tempArr[1]);
if (actualLen != messLen)
{
Console.WriteLine("message length({0}) != actual length({1})", messLen, actualLen);
return false;
}
int opCode = Convert.ToInt32(tempArr[3]);
int opCode = 0;
if(tempArr[3] != "")
opCode = Convert.ToInt32(tempArr[3]);
switch (opCode)
{

View File

@ -279,6 +279,7 @@ namespace SubscriberAndUserManager
this.pictureBox1.Location = new System.Drawing.Point(257, 143);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 48;
this.pictureBox1.TabStop = false;
//

View File

@ -283,6 +283,7 @@ namespace SubscriberAndUserManager
{
try { gatewayRegs = regManager.getAllGateways(); }
catch (Exception ex) { Console.WriteLine(ex.ToString()); CustomMessageBox.Show(CustomMessageBoxType.exclamation, MainForm.returnLNGString("dberr"), MainForm.returnLNGString("err")); return; }
remainingGateways = totalGateways - regManager.gatewaysCount();
//gvGateways.DataSource = gatewayRegs;
@ -310,6 +311,7 @@ namespace SubscriberAndUserManager
int usedMapUS = 0;
int usedMapEu = 0;
int usedArcgis = 0;
for (int i = 0; i < safeDispatchRegs.Count; i++)
{
if (safeDispatchRegs[i].gps)
@ -368,16 +370,23 @@ namespace SubscriberAndUserManager
remainingOpenStreetMap = totalOpenStreetMap - usedMapEu;
remainingUS = totalUS - usedMapUS;
remainingGoogle = totalGoogle - usedGoogle;
gvSafeDispatches.DataSource = safeDispatchRegs;
#region broadcast SD for dispatcher IP changed
string ipList = "";
foreach (var item in safeDispatchRegs)
ipList += item.ip + "/";
string test1 = "#475#" + ipList;
String cmdok1 = "#" + "0.0" + test1; Int32 tmp1 = cmdok1.Length + 1; tmp1 += tmp1.ToString().Length; cmdok1 = "#" + tmp1.ToString() + cmdok1;
MainForm.BroadcastRegistrationSD(cmdok1);
//broadcast SD for dispatcher IP changed
string ipList = string.Join("/", safeDispatchRegs.Select(x => x.ip));
string cmd = $"#0.0#475#{ipList}";
// calc length and insert it at the begining
Int32 length = cmd.Length + 1;
length += length.ToString().Length;
cmd = $"#{length}{cmd}";
MainForm.BroadcastRegistrationSD(cmd);
#endregion
//gvSafeDispatches.Columns[5].HeaderText = "Geo-Fences";