本文整理汇总了C++中Lang类的典型用法代码示例。如果您正苦于以下问题:C++ Lang类的具体用法?C++ Lang怎么用?C++ Lang使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Lang类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeShastiamsaLords
/*****************************************************
**
** GenericTableWriter --- writeShastiamsaLords
**
******************************************************/
void GenericTableWriter::writeShastiamsaLords( const uint &i0, const TcColumnSet &set )
{
int shast;
Lang lang;
ObjectPosition pos;
const static bool k_shastiamsa_benefic[60] = {
false, false, true, true, true, true, false, false, false, false,
false, false, true, true, false, false, true, true, true, true,
true, true, true, true, true, true, true, true, true, false,
false, false, false, false, false, false, true, true, true, false,
false, false, false, false, true, true, true, false, true, true,
false, false, true, true, false, true, true, true, false, true,
};
// Dignities
table->setHeader( i0, _( "D-60 Lords" ));
for ( uint p = 0; p < obs.size(); p++ )
{
pos = getObjectPosition( obs[p], set );
shast = (int)( a_red( pos.longitude, 30 ) * 2 );
if ( isEvenRasi( pos.longitude )) shast = 59 - shast;
assert( shast >= 0 && shast < 60 );
table->setEntry( i0, p + 1, wxString::Format( wxT( "%s (%c)" ), lang.getShastiamsaName( shast ).c_str(),
( k_shastiamsa_benefic[(int)shast] ? 'B' : 'M' )));
}
}
示例2: CalculatorFactory
/*****************************************************
**
** TextHelper --- writeAstronomicalData
**
******************************************************/
int TextHelper::writeAstronomicalData()
{
wxString pname;
int p, ret = 0;
Calculator *calculator = CalculatorFactory().getCalculator();
Formatter *f = Formatter::get();
Lang lang;
vector<int> obs1 = chartprops->getPlanetList();
vector<int> obs;
for ( unsigned int i = 0; i < obs1.size(); i++ )
{
if ( obs1[i] < MAX_EPHEM_OBJECTS ) obs.push_back( obs1[i] );
}
if ( show_header ) writer->writeHeader1( _( "Astronomical Positions" ));
Table table( 4, obs.size() + 1 );
table.setHeader( 0, _( "Planet" ));
table.setHeader( 1, _( "Longitude" ));
table.setHeader( 2, _( "Latitute" ));
table.setHeader( 3, _( "Speed (deg/day)" ));
table.col_line[0] = true;
table.col_alignment[0] = Align::Right;
table.col_alignment[1] = Align::Right;
int line = 1;
for ( unsigned int i = 0; i < obs.size(); i++ )
{
p = obs[i];
if ( horoscope->getTropicalLength( p ) == 0 ) ret++;
pname = writer->getObjectName( p, TLARGE);
table.setEntry( 0, line, pname );
table.setEntry( 1, line, writer->getPosFormatted( horoscope->getTropicalLength( p ), horoscope->isRetrograde( p ), DEG_PRECISION_MORE ));
if ( p != OASCENDANT && p != OMERIDIAN )
{
table.setEntry( 2, line, f->getLatitudeFormatted( horoscope->getLatitude( p ), DEG_PRECISION_MORE ));
table.setEntry( 3, line, f->getLenFormatted( horoscope->getSpeed( p ), DEG_PRECISION_MORE ));
}
line++;
}
writer->writeTable( table );
Table t2( 2, 5 );
t2.setHeader( 0, _( "Name" ));
t2.setHeader( 1, _( "Value" ));
writer->writeHeader2( _( "Ayanamsa" ));
line = 1;
for ( int i = 0; i < NB_AYANAMSAS; i++ )
{
t2.setEntry( 0, line, lang.getAyanamsaName( i+1 ));
t2.setEntry( 1, line, f->getDegreesFormatted( calculator->calcAyanamsa( horoscope->getJD(), i+1 ), DEG_PRECISION_MORE ));
line++;
}
t2.setEntry( 0, 4, _( "Custom" ) );
t2.setEntry( 1, 4, f->getDegreesFormatted( calculator->calcAyanamsa( horoscope->getJD(), 4 ), DEG_PRECISION_MORE ));
writer->writeTable( t2 );
return ret;
}
示例3: _
/*****************************************************
**
** GenericTableWriter --- writeCharaKarakas
**
******************************************************/
void GenericTableWriter::writeCharaKarakas( const uint &i0, const TcColumnSet &set )
{
table->setHeader( i0, _( "Karaka" ));
if ( set.listcontext != TAB_LC_PLANETS || ! set.vedic ) return;
Lang lang;
ObjectId p;
const bool cmode = config->vedicCalculation->charaKarakaMode; // 0: Parasara, 1: Raman
JaiminiExpert jexpert( h, V_RASI );
jexpert.calcCharaKarakas();
for ( uint i = 0; i < obs.size(); i++ )
{
assert( table->getNbRows() > i );
// map planet id to karaka index - quite ugly
p = obs[i];
if ( cmode ) // Raman
{
if ( p > OSATURN ) continue;
}
else // Parasara
{
if ( p == OURANUS ) continue;
if ( p == OMEANNODE || p == OTRUENODE ) p = (ObjectId)7;
if ( p > 7 ) continue;
}
table->setEntry( i0, i + 1, lang.getKarakaName( jexpert.getCharaKarakaProperty( p )));
}
}
示例4: writeVedicDefault
/*****************************************************
**
** PrintoutHelper --- writeVedicDefault
**
******************************************************/
void PrintoutHelper::writeVedicDefault( Table *table )
{
int i;
Lang lang;
VargaHoroscope chart( h, 0 );
VargaHoroscope nchart( h, 1 );
JaiminiExpert jexpert( &nchart );
jexpert.calcCharaKarakas();
NakshatraExpert nexpert;
table->setHeader( 2, _( "Planet" ), false, 1 );
table->setHeader( 4, _( "Length" ), false, 1 );
table->setHeader( 6, _( "Nakshatra" ));
table->setHeader( 7, _( "D-9" ));
table->setHeader( 8, _( "Karaka" ));
table->col_line[5] = true;
int line = 1;
vector<int> obs = PlanetList().getVedicObjectList( OBJECTS_INCLUDE_ASCENDANT | OBJECTS_INCLUDE_DRAGONTAIL | OBJECTS_INCLUDE_DRAGONHEAD );
for ( unsigned int p = 0; p < obs.size(); p++ )
{
i = obs[p];
writePlanetaryObject( table, 2, line, i, false, true );
table->setEntry( 6, line, lang.getNakshatraName(::getNakshatra(h->getObjectPosition( i, true ).length, N27), N27, TLARGE ) );
table->setEntry( 7, line, writer->getSignName(nchart.getRasi( i ), config->signPrecision ), config->useSignSymbols );
if ( p < 8 ) table->setEntry( 8, line, lang.getKarakaName( jexpert.getCharaKarakaProperty(p)) );
line++;
}
}
示例5: switch
int ShowLanguagesDlg::OnNotify(GViewI *n, int f)
{
switch (n->GetId())
{
case IDOK:
{
if (d->Lst)
{
List<Lang> All;
d->Lst->GetAll(All);
for (Lang *L = All.First(); L; L = All.Next())
{
d->App->ShowLang(L->GetLang()->Id, L->GetVal());
}
d->App->OnLanguagesChange(0, 0, true);
}
}
case IDCANCEL:
{
EndModal(n->GetId() == IDOK);
break;
}
}
return false;
}
示例6: OnPlanetTimer
/*****************************************************
**
** MainWindowStatusbar --- OnPlanetTimer
**
******************************************************/
void MainWindowStatusbar::OnPlanetTimer( wxTimerEvent& )
{
wxString t0, t1;
double mlen, asclen, dummy, nakportion;
Lang lang;
Calculator *calculator = CalculatorFactory().getCalculator();
DataSet d;
SheetFormatter fmt;
d.setCurrentDate();
d.setLocation( *config->defaultLocation );
asclen = calculator->calcAscendantAya( d.getJD(), d.getLocation()->getLatitude(),
d.getLocation()->getLongitude(), config->preferVedic );
calculator->calcPosition( &d, OMOON, mlen, dummy, true, config->preferVedic );
t0 << fmt.fragment2PlainText( fmt.getObjectName( OASCENDANT, TF_MEDIUM ))
<< SPACE
<< fmt.fragment2PlainText( fmt.getPosFormatted( asclen ));
SetStatusText( t0, 0 );
t1 << fmt.fragment2PlainText( fmt.getObjectName( OMOON, TF_MEDIUM ))
<< SPACE
<< fmt.fragment2PlainText( fmt.getPosFormatted( mlen ));
if ( config->preferVedic )
{
nakportion = (int)(getNakshatraLongitude27( mlen ) * 10000 /NAKSHATRA_LEN );
nakportion /= 100;
t1 << SPACE << nakportion << wxT( "%" ) << SPACE
<< lang.getNakshatra27Name( ::getNakshatra27( mlen ), TF_MEDIUM );
}
SetStatusText( t1, 1 );
}
示例7: while
LangType Buffer::getLangFromExt(const char *ext)
{
NppParameters *pNppParam = NppParameters::getInstance();
int i = pNppParam->getNbLang();
i--;
while (i >= 0)
{
Lang *l = pNppParam->getLangFromIndex(i--);
const char *defList = l->getDefaultExtList();
const char *userList = NULL;
LexerStylerArray &lsa = pNppParam->getLStylerArray();
const char *lName = l->getLangName();
LexerStyler *pLS = lsa.getLexerStylerByName(lName);
if (pLS)
userList = pLS->getLexerUserExt();
std::string list("");
if (defList)
list += defList;
if (userList)
{
list += " ";
list += userList;
}
if (isInList(ext, list.c_str()))
return l->getLangID();
}
return L_TXT;
}
示例8: if
LangDiagram::LangDiagram(const Lang &lang)
{
ulen N=lang.getSyntCount();
// start/stop
{
stop=N;
start.reserve(N);
lang.applyForSynts( [this] (Synt synt) { if( synt.isLang() ) start.append_fill(synt.getIndex()); } );
start.shrink_extra();
}
// elements
{
elements.reserve(N);
lang.applyForSynts( [this] (Synt synt) { elements.append_fill(synt); } );
}
// arrows
{
ArrowBuilder builder(N);
const Element *base=elements.getPtr();
lang.applyForSynts( [=,&builder] (Synt synt) { builder.add(synt,base); } );
lang.applyForRules( [&builder] (Rule rule) { builder.add(rule); } );
builder.finish(arrows);
}
}
示例9: writeHouse
/*****************************************************
**
** PrintoutHelper --- writeHouse
**
******************************************************/
void PrintoutHelper::writeHouse( Table *table, const int &row, const int &line, const int& house, const bool &vedic )
{
double len;
wxString s;
Lang lang;
Formatter *formatter = Formatter::get();
if ( config->useVedicPlanetNames ) s = lang.getBhavaName( house - 1 );
else s.Printf( wxT( "%02d" ), house );
table->setEntry( row, line, s );
len = h->getHouse( house - 1, vedic );
if ( config->useVedicPositions )
table->setEntry( row + 2, line, writer->getPosFormatted( len, false, DEG_PRECISION_SECOND ), false );
else
{
table->setEntry( row + 2, line, formatter->getLenFormatted( getRasiLen( len ), DEG_PRECISION_MINUTE ));
table->setEntry( row + 3, line, writer->getSignName( getRasi( len )), config->useSignSymbols );
}
if ( vedic )
{
KpData kp = h->getHouseKPLords( house - 1 );
table->setEntry( row + 5, line, writer->getObjectName( kp.lord, TSHORT, true ), config->usePlanetSymbols );
table->setEntry( row + 6, line, writer->getObjectName( kp.sublord, TSHORT, true ), config->usePlanetSymbols );
table->setEntry( row + 7, line, writer->getObjectName( kp.subsublord, TSHORT, true ), config->usePlanetSymbols );
}
}
示例10: writeLunar
/*****************************************************
**
** EphemExpert --- writeLunar
**
******************************************************/
void EphemExpert::writeLunar( Writer *writer )
{
if ( ! clunar ) calcLunar();
Lang lang;
wxString s, thetime;
list<LunarEvent>::iterator iter;
LunarEvent *e;
TzUtil tzu;
writeHeaderInfo( writer );
Table table( 7, lunarEvents.size()+1 );
table.setHeader( 0, _( "Day" ));
table.setHeader( 1, _( "Time" ));
table.setHeader( 2, _( "Sun" ));
table.setHeader( 3, _( "Moon" ));
table.setHeader( 4, _( "Angle" ));
table.setHeader( 5, _( "Tithi" ));
table.setHeader( 6, _( "Western" ));
int line = 1;
for ( iter = lunarEvents.begin(); iter != lunarEvents.end(); iter++ )
{
e = (LunarEvent*)(&(*iter));
TzFormattedDate fd = tzu.getDateFormatted( e->jd, isLocaltime );
thetime = fd.timeFormatted;
//if ( dstchange ) thetime << wxT( " " ) << fd.timezoneFormatted;
s.Printf( wxT( "%02d %s" ), fd.dayOfMonth, fd.weekDay.c_str());
if ( testDayIndexForCurrent( fd.dayOfMonth )) table.setHeaderEntry( 0, line, s );
else table.setEntry( 0, line, s );
table.setEntry( 1, line, thetime );
table.setEntry( 2, line, writer->getPosFormatted( e->slen, false ) );
table.setEntry( 3, line, writer->getPosFormatted( e->mlen, false ) );
int angle = (int)( red_deg( e->mlen - e->slen ) + .00001 );
if ( angle >= 360 ) angle -= 360;
s.Printf( wxT( "%d" ), angle );
table.setEntry( 4, line, s );
if ( ! ( angle % 12 ))
{
table.setEntry( 5, line, lang.getTithiName( angle / 12 ) );
}
if ( angle == 0 ) table.setEntry( 6, line, _( "New Moon" ));
else if ( angle == 180 ) table.setEntry( 6, line, _( "Full Moon" ));
else if ( angle == 60 || angle == 300 ) table.setEntry( 6, line, _( "Sextile" ));
else if ( angle == 90 ) table.setEntry( 6, line, _( "Half Moon (Waxing)" ));
else if ( angle == 120 || angle == 240 ) table.setEntry( 6, line, _( "Trine" ));
else if ( angle == 270 ) table.setEntry( 6, line, _( "Half Moon (Waning)" ));
// Semi squares
else if (( angle == 45 || angle == 135 || angle == 225 || angle == 315 ))
table.setEntry( 6, line, _( "Semi Square" ));
line++;
}
writer->writeTable( table );
}
示例11: writeHeaderInfo
/*****************************************************
**
** EphemExpert --- writeHeaderInfo
**
******************************************************/
void EphemExpert::writeHeaderInfo( Writer *writer )
{
if ( ! show_header ) return;
Lang lang;
wxString s;
s.Printf( wxT ( "%s %d" ), (const wxChar*)lang.getMonthName( month-1 ), year );
writer->writeHeader1( s );
}
示例12: writeDetails
/*****************************************************
**
** EphemExpert --- writeDetails
**
******************************************************/
void EphemExpert::writeDetails( Writer *writer )
{
int i;
wxString s, tz_str, thetime;
Lang lang;
Formatter *formatter = Formatter::get();
TzUtil tzu;
if ( ! cdetails ) calcDetails();
s.Printf( wxT ( "%s %d" ), (const wxChar*)lang.getMonthName( month-1 ), year );
writer->writeHeader1( s );
int line = 1;
int nb_leaps = 0;
for ( i = 0; i < nb_days; i++ )
{
if ( i > 0 && weekday[i] == 0 ) nb_leaps++;
}
Table table( 5, nb_days+1+nb_leaps );
table.setHeader( 0, _( "Day" ));
table.setHeader( 1, _( "Sidereal Time" ));
table.setHeader( 2, _( "Sunrise" ));
table.setHeader( 3, _( "Sunset" ));
table.setHeader( 4, _( "Tithi (Sunrise)" ));
line = 1;
for ( i = 0; i < nb_days; i++ )
{
// blank line on weekend
if ( i > 0 && weekday[i] == 0 )
{
for ( int j = 0; j < 5; j++ ) table.setHeaderEntry( j, line, wxEmptyString );
line++;
}
s.Printf( wxT( "%02d %s" ), i+1, (const wxChar*)lang.getWeekdayName( weekday[i] ).Left(2) );
if ( testDayIndexForCurrent( i+1 )) table.setHeaderEntry( 0, line, s );
else table.setEntry( 0, line, s );
table.setEntry( 1, line, formatter->getTimeFormatted( st[i] ) );
TzFormattedDate fd = tzu.getDateFormatted( sunrise[i], isLocaltime );
thetime = fd.timeFormatted;
//if ( dstchange ) thetime << wxT( " " ) << fd.timezoneFormatted;
table.setEntry( 2, line, thetime );
fd = tzu.getDateFormatted( sunset[i], isLocaltime );
table.setEntry( 3, line, fd.timeFormatted );
table.setEntry( 4, line, lang.getTithiName( tithi[i] ));
line++;
}
writer->writeTable( table );
}
示例13: writeSignQualities
/*****************************************************
**
** GenericTableWriter --- writeSignQualities
**
******************************************************/
void GenericTableWriter::writeSignQualities( const uint &i0, const TcColumnSet &set )
{
Lang lang;
table->setHeader( i0, _( "Quality" ));
ObjectPosition pos;
for ( uint p = 0; p < obs.size(); p++ )
{
pos = getObjectPosition( obs[p], set );
table->setEntry( i0, p + 1, lang.getSignQualityName( getRasi( pos.longitude )));
}
}
示例14: writeDignities
/*****************************************************
**
** GenericTableWriter --- writeDignities
**
******************************************************/
void GenericTableWriter::writeDignities( const uint &i0, const TcColumnSet& )
{
Lang lang;
table->setHeader( i0, _( "Dignity" ));
for ( uint p = 0; p < obs.size(); p++ )
{
if ( obs[p] >= OSUN && obs[p] <= OSATURN )
{
table->setEntry( i0, p + 1, lang.getDignityName( h->getVargaData( obs[p], V_RASI )->getDignity(), format ));
}
}
}
示例15: getLenString
// unused
const wxString Formatter::getLenString( const double &len, const int format, const int dir )
{
wxString s;
Lang lang;
s << ( dir == 1 ? 'R' : 'D' );
double mylen = red_deg( len );
const int sign = (int)( mylen / 30 );
mylen -= 30 * sign;
s << getDegMinSecFormatted( mylen, format, 0.0, 30.0 ) << lang.getSignName(sign);
return s;
}