停车场系统源程序之初始化程序

来源:誉澄智能 2012/7/10 14:24:04      点击:

 TmrInit.Enabled := false;
    with qryComm do
    begin

        Close;
        SQL.Clear;
        SQL.Add('SELECT * FROM JY_Opreation_thing');
        Open;
        while not Eof do
        begin
            cmbUserName.Items.Add(trim(FieldByName('操作员姓名').AsString));
            Next;
        end;
    end;
    ClearData;
    cmbUserName.ItemIndex := RIniInt('MONITOR','LastLogon', -1);
    RefreshInPrk;
    comm1.CommName :='COM'+IntToStr(RiniInt('MONITOR','Ledcom1',0)+1);
    comm2.CommName :='COM'+IntToStr(RiniInt('MONITOR','Ledcom2',0)+1);
    comm3.CommName :='COM'+IntToStr(RiniInt('MONITOR','Ledcom3',0)+1);
  try
  comm1.StartComm;
  except
      ShowMessage('打开LED1串口错误,请检查是否有其它程序占用端口,或者进入后更改端口并重起!');
  end;

  try
  comm2.StartComm;
  except
      ShowMessage('打开LED2串口错误,请检查是否有其它程序占用端口,或者进入后更改端口并重起!');
  end;

   try
  comm3.StartComm;
  except
      ShowMessage('打开LED3串口错误,请检查是否有其它程序占用端口,或者进入后更改端口并重起!');
  end;
    EditPsw.SetFocus;