upubfun.pas

来自「a voice guide client ,it is the second p」· PAS 代码 · 共 1,965 行 · 第 1/5 页

PAS
1,965
字号
//  gShowBrake:Boolean;
//  //是否显示空调状态
//  gShowAC:Boolean;
//  //是否显示车门开关
//  gShowDoor:Boolean;
//  //是否显示设/撤防
//  gShowAlarm:Boolean;
//  //是否显示ACC开关状态
//  gVehicleSpeedState: Boolean;
//  //是否显示越界报警
//  gShowOutAlarm:Boolean;

  gSendStopCall : Boolean;//是发送停止命令还是只是不显示.
  gTitleNumber  : Integer;
  gIsShowStopSect : Boolean; //是否显示停车标志
  gMinStopMinute  : Integer; //最小停车时间
  ///////////////////////////////////////////
  //是否允许编辑车辆信息
  gCanEditCarInfo :Boolean;
  gCanEditAdvance :Boolean;
  gPetroCarInfo : Boolean;
  //end;
  ////////////////////////////////////

  //地图路径
  gMapPath,
  gCustsymbPath : string;

  //车辆信息列表,组信息列表,群信息列表,所属用户列表

  gCarInfoList: THashedStringList;
  gVehicleGroupList: THashedStringList;
  gTeamInfoList, gGroupInfoList, gUsrInfoList: TStringList;
  //路桥费信息列表
  gPriceInfoList: TStringList;
  //服务器登陆用户列表
  gOtherClientList: TStringList;
  //航行任务列表,航线列表
  gTaskInfoList, gWalkLineList: TStringList;
  //登陆数据库用户ID, 用户类型(0:Adm, 1:Usr, 2:Guest),登陆ID(注销的时候需要)
  gCurUsrId, gCurUsrType, gCurLogId: Integer;
  //当前用户信息
  gCurUsrInfo: TUsrInfo;
  //当前系统界面
  gLookFeel: TLookFeel;
  gTargetHintShow: TTargetHintShow;
  //地理信息显示;
  gShowGISClient : Boolean;
  //车辆信息显示;
  gShowCarInfo : string;
  // 活动车辆信息显示;
  gShowCarInfoActive : string;
//  gShowCarInfo: set of TCarInfoType;
  gShowTrackType: TShowTrackType;
  gShowTargetLabel: Integer; //ruihanxl
//  gShowTargetLabel: TCarInfoType;
  gShowCommPropertyEnable: Boolean;
  gShowCommProperty: string;
  gShowOilDebug: Boolean;

  //默认呼叫参数、回放间隔
  gDefCallInterval, gDefCallTimes: Integer;
  gDefReplayInterval: Integer;
  //报警弹出
  gPopOnEm, gPopOnMsg: Boolean;
  //自动呼叫
  gSysAutoCall: Boolean;
  //屏蔽数字13
  gSysShieldNumber: Boolean;
  //自动解除报警
  gSysAutoCancelAlert: Boolean;
  //超速度报警
  gEmSpeedOverEnable: Boolean;
  //低速度报警
  gEmSpeedSlowEnable: Boolean;
  gEmSpeedSlow: Integer;
  //迟到报警
  gEmAreaEnable,
  gEmLaterEnable: Boolean;
  //新建窗口模式
  gNewWinDockType: Integer;
  //目标轨迹点数目 -luhao 2004-5-27
  gTrackPtCount:Integer;
  //跟踪新数据-luhao 2004-5-28
  gTrackNewData:Boolean;
  //报警声音开关
  gPlayAlarmSound:Boolean;
  //中山伟明速度状态
  gZsSpeedState: Boolean;
  //出租业务
  gTaxiOpened: Boolean;
  //通大版本标志
  gTongDaClient: Integer;
  // 终配系统是否采用XP风格
  gZPXPStyle: Integer;

  // 是否显示道路名称
  gIsShowRoadName: Boolean;
  // 系统版本名称
  gAppVersionName: string;

  // 温度修正值
  gTemperatureFix: Integer;
  ///////////////////////////////////
  //add by wulianghong
  gHistoryCnt:Integer;
  gHistoryCurrentCnt:Integer;
  ///////////////////////////////////

  // 可编辑图层名称
  gMapCusLayerName: String;

  //是否抗漂移
  gAntiZero:Boolean;

  //是否显示亿程所要求的加六个字段的信息
  gShow6FieldInfo:Boolean;

  //团队ID号
  gTeamID:Integer;

  //是否显示信息
  gShowMessages:Boolean;

  //是否显示调试信息
  gShowDebugInfo:Boolean;

  //是否显示数据库调试信息
  gShowDebugDB:Boolean;


  //是否显示电子里程管理
  gShowDistanceCalc:Boolean;

  //是否显示MSC管理
  gShowMSCManage:Boolean;

  //是否显示油位管理
  gShowOilLevel:Boolean;

  //是否显示轨迹分析
  gShowGPSANA  :Boolean;

  //是否显示"发动机关闭"
  gShowMotorClose:Boolean;

  //是否生成超低速报警
  gLowSpeedAlert  : Boolean;

//  // 是否生成超高速报警
//  gOverSpeedAlert : Boolean;
//  //是否显示里程信息
//  gShowMileageMessage:Boolean;
//  gEmGprsEnable:Boolean;

  // 超速报警速度
  gOverSpeedMax : Integer;
  gOverSpeedNormal:Boolean;

  //轨迹回放时是否显示里程统计信息
//  gReplayDistanceCalc :Boolean;
  //左右转向灯是否显示
  gShowLeftLight:Boolean;
  gShowRightLight:Boolean;
  //是否显示来自定位数据劫警.
  gShowDacoity:Boolean;
  gSixHoursLimit:Boolean;
  gShowDacoityLog:Boolean;

  gShowACC:Boolean;
  //是否在报警窗口显示命令发送
  gShowCmdSend:Boolean;


  //左转向灯是否替换为吊机工作与吊机不工作
  gReplaceLeftLight:Boolean;

  // 修正里程的比率
  gDeltaDistanceRatio: Double;
  // 修正里程的车牌列表
  gDeltaDistanceNOs: string;

  //与转发车牌相关
  gTransCarCodeUDPIP:string;
  gTransCarCodeUDPPort:integer;
  gTransCarCodeEnable:Boolean;


  // 轨迹数据是否产生报警
  gTrackGenOper: Boolean;

  // 轨迹回放配置

  // 统计列表
//  gShowQryResultRegNO       : Boolean;
  gShowQryResultVehicleName : Boolean;
  gShowQryResultTimeSect    : Boolean;
  gShowQryResultRecordCount : Boolean;
  gShowQryResultMileage     : Boolean;
  gShowQryResultAverageSpeed: Boolean;
  gShowQryResultOilCost     : Boolean;
  gShowQryResultOilFee      : Boolean;
  gShowQryResultInvalidRate : Boolean;
  gShowQryResultValidRate   : Boolean;
  gShowQryResultStirCan     : Boolean;
  // 取路名逻辑
  gShowQryGetRoadName       : Boolean;

{读取配置文件}
procedure ReadIni;
procedure WriteIni;
function GetVersionFromFile( aFileName : string ): string;
{初始化,群、组、车辆、“服务器登陆用户”列表}
procedure InitInfoList;
procedure InitCarInfoList;
procedure InitTeamInfoList;
procedure InitGroupInfoList;
procedure InitGpsClientList;
procedure InitPriceInfoList;
{车辆信息列的名称、宽度;终端类型名称}
//function GetCarInfoTypeMsg(InfoType: TCarInfoType): string; goshgen
//function GetCarInfoTypeWide(InfoType: TCarInfoType): Integer; goshgen
function GetTerminalTypName(TerminalStyleId: Integer): string;

function GetCarInfo(ACarId: Integer): TCarInfo;
function GetAllCarIds: string;
//function GetCarLabel(CarInfo: TCarInfo; InfoType: TCarInfoType): string;
function GetCurCarIds: string;

{地理:距离}
function GetDistance(Lon1, Lat1, Lon2, Lat2: Double):Double;
procedure GetDeltaDegree(Long, Lat: Double; Distance: Integer; var DeltaLong, DeltaLat: Double);

{报警声音}
procedure EmSndOpen(ASndFile: string);
procedure EmSndClose;

{是否是IP地址}
function IsIP(AIpAddress: string): Boolean;
function getDBName: string;

{获取子字符串}
function GetSubStr(const AString,ADivFlag:String;AIndex:Integer):String;

implementation

uses
  Forms, Math, mmsystem, StrUtils, uFrmMain,
  uGPSClientCarInfoListDisplay, uGPSClientProcessTrack, uGPSClientProcessUtils,
  uGPSClientProcessOperation;

function FormatDigit(ADigite, ALen: Integer): string;
begin
  Result:=  IntToStr(ADigite);
  Result:= StringOfChar('0', ALen- Length(Result))+ Result;
end;

procedure ReadIni;
var
  IniFile: TIniFile;
  sAppPath: string;
  sIniFileName: string;
begin
  sIniFileName:= ChangeFileExt(Application.ExeName, '.ini');
  sAppPath:= ExtractFilePath(Application.ExeName);
  IniFile:= TIniFile.Create(sIniFileName);
  try
    gMtscHost := IniFile.ReadString('Network', 'MtscHost', '127.0.0.1');
    gDataHost := IniFile.ReadString('Network', 'DataHost', '127.0.0.1');
    gDataHostList := IniFile.ReadString('Network', 'DataHostList', '127.0.0.1');
    gIsUseDataHostList := IniFile.ReadBool('Network', 'IsUseDataHostList', False);
    gIsCacheLogon := IniFile.ReadBool('Network', 'IsCacheLogon', False);
    gMtscPort := IniFile.ReadInteger('Network', 'MtscPort', 2002);
    gDataPort := IniFile.ReadInteger('Network', 'DataPort', 211);
    gReplayPort := IniFile.ReadInteger('Network', 'ReplayPort', 211);
    gReplayDB   := IniFile.ReadString('Network', 'ReplayDB', '');
    gZPDataHost := IniFile.ReadString('Network', 'ZPDataHost', '127.0.0.1');
    gZPDataPort := IniFile.ReadInteger('Network', 'ZPDataPort', 211);
    gETAGDispatchHost := IniFile.ReadString('Network', 'ETAGDispatchHost', '127.0.0.1');
    gANADataHost := IniFile.ReadString('Network', 'ANADataHost', '127.0.0.1');
    gDistanceCalcHost := IniFile.ReadString('Network', 'DistanceCalcHost', '127.0.0.1');
    gANADataPort := IniFile.ReadInteger('Network', 'ANADataPort', 211);
    gGpsOnLine:= IniFile.ReadBool('Network', 'GpsOnLine', True);
    gLogonNOOP:= IniFile.ReadBool('Network', 'LogonNOOP', False);
    gNOOPInterval := IniFile.ReadInteger('Network', 'NOOPInterval', 60000);
    gAuthServerHost := IniFile.ReadString('Network', 'AuthServerHost', '127.0.0.1');
    gAuthServerPort := IniFile.ReadInteger('Network', 'AuthServerPort', 211);
    gUseNewDBServer := IniFile.ReadBool('Network', 'UseNewDBServer', False);
    gUseAuthServer := IniFile.ReadBool('Network', 'UseAuthServer', False);
    GIsBaseDBAuth  := IniFile.ReadBool('Network', 'IsBaseDBAuth', False);
    GLookOil       := IniFile.ReadBool('Network', 'IsLookOil', False);
    gUpgradeURL    := IniFile.ReadString('Network', 'UpgradeURL', '');

    gLogName  := IniFile.ReadString('System', 'LogName', '');
    gPassWd   := IniFile.ReadString('System', 'Password', '');
    gHistoryLogNames:= IniFile.ReadString('System', 'LogName', '账号');
    gNewWinDockType:= IniFile.ReadInteger('System', 'NewWinDockType', 0);

    //System
    gTitle    := IniFile.ReadString('System', 'Title', 'GPS实时监控系统');
    gLookFeel := TLookFeel(IniFile.ReadInteger('System', 'LookAndFeel', 0));
    gTargetHintShow:= TTargetHintShow(IniFile.ReadInteger('System', 'TargetHintShow', 0));
    gMapPath  := IniFile.ReadString('System', 'MapPath', '');
    gCustsymbPath:= IniFile.ReadString('System', 'CustsymbPath', '');
    if not DirectoryExists(gMapPath)then gMapPath:= sAppPath+ 'Maps\';
    if not DirectoryExists(gCustsymbPath) then gCustsymbPath:= sAppPath+ 'CUSTSYMB\';

    if gMapPath[ Length(gMapPath) ] <> '\' then gMapPath := gMapPath +'\';
    if gCustsymbPath[ Length(gCustsymbPath) ] <> '\' then gCustsymbPath := gCustsymbPath +'\';

    gDebug:= IniFile.ReadBool('System', 'Debug', False);
    gTaxiOpened:= IniFile.ReadBool('System', 'TAXI', False);
    gTongDaClient := IniFile.ReadInteger('System', 'TongDaClient', 0);

    gCanEditCarInfo := IniFile.ReadBool('System','CanEdit',False);
    gCanEditAdvance := IniFile.ReadBool('System','CanEditADV',False);

    gSendStopCall   := IniFile.ReadBool('System','SendStopCall',False);

    //GpsView
    gShowGISClient      := IniFile.ReadBool('GpsView', 'ShowGISClient', False);
    gShowCarInfo        := IniFile.ReadString('GpsView', 'ShowCarInfoType', '');
    gShowCarInfoActive  := IniFile.ReadString('GpsView', 'ShowCarInfoTypeActive', '');
    gIsShowRoadName     := IniFile.ReadBool('GpsView','IsShowRoadName',False);
    gAppVersionName     := IniFile.ReadString('GpsView', 'VersionName', '');

    TGPSClientCarInfoListDisplay.ApplyColumnSetting(
      gShowCarInfo, gShowCarInfoActive, GPSClientCarInfoColumnList);

    gShowTrackType  := TShowTrackType(IniFile.ReadInteger('GpsView', 'ShowTrackType', 0));
//    gShowTargetLabel:= TCarInfoType(IniFile.ReadInteger('GpsView', 'TargetLabel', 0));
    gShowTargetLabel:= IniFile.ReadInteger('GpsView', 'TargetLabel', 0);
    gShowCommPropertyEnable:= IniFile.ReadBool('GpsView', 'ShowCommPropertyEnable', False);
    gShowCommProperty:= IniFile.ReadString('GpsView', 'ShowCommProperty', '自定义属性');
    gShowOilDebug   := IniFile.ReadBool('GpsView', 'ShowOilDebug', False);
    gTrackPtCount := IniFile.ReadInteger('GpsView', 'ShowTrackPtCount', 200);
    gTrackNewData := IniFile.ReadBool('GpsView', 'AutoTrackNewData',False);
    gAllGpsValid  := IniFile.ReadBool('GpsView', 'AllGPSValid',False);
    gVersionFlag  := IniFile.ReadInteger('GpsView', 'VersionFlag', 0);
    gFullExtentViewAll  := IniFile.ReadBool('GpsView', 'FullExtentViewAll', False);
    gFullExtentSearch   := IniFile.ReadBool('GpsView', 'FullExtentSearch', False);
    gIgnorCompensate := IniFile.ReadBool('GpsView', 'IgnorCompensat', False);

    gDoorAlert    := IniFIle.ReadBool('GpsView','DoorAlert',False);

    //是否显示车辆的相关状态,默认是显示
    // gBatteryAlert := IniFile.ReadBool('GpsView','BatteryAlert',False);
    // gShowMotorClose  := iniFile.ReadBool('GpsView','ShowMotorClose',True);
    // gShowLeftLight  := iniFile.ReadBool('GpsView','ShowLeftLight',True);
    // gShowRightLight := iniFile.ReadBool('GpsView','ShowRightLight',True);
    // gShowAC := iniFile.ReadBool('GpsView','ShowAC',True);
    // gShowDoor := iniFile.ReadBool('GpsView','ShowDoor',True);
    // gShowBrake := iniFile.ReadBool('GpsView','ShowBrake',True);
    // gShowAlarm := iniFile.ReadBool('GpsView','ShowAlarm',True);
    // gShowACC := iniFile.ReadBool('GpsView','ShowACC',True);
    // gVehicleSpeedState := IniFile.ReadBool('GpsView','VehicleSpeedState', False);
    // gShowOutAlarm := IniFile.ReadBool('GpsView','ShowOutAlarm',True);


    TGPSClientProcessUtils.GPSDescFilterConfigRead(IniFile, 'GpsView');

    gShowMessages := IniFile.ReadBool('GpsView','ShowMessages',True);
    gShowDebugInfo := IniFile.ReadBool('GpsView','ShowDebugInfo',False);
    gShowDebugDB := IniFile.ReadBool('GpsView','ShowDebugDB',False);

    gShowDistanceCalc := iniFile.ReadBool('GpsView','ShowDistanceCalc',False);
    gShowMSCManage := iniFile.ReadBool('GpsView','ShowMSCManage',False);
    gShowOilLevel := iniFile.ReadBool('GpsView','ShowOilLevel',False);
    gShowGPSANA   := IniFile.ReadBool('GpsView', 'ShowGPSANA', False);


    gLowSpeedAlert := iniFile.ReadBool('GpsView','LowSpeedAlert',True);

//    gOverSpeedAlert := iniFile.ReadBool('GpsView','OverSpeedAlert',True);
//    gShowMileageMessage := iniFile.ReadBool('GpsView','ShowMileageMessage',True);
//    gEmGprsEnable := IniFile.ReadBool('EmGprs','Enable',True);
    TGPSClientProcessOperation.OperationFilterConfigRead(IniFile, 'GpsView');
    gOverSpeedNormal := IniFile.ReadBool('GpsView','OverSpeedNormal', True);



    gTitleNumber    := IniFile.ReadInteger('GpsView','Title',0);
    gShowQryGetRoadName := IniFile.ReadBool('GpsView','ShowQryGetRoadName',False);
    gIsShowStopSect := IniFile.ReadBool('GpsView','IsShowStopSect',False);
    gMinStopMinute  := IniFile.ReadInteger('GpsView','MinStopMinute',3);

    //gPetroCarInfo := IniFile.ReadBool('GpsView', 'PetroCarInfo',False);
    gZPXPStyle      := IniFile.ReadInteger('GpsView', 'ZPStyle', 0);
    gTemperatureFix := IniFile.ReadInteger('GpsView', 'TPFix', 0);

//    gReplayDistanceCalc := IniFile.ReadBool('GpsView', 'ReplayDistanceCalc',False);

    gShowDacoity := iniFile.ReadBool('GpsView','ShowDacoity',True);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?