//--------------------------------------------------------------------------- __fastcall TframTag::TframTag(TComponent* Owner) : TFrame(Owner) { tagname_by_text(&m_TagName, ".."); lblStatus->Caption = ""; grpSwitchProperty->Left = grpAnalogProperty_1->Left; grpSwitchProperty->Top = grpAnalogProperty_1->Top; ZeroMemory(&m_Tag, sizeof(m_Tag)); ZeroMemory(&m_TagName, sizeof(m_TagName)); }
void CDiaInputD::OnSet() { TAG_NAME tn; tagname_by_text(&tn,(LPCTSTR)m_pInputD->m_TagName); TAG_VALUE tv; tv.iValue=1; proxy_write_tags(1, &tn, &tv); }
RTDB_API RTK_CURSOR PMC_API open_tag_t( RTK_CURSOR node, const char * short_name ) { TAG_NAME tn; tagname_by_text(&tn, short_name); return open_tag(node, &tn.sname); }
void CDiaInputD::OnReset() { TAG_NAME tn; tagname_by_text(&tn,(LPCTSTR)m_pInputD->m_TagName); pmc_value_t tg; tg.Flags |= TF_Valid; tg.Value.iValue=0; proxy_write_tags(1, &tn, &tg.Value); }
void CAutoPopup::init() { __uint i; popupEntry_t * ent; nEntries = (__uint)GetPrivateProfileInt( "AutoPopup", "count", 0, get_config_file() ); if(nEntries >= maxPopups){ nEntries = maxPopups; } ent = entries; char lineBuf[1024]; char key[4]; memset(&entries, 0, sizeof(entries)); for(i=0; i<nEntries; i++){ sprintf(key, "%d", i); GetPrivateProfileString( "AutoPopup", key, "", lineBuf, sizeof(lineBuf), get_config_file() ); CArgs a; parse_arg_ex(lineBuf, &a, ","); if(a.argc != 5){ continue; } if(!tagname_by_text(&ent->tn, a.argv[0])){ continue; } if(atoi(a.argv[1])){ ent->flags |= popupWhenVariableIsOn; } if(atoi(a.argv[2])){ ent->flags |= popupOverlay; } if(atoi(a.argv[3])){ ent->flags |= popupAutoHide; } strncpy(ent->associatedPicture, a.argv[4], MAX_PATH); ent->associatedPicture[MAX_PATH - 1] = 0; ent++; } nEntries = ent - entries; }
CExpression::arbore CExpression::identificator() { int poz; arbore nod = NULL,nod2 = NULL; arbore result = NULL; TAG_NAME tn; poz=pozitie; SkipSpaces(); if (m_definitie[pozitie]=='\0') result = NULL; if (isdigit(m_definitie[pozitie])){ // Este numar ? while ((isdigit(m_definitie[pozitie]) || (m_definitie[pozitie]=='.'))){ pozitie++; } nod = new NOD; nod->left = NULL; nod->right = NULL; nod->operatie = '@'; nod->valoare = atof(m_definitie.Mid(poz,pozitie-poz)); result = nod; }else if (_is_valid_id_char(m_definitie[pozitie])){ // Am i an identifier ? //if (isalpha(m_definitie[pozitie]) ){ // Am i an identifier ? //while (isalnum(m_definitie[pozitie])) LPCSTR str = m_definitie; while (_is_valid_id_char(str[pozitie])) { pozitie++; } CString id = m_definitie.Mid(poz,pozitie-poz); CString nid = id; id.MakeUpper(); if (id =="SIN"){ // Functia sinus CString nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=150; SkipSpaces(); return nod; }else if (id =="COS") // Functia sinus CString { nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=151; SkipSpaces(); return nod; }else if (id =="EXP") // Functia sinus CString { nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=152; SkipSpaces(); return nod; }else if (id =="SQRT") // Functia sinus CString { nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=153; SkipSpaces(); return nod; }else if (id =="LOG") // Functia sinus CString { nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=154; SkipSpaces(); return nod; }else if (id =="TG") // Functia sinus CString { nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=155; SkipSpaces(); return nod; }else if (id =="CTG"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=156; SkipSpaces(); return nod; }else if (id =="ASIN"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=157; SkipSpaces(); return nod; }else if (id =="ACOS"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=158; SkipSpaces(); return nod; }else if (id =="ATG"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=159; SkipSpaces(); return nod; }else if (id =="$YEAR"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=160; SkipSpaces(); return nod; }else if (id =="$MONTH"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=161; SkipSpaces(); return nod; }else if (id =="$DAY"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=162; SkipSpaces(); return nod; }else if (id =="$HOUR"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=163; SkipSpaces(); return nod; }else if (id =="$MINUTE"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=164; SkipSpaces(); return nod; }else if (id =="$SECOND"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=165; SkipSpaces(); return nod; }else if (id =="MAX"){ SkipSpaces(); if(m_definitie[pozitie] != '('){ return NULL; } pozitie++; nod2 = factor(); // skip ';' SkipSpaces(); if(m_definitie[pozitie] != ';'){ return NULL; } pozitie++; arbore nod3 = factor(); if(!nod3){ return NULL; } SkipSpaces(); if(m_definitie[pozitie] != ')'){ return NULL; }; pozitie++; nod = new NOD; nod->left = nod2; nod->right = nod3; nod->operatie=166; SkipSpaces(); return nod; }else if (id =="MIN"){ SkipSpaces(); if(m_definitie[pozitie] != '('){ return NULL; } pozitie++; nod2 = factor(); // skip ';' SkipSpaces(); if(m_definitie[pozitie] != ';'){ return NULL; } pozitie++; arbore nod3 = factor(); if(!nod3){ return NULL; } SkipSpaces(); if(m_definitie[pozitie] != ')'){ return NULL; } pozitie++; nod = new NOD; nod->left = nod2; nod->right = nod3; nod->operatie=167; SkipSpaces(); return nod; }else if (id =="RANDOM"){ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=168; SkipSpaces(); return nod; }else if (id == "$NOW"){ nod2 = factor(); nod = new NOD; nod->left = NULL; nod->right=NULL; nod->operatie=169; SkipSpaces(); return nod; }else if (id == "LASTUPDATE"){ /* added by jackie, 2004/2/26 */ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=170; SkipSpaces(); return nod; }else if(id == "SPAN"){ /* added by jackie, 2004/2/26 */ nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=172; SkipSpaces(); return nod; }else if(id == "ABS"){ // added by chenj, 2008-5-22 nod2 = factor(); nod = new NOD; nod->left = nod2; nod->right=NULL; nod->operatie=173; SkipSpaces(); return nod; } // is not a keyward, check if it's a database tag if(tagname_by_text(&tn, (char*)(LPCTSTR)id) ){ nod = new NOD; nod -> left = NULL; nod -> right = NULL; nod -> operatie = 171; nod -> pvObj = query_tag(HNODE_LOCAL_MACHINE, &tn.sname); SkipSpaces(); result = nod; }else{ result = NULL; } } SkipSpaces(); return result; }
long CCell::GetDynTags(TAG_NAME *pFatherTags, bool bFake,long lFatherCount) { TAG_NAME *pTags; long lCount=lFatherCount; CDny * pDny; POSITION pos; CElement *pElement; for(pos=m_Elements.GetHeadPosition();pos!=NULL;){ pElement=((CElement*)(m_Elements.GetNext(pos))); if(pElement->IsKindOf(RUNTIME_CLASS(CCell))){ lCount=((CCell*)pElement)->GetDynTags(pFatherTags,bFake,lCount); }else{ //blink pDny=(CDny*)(&(pElement->m_DnyAttr.m_Blink)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //button a pDny=(CDny*)(&(pElement->m_DnyAttr.m_ButtonA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //button d pDny=(CDny*)(&(pElement->m_DnyAttr.m_ButtonD)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //button wnd //pDny=(CDny*)(&(pElement->m_DnyAttr.m_ButtonWnd)); //if(pDny->m_Used){ // if(!bFake){ // tagname_by_text(pTags,pDny->m_TagName.GetBuffer(TAGNAME_TEXT_LENGTH)); // pDny->m_TagName.ReleaseBuffer(); // pTags++; // } // lCount++; //} //color brush a pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorBrushA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color brush aa pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorBrushAA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color brush d pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorBrushD)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color brush da pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorBrushDA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color pen a pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorPenA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color pen aa pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorPenAA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color pen d pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorPenD)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color pen da pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorPenDA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color text a pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorTextA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color text aa pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorTextAA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color text d pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorTextD)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //color text da pDny=(CDny*)(&(pElement->m_DnyAttr.m_ColorTextDA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //direction pDny=(CDny*)(&(pElement->m_DnyAttr.m_Direction)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //enable pDny=(CDny*)(&(pElement->m_DnyAttr.m_Enable)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //fill h pDny=(CDny*)(&(pElement->m_DnyAttr.m_FillH)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //fill v pDny=(CDny*)(&(pElement->m_DnyAttr.m_FillV)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //input a pDny=(CDny*)(&(pElement->m_DnyAttr.m_InputA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //input d pDny=(CDny*)(&(pElement->m_DnyAttr.m_InputD)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //pos h pDny=(CDny*)(&(pElement->m_DnyAttr.m_PosH)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //pos v pDny=(CDny*)(&(pElement->m_DnyAttr.m_PosV)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //size h pDny=(CDny*)(&(pElement->m_DnyAttr.m_SizeH)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //size v pDny=(CDny*)(&(pElement->m_DnyAttr.m_SizeV)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //slide h pDny=(CDny*)(&(pElement->m_DnyAttr.m_SlideH)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //slide v pDny=(CDny*)(&(pElement->m_DnyAttr.m_SlideV)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //value a pDny=(CDny*)(&(pElement->m_DnyAttr.m_ValueA)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //value d pDny=(CDny*)(&(pElement->m_DnyAttr.m_ValueD)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } //visible pDny=(CDny*)(&(pElement->m_DnyAttr.m_Visible)); if(pDny->m_Used){ if(!bFake){ pTags=pFatherTags+lCount; tagname_by_text(pTags,(LPCTSTR)pDny->m_TagName); } lCount++; } } } return lCount; }