コード例 #1
0
ファイル: GenericModule.cs プロジェクト: fullbusterg/tams4
        public GenericModule(TamsProject theProject, TabPage controlPage, ToolStripMenuItem[] boundButtons, string mn = "miscellaneous") : base(theProject, controlPage, boundButtons, itemSelectionSql)
        {
            ModuleName = mn;

            boundButtons[1].Click += SidewalkReport;
            boundButtons[2].Click += RoadReport;
            boundButtons[3].Click += RampReport;
            boundButtons[4].Click += DrainageReport;
            boundButtons[5].Click += AccidentReport;
            boundButtons[6].Click += OtherReport;
            boundButtons[7].Click += RoadsWithSidewalks;

            setControlPanel();

            ModuleSettings.Add(new ProjectSetting(name: ModuleName + "_file", module: ModuleName));
            ModuleSettings.Add(new ProjectSetting(name: ModuleName + "_relative", module: ModuleName));

            FieldSettingToDbColumn = new Dictionary <string, string>()
            {
                { ModuleName + "_f_TAMSID", "TAMSID" }
            };

            icons = new Dictionary <string, string>()
            {
                { "Severe Road Distress", "road" },
                { "Other", "other" },
                { "ADA Ramp", "ramp" },
                { "Sidewalk", "sidewalk" },
                { "Drainage", "drainage" },
                { "Accident Hotspot", "accident" }
            };

            Project.map.ResetBuffer();
            Project.map.Update();
        }
コード例 #2
0
ファイル: GenericModule.cs プロジェクト: utahltap/tams4
        public override bool openFile(string thePath = "", string type = "point")
        {
            if (type == "")
            {
                type = "point";
            }
            if (type != "point")
            {
                throw new Exception("Generic module requires a point-type shp file");
            }

            ModuleSettings.Add(new ProjectSetting(name: ModuleName + "_f_TAMSID", module: ModuleName, value: "",
                                                  display_text: "SHP field with a unique identifier (TAMSID).", display_type: "field",
                                                  description: "The unique identify for objects in this layer.", required: true));

            injectSettings();

            if (!base.openFile(thePath, type))
            {
                return(false);
            }

            ControlsPage.Controls.Remove(ControlsPage.Controls["MODULEADD"]);
            Panel_Other panel = new Panel_Other(Project);

            panel.Name = "OTHERCONTROLS";
            panel.Dock = DockStyle.Fill;
            ControlsPage.Controls.Add(panel);

            #region eventhandlers
            panel.toolStripMoveLandmark.Click += moveLandmark;
            panel.setChangedHandler(controlChanged);
            panel.toolStripButtonSave.Click               += saveHandler;
            panel.toolStripButtonCancel.Click             += cancelChanges;
            panel.toolStripDropDownAddObject.Click        += toggleAddFeature;
            panel.clickMapToolStripMenuItem.Click         += clickMap;
            panel.enterCoordinatesToolStripMenuItem.Click += enterCoordinates;
            panel.toolStripButtonRemove.Click             += deleteFeature;

            panel.setOtherDateToolStripMenuItem.Click += selectRecordDate;
            panel.setTodayToolStripMenuItem.Click     += resetRecordDate;
            panel.pictureBoxPhoto.Click += clickPhotoBox;
            Project.map.MouseUp         += moveLandmarkMouseUp;
            #endregion

            setMaxID();
            setSymbolizer();
            disableDisplay();
            resetDisplay();
            resetSaveCondition();

            return(true);
        }
        protected override void LoadFromContext()
        {
            base.LoadFromContext();

            foreach (var key in ModuleContext.Configuration.ModuleSettings.Keys)
            {
                ModuleSettings.Add(Convert.ToString(key), Convert.ToString(ModuleContext.Configuration.ModuleSettings[key]));
            }

            foreach (var key in ModuleContext.Configuration.TabModuleSettings.Keys)
            {
                TabModuleSettings.Add(Convert.ToString(key), Convert.ToString(ModuleContext.Configuration.TabModuleSettings[key]));
            }
        }