Пример #1
0
void WriteContourSpec(const PSC_ContourSpec& contourSpec)
{
    const int scalarVer = 2; // added mitreLine
//    const int scalarVer = 1; // added master override
//    const int scalarVer = 0;
    WriteInt(scalarVer);
    WriteLine();

    WriteFuncObjRef(contourSpec.dataObjRef);
    WriteFuncObjRef(contourSpec.specMasterObjRef);

    WriteBool(contourSpec.specIsMaster);
    WriteBool(contourSpec.calcIncVal);
    WriteBool(contourSpec.doLogInc);

    SetRealConvFormat(SC_RealFormat(ncf_Scientific, 8));
    WriteDouble(contourSpec.startVal);
    WriteDouble(contourSpec.endVal);
    WriteDouble(contourSpec.incVal);
    WriteInt(contourSpec.nIncs);

    WriteInt(contourSpec.contourLineSpec.linePen);
    WriteInt(contourSpec.contourLineSpec.lineThickness);
    WriteInt(contourSpec.contourLineSpec.lineType);
    WriteBool(contourSpec.contourLineSpec.mitreLines); // v2
    WriteBool(contourSpec.overrideMasterLineSpec);

    WriteLegendOverride(contourSpec.legendGC);
}
Пример #2
0
void WriteColorLegendSpec(const PSC_ColorLegendSpec& legendSpec)
{
    const int specVer = 0;
    WriteInt(specVer);
    WriteLine();

    WriteFuncObjRef(legendSpec.colorLegendObjRef);

    SetRealConvFormat(SC_RealFormat(ncf_Decimal, 3));
    WriteDouble(legendSpec.barLength    );
    WriteDouble(legendSpec.barAspect    );
    WriteLine();

    WriteInt(int(legendSpec.orientation));
    WriteBool(legendSpec.ticsAtIncs );
    WriteBool(legendSpec.dataTypeLabel );
    WriteLine();

    WriteBool(legendSpec.dataLabelAboveLeft);
    WriteBool(legendSpec.incLabelAboveLeft);
    WriteBool(legendSpec.overrideLabel);
    WriteLine();

    WriteText(legendSpec.newLabel);
}
Пример #3
0
 void  WriteCoord(const Coord3D& fCoord)
 {
     WriteDouble(fCoord.cX);
     WriteDouble(fCoord.cY);
     WriteDouble(fCoord.cZ);
     WriteLine();
 }
Пример #4
0
void DPO_BasicSequenceFit::WriteToFile()
{
     const int objMajVer = 2;             // added field & sim reduce
//   const int objMajVer = 1;            // added coverage test & multiplier
//    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);

    // base class
    WriteFuncObjRef(simResultsObjRef);
    WriteInt(int(fitCalcType));
    WriteDouble(fitSigma);
    WriteBool(fitIsNormed);

    WriteDouble(minCoverage);           // added v1
    WriteDouble(coveragePenalty);       // added v1

    WriteBool(removeFieldDuplicates);   // v2
    WriteBool(removeSimDuplicates);
    WriteDouble(duplicateEps);


    WriteLine();

    // derived current
    WriteFuncObjRef(xyInputObjRef);
    WriteTimeLimits(timeLimits);

    WriteInterpPoints(interpPoints);
}
Пример #5
0
void SaveTIMER(SAVESTATE_t *save, timerc *time) {
	if (!time) return;
	CHUNK_t* chunk = NewChunk(save,TIMER_tag);
	WriteLong(chunk, time->tstates);
	WriteLong(chunk, time->freq);
	WriteDouble(chunk, tc_elapsed(time));
	WriteDouble(chunk, time->lasttime);
}
Пример #6
0
    void WriteThreshold(const DSC_Threshold& threshold)
    {
        static const int thVer = 0;
        WriteInt(thVer);

        WriteInt(int(threshold.minThreshold));
        WriteInt(int(threshold.maxThreshold));
        WriteDouble(threshold.minVal, SC_RealFormat(ncf_Scientific, 10));
        WriteDouble(threshold.maxVal, SC_RealFormat(ncf_Scientific, 10));
        WriteLine();
    }
Пример #7
0
void IO_ProfileSimResults::WriteOneCase(const ProfileSimCaseResults& caseRes,
                                         int&                nextRec)
{
    BufferReset(nextRec);
    WriteString(caseRes.caseID, ProfileSimCaseResults::caseIDLen);
    WriteDouble(caseRes.staticPressure);
    WriteBool(caseRes.caseDataIsExtended);

    WriteInt(caseRes.caseValues.Size());
    for (int i = 0; i < caseRes.caseValues.Size(); i++)
        WriteDouble(caseRes.caseValues[i]);

    if (!caseRes.caseDataIsExtended)
    {
        const DC_GridData& currGrid = caseRes.caseData;
        WriteString(currGrid.gridID, DC_GridData::gridIDLen);
        WriteString(currGrid.xData.dataID, DC_DataCoord::dataIDLen);
        WriteString(currGrid.yData.dataID, DC_DataCoord::dataIDLen);

        WriteBool(currGrid.xData.dataIsLog);
        WriteBool(currGrid.yData.dataIsLog);

        WriteInt(currGrid.xData.Size());
        WriteInt(currGrid.yData.Size());
        WriteDoubleArray(currGrid.xData);
        WriteDoubleArray(currGrid.yData);
        for (int i = 0; i < currGrid.Size(); i++)
            WriteDouble(currGrid[i]);
    }
    else
    {
        const ExtendedProfile& currPro = caseRes.extendedCaseData;
        WriteInt(currPro.ntotalVert);
        WriteInt(currPro.nradial);
        WriteInt(currPro.nconstantVert);
        WriteInt(currPro.nvariableVert);
//      WriteDouble(currPro.constantVertThick);  // v1
        WriteDoubleArray(currPro.constantVertZPos);
        WriteDoubleArray(currPro.nodeRadii);
        WriteInt(currPro.Size());
        for (int i = 0; i < currPro.Size(); i++)
        {
            const ExtendedProfileTimeData& currSing = currPro[i];
            WriteDouble(currSing.profileTime);
            if (currPro.nvariableVert > 0)
                WriteDoubleArray(currSing.waterTablePos);
            WriteDoubleMatrix(currSing.nodalPressures);
        }
    }


    FlushBuffer(nextRec);
}
Пример #8
0
    void WritePointArray(const SC_PointArray& pointArray)
    {
        WriteInt(pointArray.Size());
        WriteLine();

        SetRealConvFormat(SC_RealFormat(ncf_Scientific, 6));
        for (int i = 0; i < pointArray.Size(); i++)
            {
                WriteDouble(pointArray[i].pX);
                WriteDouble(pointArray[i].pY);
                WriteLine();
            }
    }
Пример #9
0
int main (void)
{
	printf ("Hello World\n");
	OpenIniFile ("Test.Ini");
#ifdef INIFILE_TEST_READ_AND_WRITE
	WriteString  ("Test", "Name", "Value");
	WriteString  ("Test", "Name", "OverWrittenValue");
	WriteString  ("Test", "Port", "COM1");
	WriteString  ("Test", "User", "James Brown jr.");
	WriteString  ("Configuration", "eDriver", "MBM2.VXD");
	WriteString  ("Configuration", "Wrap", "LPT.VXD");
	WriteInt 	 ("IO-Port", "Com", 2);
	WriteBool 	 ("IO-Port", "IsValid", 0);
	WriteDouble  ("TheMoney", "TheMoney", 67892.00241);
	WriteInt     ("Test"    , "ToDelete", 1234);
	WriteIniFile ("Test.Ini");
	printf ("Key ToDelete created. Check ini file. Any key to continue");
	while (!kbhit());
	OpenIniFile  ("Test.Ini");
	DeleteKey    ("Test"	  , "ToDelete");
	WriteIniFile ("Test.Ini");
#endif
	printf ("[Test] Name = %s\n", ReadString ("Test", "Name", "NotFound"));
	printf ("[Test] Port = %s\n", ReadString ("Test", "Port", "NotFound"));
	printf ("[Test] User = %s\n", ReadString ("Test", "User", "NotFound"));
	printf ("[Configuration] eDriver = %s\n", ReadString ("Configuration", "eDriver", "NotFound"));
	printf ("[Configuration] Wrap = %s\n", ReadString ("Configuration", "Wrap", "NotFound"));
	printf ("[IO-Port] Com = %d\n", ReadInt ("IO-Port", "Com", 0));
	printf ("[IO-Port] IsValid = %d\n", ReadBool ("IO-Port", "IsValid", 0));
	printf ("[TheMoney] TheMoney = %1.10lf\n", ReadDouble ("TheMoney", "TheMoney", 111));
	CloseIniFile ();
	return 0;
}
Пример #10
0
    void SampleStaticSupport::WriteToFile()
    {
        WriteGroupHeader(groupHeader, majorVersion, minorVersion);

        // global objects
        WriteGlobalFunc(sampResultsFO);
        WriteGlobalFunc(uncertInput);       //added v3
        WriteGlobalFunc(uncertResultsFO);   //added v3

        //  static control variables basic
        WriteInt(int(uncertType));  //added v3
        WriteBool(samplingIsLHS);
        WriteBool(specifyCorrelations);
        WriteBool(forceCorrelationsToZero);
        WriteInt(numberOfTrials);
        WriteInt(randSeed);
        WriteInt(singleRunRealization);
        WriteBool(calcDerivSpan);   //added v3
        WriteDouble(derivSpan);     //added v3
        WriteLine();

        // selected metrics - added v3
        for (int i = 0; i < UncertInput::maxMetricSel; i++)
        {
            WriteBool(uncertInput.inputMetrics[i].uncertOnMetric);
            WriteFuncObjRef(uncertInput.inputMetrics[i].metricObject);
        }
        WriteLine();

    }
Пример #11
0
void SaveSTDINT(SAVESTATE_t* save, STDINT_t *stdint) {
	int i;
	if (!stdint) return;
	CHUNK_t* chunk = NewChunk(save, STDINT_tag);
	WriteChar(chunk, stdint->intactive);

	WriteDouble(chunk, stdint->lastchk1);
	WriteDouble(chunk, stdint->timermax1);
	WriteDouble(chunk, stdint->lastchk2);
	WriteDouble(chunk, stdint->timermax2);
	for(i = 0; i < 4; i++) {
		WriteDouble(chunk, stdint->freq[i]);
	}
	WriteInt(chunk, stdint->mem);
	WriteInt(chunk, stdint->xy);
}
Пример #12
0
void DataCaptureStaticSupport::WriteDataCapture(DataCaptureSpecGlob& outDC)
{
  WriteText(outDC.dataDesig);
  WriteBool(outDC.makeDefaultDataDesig);
  WriteInt(outDC.captureType);
  WriteInt(outDC.pressureCapType);
  WriteInt(outDC.flowCapType);
  WriteInt(outDC.productionCapType);
  WriteInt(outDC.testZoneCapType);
  WriteUnitReal(outDC.radiusData);
  WriteBool(outDC.zvalueIsRatio);   // added v3
  WriteUnitReal(outDC.actualZ);   // added v3
  WriteDouble(outDC.normalizedZ);   // added v3
  WriteUnitReal(outDC.obsXLocation); // addec v4
  WriteUnitReal(outDC.obsYLocation); // addec v4

  WriteLine();            // added v5
  WriteText(outDC.wellboreZoneID);  // added v5


  WriteUnitIndex(outDC.outputUnits);
  WriteGlobalFunc(outDC.outputFO);
  WriteLine();

  WriteInt(outDC.superData.ValidSize());
  WriteLine();
  for (int i = 0; i < outDC.superData.Size(); i++)
    if (outDC.superData.IsValid(i))
      WriteSuperComponent(outDC.superData.GetRef(i));
}
Пример #13
0
 void CXmlWriter::WriteAttribute(const std::wstring& strAttributeName, double dValue)
 {
     WriteString(L" " + strAttributeName + L"=");
     WriteString(L"\"");
     WriteDouble(dValue);
     WriteString(L"\"");
 }
Пример #14
0
void CNodedMemoryBuffer::WriteDoubleField(int iFieldId, double dVal)
{
   ASSERT(IsStoring());
   WriteInt(iFieldId);
   WriteDword(sizeof(double));
   WriteDouble(dVal);
}
Пример #15
0
void DPO_PATTRN::WriteToFile()
{
    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);
    WriteFuncObjRef(indepVarObjRef);
    WriteFuncObjRef(depVarObjRef);
    WriteText(title);

    WriteText(obsStr);
    WriteText(mcRepStr);
    WriteInt(nreplicates);
    WriteInt(randSeed);
    WriteInt(nxintInp);
    WriteInt(nyintInp);
    WriteInt(nrandomPatterns);
    WriteBool(logarithms);
    WriteDouble(alphaCutoff);
    WriteInt(mtest1);
    WriteLine();
    WriteRealFormat(coeffFormat);
    WriteLine();

    WriteBool(verbose);
    WriteBool(verboseMC);
    WriteBool(verboseCV);
    WriteBool(coefficients);
    WriteBool(rankCoefficients);
    WriteLine();

    for (int i = ptCC; i < ptLastTest; i++)
        WriteBool(tests[i]);
    WriteLine();
}
Пример #16
0
void CIni::SerGetDouble(	bool bGet,double&	f,	LPCTSTR strEntry,LPCTSTR strSection/* = NULL*/,double fDefault/* = 0.0*/)
{
	if(bGet)
		f = GetDouble(strEntry,fDefault/*=NULL*/,strSection/* = NULL*/);
	else
		WriteDouble(strEntry,f, strSection/* = NULL*/);
}
size_t PlayerPositionAndLook::serialize(Buffer& _dst, size_t _offset)
{
	_pm_checkInit();
	if(_offset == 0) _dst.clear();

	_offset = WriteInt8(_dst, _offset, _pf_packetId);
	_offset = WriteDouble(_dst, _offset, _pf_x);
	_offset = WriteDouble(_dst, _offset, _pf_y);
	_offset = WriteDouble(_dst, _offset, _pf_stance);
	_offset = WriteDouble(_dst, _offset, _pf_z);
	_offset = WriteFloat(_dst, _offset, _pf_yaw);
	_offset = WriteFloat(_dst, _offset, _pf_pitch);
	_offset = WriteBool(_dst, _offset, _pf_onGround);


	return _offset;
}
Пример #18
0
 void WriteRealMSSpec(const DSC_RealMSSpec& outSpec)
 {
     SetRealConvFormat(SC_RealFormat(ncf_Scientific, 8));
     WriteBool(outSpec.valueIsMaster);
     WriteFuncObjRef(outSpec.valueMasterObjRef);
     WriteDouble(outSpec.enteredRealValue);
     WriteLine();
 }
Пример #19
0
void DPO_ExtractSASteps::WriteToFile()
{
    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);
    WriteFuncObjRef(inputTableObjRef);

    WriteBool(extractByIndexes);
    WriteInt(minIndex);
    WriteInt(maxIndex);
    WriteInt(indexIncrement);
    WriteDouble(minValue);
    WriteDouble(maxValue);
    WriteLine();

}
Пример #20
0
	__int32 MarketBuy(const std::string& symbol, const double& price, double& volume, double& amount)
	{
		MemoryBuffer buffer;
		m_channel->Initialize(buffer);

		WriteAString(symbol, buffer);
		WriteDouble(price, buffer);
		WriteDouble(volume, buffer);

		const HRESULT _status = m_channel->Invoke(1, 1, buffer);
		Throw(_status, buffer);

		volume = ReadDouble(buffer);
		amount = ReadDouble(buffer);
		auto _result = ReadInt32(buffer);
		return _result;
	}
Пример #21
0
void DataCaptureStaticSupport::WriteSuperComponent(SuperComponent& outSuper)
{
  WriteInt(outSuper.superOp);
  WriteInt(outSuper.superType);
  WriteDouble(outSuper.constantRad);
  WriteSampVar(outSuper.sampRadVal);
  WriteOptVar(outSuper.optRadVal);
  WriteVaryVar(outSuper.varyRadVal);
}
Пример #22
0
void PPD_LinLogAxis::WriteToFile()
{
    const int objMajVer = 5; //  added increment font rotation
//    const int objMajVer = 4; //  added start at first inc
//    const int objMajVer = 3; //  added cursor report formatting support
//    const int objMajVer = 2; //  added set axes support
//    const int objMajVer = 1; //  change to ver 1 with axes formatting stuff
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);

    SetRealConvFormat(SC_RealFormat(ncf_Scientific, 8));

    WriteBool  (axisData.autoScaleAxes  );
    WriteBool  (axisData.axesAreLinear  );
    WriteInt(int(axisData.incrFont.fontRotation)); //added v5

    WriteDouble(axisData.axisLinMin   );
    WriteDouble(axisData.axisLinMax   );
    WriteDouble(axisData.axisLogMin   );
    WriteDouble(axisData.axisLogMax   );
    WriteLine();

    WriteInt(int(axisData.axisMajorIncs));
    WriteBool(axisData.autoMajorIncs    );
    WriteDouble(axisData.majorIncVal    );
    WriteBool(axisData.startAtFirst ); // aded v4
    WriteLine();

    WriteInt(int(axisData.axisMinorIncs));
    WriteBool(axisData.autoMinorIncs    );
    WriteInt(axisData.nminorPerMajor    );
    WriteLine();

    WriteInt(axisData.axisIncFormat.format         );
    WriteInt(axisData.axisIncFormat.digitsPrecision);
    WriteInt(axisData.cursorReportFormat.format         ); // added v3
    WriteInt(axisData.cursorReportFormat.digitsPrecision);
    WriteLine();

    // set axes limits/type only -- added v1
    WriteBool  (setaxisData.axesAreLinear  );
    WriteDouble(setaxisData.axisLinMin   );
    WriteDouble(setaxisData.axisLinMax   );
    WriteDouble(setaxisData.axisLogMin   );
    WriteDouble(setaxisData.axisLogMax   );
    WriteLine();

}
Пример #23
0
void PPO_DataLabels::WriteToFile()
{
    const int objMajVer = 1;   // increased max data labels to 16
//    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);
    PPO_AnnoBase::WriteToFile();

    WriteFuncObjRef(penSetObjRef);

    for ( int i = 0; i < PFO_DataLabels::maxDataLabels; i++)
    {
        WriteFuncObjRef(labelData[i].labelObjRef);
        WriteBool(labelData[i].doLabel);
        WriteInt(int(labelData[i].labAlign));

        WriteBool(labelData[i].overrideFormat);
        WriteInt(int(labelData[i].labelFormat.format));
        WriteInt(labelData[i].labelFormat.digitsPrecision);
        WriteBool(labelData[i].overrideMainLabel);
        WriteLine();

        WriteText(labelData[i].mainLabel);
        WriteText(labelData[i].unitsLabel);
    }

    SetRealConvFormat(SC_RealFormat(ncf_Decimal, 3));
    WriteDouble(ulLocation.pX);
    WriteDouble(ulLocation.pY);
    WriteLine();

    WriteText(legendTitle);

    WriteBool(frameLegend);
    WriteInt (frameThick);
    WriteBool(opaqueBackground);
    WriteInt (legendPen);
    WriteInt (minDataFieldWidth);
    WriteLine();

    WriteFont(legendFont);
}
Пример #24
0
size_t Explosion::serialize(Buffer& _dst, size_t _offset)
{
	_pm_checkInit();
	if(_offset == 0) _dst.clear();

	_offset = WriteInt8(_dst, _offset, _pf_packetId);
	_offset = WriteDouble(_dst, _offset, _pf_x);
	_offset = WriteDouble(_dst, _offset, _pf_y);
	_offset = WriteDouble(_dst, _offset, _pf_z);
	_offset = WriteFloat(_dst, _offset, _pf_radius);
	_offset = WriteInt32(_dst, _offset, _pf_recordCount);
	_offset = WriteByteArray(_dst, _offset, _pf_records);
	_offset = WriteFloat(_dst, _offset, _pf_playerMotionX);
	_offset = WriteFloat(_dst, _offset, _pf_playerMotionY);
	_offset = WriteFloat(_dst, _offset, _pf_playerMotionZ);


	return _offset;
}
Пример #25
0
void WriteHistogram(const PSC_Histogram& histogram)
{
    WriteEdgeSpec(histogram);
    const int specVer = 1;   // added indexOffset
//    const int specVer = 0;
    WriteInt(specVer);
    WriteLine();
    WriteBool(histogram.orientationX);
    WriteBool(histogram.baselineIsValue);
    WriteDouble(histogram.baselineValue);
    WriteBool(histogram.positionIsValue);
    WriteInt(int(histogram.widthSpec));
    WriteInt(histogram.widthLineThk);
    WriteDouble(histogram.widthSpecValue);
    WriteInt(histogram.widthSpecPixel);
    WriteDouble(histogram.widthSpecPct);
    WriteDouble(histogram.indexOffset);
    WriteLine();
}
Пример #26
0
void DPO_XYRemoveDuplicate::WriteToFile()
{
    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);
    WriteFuncObjRef(xyInputObjRef);
    WriteLine();
    WriteText(outputDesc);

    WriteBool(removeDuplicateXValues);
    WriteInt(yValueToKeepOp);
    WriteDouble(duplicateXLimit, SC_SciFormat(10));
    WriteBool(removeOutOfSeq);
    WriteBool(removeDuplicateYValues);
    WriteDouble(duplicateYLimit, SC_SciFormat(10));

    WriteLine();
}
Пример #27
0
void cProtocol161::SendPlayerMaxSpeed(void)
{
	cCSLock Lock(m_CSPacket);
	WriteByte(PACKET_ENTITY_PROPERTIES);
	WriteInt(m_Client->GetPlayer()->GetUniqueID());
	WriteInt(1);
	WriteString("generic.movementSpeed");
	WriteDouble(m_Client->GetPlayer()->GetMaxSpeed());
	Flush();
}
Пример #28
0
void DPO_XYReduction::WriteToFile()
{
    const int objMajVer = 1;  // added log change
//    const int objMajVer = 0;
    const int objMinVer = 0;

    WriteObjectHeader(objMajVer, objMinVer);
    WriteFuncObjRef(xyInputObjRef);
    WriteLine();
    WriteText(outputDesc);

    WriteInt(dataReductionOperation);
    WriteInt(pointSkipInterval);
    WriteDouble(maxXChange, SC_SciFormat(10));
    WriteDouble(maxYChange, SC_SciFormat(10));
    WriteBool(logXChange);
    WriteBool(logYChange);
    WriteLine();
}
Пример #29
0
void WriteAnnoSpec(const PSC_AnnoSpec& annoSpec)
{
    const int specVer = 0;
    WriteInt(specVer);
    WriteLine();

    SetRealConvFormat(SC_RealFormat(ncf_Decimal, 3));
    WriteDouble(annoSpec.ulLocation.pX);
    WriteDouble(annoSpec.ulLocation.pY);
    WriteLine();

    WriteText(annoSpec.legendTitle);

    WriteBool(annoSpec.frameLegend);
    WriteInt (annoSpec.frameThick);
    WriteBool(annoSpec.opaqueBackground);
    WriteInt (annoSpec.legendPen);

    WriteFont(annoSpec.legendFont);
}
Пример #30
0
void WriteEdgeSpec(const PSC_EdgeSpec& edgeSpec)
{
    static const int edgeVer = 0;
    WriteInt(edgeVer);

    WriteBool(edgeSpec.plotEdges);
    WriteInt(edgeSpec.edgePen       );
    WriteInt(edgeSpec.edgeThk       );
    WriteDouble(edgeSpec.edgePolyOffset, SC_RealFormat(ncf_Scientific, 2));
    WriteLine();
}