Ejemplo n.º 1
0
//---------------------------------------------------------------------------
void __fastcall TLogListDlg::KFindBottomClick(TObject *Sender)
{
	if( m_FindCall.IsEmpty() || (Sender == KFindBottom) ){
		AnsiString as = m_FindCall;
		if( InputMB(NULL, sys.m_MsgEng ? "Callsign":"検索するコールサイン", as) == FALSE ) return;
		jstrupr(as.c_str());
		m_FindCall = as;
	}
	int n = Log.Find(m_FindCall.c_str(), Grid->Row - 2, 1);
	if( n >= 0 ){
		Grid->Row = n + 1;
	}
	else {
		WarningMB(sys.m_MsgEng ? "'%s' was not found" : "'%s'は見つかりませんでした.", m_FindCall.c_str());
	}
}
Ejemplo n.º 2
0
int	ctc(int da,char *s,int skey)
{
	int	ct,co,dd=0,i,a;

	if( da>127 ){da=60;if( da>255 ){dd=1;}}
	if( s[0]==0 ){return(-1);}
	jstrupr(s);ct=0;
	i=0;while(s[i]!=0){
		a=s[i++];
		if( a=='H' ){ct=0;break;}
		if( a=='$' ){strcpy(s,&s[1]);ct=0;break;}

		if( a=='C' ){ct=1;}
		if( a=='D' ){ct=3;}
		if( a=='E' ){ct=5;}
		if( a=='F' ){ct=6;}
		if( a=='G' ){ct=8;}
		if( a=='A' ){ct=10;}
		if( a=='B' ){ct=12;}

		if( ct!=0 && s[i]=='B'){i++;ct--;skey=0;}
		if( a=='N' || a=='=' || a=='#' || a=='+' || a=='-' ){skey=0;}
	}

	if( da<0 ){if( ct>0 ){return(1);}else{return(0);}}
	if( ct==0 ){
		da=str_val(s);
	}else{
		ct=ct/*+key_shi[skey&15][ct-1]*/;

		co=(da/12)-1;
		i=0;while(s[i]!=0){
			a=s[i++];
			if( a=='#' || a=='+' ){ct++;}
			if( a=='-' ){ct--;}
			if( a>='0' && a<='9' ){co=a-'0';}
			if( a=='.' ){co=-1;}
			if( a=='<' && dd==0 ){co++;}
			if( a=='>' && dd==0 ){co--;}
		}
		da=((co+1)*12+ct-1);
	}
	if(da<0||da>127){da=-1;}
	return(da);
}
Ejemplo n.º 3
0
int	str_val(char *s)
{
	int	v=0;
	unsigned char	a;

	while(*s==' '){s++;}

	jstrupr(s);
	if(str_last(s)!='H' && s[0]!='$' ){return atoi(s);}

	while(*s!=0){
		a=*s++;
		if(a==' '||a==',' || a=='='){break;}
		if(a>='0' && a<='9'){v=v<<4;v=v+(a-'0');}
		if(a>='A' && a<='F'){v=v<<4;v=v+(a-'A')+10;}
	}

	return v;
}
Ejemplo n.º 4
0
int	strch(int och,char *tmp0)
{
	int	ex;

	jstrupr(tmp0);

	if(tmp0[0]=='A'||tmp0[0]=='B'){
		ex=str_val(&tmp0[1]);
		if(ex<1 || ex>16){ex=1;}

		if(tmp0[1]==0 && och>0){ex=((och-1)&15)+1;}

		ex+=(tmp0[0]-'A')*16;
	}else{
		ex=str_val(tmp0);
		if(ex<0 || ex>32){ex=0;}
		if(och>16 && ex<17){ex+=16;}
	}

	return(ex);
}
Ejemplo n.º 5
0
void __fastcall TRxViewDlg::PBoxMouseDown(TObject *Sender,
      TMouseButton Button, TShiftState Shift, int X, int Y)
{
	BOOL f = m_Dump.ClearAllSelect(FALSE);
	int r = m_Dump.GetWindowText(MainVARI->m_StrSel, X, Y);
	if( f || r ) m_Dump.Paint();
    if( r ){
		MainVARI->m_UStrSel = jstrupr(MainVARI->m_StrSel.c_str());
		if( (Button == mbLeft)||(Button == mbRight) ){
			RECT rc;
			::GetWindowRect(PC->Handle, &rc);
			MainVARI->PupRX->PopupComponent = this;
			MainVARI->PupRX->Popup(rc.left+X, rc.top+Y);
		}
    }
    else if( Button == mbRight ){
		RECT rc;
		::GetWindowRect(PC->Handle, &rc);
		MainVARI->PupRXW->PopupComponent = StatusBar;
		MainVARI->PupRXW->Popup(rc.left+X, rc.top+Y);
    }
}
Ejemplo n.º 6
0
void main()
  {
    printf( "%s\n", source );
    printf( "%s\n", jstrupr( source ) );
    printf( "%s\n", source );
  }
Ejemplo n.º 7
0
void __fastcall TQSODlgBox::UpdateCurData(SDMMLOG *sp)
{
	int y, m, d, h;

	switch(Log.m_LogSet.m_DateType){
		case 2:			// dd-mm-yy
		case 3:			// dd-mm-yyyy
			if( sscanf(AnsiString(EditDate->Text).c_str(), "%u.%u.%u", &d, &m, &y) == 3 ){	//ja7ude 0428
				sp->year = BYTE(y % 100);
				sp->date = WORD(m * 100 + d);
			}
			break;
		case 4:			// mm-dd-yy
		case 5:			// mm-dd-yyyy
			if( sscanf(AnsiString(EditDate->Text).c_str(), "%u.%u.%u", &m, &d, &y) == 3 ){	//ja7ude 0428
				sp->year = BYTE(y % 100);
				sp->date = WORD(m * 100 + d);
			}
			break;
		default:		// yy-mm-dd, yyyy-mm-dd
			if( sscanf(AnsiString(EditDate->Text).c_str(), "%u.%u.%u", &y, &m, &d) == 3 ){	//ja7ude 0428
				sp->year = BYTE(y % 100);
				sp->date = WORD(m * 100 + d);
			}
			break;
	}
	if( !EditBgn->Text.IsEmpty() ){
		if( sscanf(AnsiString(EditBgn->Text).c_str(), "%u", &d) == 1){	//ja7ude 0428
			h = d / 100;
			m = d % 100;
			if( (sp->btime / 30) != (h * 60 + m) ){
				sp->btime = WORD((h * 60 + m) * 30 + 1);
			}
		}
	}
	if( !EditEnd->Text.IsEmpty() ){
		if( sscanf(AnsiString(EditEnd->Text).c_str(), "%u", &d) == 1){	//ja7ude 0428
			h = d / 100;
			m = d % 100;
			if( (sp->etime / 30) != (h * 60 + m) ){
				sp->etime = WORD((h * 60 + m) * 30 + 1);
			}
		}
	}
	StrCopy(sp->call, AnsiString(EditCall->Text).c_str(), MLCALL);	//ja7ude 0428
	jstrupr(sp->call);
	StrCopy(sp->name, AnsiString(EditName->Text).c_str(), MLNAME);	//ja7ude 0428
	if( Log.m_LogSet.m_UpperName ) jstrupr(sp->name);
	StrCopy(sp->qth, AnsiString(EditQTH->Text).c_str(), MLQTH);	//ja7ude 0428
	if( Log.m_LogSet.m_UpperQTH ) jstrupr(sp->qth);
	StrCopy(sp->ur, AnsiString(EditHis->Text).c_str(), MLRST);	//ja7ude 0428
	jstrupr(sp->ur);
	StrCopy(sp->my, AnsiString(EditMy->Text).c_str(), MLRST);	//ja7ude 0428
	jstrupr(sp->my);
	Log.SetFreq(sp, AnsiString(EditBand->Text).c_str());	//ja7ude 0428
	Log.SetMode(sp, AnsiString(EditMode->Text).c_str());	//ja7ude 0428
	StrCopy(sp->rem, AnsiString(EditRem->Text).c_str(), MLREM);	//ja7ude 0428
	if( Log.m_LogSet.m_UpperREM ) jstrupr(sp->rem);
	StrCopy(sp->qsl, AnsiString(EditQSL->Text).c_str(), MLQSL);	//ja7ude 0428
	if( Log.m_LogSet.m_UpperQSL ) jstrupr(sp->qsl);
	if( sscanf(AnsiString(EditEnv->Text).c_str(), "%u", &d) == 1){	//ja7ude 0428
		sp->env = WORD(d);
	}
	else {
		sp->env = 0;
	}
	Log.SetOptStr(0, sp, AnsiString(EditOpt1->Text).c_str());	//ja7ude 0428
	Log.SetOptStr(1, sp, AnsiString(EditOpt2->Text).c_str());	//ja7ude 0428
	Log.SetOptStr(2, sp, AnsiString(EditUsr1->Text).c_str());	//ja7ude 0428
	Log.SetOptStr(3, sp, AnsiString(EditUsr2->Text).c_str());	//ja7ude 0428
	sp->send = *EditS->Text.c_str();
	sp->recv = *EditR->Text.c_str();
	sp->cq = *EditM->Text.c_str();
	sp->cq = char(toupper(sp->cq));
	StrCopy(sp->pow, AnsiString(EditPow->Text).c_str(), MLPOW);	//ja7ude 0428
	jstrupr(sp->pow);
	if( Log.m_LogSet.m_TimeZone != 'I' ){
		UTCtoJST(sp);
	}
}