/
YakuninAV
/
Convertors
Обзор
Документация
Войти
/
YakuninAV
/
Convertors
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Estimate/EstFlags.pas
207 строк
7 KB
YakuninAV
begin with gitflick
31 июл 2026, 15:21
31 июл 2026, 15:21
1dc0fc6
Код
Авторство
О чём код?
unit EstFlags; interface const ef_Subposition = 1; ef_ZP = 2; ef_MAT = 4; ef_EM = 8; ef_ZPM = 16; ef_Vozvrat = 32; ef_ZT = 64; ef_Abstract = 128; ef_Musor = 256; ef_Demontaj = 512; ef_Transport= 1024; ef_CurRes = 2048; ef_Integrate= 4096; ef_Tariff = 8192; ef_Equipment= 16384; ef_Taken = 32768; ef_ResPos = 65536; ef_HiddenWork = 131072; ef_Comment = 262144; ef_Pir = 524288; ef_Pioneering = 1048576; //����� ��������� � ������� ���� of_Subposition = ef_Subposition; //������ - �������� ���� ��� ������� ������ of_ProductionBuilding = 2; of_AdditionalExpenses = 4; of_PirPioneering = 8; of_Abstract = ef_Abstract; //������ - �������� ���� ��� ������� ������ of_Comment = ef_Comment; //����� ��� ����� ���������� � ���� DIVDET cf_Fixed = 1; cf_LockedResults = 2; cf_LockedFactors = 4; cf_LockedCaption = 8; cf_BoldFont = 16; cf_ItalicFont = 32; //compens creation flags ecf_PrintNullPos = ef_Integrate; function IsAbstractPosition(AFlag: integer): boolean; function IsSubPosition(AFlag: integer): boolean; function IsAbstractSubPosition(AFlag: integer): boolean; function MayBeMainPosition(AFlag: integer): boolean; function IsCommentPosition(AFlag: Integer): Boolean; function IsOnlyMaterial(AFlag: integer): boolean; function IsFreeMaterial(AFlag: integer): boolean; function IsSubMaterial(AFlag: integer): boolean; function IsAbstractSubMaterial(AFlag: integer): boolean; function IsMatAddTransport(AFlag: integer): boolean; //�������������� �������������� ������������ �������� (������������) function IsMatAuxResources(AFlag: integer): boolean; //��������������� ��������������� ������� (��� ��������� ������) function IsOnlyMachine(AFlag: integer): boolean; function IsFreeMachine(AFlag: integer): boolean; function IsSubMachine(AFlag: integer): boolean; function IsAbstractSubMachine(AFlag: integer): boolean; function IsExtraEM(AFlag: integer): boolean; //������� � ������������ ������������ ����� function IsSubOrExtraEmPosition(AFlag: integer): boolean; function IsOnlyLabour(AFlag: integer): boolean; function IsFreeLabour(AFlag: integer): boolean; function IsSubLabour(AFlag: integer): boolean; function IsAbstractSubLabour(AFlag: integer): boolean; function IsSubLabourOrMachine(AFlag: integer): boolean; function IsSubPirFixedPosition(AFlag: integer): boolean; function IsSubSpecPosition(AFlag: integer): boolean; //����������� ������ - �� ��������, �� ������, �� ����������� implementation function IsAbstractPosition(AFlag: integer): boolean; begin Result:=AFlag and ef_Abstract>0; end; function IsSubPosition(AFlag: integer): boolean; begin Result:=AFlag and ef_Subposition>0; end; function IsAbstractSubPosition(AFlag: integer): boolean; begin Result:=AFlag and (ef_Abstract or ef_Subposition)=ef_Abstract or ef_Subposition; end; function MayBeMainPosition(AFlag: integer): boolean; begin //Result:=(AFlag and (ef_SubPosition or ef_ZP)=ef_ZP) or (AFlag=0); Result:=(AFlag and (ef_SubPosition or ef_ZP or ef_EM)=ef_ZP or ef_EM) or (AFlag=0) or (AFlag=ef_ResPos) or (AFlag and (ef_SubPosition or ef_Pir)=ef_Pir); end; function IsCommentPosition(AFlag: Integer): Boolean; begin Result := AFlag and ef_Comment = ef_Comment; end; function IsOnlyMaterial(AFlag: integer): boolean; begin // Result:=(AFlag and (ef_ZP+ef_EM+ef_ZT)=0) and (AFlag and (ef_Pir or ef_Mat)=ef_Mat); //ef_ZT ����� ���� � ��������� � ef_Mat ��� ���������� ��������������� �������� ��� ���������� ������ Result:=(AFlag and (ef_ZP or ef_EM)=0) and (AFlag and (ef_Pir or ef_Integrate or ef_Mat)=ef_Mat); //ef_Mat ������������ � ��� ��� ����������� ��� ��� ������ � ef_Integrate end; function IsFreeMaterial(AFlag: integer): boolean; begin Result:=IsOnlyMaterial(AFlag) and (not IsSubPosition(AFlag)); end; function IsSubMaterial(AFlag: integer): boolean; var F: integer; begin Result:=IsOnlyMaterial(AFlag) and IsSubposition(AFlag); end; function IsAbstractSubMaterial(AFlag: integer): boolean; begin Result:=IsSubMaterial(AFlag) and (AFlag and ef_Abstract=ef_Abstract); end; function IsMatAddTransport(AFlag: integer): boolean; begin Result:=IsOnlyMaterial(AFlag) and (AFlag and (ef_Pir or ef_Pioneering)=ef_Pioneering); //ef_Pioneering ��� �� ��� � ��������� � ������ ��������� ������������ ��� ����������� �������������� ��������� ���������� � ������������ end; function IsMatAuxResources(AFlag: integer): boolean; begin Result:=IsOnlyMaterial(AFlag) and (AFlag and (ef_Pir or ef_ZT)=ef_ZT); //ef_ZP � ef_ZT ������������ � ��� ��� ����������� ������� �� ����������� end; function IsOnlyMachine(AFlag: integer): boolean; begin Result:=(AFlag and (ef_ZP+ef_Mat+ef_ZT)=0) and (AFlag and (ef_Pir or ef_Integrate or ef_EM)=ef_EM); //ef_EM ���� � ��� �� ������������, �� ��� ����� ���� end; function IsFreeMachine(AFlag: integer): boolean; begin Result:=IsOnlyMachine(AFlag) and (not IsSubPosition(AFlag)); end; function IsSubMachine(AFlag: integer): boolean; var F: integer; begin Result:=IsOnlyMachine(AFlag) and IsSubPosition(AFlag); end; function IsAbstractSubMachine(AFlag: integer): boolean; begin Result:=(AFlag and ef_Abstract>0) and IsSubMachine(AFlag); end; function IsExtraEM(AFlag: integer): boolean; begin Result:=IsOnlyMachine(AFlag) and (AFlag and (ef_Pir or ef_Pioneering)=ef_Pioneering); //ef_Pioneering ��� �� ��� � �������� � ������� ������ ������������ ��� ����������� ������� � ������������ ������������ ����� end; function IsSubOrExtraEmPosition(AFlag: integer): boolean; begin Result := IsSubPosition(AFlag) or IsExtraEM(AFlag); end; function IsOnlyLabour(AFlag: integer): boolean; begin Result:=(AFlag and (ef_EM+ef_Mat+ef_ZT)=0) and (AFlag and (ef_Pir or ef_Integrate or ef_ZP)=ef_ZP); //ef_ZP � ef_ZT ������������ � ��� ��� ����������� ������� �� ����������� end; function IsFreeLabour(AFlag: integer): boolean; begin Result:=IsOnlyLabour(AFlag) and (not IsSubPosition(AFlag)); end; function IsSubLabour(AFlag: integer): boolean; var F: integer; begin Result:=IsOnlyLabour(AFlag) and IsSubPosition(AFlag); end; function IsAbstractSubLabour(AFlag: integer): boolean; begin Result:=(AFlag and ef_Abstract>0) and IsSubLabour(AFlag); end; function IsSubLabourOrMachine(AFlag: integer): boolean; begin Result:=IsSubLabour(AFlag) or IsSubMachine(AFlag); end; function IsSubPirFixedPosition(AFlag: integer): boolean; begin Result := (AFlag and (ef_Pir or ef_Subposition) = (ef_Pir or ef_Subposition)) and (AFlag and (ef_Integrate {or ef_ZT or ef_ZP} or ef_Mat) > 0); end; function IsSubSpecPosition(AFlag: integer): boolean; begin Result := IsSubPosition(AFlag) and not IsOnlyMaterial(AFlag) and not IsOnlyMachine(AFlag) and not IsOnlyLabour(AFlag); end; end.