ホーム › Devices.Geolocation › GNSS_FIXDATA_BASIC
GNSS_FIXDATA_BASIC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示すDWORD。 |
| Version | DWORD | 4 | +4 | +4 | 構造体のバージョンを示すDWORD。 |
| Latitude | DOUBLE | 8 | +8 | +8 | 緯度を度単位の倍精度浮動小数点で示す。 |
| Longitude | DOUBLE | 8 | +16 | +16 | 経度を度単位の倍精度浮動小数点で示す。 |
| Altitude | DOUBLE | 8 | +24 | +24 | 海抜高度をメートル単位の倍精度浮動小数点で示す。 |
| Speed | DOUBLE | 8 | +32 | +32 | 移動速度をメートル毎秒の倍精度浮動小数点で示す。 |
| Heading | DOUBLE | 8 | +40 | +40 | 進行方位を度単位の倍精度浮動小数点で示す。 |
各言語での定義
#include <windows.h>
// GNSS_FIXDATA_BASIC (x64 48 / x86 48 バイト)
typedef struct GNSS_FIXDATA_BASIC {
DWORD Size;
DWORD Version;
DOUBLE Latitude;
DOUBLE Longitude;
DOUBLE Altitude;
DOUBLE Speed;
DOUBLE Heading;
} GNSS_FIXDATA_BASIC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_FIXDATA_BASIC
{
public uint Size;
public uint Version;
public double Latitude;
public double Longitude;
public double Altitude;
public double Speed;
public double Heading;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_FIXDATA_BASIC
Public Size As UInteger
Public Version As UInteger
Public Latitude As Double
Public Longitude As Double
Public Altitude As Double
Public Speed As Double
Public Heading As Double
End Structureimport ctypes
from ctypes import wintypes
class GNSS_FIXDATA_BASIC(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Version", wintypes.DWORD),
("Latitude", ctypes.c_double),
("Longitude", ctypes.c_double),
("Altitude", ctypes.c_double),
("Speed", ctypes.c_double),
("Heading", ctypes.c_double),
]#[repr(C)]
pub struct GNSS_FIXDATA_BASIC {
pub Size: u32,
pub Version: u32,
pub Latitude: f64,
pub Longitude: f64,
pub Altitude: f64,
pub Speed: f64,
pub Heading: f64,
}import "golang.org/x/sys/windows"
type GNSS_FIXDATA_BASIC struct {
Size uint32
Version uint32
Latitude float64
Longitude float64
Altitude float64
Speed float64
Heading float64
}type
GNSS_FIXDATA_BASIC = record
Size: DWORD;
Version: DWORD;
Latitude: Double;
Longitude: Double;
Altitude: Double;
Speed: Double;
Heading: Double;
end;const GNSS_FIXDATA_BASIC = extern struct {
Size: u32,
Version: u32,
Latitude: f64,
Longitude: f64,
Altitude: f64,
Speed: f64,
Heading: f64,
};type
GNSS_FIXDATA_BASIC {.bycopy.} = object
Size: uint32
Version: uint32
Latitude: float64
Longitude: float64
Altitude: float64
Speed: float64
Heading: float64struct GNSS_FIXDATA_BASIC
{
uint Size;
uint Version;
double Latitude;
double Longitude;
double Altitude;
double Speed;
double Heading;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GNSS_FIXDATA_BASIC サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Latitude : DOUBLE (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Longitude : DOUBLE (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Altitude : DOUBLE (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Speed : DOUBLE (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; Heading : DOUBLE (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GNSS_FIXDATA_BASIC
#field int Size
#field int Version
#field double Latitude
#field double Longitude
#field double Altitude
#field double Speed
#field double Heading
#endstruct
stdim st, GNSS_FIXDATA_BASIC ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size