|
There are mathematical formulas for these which can be simply implemented as C code.
The gauge pressure formula should be provided by the manufacturer of the gauge because it contains gauge specific constants.
Calculating pressure from depth is rather seldom in the oceanographic area. Depth sensors are measuring pressure and the pressure value itself is recorded in dbar (because 1 dbar corresponds to about 1 metre). To get the absolute pressure these sensors usually measure the offset (air pressure) before deployed and subtract this offset from all under water measurements. The advantage of this method is that this eliminates also offset drift errors.
See the Unesco technical papers in marine Science 44: Algorithms for computation of fundamental properties of seawater (PDF)[^] for formulas.
Some of them might be required for the gauge pressure calculation.
It contains also a formula for calculating depth from pressure in seawater which is shown on his own also at Code10[^].
|
|
|
|
|
roh = mgh obviously.
Now you need to know the thickness of the air at any point on the planets surface and adjust for air pressure.
|
|
|
|
|
I am developing a native C++ DLL and unit tests for this DLL. When I try to launch a test, I always get the above mentioned message.
At first glance it seems that a DLL or some DLLs can not be found. However, the unit test DLL is created in the same folder as the DLL to be tested. The working directory is exactly the same as the directory the DLLs reside in. Therefore, this reason can be ruled out.
The IDE is Microsoft Visual Studio 2013 update 4 and the operating system is Windows 10.
How can I get my unit test running? I hope I do not need to bother with command line tools or build scripts.
|
|
|
|
|
Did you see this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
That link is broken. You should quote what 'this' is...
|
|
|
|
|
59 pages into this thread, and 18 months later? Thanks but I'll pass. The link was relevant at the time the OP needed it.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Misread the date but I meant you should (as in its practical to) quote what you're looking at in a link in case the link goes away (as it surely will) people still get context after Microsoft or who ever removes there site down the line.
|
|
|
|
|
Hello everyone!
How could I save the value of a member variable (int m_nCon) in the same text file where I have already save the content of a list control(declared as m_List)?? For the list control I used WriteString(). For the integer member variable I want to save, I used
file.Write(&m_nCon, sizeof(int)); but I got only a big blank space :/ Here is the code:
void CDataDialog::OnBnClickedOk()
{
CStdioFile file(L"sample.txt", CFile::modeCreate |
CFile::modeWrite);
int nCount = m_List.GetItemCount();
for (int x = 0; x < nCount; x++)
{
CString strText1 = m_List.GetItemText(x, 1);
file.WriteString(strText1);
file.WriteString(_T("\n"));
CString strText2 = m_List.GetItemText(x, 2);
file.WriteString(strText2);
file.WriteString(_T("\n"));
}
file.Close();
}
|
|
|
|
|
If you used Write() to write the integer and then used something like Notepad to view the file, it will indeed not look like you'd expect. This is a difference between "binary" and "text" files.
Try something like:
CString s;
s.Format(_T("%d\n"), m_nCon);
file.WriteString(s);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
It worked!!I didn't know the difference! Thank you very much for your answer and the explication!!
|
|
|
|
|
To write list control records into text file use structure
you can write and read entire row of list control.
it will be better to seek the file pointer while reading and writing
|
|
|
|
|
Hi i created a Combobox Button in toolbar. It working fine in my machine. But when i testing it on other machines not all but some with win 10 and 7. It case to stop running application.
ON_REGISTERED_MESSAGE(AFX_WM_RESETTOOLBAR, OnToolbarReset)
LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM)
{
UINT uiToolBarId = (UINT)wp;
switch (uiToolBarId)
{
case IDR_MAINFRAME:
case IDR_MAINFRAME_256:
{
CMFCToolBarComboBoxButton comboButton(ID_COMBO, GetCmdMgr()->GetCmdImage(ID_COMBO, FALSE), CBS_DROPDOWNLIST);
comboButton.AddItem(_T("opt 1"));
comboButton.AddItem(_T("opt 2"));
comboButton.AddItem(_T("opt 3"));
comboButton.SelectItem(0);
m_wndToolBar.ReplaceButton(ID_COMBO, comboButton);
}
break;
}
return 0;
}
Im out of ideas How to make it working.
modified 24-Mar-17 9:49am.
|
|
|
|
|
vojtee wrote: How to make it working. The first thing you need to do is to find out why it is "not working", and explain exactly what "not working" means. Without that information it is impossible to help.
|
|
|
|
|
I cant describe it better than not working .
So i have 2 application. In first app that code is included and in second app that code is not included. First application don't work on some machines but on thers works fine.
Windows do not generate any error. It just start and close immediately.
Second app working fine everywhere.
|
|
|
|
|
Well I am sorry but it is impossible to guess what your code is doing. You have the source code so you need to add some debugging to your program to find out where it is going wrong.
|
|
|
|
|
Put some traces inside your code, so you can know what is going wrong at some PC.
|
|
|
|
|
Hello everyone,
I have created an editable list control (report style) with numbers. How could I save all content of list in a text file, each edited "number" below the other. I tried something like this:
void CDataDialog::OnOK()
{
CWnd* pwndCtrl = GetFocus();
int ctrl_ID = pwndCtrl->GetDlgCtrlID();
CString str;
ofstream outFile;
outFile.open("sample.txt");
switch (ctrl_ID)
{
case IDC_EDIT1:
GetDlgItemText(IDC_EDIT1, str);
for (int i = 1; i <= m_nCon; i++)
{
outFile << str <<endl;
outFile << m_nCon << endl;
}
outFile.close();
SetCell(::GetDlgItem(m_hWnd, IDC_LIST1),
str, nItem, nSubItem);
::SendDlgItemMessage(m_hWnd, IDC_EDIT1,
WM_KILLFOCUS, 0, 0);
::ShowWindow(::GetDlgItem(m_hWnd, IDC_EDIT1),
SW_HIDE);
break;
default:
break;
}
}
but by this way I can save only the last edited item in text file. Thank you in advance!!
|
|
|
|
|
Something like:
CStdioFile file("sample.txt", CFile::modeCreate);
int nCount = listControl.GetItemCount();
for (int x = 0; x < nCount; x++)
{
CString strText = listControl.GetItemText(x, 0);
file.WriteString(strText);
}
file.Close();
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I wrote this:
void CDataDialog::OnBnClickedOk()
{
CStdioFile file("over1.txt", CFile::modeCreate);
int nCount = m_List.GetItemCount();
for (int x = 0; x < nCount; x++)
{
CString strText = m_List.GetItemText(x, 0);
file.WriteString(strText);
}
file.Close();
}
and when execute it I get this statement: "Debug assertion failed". Is this because I already use CString CDataDialog::GetItemText(HWND hWnd, int nItem, int nSubItem) const??? Sorry I didn't mention it in the first post.
CString CDataDialog::GetItemText(
HWND hWnd, int nItem, int nSubItem) const
{
LVITEM lvi;
memset(&lvi, 0, sizeof(LVITEM));
lvi.iSubItem = nSubItem;
CString str;
int nLen = 128;
int nRes;
do
{
nLen *= 2;
lvi.cchTextMax = nLen;
lvi.pszText = str.GetBufferSetLength(nLen);
nRes = (int)::SendMessage(hWnd,
LVM_GETITEMTEXT, (WPARAM)nItem,
(LPARAM)&lvi);
} while (nRes == nLen - 1);
str.ReleaseBuffer();
return str;
}
|
|
|
|
|
lolici wrote: ...and when execute it I get this statement: "Debug assertion failed". You'll need to step through the code using the debugger to find the line that is asserting.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
The problem is here:
int nCount = m_List.GetItemCount();
I need another function than GetItemCount?
|
|
|
|
|
That line is NOT asserting. You need to step into the GetItemCount() method (until you find an ASSERT() macro).
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
lolici wrote: I wrote this:
void CDataDialog::OnBnClickedOk()
{
CStdioFile file("over1.txt", CFile::modeCreate);
<pre>
<span class="code-keyword">int</span> nCount = m_List.GetItemCount();</pre></blockquote>
What is m_List? Where and how is it defiled/initialized?
lolici wrote: CString CDataDialog::GetItemText(
HWND hWnd, int nItem, int nSubItem) const
{
LVITEM lvi;
memset(&lvi, 0, sizeof(LVITEM));
lvi.iSubItem = nSubItem;
CString str;
int nLen = 128;
int nRes;
do
{
nLen *= 2;
lvi.cchTextMax = nLen;
lvi.pszText = str.GetBufferSetLength(nLen);
nRes = (int)::SendMessage(hWnd,
LVM_GETITEMTEXT, (WPARAM)nItem,
(LPARAM)&lvi);
} while (nRes == nLen - 1);
str.ReleaseBuffer();
return str;
}
Why do you iplement your own function rather than use CListCtrl::GetItemText (MFC) method?
|
|
|
|
|
m_list is the control variable I declared about list control. I used CListCtrl::GetItemText (MFC)
but didn't work either :/
|
|
|
|
|
Then please show your code how this variable was attached to the list control: did you use MFC DDX_... mechanism or something else?
|
|
|
|