Skip to content

Commit

Permalink
Version 12.0.3-ii
Browse files Browse the repository at this point in the history
  • Loading branch information
papyrussolution committed May 28, 2024
1 parent 38547ad commit b9a07a8
Show file tree
Hide file tree
Showing 18 changed files with 317 additions and 286 deletions.
23 changes: 16 additions & 7 deletions Src/Include/Db.h
Original file line number Diff line number Diff line change
Expand Up @@ -4810,28 +4810,36 @@ struct SDataPageHeader {
};

class SRecPageManager {
public:
//
// Структура RowId:
// | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
// 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// 6 5 4 3 2 1 0
// | | |
// reserve offs bits
// | | | | |
// reserve pobw page sequence number offset in the page
//
// Общий размер типа: 64 бита
// Старшие 16 бит - зарезервированы
// Следующие старшие 4 бита - индикатор битовой ширины поля смещения внутри страницы.
// Битовая ширина смещения может быть от 9 до 24 бит (0: 9, 1: 10, 15: 24)
// Битовую ширину поля смещения назовем pobw (page offset bit-width)
// Само смещение внутри страницы задается со сдвигом в 32 поскольку заголовок
// страницы длиной 32 байта не участвует в распределении рабочих блоков.
// Таким образом максимальная длина страницы = 2^(24+5)
// Следующие старшие (64-4-pobw) бит - номер страницы.
// Самые младшие pobw бит - смещение внутри страницы
//
static constexpr uint RowIdBitWidth = 48;
static FORCEINLINE uint GetPageBits(uint offsetBits) { return (RowIdBitWidth - offsetBits - 4/*pobw*/); }
//
// Descr: Вспомогательная функция, определяющая битовую ширину поля смещения в идентификаторе
// блока записи. Функция принимает опциональный проверочный аргумент pageSize.
// Если pageSize != 0, то функция одновременно извлекает битовую ширину смещения из rowid
// и вычисляет ее исходя из размера страницы. Если полученные два значения не равны,
// то возвращает 0 (error).
//
static uint Helper_SplitRowId_GetOffsetBits(uint64 rowId, uint pageSize);
public:
static uint64 MakeRowId(uint pageSize, uint pageSeq, uint offset);
static int SplitRowId(uint64 rowId, uint pageSize, uint * pPageSeq, uint * pOffset);
static int SplitRowId_WithPageSizeCheck(uint64 rowId, uint pageSize, uint * pPageSeq, uint * pOffset);
static int SplitRowId(uint64 rowId, uint * pPageSeq, uint * pOffset);
SRecPageManager(uint32 pageSize);
~SRecPageManager();
int Write(uint64 * pRowId, uint pageType, const void * pData, size_t dataLen);
Expand All @@ -4847,6 +4855,7 @@ class SRecPageManager {
SDataPageHeader * AllocatePage(uint32 type);
SDataPageHeader * QueryPageForReading(uint64 rowId, uint32 pageType, uint * pOffset);
int ReleasePage(SDataPageHeader * pPage);
int WriteToPage(SDataPageHeader * pPage, uint64 rowId, const void * pData, size_t dataLen);

const uint32 PageSize;
uint32 LastSeq;
Expand Down
12 changes: 12 additions & 0 deletions Src/Include/Pp.h
Original file line number Diff line number Diff line change
Expand Up @@ -22030,6 +22030,18 @@ class PPSyncCashSession {
int Status; // tag 2109 Сведения о статусе товара (ofdtag-2109)
*/
static void LogPreprocessChZnCodeResult(int ret, int op, const char * pCode, double qtty, const CCheckPacket::PreprocessChZnCodeResult & rResult);

enum {
ppchzcopCheck = 0, // проверка марки
ppchzcopAccept = 1, // акцепт марки. должна быть вызвана непосредственно после вызова PreprocessChZnCode(0, ...)
ppchzcopReject = 2, // отказ от акцепта марки. должна быть вызвана непосредственно после вызова PreprocessChZnCode(0, ...)
ppchzcopInit = 100, // предварительные операции перед проверкой марок по чеку. Может быть актуально для некоторых типов регистраторов
ppchzcopSurrogateCheck = 101, // фиктивная проверка марки в специальных случаях (draftbeer horeca) // @v11.9.4
ppchzcopSurrogateAccept = 102, // фиктивный акцепт марки в специальных случаях (draftbeer horeca) // @v11.9.4
ppchzcopCancel = 103, // @v12.0.4 Функция отмены после проверки марок. Применяется в паре с ppchzcopInit если операция инициализации
// провела какие-то действия, которые требуется отменить в случае, если чек не проводится.
// Фактически, эта операция введена ради аппарата Штрих-ФР из-за того, что проверку марок он осущетсвляет только в режиме открытого чека.
};
//
// Descr: Функция реализует препроцессинг кодов маркировки товаров в соответствии с российскими правилами ОФД 1.2
// ARG(op IN):
Expand Down
3 changes: 3 additions & 0 deletions Src/Include/SLIB.H
Original file line number Diff line number Diff line change
Expand Up @@ -7732,6 +7732,9 @@ public:
#endif
static FORCEINLINE uint32 Rotr(ulong x, uint n) { return Rotr((uint32)x, n); }
static FORCEINLINE uint32 Rotl(ulong x, uint n) { return Rotl((uint32)x, n); }
//
static FORCEINLINE uint32 CeilLog2(uint32 x) { return x ? (32 - Clz(x - 1)) : 0; } // @v12.0.4
static FORCEINLINE uint64 CeilLog2(uint64 x) { return x ? (64 - Clz(x - 1)) : 0; } // @v12.0.4
};
//
// Encrypt / Decrypt functions
Expand Down
11 changes: 3 additions & 8 deletions Src/OSF/openjpeg/src/lib/openjp2/t2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,24 +1218,19 @@ static boolint opj_t2_read_packet_header(opj_t2_t* p_t2,
}
}
n = (int32_t)l_cblk->numnewpasses;

if((p_tcp->tccps[p_pi->compno].cblksty & J2K_CCP_CBLKSTY_HT) != 0)
do {
uint32_t bit_number;
l_cblk->segs[l_segno].numnewpasses = l_segno == 0 ? 1 : (uint32_t)n;
bit_number = l_cblk->numlenbits + opj_uint_floorlog2(
l_cblk->segs[l_segno].numnewpasses);
bit_number = l_cblk->numlenbits + opj_uint_floorlog2(l_cblk->segs[l_segno].numnewpasses);
if(bit_number > 32) {
opj_event_msg(p_manager, EVT_ERROR,
"Invalid bit number %d in opj_t2_read_packet_header()\n",
bit_number);
opj_event_msg(p_manager, EVT_ERROR, "Invalid bit number %d in opj_t2_read_packet_header()\n", bit_number);
opj_bio_destroy(l_bio);
return FALSE;
}
l_cblk->segs[l_segno].newlen = opj_bio_read(l_bio, bit_number);
JAS_FPRINTF(stderr, "included=%d numnewpasses=%d increment=%d len=%d \n",
l_included, l_cblk->segs[l_segno].numnewpasses, l_increment,
l_cblk->segs[l_segno].newlen);
l_included, l_cblk->segs[l_segno].numnewpasses, l_increment, l_cblk->segs[l_segno].newlen);
n -= (int32_t)l_cblk->segs[l_segno].numnewpasses;
if(n > 0) {
++l_segno;
Expand Down
26 changes: 7 additions & 19 deletions Src/OSF/openjpeg/src/lib/openjp2/tcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,40 +931,28 @@ static INLINE boolint opj_tcd_init_tile(opj_tcd_t * p_tcd, uint32_t p_tile_no, b
/* BUG_WEIRD_TWO_INVK (look for this identifier in dwt.c): */
/* the test (!isEncoder && l_tccp->qmfbid == 0) is strongly */
/* linked to the use of two_invK instead of invK */
const int32_t log2_gain = (!isEncoder &&
l_tccp->qmfbid == 0) ? 0 : (l_band->bandno == 0) ? 0 :
(l_band->bandno == 3) ? 2 : 1;

const int32_t log2_gain = (!isEncoder && l_tccp->qmfbid == 0) ? 0 : (l_band->bandno == 0) ? 0 : (l_band->bandno == 3) ? 2 : 1;
/* Nominal dynamic range. Equation E-4 */
const int32_t Rb = (int32_t)l_image_comp->prec + log2_gain;

/* Delta_b value of Equation E-3 in "E.1 Inverse quantization
* procedure" of the standard */
l_band->stepsize = (float)(((1.0 + l_step_size->mant / 2048.0) * pow(2.0,
(int32_t)(Rb - l_step_size->expn))));
l_band->stepsize = (float)(((1.0 + l_step_size->mant / 2048.0) * pow(2.0, (int32_t)(Rb - l_step_size->expn))));
}

/* Mb value of Equation E-2 in "E.1 Inverse quantization
* procedure" of the standard */
l_band->numbps = l_step_size->expn + (int32_t)l_tccp->numgbits -
1;

l_band->numbps = l_step_size->expn + (int32_t)l_tccp->numgbits - 1;
if(!l_band->precincts && (l_nb_precincts > 0U)) {
l_band->precincts = (opj_tcd_precinct_t*)opj_malloc(/*3 * */
l_nb_precinct_size);
l_band->precincts = (opj_tcd_precinct_t*)opj_malloc(/*3 * */ l_nb_precinct_size);
if(!l_band->precincts) {
opj_event_msg(manager, EVT_ERROR,
"Not enough memory to handle band precints\n");
opj_event_msg(manager, EVT_ERROR, "Not enough memory to handle band precints\n");
return FALSE;
}
/*fprintf(stderr, "\t\t\t\tAllocate precincts of a band (opj_tcd_precinct_t):
%d\n",l_nb_precinct_size); */
/*fprintf(stderr, "\t\t\t\tAllocate precincts of a band (opj_tcd_precinct_t):%d\n",l_nb_precinct_size); */
memzero(l_band->precincts, l_nb_precinct_size);
l_band->precincts_data_size = l_nb_precinct_size;
}
else if(l_band->precincts_data_size < l_nb_precinct_size) {
opj_tcd_precinct_t * new_precincts = (opj_tcd_precinct_t*)opj_realloc(
l_band->precincts, /*3 * */ l_nb_precinct_size);
opj_tcd_precinct_t * new_precincts = (opj_tcd_precinct_t*)opj_realloc(l_band->precincts, /*3 * */ l_nb_precinct_size);
if(!new_precincts) {
opj_event_msg(manager, EVT_ERROR, "Not enough memory to handle band precints\n");
SAlloc::F(l_band->precincts);
Expand Down
23 changes: 1 addition & 22 deletions Src/PPEquip/Crcshsrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,28 +703,6 @@ int ACS_CRCSHSRV::Helper_ExportGoods_V10(const int mode, bool goodsIdAsArticle,
if(oneof2(mode, 0, 1)) { // @v10.6.7
p_writer->PutElement("name", r_cur_entry.Name);
{
// @v11.4.4 {
/* @v11.4.5 if(goodsIdAsArticle) {
// @v10.9.11 {
if(r_cur_entry.Flags_ & AsyncCashGoodsInfo::fGMarkedType) {
const char * p_mark_type = 0;
switch(r_cur_entry.ChZnProdType) {
case GTCHZNPT_SHOE: p_mark_type = "FOOTWEAR"; break;
case GTCHZNPT_TEXTILE: p_mark_type = "LIGHT_INDUSTRY"; break;
case GTCHZNPT_CARTIRE: p_mark_type = "TYRES"; break;
case GTCHZNPT_PERFUMERY: p_mark_type = "PERFUMES"; break;
case GTCHZNPT_MILK: p_mark_type = "MILK"; break;
}
if(p_mark_type)
p_writer->PutElement("mark-type", p_mark_type);
}
// } @v10.9.11
p_writer->StartElement("bar-code", "code", temp_buf.Z().Cat(r_cur_entry.ID));
p_writer->PutElement("count", temp_buf.Z().Cat("1"));
p_writer->PutElement("default-code", true);
p_writer->EndElement(); // </bar-code>
}*/
// } @v11.4.4
for(uint i = 0; i < barcodes.getCount(); i++) {
BarcodeTbl::Rec bc = barcodes.at(i);
if(sstrlen(bc.Code)) {
Expand All @@ -742,6 +720,7 @@ int ACS_CRCSHSRV::Helper_ExportGoods_V10(const int mode, bool goodsIdAsArticle,
case GTCHZNPT_MILK: p_mark_type = "MILK"; break;
case GTCHZNPT_WATER: p_mark_type = "WATER"; break; // @v11.5.6
case GTCHZNPT_DRAFTBEER: p_mark_type = "DRAFT_BEER"; break; // @v11.9.2
case GTCHZNPT_BEER: p_mark_type = "BEER"; break; // @v12.0.4
}
if(p_mark_type)
p_writer->PutElement("mark-type", p_mark_type);
Expand Down
6 changes: 3 additions & 3 deletions Src/PPEquip/EquipDll/Pirit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2550,7 +2550,6 @@ int PiritEquip::RunCheck(int opertype)
CreateStr("", in_data); // #13 (tag 1073) Телефон(ы) платежного агента (для пл.агента/субагента, иначе пустой)
CreateStr("", in_data); // #14 (tag 1074) Телефон(ы) оператора по приему платежей (для пл.агента/субагента, иначе пустой)
CreateStr("030"/*GTCHZNPT_DRAFTBEER*/, in_data); // #15 (tag 1262) Идентификатор ФОИВ. Значение определяется ФНС РФ. Параметр используется только при регистрации ККТ в режиме ФФД 1.2.

// @v11.9.3 str.Z().Cat(checkdate(Check.Timestamp.d) ? Check.Timestamp.d : getcurdate_(), DATF_DMY|DATF_NODIV|DATF_CENTURY); // @v11.2.3 // @v11.2.7
str.Z().Cat("26032022"); // @v11.9.3
//str.Z().Cat(checkdate(Check.Timestamp.d) ? Check.Timestamp.d : getcurdate_(), DATF_DMY | DATF_NODIV | DATF_CENTURY);
Expand All @@ -2567,7 +2566,8 @@ int PiritEquip::RunCheck(int opertype)
// Параметр используется только при регистрации ККТ в режиме ФФД 1.2.
// @v11.2.3 {
{
str.Z();
// @v12.0.4 str.Z();
str.Z().Cat("mode=horeca"); // @v12.0.4
CreateStr(str, in_data); // #18 (tag 1265) Значение отраслевого реквизита. Значение определяется отраслевым НПА.
// Параметр используется только при регистрации ККТ в режиме ФФД 1.2.
}
Expand Down Expand Up @@ -2687,7 +2687,7 @@ int PiritEquip::RunCheck(int opertype)
CreateStr(str, in_data); // #15 (tag 1262) Идентификатор ФОИВ. Значение определяется ФНС РФ. Параметр используется только при регистрации ККТ в режиме ФФД 1.2.
}
// @v11.9.3 str.Z().Cat(checkdate(Check.Timestamp.d) ? Check.Timestamp.d : getcurdate_(), DATF_DMY|DATF_NODIV|DATF_CENTURY); // @v11.2.3 // @v11.2.7
str.Z().Cat("26.03.2022"); // @v11.9.3 // @v12.0.3 @fix "26032022"-->"26.03.2022"
str.Z().Cat("26032022"); // @v11.9.3
CreateStr(str, in_data); // #16 (tag 1263) Дата документа основания. Допускается дата после 1999 года.
// Должен содержать сведения об НПА отраслевого регулирования. Параметр используется только при регистрации ККТ в режиме ФФД 1.2.
/* @v11.9.3 if(Check.CheckNum > 0)
Expand Down
Loading

0 comments on commit b9a07a8

Please sign in to comment.