本文整理汇总了C++中TEST_FLAG函数的典型用法代码示例。如果您正苦于以下问题:C++ TEST_FLAG函数的具体用法?C++ TEST_FLAG怎么用?C++ TEST_FLAG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TEST_FLAG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Get_RA_LDPC_8812
u8 Get_RA_LDPC_8812(struct sta_info *psta)
{
uint8_t bLDPC = 0;
if (psta->mac_id == 1)
bLDPC = 0;
else
if (psta != NULL) {
#ifdef CONFIG_80211AC_VHT
if (IsSupportedVHT(psta->wireless_mode)) {
if (TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
bLDPC = 1;
else
bLDPC = 0;
} else
if (IsSupportedTxHT(psta->wireless_mode)) {
if (TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
bLDPC = 1;
else
bLDPC = 0;
} else
#endif
bLDPC = 0;
}
return (bLDPC << 2);
}
示例2: name_callback
static int
name_callback (const BoxType * box, void *cl)
{
TextTypePtr text = (TextTypePtr) box;
struct ans_info *i = (struct ans_info *) cl;
ElementTypePtr element = (ElementTypePtr) text->Element;
double newarea;
if (TEST_FLAG (i->locked, text))
return 0;
if ((FRONT (element) || i->BackToo) && !TEST_FLAG (HIDENAMEFLAG, element) &&
POINT_IN_BOX (PosX, PosY, &text->BoundingBox))
{
/* use the text with the smallest bounding box */
newarea = (text->BoundingBox.X2 - text->BoundingBox.X1) *
(double) (text->BoundingBox.Y2 - text->BoundingBox.Y1);
if (newarea < i->area)
{
i->area = newarea;
*i->ptr1 = element;
*i->ptr2 = *i->ptr3 = text;
}
return 1;
}
return 0;
}
示例3: ghid_set_status_line_label
/* ---------------------------------------------------------------------------
* output of status line
*/
void
ghid_set_status_line_label (void)
{
gchar *flag = TEST_FLAG (ALLDIRECTIONFLAG, PCB)
? "all"
: (PCB->Clipping == 0
? "45"
: (PCB->Clipping == 1
? "45_/"
: "45\\_"));
gchar *text = pcb_g_strdup_printf (
_("%m+<b>view</b>=%s "
"<b>grid</b>=%$mS "
"%s%s "
"<b>line</b>=%mS "
"<b>via</b>=%mS (%mS) %s"
"<b>clearance</b>=%mS "
"<b>text</b>=%i%% "
"<b>buffer</b>=#%i"),
Settings.grid_unit->allow,
Settings.ShowBottomSide ? C_("status", "bottom") : C_("status", "top"),
PCB->Grid,
flag, TEST_FLAG (RUBBERBANDFLAG, PCB) ? ",R " : " ",
Settings.LineThickness,
Settings.ViaThickness,
Settings.ViaDrillingHole,
ghidgui->compact_horizontal ? "\n" : "",
Settings.Keepaway,
Settings.TextScale, Settings.BufferNumber + 1);
ghid_status_line_set_text (text);
g_free (text);
}
示例4: rat_callback
static int
rat_callback (const BoxType * b, void *cl)
{
RatType *rat = (RatType *)b;
set_object_color ((AnyObjectType *) rat, NULL, PCB->RatSelectedColor,
PCB->ConnectedColor, PCB->FoundColor, PCB->RatColor);
if (Settings.RatThickness < 100)
rat->Thickness = pixel_slop * Settings.RatThickness;
/* rats.c set VIAFLAG if this rat goes to a containing poly: draw a donut */
if (TEST_FLAG(VIAFLAG, rat))
{
int w = rat->Thickness;
if (TEST_FLAG (THINDRAWFLAG, PCB))
gui->graphics->set_line_width (Output.fgGC, 0);
else
gui->graphics->set_line_width (Output.fgGC, w);
gui->graphics->draw_arc (Output.fgGC, rat->Point1.X, rat->Point1.Y,
w * 2, w * 2, 0, 360);
}
else
gui->graphics->draw_pcb_line (Output.fgGC, (LineType *) rat);
return 1;
}
示例5: DrawMask
/* ---------------------------------------------------------------------------
* draws solder mask layer - this will cover nearly everything
*/
void
DrawMask (int side, const BoxType *screen)
{
int thin = TEST_FLAG(THINDRAWFLAG, PCB) || TEST_FLAG(THINDRAWPOLYFLAG, PCB);
if (thin)
gui->graphics->set_color (Output.pmGC, PCB->MaskColor);
else
{
DrawMaskBoardArea (HID_MASK_BEFORE, screen);
gui->graphics->use_mask (HID_MASK_CLEAR);
}
r_search (PCB->Data->pin_tree, screen, NULL, clearPin_callback, NULL);
r_search (PCB->Data->via_tree, screen, NULL, clearPin_callback, NULL);
r_search (PCB->Data->pad_tree, screen, NULL, clearPad_callback, &side);
if (thin)
gui->graphics->set_color (Output.pmGC, "erase");
else
{
DrawMaskBoardArea (HID_MASK_AFTER, screen);
gui->graphics->use_mask (HID_MASK_OFF);
}
}
示例6: DrawVia
/* ---------------------------------------------------------------------------
* draw a via object
*/
void
DrawVia (PinType *Via)
{
AddPart (Via);
if (!TEST_FLAG (HOLEFLAG, Via) && TEST_FLAG (DISPLAYNAMEFLAG, Via))
DrawViaName (Via);
}
示例7: Set_RA_LDPC_8812
void
Set_RA_LDPC_8812(
struct sta_info *psta,
BOOLEAN bLDPC
)
{
if(psta == NULL)
return;
#ifdef CONFIG_80211AC_VHT
if(psta->wireless_mode == WIRELESS_11_5AC)
{
if(bLDPC && TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
SET_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
else
CLEAR_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
}
else if(IsSupportedTxHT(psta->wireless_mode) || IsSupportedVHT(psta->wireless_mode))
{
if(bLDPC && TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
SET_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
else
CLEAR_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
}
#endif
//DBG_871X("MacId %d bLDPC %d\n", psta->mac_id, bLDPC);
}
示例8: DrawPin
/* ---------------------------------------------------------------------------
* draw a pin object
*/
void
DrawPin (PinType *Pin)
{
AddPart (Pin);
if ((!TEST_FLAG (HOLEFLAG, Pin) && TEST_FLAG (DISPLAYNAMEFLAG, Pin))
|| doing_pinout)
DrawPinName (Pin);
}
示例9: __indexable
Boolean
__indexable( Association_Mode* the_assoc, char* file, int line )
{
if( !the_assoc )
CHILLEXCEPTION( file, line, EMPTY, NULL_ASSOCIATION );
if( !TEST_FLAG(the_assoc, IO_ISASSOCIATED) )
CHILLEXCEPTION( file, line, NOTASSOCIATED, IS_NOT_ASSOCIATED );
return TEST_FLAG(the_assoc, IO_INDEXABLE) ? True : False;
}
示例10: FlagElementName
static int
FlagElementName (void *data)
{
if (TEST_FLAG (NAMEONPCBFLAG, PCB))
return 2;
if (TEST_FLAG (DESCRIPTIONFLAG, PCB))
return 1;
return 3;
}
示例11: clearPin_callback
static int
clearPin_callback (const BoxType * b, void *cl)
{
PinType *pin = (PinType *) b;
if (TEST_FLAG (THINDRAWFLAG, PCB) || TEST_FLAG (THINDRAWPOLYFLAG, PCB))
gui->graphics->thindraw_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
else
gui->graphics->fill_pcb_pv (Output.pmGC, Output.pmGC, pin, false, true);
return 1;
}
示例12: ghid_set_status_line_label
/* ---------------------------------------------------------------------------
* output of status line
*/
void
ghid_set_status_line_label (void)
{
gchar text[512];
if (!Settings.grid_units_mm)
snprintf (text, sizeof (text),
_("<b>%c view</b>=%s "
"<b>grid</b>=%.1f:%i "
"%s%s "
"<b>line</b>=%.1f "
"<b>via</b>=%.1f(%.1f) %s"
"<b>clearance</b>=%.1f "
"<b>text</b>=%i%% "
"<b>buffer</b>=#%i"),
PCB->Changed ? '*' : ' ',
Settings.ShowSolderSide ? _("solder") : _("component"),
PCB->Grid / 100.0,
(int) Settings.GridFactor,
TEST_FLAG (ALLDIRECTIONFLAG, PCB) ? "all" :
(PCB->Clipping == 0 ? "45" :
(PCB->Clipping == 1 ? "45_/" : "45\\_")),
TEST_FLAG (RUBBERBANDFLAG, PCB) ? ",R " : " ",
Settings.LineThickness / 100.0,
Settings.ViaThickness / 100.0,
Settings.ViaDrillingHole / 100.0,
ghidgui->compact_horizontal ? "\n" : "",
Settings.Keepaway / 100.0,
Settings.TextScale, Settings.BufferNumber + 1);
else
snprintf (text, sizeof (text),
_("<b>%c view</b>=%s "
"<b>grid</b>=%5.3f:%i "
"%s%s "
"<b>line</b>=%5.3f "
"<b>via</b>=%5.3f(%5.3f) %s"
"<b>clearance</b>=%5.3f "
"<b>text</b>=%i%% "
"<b>buffer</b>=#%i"),
PCB->Changed ? '*' : ' ',
Settings.ShowSolderSide ? _("solder") : _("component"),
PCB->Grid * COOR_TO_MM, (int) Settings.GridFactor,
TEST_FLAG (ALLDIRECTIONFLAG, PCB) ? "all" :
(PCB->Clipping == 0 ? "45" :
(PCB->Clipping == 1 ? "45_/" : "45\\_")),
TEST_FLAG (RUBBERBANDFLAG, PCB) ? ",R " : " ",
Settings.LineThickness * COOR_TO_MM,
Settings.ViaThickness * COOR_TO_MM,
Settings.ViaDrillingHole * COOR_TO_MM,
ghidgui->compact_horizontal ? "\n" : "",
Settings.Keepaway * COOR_TO_MM,
Settings.TextScale, Settings.BufferNumber + 1);
ghid_status_line_set_text (text);
}
示例13: common_thindraw_pcb_pv
void
common_thindraw_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask)
{
Coord w = mask ? pv->Mask : pv->Thickness;
Coord r = w / 2;
if (TEST_FLAG (HOLEFLAG, pv))
{
if (mask)
gui->graphics->draw_arc (fg_gc, pv->X, pv->Y, r, r, 0, 360);
if (drawHole)
{
r = pv->DrillingHole / 2;
gui->graphics->set_line_cap (bg_gc, Round_Cap);
gui->graphics->set_line_width (bg_gc, 0);
gui->graphics->draw_arc (bg_gc, pv->X, pv->Y, r, r, 0, 360);
}
return;
}
if (TEST_FLAG (SQUAREFLAG, pv))
{
Coord l = pv->X - r;
Coord b = pv->Y - r;
Coord r = l + w;
Coord t = b + w;
gui->graphics->set_line_cap (fg_gc, Round_Cap);
gui->graphics->set_line_width (fg_gc, 0);
gui->graphics->draw_line (fg_gc, r, t, r, b);
gui->graphics->draw_line (fg_gc, l, t, l, b);
gui->graphics->draw_line (fg_gc, r, t, l, t);
gui->graphics->draw_line (fg_gc, r, b, l, b);
}
else if (TEST_FLAG (OCTAGONFLAG, pv))
{
draw_octagon_poly (fg_gc, pv->X, pv->Y, w, true);
}
else /* draw a round pin or via */
{
gui->graphics->set_line_cap (fg_gc, Round_Cap);
gui->graphics->set_line_width (fg_gc, 0);
gui->graphics->draw_arc (fg_gc, pv->X, pv->Y, r, r, 0, 360);
}
/* and the drilling hole (which is always round */
if (drawHole)
{
gui->graphics->set_line_cap (bg_gc, Round_Cap);
gui->graphics->set_line_width (bg_gc, 0);
gui->graphics->draw_arc (bg_gc, pv->X, pv->Y, pv->DrillingHole / 2,
pv->DrillingHole / 2, 0, 360);
}
}
示例14: FindPad
/* ---------------------------------------------------------------------------
* Find a particular pad from an element name and pin number
*/
static bool
FindPad (char *ElementName, char *PinNum, ConnectionType * conn, bool Same)
{
ElementTypePtr element;
Cardinal i;
if ((element = SearchElementByName (PCB->Data, ElementName)) != NULL)
{
for (i = 0; i < element->PadN; i++)
if (NSTRCMP (PinNum, element->Pad[i].Number) == 0 && (!Same
||
!TEST_FLAG
(DRCFLAG,
&element->
Pad[i])))
{
conn->type = PAD_TYPE;
conn->ptr2 = &element->Pad[i];
conn->group =
TEST_FLAG (ONSOLDERFLAG, &element->Pad[i]) ? SLayer : CLayer;
if (TEST_FLAG (EDGE2FLAG, &element->Pad[i]))
{
conn->X = element->Pad[i].Point2.X;
conn->Y = element->Pad[i].Point2.Y;
}
else
{
conn->X = element->Pad[i].Point1.X;
conn->Y = element->Pad[i].Point1.Y;
}
break;
}
if (i == element->PadN)
{
for (i = 0; i < element->PinN; i++)
if (!TEST_FLAG (HOLEFLAG, &element->Pin[i]) &&
element->Pin[i].Number &&
NSTRCMP (PinNum, element->Pin[i].Number) == 0 &&
(!Same || !TEST_FLAG (DRCFLAG, &element->Pin[i])))
{
conn->type = PIN_TYPE;
conn->ptr2 = &element->Pin[i];
conn->group = SLayer; /* any layer will do */
conn->X = element->Pin[i].X;
conn->Y = element->Pin[i].Y;
break;
}
if (i == element->PinN)
return (false);
}
conn->ptr1 = element;
return (true);
}
return (false);
}
示例15: FindPad
/*!
* \brief Find a particular pad from an element name and pin number.
*/
static bool
FindPad (char *ElementName, char *PinNum, ConnectionType * conn, bool Same)
{
ElementType *element;
GList *i;
if ((element = SearchElementByName (PCB->Data, ElementName)) == NULL)
return false;
for (i = element->Pad; i != NULL; i = g_list_next (i))
{
PadType *pad = i->data;
if (NSTRCMP (PinNum, pad->Number) == 0 &&
(!Same || !TEST_FLAG (DRCFLAG, pad)))
{
conn->type = PAD_TYPE;
conn->ptr1 = element;
conn->ptr2 = pad;
conn->group = TEST_FLAG (ONSOLDERFLAG, pad) ? bottom_group : top_group;
if (TEST_FLAG (EDGE2FLAG, pad))
{
conn->X = pad->Point2.X;
conn->Y = pad->Point2.Y;
}
else
{
conn->X = pad->Point1.X;
conn->Y = pad->Point1.Y;
}
return true;
}
}
for (i = element->Pin; i != NULL; i = g_list_next (i))
{
PinType *pin = i->data;
if (!TEST_FLAG (HOLEFLAG, pin) &&
pin->Number && NSTRCMP (PinNum, pin->Number) == 0 &&
(!Same || !TEST_FLAG (DRCFLAG, pin)))
{
conn->type = PIN_TYPE;
conn->ptr1 = element;
conn->ptr2 = pin;
conn->group = bottom_group; /* any layer will do */
conn->X = pin->X;
conn->Y = pin->Y;
return true;
}
}
return false;
}