예제 #1
0
 public CWorkSwitch(FormGPS _f)
 {
     mf = _f;
 }
예제 #2
0
        //constructor
        public CModuleComm(FormGPS _f)
        {
            mf = _f;
            serialRecvAutoSteerStr = " ** Steer Module Not Connected";
            serialRecvMachineStr   = " ** Machine Module Not Connected";

            //WorkSwitch logic
            isWorkSwitchEnabled = false;

            //does a low, grounded out, mean on
            isWorkSwitchActiveLow = true;

            isMachineDataSentToAutoSteer = Properties.Vehicle.Default.setVehicle_isMachineControlToAutoSteer;

            //autosteer constant data
            autoSteerData[sdHeaderHi]     = 127; // PGN - 32766
            autoSteerData[sdHeaderLo]     = 254;
            autoSteerData[sd2]            = 0;
            autoSteerData[sdSpeed]        = 0;
            autoSteerData[sdDistanceHi]   = 125; // PGN - 32020
            autoSteerData[sdDistanceLo]   = 20;
            autoSteerData[sdSteerAngleHi] = 125; // PGN - 32020
            autoSteerData[sdSteerAngleLo] = 20;
            autoSteerData[sd8]            = 0;
            autoSteerData[sd9]            = 0;

            //autosteer steer settings
            autoSteerSettings[ssHeaderHi]        = 127;// PGN - 32764 as header
            autoSteerSettings[ssHeaderLo]        = 252;
            autoSteerSettings[ssKp]              = Properties.Settings.Default.setAS_Kp;
            autoSteerSettings[ssLowPWM]          = Properties.Settings.Default.setAS_lowSteerPWM;
            autoSteerSettings[ssKd]              = Properties.Settings.Default.setAS_Kd;
            autoSteerSettings[ssKo]              = Properties.Settings.Default.setAS_Ko;
            autoSteerSettings[ssSteerOffset]     = Properties.Settings.Default.setAS_steerAngleOffset;
            autoSteerSettings[ssMinPWM]          = Properties.Settings.Default.setAS_minSteerPWM;
            autoSteerSettings[ssHighPWM]         = Properties.Settings.Default.setAS_highSteerPWM;
            autoSteerSettings[ssCountsPerDegree] = Properties.Settings.Default.setAS_countsPerDegree;

            //arduino basic steer settings
            ardSteerConfig[arHeaderHi] = 127; //PGN - 32763
            ardSteerConfig[arHeaderLo] = 251;
            ardSteerConfig[arSet0]     = Properties.Vehicle.Default.setArdSteer_setting0;
            ardSteerConfig[arSet1]     = Properties.Vehicle.Default.setArdSteer_setting1;
            ardSteerConfig[arMaxSpd]   = Properties.Vehicle.Default.setArdSteer_maxSpeed;
            ardSteerConfig[arMinSpd]   = Properties.Vehicle.Default.setArdSteer_minSpeed;
            byte inc = (byte)(Properties.Vehicle.Default.setArdSteer_inclinometer << 6);

            ardSteerConfig[arIncMaxPulse] = (byte)(inc + (byte)Properties.Vehicle.Default.setArdSteer_maxPulseCounts);
            ardSteerConfig[arAckermanFix] = Properties.Vehicle.Default.setArdSteer_ackermanFix;
            ardSteerConfig[arSet2]        = Properties.Vehicle.Default.setArdSteer_setting2;
            ardSteerConfig[ar9]           = 0;

            //machine, sections data array
            machineData[mdHeaderHi]             = 127; // PGN - 32762
            machineData[mdHeaderLo]             = 250;
            machineData[mdSectionControlByteHi] = 0;
            machineData[mdSectionControlByteLo] = 0;
            machineData[mdSpeedXFour]           = 0;
            machineData[mdUTurn]   = 0;
            machineData[mdTree]    = 0;
            machineData[mdHydLift] = 0;
            machineData[md8]       = 0;
            machineData[md9]       = 0;

            //arduino machine configuration
            ardMachineConfig[amHeaderHi]  = 127; //PGN - 32760
            ardMachineConfig[amHeaderLo]  = 248;
            ardMachineConfig[amRaiseTime] = Properties.Vehicle.Default.setArdMac_hydRaiseTime;
            ardMachineConfig[amLowerTime] = Properties.Vehicle.Default.setArdMac_hydLowerTime;
            ardMachineConfig[amEnableHyd] = Properties.Vehicle.Default.setArdMac_isHydEnabled;
            ardMachineConfig[amSet0]      = Properties.Vehicle.Default.setArdMac_setting0;
            ardMachineConfig[am6]         = 0;
            ardMachineConfig[am7]         = 0;
            ardMachineConfig[am8]         = 0;
            ardMachineConfig[am9]         = 0;

            //Section control: switches
            ss[swHeaderHi] = 0;  //PGN - 32609
            ss[swHeaderLo] = 0;  //0xE0
            ss[sw2]        = 0;
            ss[sw3]        = 0;
            ss[sw4]        = 0;
            ss[swONHi]     = 0;
            ss[swONLo]     = 0;
            ss[swOFFHi]    = 0;
            ss[swOFFLo]    = 0;
            ss[swMain]     = 0;

            ssP[swHeaderHi] = 0;  //PGN - 32609
            ssP[swHeaderLo] = 0;  //0xE0
            ssP[sw2]        = 0;
            ssP[sw3]        = 0;
            ssP[sw4]        = 0;
            ssP[swONHi]     = 0;
            ssP[swONLo]     = 0;
            ssP[swOFFHi]    = 0;
            ssP[swOFFLo]    = 0;
            ssP[swMain]     = 0;
        }
예제 #3
0
 public CWorldGrid(FormGPS _f)
 {
     mf = _f;
 }
예제 #4
0
 public FormGPSData(Form callingForm)
 {
     mf = callingForm as FormGPS;
     InitializeComponent();
 }
예제 #5
0
 //constructor
 public CContour(FormGPS _f)
 {
     mf = _f;
 }
예제 #6
0
파일: CFont.cs 프로젝트: gaslypierre/Drive
 public CFont(FormGPS _f)
 {
     //constructor
     mf       = _f;
     isFontOn = true;
 }